I am using bootstrap 3 and I am making a social networking site, this code here is a part of a panel which shows the posts.The problem is it is showing the comments on toggle but the comments are not appearing within the footer it is crossing it...So what is wrong in my or how can I extend the panel footer?
Here's the code:
<div class="panel-footer">
Like <span class="glyphicon glyphicon-thumbs-up"></span>
Comments
<div id='toggleComment<?php echo $idp;?>' style="display:none;">
<form action="" method="POST"><!--FORM COMMENT-->
<div class="form-group">
<div class="rows" >
<div class="col-sm-1" style="padding-right:2px;">
<div class="compic">
<img src="<?php echo $profilepic; ?>" style="width:100%;height:100%;" />
</div>
</div>
<div class="col-sm-11" style="padding-left:3px; padding-bottom:7px">
<textarea class="form-control expandable pull-left" name="comment<?php echo $idp;?>" id="comment" placeholder="Write a comment..." required>
</textarea>
</div>
</div>
<hr>
<button type="submit" class="btn btn-primary pull-right" name="subcom<?php echo $idp;?>"><b>Comment</b></button>
<div class="clearfix"></div>
</div></form>
<div class="rows" >
<?php
$postid=$idp;
$postby=$id;
$postto=$uid;
if(isset($_POST['subcom'.$postid]))
{ $postbody=$_POST['comment'.$postid];
if($postbody!="")
{$res=mysqli_query($con,"INSERT INTO comment VALUES('','$postby','$postto','$postbody','$postid')");}
}
$show=mysqli_query($con,"SELECT * FROM comment WHERE postid='$idp' ORDER by id");
while($show_row=mysqli_fetch_array($show))
{
$commentbyid=$show_row['cby'];
$combody=$show_row['cbody'];
$cbyquery=mysqli_query($con,"SELECT * FROM user WHERE id='$commentbyid'") or die(mysqli_error($con));
$cby=mysqli_fetch_array($cbyquery);
$cpic=$cby['profpic'];
if ($cpic== "" || !file_exists("userdata/profile_pics/$cpic"))
{
$cpic = "images/default_pic.jpg";
}
else
{
$cpic = "userdata/profile_pics/".$cpic;
}
$cname=ucfirst(strtolower($cby[1]));
$csname=ucfirst(strtolower($cby[2]));
?>
<div class="col-sm-1" style="padding-right:2px;">
<div class="compic">
<img src="<?php echo $cpic; ?>" style="width:100%;height:100%;" />
</div>
</div>
<div class="col-sm-11" style="padding-left:3px;">
<?php echo $cname." ".$csname;?><br>
<?php echo $combody;?>
</div>
<?php
}
?></div>
</div><!--Toggle Ends here-->
</div>
finally got it it was because of the <div class="clearfix"></div> and it got solved when I used it just after </div><!--Toggle Ends here-->
Related
I am having a problem getting back to my page with a unique id after processing a data
this first part of the code is redirecting into the page getting the unique id of the folder
<img src="<?= $row['folderimage'];?>" onerror="this.src='images/folder.png'" class="card-img-top" height="160" >
<div class="card-img">
<h6 style="text-align: center;"><?= $row['foldername'];?></h6>
this is the folder.php with unique id
<?php
require'config.php';
session_start();
if(isset($_GET['fldid'])){
$folder_id=$_GET['fldid'];
$sql="SELECT * FROM file_folder WHERE id='$folder_id'";
$result=mysqli_query($conn,$sql);
$row=mysqli_fetch_array($result);
$folder_name=$row['foldername'];
}
?>
<!DOCTYPE html>
<html>
<head>
<title>BSU</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="file.css">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" ><!-- FOR FONT AWESOME ICON-->
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"><!-- for css bootsrap 4 -->
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<!-- Popper JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>
<body class="bdy">
<div class="container-fluid">
<div class="row">
<div class="col-lg-3">
<hr>
<ul class="list-group">
<li class="list-group-item">
<div class="form-check">
<button class="btn btn-primary btn-lg btn-block" onclick="openFormfld()">Add Folde with Link</button>
</div>
</li>
<!-- para mag pop up ang add file form-->
<div class="form-popup" id="myFolderForm">
<form action="process.php" method="POST" enctype="multipart/form-data" class="form-container">
<!-- para ma notify if success or may error sa pag add ng file-->
<div style="display:<?php if(isset($_SESSION['showFilerror'])){echo $_SESSION['showFilerror'];}else { echo'none'; } unset($_SESSION['showFilerror']); ?>"
class="alert alert-danger alert-dismissible text-center mt-3">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong><?php if(isset($_SESSION['filemess'])){echo $_SESSION['filemess'];} unset($_SESSION['showFilerror']); ?></strong>
</div>
<!-- end of notif -->
<input type="hidden" name="folderid" value="<?= $folder_id; ?>">
<label for="folder"><b>Folder</b></label>
<input type="text" placeholder="Enter Folder Name" name="fldname"required>
<label for="link"><b>Link</b></label>
<input type="text" placeholder="Enter Link" name="link" required>
<label for="image"><b>Image For Folder</b></label>
<input type="file" name="image">
<button style="margin-top: 15px;" type="submit" name="folderlinkbtn" class="btn btnsub">Save</button>
Close
</form>
</div>
</ul>
</div>
<!-- para ma display ang folders -->
<div class="col-lg-9">
<!-- para ma notify pag successfull pag update-->
<div style="display:<?php if(isset($_SESSION['showAlert'])){echo $_SESSION['showAlert'];}else { echo'none'; } unset($_SESSION['showAlert']); ?>"
class="alert alert-success alert-dismissible text-center mt-3">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong><?php if(isset($_SESSION['message'])){echo $_SESSION['message'];} unset($_SESSION['showAlert']); ?></strong>
</div>
<!-- para ma notify pag hinde successfull pag update-->
<div style="display:<?php if(isset($_SESSION['showError'])){echo $_SESSION['showError'];}else { echo'none'; } unset($_SESSION['showError']); ?>"
class="alert alert-danger alert-dismissible text-center mt-3">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong><?php if(isset($_SESSION['error'])){echo $_SESSION['error'];} unset($_SESSION['showError']); ?></strong>
</div>
<!-- end of notif -->
<h5 class="text-center" id="textChange"><?= $folder_name; ?> Folder</h5>
<hr>
<div class="row" id="result">
<?php
$sql="SELECT * FROM folder_link WHERE folder_id='$folder_id'";
$result=$conn->query($sql);
while($row=$result->fetch_assoc()){
?>
<div class="col-md-3 mb-2">
<div class="card-deck">
<div style="background-color:#f3f4ed " class="card border-secondary">
<div class="btn-group">
<button style="float: right;" class="btn btn-success dropdown-toggle" id="showhidereply" data-toggle="dropdown" aria-haspopup="true" data-id="<?= $row['id'];?>"></button>
<div class="dropdown-menu" id="replycomment-<?= $row['id'];?>">
<a class="dropdown-item refold" data-id="<?= $row['id'];?>" >Rename Folder</a>
<a class="dropdown-item chgimg" data-id="<?= $row['id'];?>" >Change Folder Picture</a>
Delete Folder
</div>
</div>
<img src="<?= $row['folder_image'];?>" onerror="this.src='images/folder.png'" class="card-img-top" height="160" >
<div class="card-img">
<h6 style="text-align: center;"><?= $row['folder_name'];?></h6>
<!-- para sa update folder name pop up-->
<div class="pop-up" id="upd-<?= $row['id'];?>">
<div class="popup-content">
<form action="process.php" method="POST">
<p style="text-align: center;">Rename Folder</p>
<input type="hidden" name="idd" value="<?= $row['id'];?>">
<input class="newfold" type="text" name="updatefolder" placeholder="Enter New Folder Name" required>
Close
<button type="submit" name="updatebtnfld" class="btn popbtn">Update</button>
</form>
</div>
</div>
<!-- end sa update folder name pop up-->
<!-- para mapalitan ang image folder pop up-->
<div class="pop-up" id="img-<?= $row['id'];?>">
<div class="popup-content">
<form action="process.php" method="POST" enctype="multipart/form-data">
<p style="text-align: center;">Change Folder Iamge</p>
<input type="hidden" name="idd" value="<?= $row['id'];?>">
<input type="file" name="image" required>
Close
<button type="submit" name="updimgfld" class="btn popbtn">Update</button>
</form>
</div>
</div>
<!-- end sa update link pop up-->
</div>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
<!-- end sa folders display-->
</div>
</div>
this code below is my problem I don't what should I add in header to get me back in the page with unique id
if(isset($_POST['folderlinkbtn'])){
$fldid = $_POST['folderid'];
$fol = $_POST['fldname'];
$lin = $_POST['link'];
$image='images/'.$_FILES['image']['name'];
$target_dir="images/";
$target_file=$target_dir.basename($_FILES['image']['name']);
move_uploaded_file($_FILES['image']['tmp_name'],$target_file);
$sql="SELECT folder_id FROM folder_link WHERE folder_name ='$fol' LIMIT 1";
$check_query =mysqli_query($conn,$sql);
$count_folder = mysqli_num_rows($check_query);
if($count_folder>0){
$_SESSION['showFilerror']= 'block';
$_SESSION['filemess']="Sorry Folder Name Already Exist";
header('location:folder.php');}
else{
$sql ="INSERT INTO folder_link (folder_id,folder_links,folder_name,folder_image)VALUES('$fldid','$lin','$fol','$target_file')";
$run_query=mysqli_query($conn,$sql);
if($run_query){
$_SESSION['showAlert']= 'block';
$_SESSION['message']="Add File Successful";
header('location:folder.php');
}
else{
$_SESSION['showFilerror']= 'block';
$_SESSION['filemess']="ERROR</strong>";
header('location:folder.php');
}
}
}
if the processing requires redirecting to another page then include the unique ID in the url using GET method then include it in header function on php
I already fix the problem thanks in giving me an idea i just put
header( "Location: folder.php?fldid={$fldid}" );
i am trying to create e-commerce website. neither it is showing error not providing coding result. trying to develop popup modal it is not showing results, modal popup is appearing but the echo codes which were put to retrieve database table value, for example this command is not working. how to find mistake?
<!-- The Modal -->
<?php
require_once '../core/init.php';
<!--this code is to retreive data from database thelewala and table products-->
$id = $_post['id'];
$id = (int)$id;
$sql = "SELECT * FROM products WHERE id = '$id'";
$result = $db->query($sql);
$product = mysqli_fetch_assoc($result);
<!-- this code is to retrieve data from database thelewala and table brand-->
$brand_id = $product['brand'];
$sql = "SELECT brand FROM brand WHERE id = '$brand_id'";
$brand_query = $db->query($sql);
$brand = mysqli_fetch_assoc($brand_query);
?>
<?php ob_start(); ?>
<div class="modal fade" id="details-modal">
<div class="modal-dialog">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<h4 class="modal-title"><?php echo $product['title']; ?></h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<!-- Modal body -->
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col-sm-6">
<div>
<img src="<?php echo $product['image']; ?>" alt="<?php echo $product['title']; ?>'" class="details img.responsive" />
</div>
</div>
<div class="col-sm-6">
<h4>Details</h4>
<p><?php echo $product['discription']; ?></p>
<hr />
<p>Price : Rs. <?php echo $product['price']; ?></p>
<p>Brand : <?php echo $brand['brand']; ?></p>
<form action="add_card.php" method="post">
<div class="form-group">
<div class="col-xs-3">
<lable for="quantity">Quantity</lable>
<input type="text" class="form-control" id="quantity" name="quantity" />
</div>
</div>
<div class="form-group">
<lable for="size">Size</lable>
<select name="size" id="size" class="form-control">
<option value=""></option>
<option value="32">32</option>
<option value="36">36</option>
<option value="XL">XL</option>
</select>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- Modal footer -->
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-warning" <span class="glyphicon glyphicon-shopping-cart"></spa>Add to Cart</button>
</div>
</div>
</div>
</div>
<?php echo ob_get_clean(); ?>
i want to include a else statement after the completion of the block after the second if for category equal to helathcare ....now i want another else for finance but i am not getting where excatly to place that else
i have a confusion on where to keep the else for finance and 2 more categories
now whenever i try to place the one else at the last goes unrecable to its if statement i donno its very confusing as to where to place 2 more else if statments for 2 more categories
<?php
global $row2;
if(isset($_POST['category']))
{
if($_POST['category']== 'Healthcare')
{
$query = "select *from event where category = 'Healthcare';";
$result=mysqli_query($conn,$query)or die(mysqli_error($conn));
while($row2= mysqli_fetch_array($result))
{
?>
<div class="events events-full event-list">
<div class="container">
<div class="row">
<div class="col-md-9 col-sm-8">
<!--Blog Post Start-->
<div class="blog-post">
<div class="post-thumb">
<div class="link-wrap"> <i class="fa fa-search"></i> <i class="fa fa-link"></i> </div>
<img src="images/gallery/<?php echo $row2['event_image']?>" alt='user'></div>
<div class="event-text">
<div class="event-counter"></div>
<h4> <?php echo($row2['title']); ?> </h4>
<p><?php echo($row2['descrption']); ?></p>
<p><span class="glyphicon glyphicon-map-marker"><?php echo($row2['location']); ?></span></p>
<p><span class="glyphicon glyphicon-grain"><?php echo($row2['organizer']); ?></span></p>
<a class="nd" href="">
<form action="eventdetail.php" method="post">
<input type='hidden' value="<?php echo $row2['id']; ?>" name='id'/>
<button type="submit" class="btn btn-primary" name="detail" value=”detail”>Event Detail</button>
</div>
</a> </div>
</div>
</form>
<!--Blog Post End-->
<?php }
}
}
else
{
global $row2;
$query = "select *from event;" ;
$result=mysqli_query($conn,$query)or die(mysqli_error($conn));
while($row2= mysqli_fetch_array($result))
{
?>
<div class="events events-full event-list">
<div class="container">
<div class="row">
<div class="col-md-9 col-sm-8">
<!--Blog Post Start-->
<div class="blog-post">
<div class="post-thumb">
<div class="link-wrap"> <i class="fa fa-search"></i> <i class="fa fa-link"></i> </div>
<img src="images/gallery/<?php echo $row2['event_image']?>" alt='user'></div>
<div class="event-text">
<div class="event-counter"></div>
<h4> <?php echo($row2['title']); ?> </h4>
<p><?php echo($row2['descrption']); ?></p>
<p><span class="glyphicon glyphicon-map-marker"><?php echo($row2['location']); ?></span></p>
<p><span class="glyphicon glyphicon-grain"><?php echo($row2['organizer']); ?></span></p>
<a class="nd" href="">
<form action="eventdetail.php" method="post">
<input type='hidden' value="<?php echo $row2['id']; ?>" name='id'/>
<button type="submit" class="btn btn-primary" name="detail" value=”detail”>Event Detail</button>
</div>
</a> </div>
</div>
</form>
<!--Blog Post End-->
<?php } } ?>
?>
You can't put multiple else blocks along with the if block. However, you can use multiple(as many as you want) elseif/else if blocks along with the if block, like this:
if($_POST['category'] == 'Healthcare'){
...
}elseif($_POST['category'] == 'Finance'){
...
}elseif($_POST['category'] == '...'){
...
}else{
...
}
Here's the reference: http://php.net/manual/en/control-structures.elseif.php
Part of your problem seems to be poor formatting. If you lined up your open and close tags for your if statements I think you would be able to see this better. Having said that, you can add any elseif/if clauses for the category if where I marked below:
<!--Blog Post End-->
<?php
} // closes while loop
} else{ } // closes healthcare if, add extra else here
} // closes POST if
else
{
I could not display flash message in my project (view file), any body help I kill my several time to display $flash message in my view page. I am new in counterfeiter, trying to learn something from online.
Controller :
function delete_image($update_id)
{
if(!is_numeric($update_id))
{
redirect('site_security/not_allowed');
}
$this->load->library('session');
$this->load->module('site_security');
$this->site_security->_make_sure_is_admin();
$data = $this->fetch_data_from_db($update_id);
$picture = $data['picture'];
$big_pic_path = './media/blog_pics/'.$picture;
$small_picture = str_replace('.', '_thumb.', $picture);
$small_pic_path = './media/blog_pics/'.$small_picture;
//attempt to remove the images
if (file_exists($big_pic_path)) {
unlink($big_pic_path);
}
if (file_exists($small_pic_path)) {
unlink($small_pic_path);
}
//update the database
unset($data);
$data['picture'] = "";
$this->_update($update_id, $data);
$flash_msg = "The image was successfully deleted.";
$value = '<div class="alert alert-success" role="alert">'.$flash_msg.'</div>';
$this->session->set_flashdata('item', $value);
redirect('blog/create/'.$update_id);
}
View File :
<h1><?= $headline ?></h1>
<?= validation_errors("<p style='color: red;'>", "</p>") ?>
<?php
if(isset($flash)){
echo $flash;
}
?>
<?php
if(is_numeric($update_id)) { ?>
<div class="row-fluid sortable">
<div class="box span12">
<div class="box-header" data-original-title>
<h2><i class="halflings-icon white edit"></i><span class="break"></span>Additional Option</h2>
<div class="box-icon">
<i class="halflings-icon white chevron-up"></i>
<i class="halflings-icon white remove"></i>
</div>
</div>
<div class="box-content">
<?php
if($picture==""){
?>
<button type="button" class="btn btn-primary">Upload Image</button>
<?php
}
else
{
?>
<button type="button" class="btn btn-danger">Delete Image</button>
<?php
}
if($update_id>2){
?>
<button type="button" class="btn btn-danger">Delete Blog Entry</button>
<?php
}
?>
<button type="button" class="btn btn-default">View Blog Entry</button>
</div>
</div><!--/span-->
</div><!--/row-->
<?php
}
?>
<div class="row-fluid sortable">
<div class="box span12">
<div class="box-header" data-original-title>
<h2><i class="halflings-icon white edit"></i><span class="break"></span>Blog Entry Details</h2>
<div class="box-icon">
<i class="halflings-icon white chevron-up"></i>
<i class="halflings-icon white remove"></i>
</div>
</div>
<div class="box-content">
<?php
$form_location = base_url()."blog/create/".$update_id;
?>
<form class="form-horizontal" method="post" action="<?= $form_location ?>">
<fieldset>
<div class="control-group">
<label class="control-label" for="typeahead">Date Published </label>
<div class="controls">
<input type="text" name="date_published" class="input-xlarge datepicker" id="date01" value="<?= $date_published ?>">
</div>
</div>
<div class="control-group">
<label class="control-label" for="typeahead">Blog Entry Title </label>
<div class="controls">
<input type="text" class="span7" name="page_title" value="<?= $page_title ?>">
</div>
</div>
<div class="control-group hidden-phone">
<label class="control-label">Blog Entry Keywords</label>
<div class="controls">
<textarea class="span7" rows="3" name="page_keywords"><?php echo $page_keywords; ?> </textarea>
</div>
</div>
<div class="control-group hidden-phone">
<label class="control-label">Blog Entry Description</label>
<div class="controls">
<textarea class="span7" rows="3" name="page_description"><?php echo $page_description; ?> </textarea>
</div>
</div>
<div class="control-group hidden-phone">
<label class="control-label" for="textarea2">Blog Entry Content</label>
<div class="controls">
<textarea class="cleditor" id="textarea2" rows="3" name="page_content"><?php echo $page_content; ?> </textarea>
</div>
</div>
<div class="control-group">
<label class="control-label" for="typeahead">Author </label>
<div class="controls">
<input type="text" class="span7" name="author" value="<?= $author ?>">
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary" name="submit" value="Submit">Submit</button>
<button type="submit" name="submit" value="Cancel" class="btn">Cancel</button>
</div>
</fieldset>
</form>
</div>
</div><!--/span-->
</div><!--/row-->
<?php
if(isset($picture) && ($picture!=null) ){
?>
<div class="row-fluid sortable">
<div class="box span12">
<div class="box-header" data-original-title>
<h2><i class="halflings-icon white edit"></i><span class="break"></span>Image</h2>
<div class="box-icon">
<i class="halflings-icon white chevron-up"></i>
<i class="halflings-icon white remove"></i>
</div>
</div>
<div class="box-content">
<img src="<?= base_url() ?>media/blog_pics/<?= $picture ?>" class="thumbnail" width="100">
</div>
</div><!--/span-->
</div><!--/row-->
<?php
}
?>
If you want to get the flashdata message you have set
Try
<?php if($this->session->flashdata('item')) {?>
<?php echo $this->session->flashdata('item');?>
<?php }?>
Your just change this code
<?php
if(isset($flash)){
echo $flash;
}
?>
To
<?php
if(isset($this->session->flashdata('item'))){
echo $flash;
}
?>
In your controller change
$flash_msg = "The image was successfully deleted.";
$value = '<div class="alert alert-success" role="alert">'.$flash_msg.'</div>';
$this->session->set_flashdata('item', $value);
To
$this->session->set_flashdata('item', 'The image was successfully deleted.');
In your view page add
<?php if($this->session->flashdata('item')){ ?>
<div class="alert alert-success">
<h4><?php echo $this->session->flashdata('item'); ?></h4>
</div>
<?php } ?>
So I'm trying to make a halfway decent login integration with MyBB, which upon success will display their avatar image in a certain area.
This is the if statement I'm using to both check the validity and display the avatar in an HTML img tag.
if (isset($mybb) && isset($mybb->user['avatar'])) {
if (substr($mybb->user['avatar'], 0, 4) = 'http') {
echo $mybb->user['avatar'];
} else {
echo('../../Forums/' . $mybb->user['avatar']);
}
}
I still don't understand what's wrong with this- I'm being thrown this up in my PHP error log:
[08-Mar-2014 23:08:46 UTC] PHP Fatal error: Can't use function return value in write context in /home/ponypwna/public_html/Login.php on line 26
Note that this PHP statement is on all one line- as displayed in the full code below:
<!DOCTYPE html>
<html>
<head>
<link href="./include/css/bootstrap.css" rel="stylesheet">
</head>
<body>
<?php
include("./include/nbar.php");
?>
<!-- Mane Area -->
<div class="container">
<div class="row">
<div class="col-md-4 col-md-offset-2">
<br /><br /><br /><p />
<!--Login and Register Here BIG so in seperate file-->
<p>
<!--Login SUCCESS -->
<?php if($mybb->user['uid']){ ?>
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title"><span class="glyphicon glyphicon-thumbs-up"></span> Login Success</h3>
</div>
<div class="panel-body">
<div class="col-xs-6 col-md-3"><img src="<?php if (isset($mybb) && isset($mybb->user['avatar'])) { if (substr($mybb->user['avatar'], 0, 4) = 'http') { echo $mybb->user['avatar']; } else { echo('../../Forums/' . $mybb->user['avatar']); } } ?>" /></div>
You have successfully logged in as <?php echo $mybb->user['username']; ?>.
</div>
</div>
<?php } else { ?>
<!--Login DEFAULT -->
<?php if(isset($_GET['su'])){ ?>
<div style="display:none;">
<?php } else { ?>
<div class="panel panel-primary">
<?php } ?>
<div class="panel-heading">
<h3 class="panel-title"><span class="glyphicon glyphicon-th-large"></span> Login</h3>
</div>
<div class="panel-body">
<form action="../../Forums/member.php" class="ajaxform" method="post">
<div class="form-group">
<label for="exampleInputEmail1">Username:</label>
<input type="text" class="form-control" id="exampleInputEmail1" name="username" placeholder="Ex: LordNature" required>
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password:</label>
<input type="password" class="form-control" id="exampleInputPassword1" name="password" placeholder="*******" required>
</div>
<input type='hidden' name='action' value='do_login'>
<input type='hidden' name='url' value='../../Login' />
<input type="submit" class="btn btn-primary" value="Login" name="submit" />
</form>
</div>
</div>
<?php } ?></p>
</div>
<div class="col-md-4">
<br /><br /><br /><p />
<b>
<div class="list-group">
<a class="list-group-item active">
<font size="4">TTT Rules</font>
</a>
<a class="list-group-item"><font size="2">1. Please obey the Staff.</a></font>
<a class="list-group-item"><font size="2">2. Do not RDM.</a></font>
<a class="list-group-item"><font size="2">3. Do not camp in T rooms for over 2 minutes.</a></font>
<a class="list-group-item"><font size="2">4. Do not harass or bully others.</a></font>
<a class="list-group-item"><font size="2">5. Do not be annoying.</a></font>
<a class="list-group-item"><font size="2">6. Do not propkill.</a></font>
<a class="list-group-item"><font size="2">7. Do not metagame.</a></font>
<a class="list-group-item"><font size="2">8. Do not hack or exploit.</a></font>
<a class="list-group-item"><font size="2">9. Do not micspam.</a></font>
<a class="list-group-item"><font size="2">10. Do not kill AFK players.</a></font>
</div></b></p>
</div>
</div>
<hr>
<?php include("./include/footer.php"); ?>
</hr>
</div> <!-- /container -->
</body>
</html>
I'm a novice to PHP, so please ignore my stupidity.
if (substr($mybb->user['avatar'], 0, 4) = 'http')
...tries to assign to the result of substr.
if (substr($mybb->user['avatar'], 0, 4) == 'http')
...is probably what you mean to do (note == (or ===) instead of =)
You can't use isset on anything else than variables, that's even in a big red box in the official documentation! This means you probably need to refactor your condition to something like
if (isset($mybb) && property_exists($mybb, "user") && array_key_exists("avatar", $mybb->user)) {