Jump to content

Recommended Posts

Hey I 'm new to this  but i got this code the links to images in my database and display them to the user but i want the images to pop-up out of the screen like this website : http://pinterest.com/ here when the small images are clicked displaying all the comments from users under it  here is the code: and thanks

 

<?php

include('models/user.php');

ob_start();

if(isset($_GET['cat'])){

	$objCat = new dbConfig();

	$sqlCat = $objCat->selectQuery("select * from categories WHERE cat_id = ".$_GET['cat']);

	$rowCat = mysql_fetch_array($sqlCat);

$title = "Blabben - ".$rowCat['cat_name'];

} 

elseif(isset($_GET['category'])){

	$objCat = new dbConfig();

	$sqlCat = $objCat->selectQuery("select * from categories WHERE cat_id = ".$_GET['category']);

	$rowCat = mysql_fetch_array($sqlCat);

$title = "Blabben - ".$rowCat['cat_name'];

} 

else { $title = "Blabben"; }

?>   

<?php

define('INCLUDE_CHECK',1);

require "timeline/functions.php";

require "timeline/connect.php";

// remove blabs older than 1 hour to prevent spam

//mysql_query("DELETE FROM blabs WHERE blab_id>1 AND blab_date<SUBTIME(NOW(),'0 1:0:0')");

//fetch the timeline

if(isset($_GET['top'])&&!isset($_GET['cat'])){

$q = mysql_query("SELECT * FROM blabs,users WHERE (blabs.user_id = users.user_id) AND (blabs.blab!='0') ORDER BY blabs.blab_id DESC LIMIT 50");

}elseif(isset($_GET['top'])&&isset($_GET['cat'])){

$q = mysql_query("SELECT * FROM blabs,users WHERE (blabs.user_id = users.user_id) AND (blabs.cat_id = ".$_GET['cat'].") AND (blabs.blab!='0') ORDER BY blabs.blab_id DESC LIMIT 50");

}elseif(!isset($_GET['top'])&&isset($_GET['cat'])){

$q = mysql_query("SELECT * FROM blabs,users WHERE (blabs.user_id = users.user_id) AND (blabs.cat_id = ".$_GET['cat'].") AND (blabs.blab!='0') ORDER BY blabs.blab_id DESC LIMIT 50");

} elseif(isset($_GET['points'])){

$q = mysql_query("SELECT * FROM blabs,users,follow WHERE follow.following = blabs.user_id AND blabs.user_id = users.user_id AND (follow.follower = ".$uinfo['user_id'].") AND blabs.blab!='0' ORDER BY users.points DESC LIMIT 50");

}

//elseif(isset($_GET['cat'])){

//$q = mysql_query("SELECT * FROM blabs,users,follow WHERE follow.following = blabs.user_id AND blabs.user_id = users.user_id AND blabs.blab!='0' AND (follow.follower = ".$uinfo['user_id'].") AND blabs.cat_id = ".$_GET['cat']." ORDER BY blabs.blab_id DESC LIMIT 50");

//}elseif(isset($_GET['category'])){

//$q = mysql_query("SELECT * FROM blabs,users,follow WHERE follow.following = blabs.user_id AND blabs.user_id = users.user_id AND blabs.blab!='0' AND (follow.follower = ".$uinfo['user_id'].") AND blabs.cat_id = ".$_GET['category']." ORDER BY blabs.blab_id DESC LIMIT 50");

//}

else{

$q = mysql_query("SELECT * FROM blabs,users,follow WHERE follow.following = blabs.user_id AND blabs.user_id = users.user_id AND (follow.follower = ".$uinfo['user_id'].") AND blabs.blab!='0' ORDER BY blabs.blab_id DESC LIMIT 50");

}

$timeline='';

//$row1=mysql_fetch_assoc($q);

//$bd = $row1['blab_date'];

//$blab_date = relativeTime($bd,$precision=2);

while($row=mysql_fetch_assoc($q))

{ 



$timeline.=formatTweet($row['name'],$row['uname'],$row['state'],$row['picture'],$row['blab'],$row['blab_date'],$row['user_id'],$row['blab_id']); }

// fetch the no blab

$noblab = '';

//if(isset($_GET['cat'])){

//$blabcount = mysql_num_rows(mysql_query("SELECT * FROM blabs WHERE blab!=0 AND cat_id=".$_GET['cat']));

//}

//elseif(isset($_GET['category'])){

//$blabcount = mysql_num_rows(mysql_query("SELECT * FROM blabs WHERE blab!=0 AND cat_id=".$_GET['category']));

//}else{

//$blabcount = mysql_num_rows(mysql_query("SELECT * FROM blabs where `blab`!='0'"));

//}

//if($blabcount<=0){ $noblab = "<div style='padding:20px 15px; text-align:center;' id='noblab'>No Blab Posted</div>"; }

?>    

<script>

    $(document).ready(function(){

	$('#noblab').hide();

	});

</script>

    

<?php if(isset($_GET['verified'])&& $_GET['verified']=='1'){ ?>

<script type="text/javascript">

showNotification({

	message: "Congratulations! You have got 250 points for verifying your account",

	type: "success",

	autoClose: true,

	duration: 5                                        

});

</script>	

<?php } ?>



<?php if(isset($_GET['verified'])&& $_GET['verified']=='11'){ ?>

<script type="text/javascript">

showNotification({

	message: "Your account is already verified.",

	type: "error",

	autoClose: true,

	duration: 5                                        

});

</script>	

<?php } ?>



<?php if(isset($_GET['blab'])&& $_GET['blab']=='added'){ ?>

<script type="text/javascript">

showNotification({

	message: "Blab has been added successfully.",

	type: "success",

	autoClose: true,

	duration: 5                                        

});

</script>	

<?php } ?>



<?php if((isset($_GET['welcome'])&& $_GET['welcome']=='1')||($uinfo['verified']=='0')){ ?>

<script type="text/javascript">

showNotification({

	message: "<span style='color:#000;'><strong>Confirm your email address to access all of Blabben's features</strong>. A confirmation message was sent to <strong><?php echo $uinfo['email']; ?></strong><br /><span style='color:#000;'><a style='color:blue; text-decoration:underline; font-weight:normal;' href='models/resend.php'>Resend Confirmation Email</a>  |  <a style='color:blue; text-decoration:underline; font-weight:normal;' href='account'>Update Email Address</a></span></span>",

	type: "success",

	autoClose: false,

	duration: 5                                        

});

</script>	

<?php } ?>



<?php if(isset($_GET['blab'])&& $_GET['blab']=='deleted'){ ?>

<script type="text/javascript">

showNotification({

	message: "Blab has been deleted successfully.",

	type: "success",

	autoClose: true,

	duration: 5                                        

});

</script>	

<?php } ?>



<?php if(isset($_GET['b'])&& $_GET['b']=='err'){ ?>

<script type="text/javascript">

showNotification({

	message: "Sorry! You don't have enough points.",

	type: "error",

	autoClose: true,

	duration: 5                                        

});

</script>	

<?php } ?>



<?php if(isset($_GET['resent'])&& $_GET['resent']=='1'){ ?>

<script type="text/javascript">

showNotification({

	message: "Confirmation email has been resent on your Email.",

	type: "success",

	autoClose: true,

	duration: 5                                        

});

</script>

<?php } ?>



    

<SCRIPT LANGUAGE="JavaScript">

<!-- Limit the number of characters per textarea -->

<!-- Begin

function textCounter(field,cntfield,maxlimit) {

if (field.value.length > maxlimit) // if too long...trim it!

field.value = field.value.substring(0, maxlimit);

// otherwise, update 'characters left' counter

else

cntfield.value = maxlimit - field.value.length;

}

//  End -->

</script>



    

   <!--tabs-->

   <div id="tabs-con">

   <div id="tabs1">

    <!--id="nation"-->

   	<div class="tab roundT"><a href="http://www.blabben.com">Blabbing</a><!--<span></span>-->

    </div>

   	<div class="tab roundT"><a href="upload-picture.php">Upload Picture</a></div>

   	<div class="tab roundT"><a <?php if(isset($_GET['cat'])){ ?>href="home?category=<?php echo $_GET['cat']; ?>" <?php } elseif(isset($_GET['category'])){ ?>href="home?category=<?php echo $_GET['category']; ?>"<?php }elseif(isset($_GET['tp'])){ ?>href="home?alltp"<?php }else{ ?>href="home?all"<?php } ?>>

<?php if(isset($_GET['cat'])){ ?><?php echo $rowCat['cat_name']; ?> All Pictures<?php } elseif(isset($_GET['category'])){ ?><strong><?php echo $rowCat['cat_name']; ?> All Pictures</strong><?php } elseif(isset($_GET['alltp'])){ ?><strong>All Recent Pictures</strong><?php } elseif(isset($_GET['all'])){ ?><strong>All Recent Pictures</strong><?php }else{ ?>All Recent Pictures<?php } ?></a></div>

    <div class="tab roundT"><a <?php if(isset($_GET['cat'])){ ?> href="home?tp&cat=<?php echo $_GET['cat']; ?>" <?php }else{ ?>href="home?tp"<?php } ?>>

<?php if(isset($_GET['cat'])){ ?><?php echo $rowCat['cat_name']; ?> Top Pictures<?php } elseif(isset($_GET['tp'])||isset($_GET['alltp'])){ ?><strong>Top Pictures</strong><?php } else{ ?>Blabben Top Pictures<?php } ?></a></div>

   </div>

        </div>

   <!--tabs end-->

   

<!--        <div class="blabnation">

        <ul class="user-dropdown">

            <li <?php //if(!isset($_GET['nation'])){?>id="selected"<?php //}else{}?>><a href="home">Blab Friends</a></li>

            <li <?php //if(isset($_GET['nation'])){?>id="selected"<?php //}else{}?>><a href="home?nation">Blab Nation</a></li>

        </ul>

        </div>

-->

   <!--content-->

   <div id="content" class="round1">

   	

    <?php

	if(!isset($_GET['top'])){

	$objBP = new dbConfig();

	$objBP1 = new dbConfig();

	//echo $_GET['cat'];

	if(isset($_GET['cat'])&&!isset($_GET['tp'])){

		$cate = "select * from blabs,users,categories,follow WHERE follow.following = blabs.user_id AND follow.follower = ".$uinfo['user_id']." AND blabs.cat_id = categories.cat_id AND blabs.user_id = users.user_id AND blabs.blab='0' AND blabs.cat_id = ".$_GET['cat']." ORDER BY blab_id DESC LIMIT 8";

	$sqlBP = $objBP->selectQuery($cate);

	}

	elseif(isset($_GET['category'])){

	$sqlBP = $objBP->selectQuery("select * from blabs,users,categories,follow WHERE follow.following = blabs.user_id AND blabs.cat_id = categories.cat_id AND follow.follower = ".$uinfo['user_id']." AND blabs.user_id = users.user_id AND blabs.blab='0' AND blabs.cat_id = ".$_GET['category']." ORDER BY blab_id DESC LIMIT 8");

	}

	elseif(isset($_GET['all'])){

	$sqlBP = $objBP->selectQuery("select * from blabs,users,categories,follow WHERE follow.following = blabs.user_id AND blabs.cat_id = categories.cat_id AND follow.follower = ".$uinfo['user_id']." AND blabs.user_id = users.user_id AND blabs.blab='0' ORDER BY blab_id DESC LIMIT 75");

	} 

	elseif(isset($_GET['tp'])&&!isset($_GET['cat'])){



	$sqlBP = $objBP->selectQuery("select * from blabs,users,categories WHERE blabs.cat_id = categories.cat_id AND blabs.user_id = users.user_id AND blabs.blab='0' ORDER BY blabs.blab_id DESC LIMIT 75");



	//$sqlBP = $objBP->selectQuery("select * from likes,blabs,users,categories WHERE likes.blab_id = blabs.blab_id AND blabs.cat_id = categories.cat_id AND likes.show='1' AND blabs.user_id = users.user_id AND blabs.blab='0' ORDER BY likes.liked DESC LIMIT 75");

	}

	elseif(isset($_GET['tp'])&&isset($_GET['cat'])){

		$t = "select * from blabs,users,categories WHERE blabs.cat_id = categories.cat_id AND blabs.user_id = users.user_id AND blabs.cat_id = ".$_GET['cat']." AND blabs.blab='0' ORDER BY blabs.blab_id DESC LIMIT 75";

	$sqlBP = $objBP->selectQuery($t);

	}

	elseif(isset($_GET['alltp'])){



	$sqlBP = $objBP->selectQuery("select * from likes,blabs,users,categories,follow WHERE follow.following = blabs.user_id AND (likes.blab_id = blabs.blab_id) AND (follow.follower = ".$uinfo['user_id'].") AND (blabs.cat_id = categories.cat_id) AND (likes.show='1') AND (blabs.user_id = users.user_id) AND (blabs.blab='0') ORDER BY likes.liked DESC");

	}

	elseif(!isset($_GET['tp'])&&isset($_GET['cat'])) { 

	$sqlBP = $objBP->selectQuery("select * from blabs,users,follow,categories WHERE (blabs.cat_id = categories.cat_id) AND (follow.following = blabs.user_id) AND (follow.follower = ".$uinfo['user_id'].") AND (blabs.user_id = users.user_id) AND (blabs.blab='0') AND (blabs.cat_id = ".$_GET['cat'].") ORDER BY blab_id DESC LIMIT 8");

	}

	else { 

	$sqlBP = $objBP->selectQuery("select * from blabs,users,follow,categories WHERE (blabs.cat_id = categories.cat_id) AND (follow.following = blabs.user_id) AND (follow.follower = ".$uinfo['user_id'].") AND (blabs.user_id = users.user_id) AND (blabs.blab='0') ORDER BY blab_id DESC LIMIT 8");

	}

 ?>

<script>

function deleteblab(blab){

c = confirm("Are you sure you want to delete this?"); if(c==true){location.href = "models/picblab_mdl.php?bid="+blab+"&delete=blab"}

}

</script>

    <!--blab-->

    <div id="blabs-con">

    <ul>

<?php $c=1; while($rowblab = mysql_fetch_array($sqlBP)){ ?>

<?php				

					//count likes

				$objLike = new dbConfig();

				$sqlLike = $objLike->selectQuery("select * from likes WHERE blab_id = ".$rowblab['blab_id']);

				$countLike = mysql_num_rows($sqlLike);



				//find if person liked

				$objLike1 = new dbConfig();

				$sqlLike1 = $objLike1->selectQuery("select * from likes WHERE blab_id = ".$rowblab['blab_id']." AND user_id = ".$uinfo['user_id']);

				$countLike1 = mysql_num_rows($sqlLike1);



				//get comments

				$objBs = new dbConfig();

				$sqlBs = $objBs->selectQuery("select * from comment WHERE blab_id = ".$rowblab['blab_id']);

				$countBs = mysql_num_rows($sqlBs);





				//get repics

				$objRe = new dbConfig();

				$sqlRe = $objRe->selectQuery("select * from blabs WHERE reblab = ".$rowblab['blab_id']);

				$countRe = mysql_num_rows($sqlRe);

				 ?>



<li class="box">

        <div class="blabs" fancybox>

<!--fancybox srart-->

<!-- Add mousewheel plugin (this is optional) -->
<script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery.mousewheel-3.0.6.pack.js"></script>

<!-- Add fancyBox main JS and CSS files -->

<script type="text/javascript" src="js/fancybox/jquery.fancybox.js"></script>

<link rel="stylesheet" type="text/css" href="js/fancybox/jquery.fancybox.css" media="screen" />

<!--fancybox end-->

<script type="text/javascript">
$(document).ready(function() {
	$(".fancybox").fancybox({
			'transitionIn' : 'elastic',
			'transitionOut' : 'fade',
			'width' : 615,
			'height' : 'auto',
			'type' : 'img'
			});
});
</script>

<script>

$(document).ready(function(){

	//$('#commentwr<?php //echo $c; ?>').hide();

	$('#commentbt<?php echo $c; ?>').click(function(){

		//$('#commentwr<?php //echo $c; ?>').slideToggle('slow');

		$('#comment<?php echo $c; ?>').focus();

	});

});

</script>

    

        <?php 



if($_SESSION['UserInfo'][0]==$rowblab['user_id']) {?>

        <div class="delete1"><a href="javascript:;" onclick="deleteblab('<?php echo $rowblab['blab_id']; ?>')"><img src="images/delete.png" title="Delete this Picture" alt="Delete" /></a></div>

        <?php } ?>

        <div class="blabs-img fancybox"><!--blabs-img start-->

        	<?php if($rowblab['blab_img']==NULL){ ?>

            	<a  class="fancybox" href="article.php?blab=<?php echo $rowblab['blab_id']; ?>"><img src="images/avatar.png" width="198" /></a>

		<?php } else { ?>

            <a class="fancybox" href="article.php?blab=<?php echo $rowblab['blab_id']; ?>"><img src="pictures/large/<?php echo $rowblab['blab_img']; ?>" width="198" /></a>

		<?php } ?>

       	<div class="blab-text"><?php echo $rowblab['blab_caption']; ?></div>

            	<div class="blab-text1"><?php echo $countLike; ?> likes</div>

            	<div class="blab-text1"><?php echo $countBs; ?> blabs</div>

            	<div class="blab-text1"><?php echo $countRe; ?> repics</div>

            </div><!-- blabs-img end-->

            <div class="like fancybox" ><img id="commentbt<?php echo $c; ?>" style="cursor:pointer;" src="images/Blab.jpg" width="61" height="18" />

            <?php if($countLike1<=0){ ?>

            <a class="fancybox" href="models/likes_mdl.php?action=like&bid=<?php echo $rowblab['blab_id']; ?>&uid=<?php echo $rowblab['user_id']; ?>&page=home"><img src="images/Like.jpg" width="56" height="18" /></a>

            <?php }?>

            <?php if($rowblab['user_id']!=$uinfo['user_id']){ 

		?>

            	

                <form style="float:right;" name="repic" id="repic" action="models/repic_mdl.php?action=repic" method="post">

                	<input name="uid" type="hidden" value="<?php echo $rowblab['user_id']; ?>" />

                	<input name="blab_img" type="hidden" value="<?php echo $rowblab['blab_img']; ?>" />

                	<input name="blab_id" type="hidden" value="<?php echo $rowblab['blab_id']; ?>" />

                	<input name="blab_caption" type="hidden" value="<?php echo $rowblab['blab_caption']; ?>" />

                	<input name="cat_id" type="hidden" value="<?php echo $rowblab['cat_id']; ?>" />

                    <input type="image" src="images/RePic.png" />

                </form>

            <?php }?>

            </div>

            <div class="onto">

            <?php if($rowblab['picture']==NULL) { ?> 

               		    <span><img src="images/avatar.png" width="30" /></span>

       		      <?php } else { ?><img src="users_images/small/<?php echo $rowblab['picture']; ?>" width="30" /><?php } ?>

            <span><strong><a href="./<?php echo $rowblab['uname']; ?>"><?php echo $rowblab['name']; ?></a> @<?php echo $rowblab['uname']; ?></strong> onto <strong><a href="home?cat=<?php echo $rowblab['cat_id']; if(isset($_GET['tp'])){echo "&tp";} ?>"><?php echo $rowblab['cat_name']; ?></a></strong></span></div>

            <?php

	$objCom = new dbConfig();

	//$coms = "select * from blabs,users,comment WHERE blabs.user_id = comment.user_id AND blabs.blab_id = comment.blab_id AND comment.blab_id = ".$rowblab['blab_id']." ORDER BY comment.com_id DESC LIMIT 2";

	$sqlCom = $objCom->selectQuery("select * from comment WHERE blab_id = ".$rowblab['blab_id']." ORDER BY com_id DESC LIMIT 2");

	$comCount = mysql_num_rows($sqlCom);

	if($comCount>=1){

		while($comments = mysql_fetch_array($sqlCom)){

 ?>     <div class="onto1">

            <?php 

		$objComU = new dbConfig();

		$sqlComU = $objComU->selectQuery("select * from users WHERE user_id = ".$comments['user_id']);

		$comU = mysql_fetch_array($sqlComU);

		if($comU['picture']==NULL) { ?> 

               		    <span><img src="images/avatar.png" width="30" /></span>

       		      <?php } else { ?><img src="users_images/small/<?php echo $comU['picture']; ?>" width="30" /><?php } ?>

            <span><strong><a href="./<?php echo $comU['uname']; ?>"><?php echo $comU['name']; ?></a></strong>  <?php echo $comments['comment']; ?></span></div>

            <?php }}

		if($countBs>=2){

		 ?>

            

            <div class="onto1" style="text-align:center">

			<span><strong><a href="article.php?blab=<?php echo $rowblab['blab_id']; ?>">All <?php echo $countBs; ?> comments...</a></strong></span></div>

               

        <?php } ?>

         <div id="commentwr<?php echo $c; ?>" class="onto1 comments" style="text-align:center">

			<span><strong><form action="models/comment_mdl.php?put=blab&uid=<?php echo $rowblab['user_id']; ?>" method="post" name="comment"><input name="blab_id" type="hidden" value="<?php echo $rowblab['blab_id']; ?>" /><textarea name="comment" id="comment<?php echo $c; ?>" placeholder="Blab It Up" maxlength="140" style="max-width:186px; min-width:186px; width:186px; height:24px;max-height:50px;" cols="" rows=""></textarea></strong></span><br />

			<input name="" type="image" src="images/Blab.jpg" style="margin-top:6px;" /></form>

	</div>

        </div>

       </li>

        

<?php $c++; } ?>

    </ul>

   

        

        

    <?php } ?>

    </div>

    <!--blabs end-->

<?php if(!isset($_GET['all'])&&!isset($_GET['category'])&&!isset($_GET['alltp'])&&!isset($_GET['tp'])) {?>

   <!--content 2-->

    <div id="content2" style="margin-bottom:20px;">

           		<a id="timeline"></a>

        <!--content left-->

      <div id="left">

           <!--tabs-->

          <div id="tabs-inside">

            <div class="tab-inside roundT"><a href="home"><?php if(!isset($_GET['top'])&&!isset($_GET['points'])){ ?><strong>Blabbing</strong><?php } else {?>Blabbing<?php } ?></a></div>

            <div class="tab-inside roundT">

		<?php if(isset($_GET['cat'])){ ?><a href="home?top&cat=<?php echo $_GET['cat']; ?>"><?php if(isset($_GET['top'])) {?><strong><?php echo $rowCat['cat_name']; ?> Top Blabs</strong><?php }else { ?><?php echo $rowCat['cat_name']; ?> Top Blabs</a><?php }}else {?><a href="home?top"><?php if(isset($_GET['top'])) {?><strong>Blabben Top Blabs</strong><?php }else { ?>Blabben Top Blabs</a><?php }} ?></div>

            <!--<div class="tab-inside roundT"><a href="home?points"><?php //if(isset($_GET['points'])){ ?><strong>Points</strong><?php //} else {?>Points<?php //} ?></a></div>-->

           </div>

         <!--tabs end-->

           <div id="leftcon">

           		<div style="text-align: center;"><?php echo $noblab; ?></div>

           		<ul class="statuses"><?=$timeline?></ul>

         </div>

      </div>

        <!--conetne left end-->



        <!--content right-->

        <div id="right">

        	<!--tabs-->

            <div id="tabs">

           	 <div class="tab1 roundT">My Blab Profile<span class="catname1"><?php if(isset($_GET['cat'])){ echo $rowCat['cat_name']; } elseif(isset($_GET['category'])){ echo $rowCat['cat_name']; } ?></span></div>

            </div>

         	<!--tabs end-->

            <!--profile-->

            <div id="blab-profile">

            	<div id="profile">

            	<?php if($uinfo['picture']==NULL) { ?> 

               		    <img src="images/avatar.png" width="50" />

       		      <?php } else { ?><img src="users_images/large/<?php echo $uinfo['picture']; ?>" width="50" /><?php } ?><span> </span><?php echo $uinfo['name']; ?><br />

           	    <a href="<?php echo $uinfo['uname']; ?>">View Profile page</a></div>

          		<!--counts-->

           		 <div id="counts">

                 	<div id="count-blabs1">

                    <?php

				$objBlab = new dbConfig();

				$sqlBlab = $objBlab->selectQuery("select * from blabs WHERE user_id = ".$_SESSION['UserInfo'][0]);

				$countBlab = mysql_num_rows($sqlBlab);



				$objF = new dbConfig();

				$sqlF = $objF->selectQuery("select * from follow WHERE follower = ".$_SESSION['UserInfo'][0]);

				$following = mysql_num_rows($sqlF);



				$objF1 = new dbConfig();

				$sqlF1 = $objF1->selectQuery("select * from follow WHERE following = ".$_SESSION['UserInfo'][0]);

				$follower = mysql_num_rows($sqlF1);



				$objPoints = new dbConfig();

				$sqlPoints = $objBlab->selectQuery("select * from users WHERE user_id = ".$_SESSION['UserInfo'][0]);

				$countPoints = mysql_fetch_array($sqlPoints);

				 ?>

                    <span><?php echo $countBlab; ?></span><br />

               	    <a href="profile">BLABS</a></div>

                 	<div id="count-points1"><span><?php echo $countPoints['points']; ?></span><br />

               	    <a href="profile">POINTS</a></div>

              </div>

           	  <!--counts end-->

              <!--counts-->

           		 <div id="counts">

                 	<div id="count-follow1"><span><?php echo $following; ?></span><br />

               	    <a href="profile?following">FOLLOWING</a></div>

                 	<div id="count-follower1"><span><?php echo $follower; ?></span><br />

               	    <a href="profile?followers">FOLLOWERS</a></div>

              </div>

           	  <!--counts end-->

                <?php 

			    $objbid = new dbConfig();

				$qb = "select * from blabs order by blab_id desc limit 1";

				$sqlbid = $objbid->selectQuery($qb);

				$bid= mysql_fetch_array($sqlbid);

				$b_id = $bid['blab_id']+1;

			?>

              

                <div id="blabit-up">

                <form id="blabfrm" name="blabfrm" method="post">



<textarea name="blab" id="blab" placeholder="Blab It Up" class="validate[required] text-input" tabindex="1" rows="2" cols="40" onKeyDown="textCounter(document.blabfrm.blab,document.blabfrm.counterb,160)"

onKeyUp="textCounter(document.blabfrm.blab,document.document.blabfrm.counterb,160)"><?php if(isset($_GET['cat'])){?>wrote onto <?php echo $rowCat['cat_name'].": "; ?><?php }elseif(isset($_GET['category'])) { ?>wrote onto <?php echo $rowCat['cat_name'].": "; }?></textarea>

<input name="name" type="hidden" value="<?php echo $_SESSION['UserInfo'][1]; ?>" />

<input name="state" type="hidden" value="<?php echo $_SESSION['UserInfo'][6]; ?>" />

<input name="city" type="hidden" value="<?php echo $_SESSION['UserInfo'][5]; ?>" />

<input name="picture" type="hidden" value="<?php echo $_SESSION['UserInfo'][10]; ?>" />

<input name="uname" type="hidden" value="<?php echo $_SESSION['UserInfo'][4]; ?>" />

<input name="cat_id" type="hidden" value="<?php if(isset($_GET['cat'])) { echo $_GET['cat']; } elseif(isset($_GET['category'])) { echo $_GET['category']; } else { echo "35"; }?>" />

<input name="blab_id" type="hidden" value="<?php echo $b_id; ?>" />

<span class="catname"><?php if(isset($_GET['cat'])){ echo "<span style='text-transform: capitalize;'>".$rowCat['cat_name']."</span>"; }elseif(isset($_GET['category'])){ echo "<span style='text-transform: capitalize;'>".$rowCat['cat_name']."</span>"; } ?></span>

<input name="counterb" class="counter" style="border:none; background:none;margin: 0; width: 50px;" disabled="disabled" value="160" type="text" />

<!--<span style="min-width:100px" class="counter">160</span>-->

<input class="submitButton inact" name="submit" type="submit" value=" " disabled="disabled" />

<div class="clear"></div>

</form>

</div>

</div>                <!--blab of day-->

                <div id="tabs">

           	 <div class="tab1 roundT" style="margin-top:10px;">Blab of the day</div>

            </div>

            <?php

	$objday = new dbConfig();

	$sqlday = $objday->selectQuery("select * from trending WHERE trending_active = '1' ORDER BY trending_id DESC");

	$bofdayn = mysql_num_rows($sqlday);

	if($bofdayn<=0){

		?>

            



                 <div class="recent-comments" style="background: none repeat scroll 0 0 #FFFFFF;

    margin-left: 6px;

    width: 93%;">

                	<div class="pinned"><strong>No Blab</strong></div>

                </div>



            <?php



		} else {

			while($bofday = mysql_fetch_array($sqlday)){

 ?>

     

                <div class="recent-comments" style="background: none repeat scroll 0 0 #FFFFFF;

    margin-left: 6px;

    width: 93%;">

   <!-- onclick="document.getElementById('q').value='<?php //echo $bofday['trendings']; ?>'"-->

	  			<div class="pinned" style="padding-left:13px;"><a href="search?q=<?php echo $bofday['trendings']; ?>" id="bofday"><?php echo $bofday['trendings']; ?></a></div>

            </div>

                <?php }} ?>

            

            

                <!--blab of day end-->

                

          </div>

            <!--profile end-->

            

        

        

        </div>

        <!--conetne right end-->

    </div>

    <!--content 2 end-->

<?php } ?>

   </div>

   <!--content end-->

    

</div>

<!--wrapper end-->

<script src="js/masonry/jquery.masonry.min.js"></script>

<script>

  $(function(){

  var $container = $('#blabs-con');

$container.imagesLoaded(function(){

  $container.masonry({

    itemSelector : '.box',

    columnWidth : 0

	 });

});



  });

</script>

</body>

</html>

<?php

$content = ob_get_contents();

ob_end_clean();

require_once("mainTemplate.php");

?>   

Link to comment
https://forums.phpfreaks.com/topic/257433-how-to-make-images-popup-with-php/
Share on other sites

So where are you stuck, exactly?

 

I can't get the larger image from the database a long with the comments to show up with the pop-up.

the little display pops up but its blank. go to http://www.blabben.com/home?tp&cat=40

login: gazaian1

pass: icd1994

 

and you see what i am talking about

and i am using a fancybox plugin

well your name and login didn't work, I see it requires an email versus just a username, so made a test account

 

user:test

email:test@live.com

password:testpassword

 

your lightbox isn't linking to anywhere, it's really made for an image.

 

If you just link to the proper pages, it will work as expected.

 

Here's one example.

http://www.blabben.com/article.php?blab=854

well your name and login didn't work, I see it requires an email versus just a username, so made a test account

 

user:test

email:test@live.com

password:testpassword

 

your lightbox isn't linking to anywhere, it's really made for an image.

 

If you just link to the proper pages, it will work as expected.

 

Here's one example.

http://www.blabben.com/article.php?blab=854

 

 

Thanks but how exactly do i link the page to the lightbox plugin

This is the code for the article page

the same page you just showed me

<?php

define('INCLUDE_CHECK',1);

include('models/user.php');

include('includes/ago.php');

ob_start();

$title = "Blabben";

$pic = $_SESSION['UserInfo'][10];

?>

<?php

	$objBP = new dbConfig();

	$sqlBP = $objBP->selectQuery("select * from blabs,users WHERE blabs.user_id = users.user_id AND blabs.blab='0' AND blabs.blab_id = ".$_GET['blab']);

	$rowblab = mysql_fetch_array($sqlBP);

 ?>

      <!--tabs-->

   <div id="tabs-con">

   <div id="tabs1">

   	<div class="tab roundT"><a href="upload-picture.php">Upload Picture</a></div>

   </div>

    	

        </div>

   <!--tabs end-->

      

   <!--content-->

   <div id="content" class="round1">

   	<!--content 2-->

    <div id="article">



	<!--content left-->

        <div id="left">

        	<!--tabs-->

            <div id="tabs">

           	 <div class="tab1 roundT">Profile</div>

            </div>

         	<!--tabs end-->

            <!--profile-->
<!--fancybox-->

<!-- Add mousewheel plugin (this is optional) -->
<script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery.mousewheel-3.0.6.pack.js"></script>

<!-- Add fancyBox main JS and CSS files -->

<script type="text/javascript" src="js/fancybox/jquery.fancybox.js"></script>

<link rel="stylesheet" type="text/css" href="js/fancybox/jquery.fancybox.css" media="screen" />

<!--fancybox-->


               <script>

jQuery(document).ready(function(){

	jQuery("#blabitup").validationEngine('attach', {promptPosition : "centerRight"});

});

</script>

            <div id="blab-profile2">

            	<div id="profile">

                  <?php if($rowblab['picture']==NULL) { ?> 

               		    <img src="images/avatar.png" class="round1" width="50" />

       		      <?php } else { ?><img src="users_images/small/<?php echo $rowblab['picture']; ?>" class="fancybox" class="round1" width="50" /><?php } ?>

                  <span></span><?php echo $rowblab['name']; ?><br />

           	    <a href="./<?php echo $rowblab['uname']; ?>">View Profile page</a></div>

          		<div class="line"></div>

                <div id="blabit-up"><form action="models/postblab_mdl.php?id=<?php echo $rowblab['blab_id']; ?>&put=comment" method="post" name="blabitup"><textarea name="comment" id="comment" class="round1 validate[required]" cols="" rows="" placeholder="Blab It Up"></textarea><input name="submit" type="submit" class="comment" value="" /></form></div>

                

                <div id="recent">Recent Comments</div>

                <!--recent commente-->

                 <?php

	$objCom1 = new dbConfig();

	$sqlCom1 = $objCom1->selectQuery("select * from comment,users WHERE comment.user_id = users.user_id AND comment.blab_id = ".$_GET['blab']." ORDER BY comment.com_id DESC");

	$Rcount = mysql_num_rows($sqlCom1);

	if($Rcount<=0){

		?>

            

                 <div class="recent-comments">

                	<div class="pinned"><strong>No Comment</strong></div>

                </div>

            <?php



		} else {

			while($Comment1 = mysql_fetch_array($sqlCom1)){

 ?>

                <div class="recent-comments">

                <?php if($Comment1['picture']==NULL) { ?> 

               		    <img src="images/avatar.png" class="round1" width="50" />

       		      <?php } else { ?><img src="users_images/small/<?php echo $Comment1['picture']; ?>"   class="round1" width="50" /></a><?php } ?>

		        <div><h2><a href="<?php echo $Comment1['uname']; ?>"><?php echo $Comment1['name']; ?></a></h2><div class="at" style="color:#000;"> @<?php echo $Comment1['uname']; ?></div></div>

	  			<div class="pinned" style="color:#000;"><?php echo $Comment1['comment']; ?></div>

                </div>

                <?php }} ?>

                <!--recent commente end-->

                

          </div>

            <!--profile end-->

            

        

        

        </div>

        <!--conetne left end-->



        <!--content right-->

      <div id="right">

      



      <!--content right top-->
<a class="fancybox" href="">

      <div id="rightconT" class="fancybox">

      	<div id="head">

       	  <?php if($rowblab['picture']==NULL) { ?> 

               		    <span><img src="images/avatar.png" width="65"/></span>

       		      <?php } else { ?><img src="users_images/large/<?php echo $rowblab['picture']; ?>" id="profile-mimg"  class="fancybox" width="65" /><?php } ?>

                  

          <div><h2><a href="<?php echo $rowblab['uname']; ?>"><?php echo $rowblab['name']; ?></a></h2><!--<img src="images/blab-logo-small.png" class="blab-small" />--><div style="color:#000;" class="at"> @<?php echo $rowblab['uname']; ?></div></div>

	  <div id="pinned">Blabbed <?php //echo $todaydate=date('Y-m-d H:m:s');

$blab_date = $rowblab['blab_date'];



$todaydate=date('Y-m-d H:m:s');

$ago = strtotime($todaydate) - strtotime($blab_date);

  if ($ago >= 86400) { 

     $diff = floor($ago/86400).' days ago'; 

  } elseif ($ago >= 3600) { 

     $diff = floor($ago/3600).' hours ago'; 

  } elseif ($ago >= 60) { 

     $diff = floor($ago/60).' minutes ago'; 

  } else { 

     $diff = 'less than a minute ago'; 

  }



echo $diff;



?> via <strong>blabben</strong> onto <a href="home?cat=<?php echo $rowblab['cat_id']; ?>" style="color:#909090;"><strong><?php

				//get Category

				$objCa = new dbConfig();

				$cn = "select * from categories WHERE cat_id = ".$rowblab['cat_id'];

				$sqlCa = $objCa->selectQuery($cn);

				$Catname = mysql_fetch_array($sqlCa);

				echo $Catname['cat_name'];



?></strong></a></div>

        </div>

        <div id="profile-blab"> 

        	<?php 



				//count likes

				$objLike = new dbConfig();

				$sqlLike = $objLike->selectQuery("select * from likes WHERE blab_id = ".$rowblab['blab_id']);

				$countLike = mysql_num_rows($sqlLike);



				//get repics

				$objRe = new dbConfig();

				$sqlRe = $objRe->selectQuery("select * from blabs WHERE reblab = ".$rowblab['blab_id']);

				$countRe = mysql_num_rows($sqlRe);





				//get comments

				$objBs = new dbConfig();

				$sqlBs = $objBs->selectQuery("select * from comment WHERE blab_id = ".$rowblab['blab_id']);

				$countBs = mysql_num_rows($sqlBs);



				//find if person liked

				$objLike1 = new dbConfig();

				$sqlLike1 = $objLike1->selectQuery("select * from likes WHERE blab_id = ".$rowblab['blab_id']." AND user_id = ".$uinfo['user_id']);

				$countLike1 = mysql_num_rows($sqlLike1);

				if($countLike1<=0) {?>

            <a href="models/likes_mdl.php?action=like&bid=<?php echo $rowblab['blab_id']; ?>&uid=<?php echo $uinfo['user_id']; ?>&page=article"><img src="images/like2.png" width="72" height="30" /></a>

            <?php } ?>

          	<form style="float:left; margin-right:15px;" name="repic" id="repic" action="models/repic_mdl.php?action=repic" method="post">

                	<input name="uid" type="hidden" value="<?php echo $rowblab['user_id']; ?>" />

                	<input name="blab_img" type="hidden" value="<?php echo $rowblab['blab_img']; ?>" />

                	<input name="blab_id" type="hidden" value="<?php echo $rowblab['blab_id']; ?>" />

                	<input name="blab_caption" type="hidden" value="<?php echo $rowblab['blab_caption']; ?>" />

                	<input name="cat_id" type="hidden" value="<?php echo $rowblab['cat_id']; ?>" />

                    <input type="image" src="images/RePic-large.png" />

                </form>

            <!--<span>From: <a href="#">images.search.yahoo.com</a></span>-->

        <div style="float:right; font-family:Verdana, Geneva, sans-serif; font-size:12px; color:#909090;">Likes: <?php echo $countLike; ?>    RePics: <?php echo $countRe; ?>    Blabs: <?php echo $countBs; ?></div>

      	</div>

      	<div id="profile-main-img" class="fancybox">

     	<?php if($rowblab['blab_img']==NULL){ ?>

            	<img src="images/avatar.png" width="550" />

		<?php } else { ?>

            	 <a class="fancybox" href="article.php?blab=<?php echo $rowblab['blab_id']; ?>"><img src="pictures/large/<?php echo $rowblab['blab_img']; ?>" class="fancybox" width="550" /></a>

		<?php } ?>



        </div>

        <div id="img-desc"><?php echo $rowblab['blab_caption']; ?><br />Blabbed via <strong>Blabben</strong></div>

    </div></a>

      <!--content right top end-->

           <!--tabs-->

           <div id="tabs-inside">

            <div class="tab-inside roundT"><a href="article.php?blab=<?php echo $_GET['blab']; ?>&Likes"><?php if(!isset($_GET['ReBlabb'])){ ?><strong>Likes</strong><?php } else {?>Likes<?php } ?></a></div>

            <div class="tab-inside roundT"><a href="article.php?blab=<?php echo $_GET['blab']; ?>&ReBlabb"><?php if(isset($_GET['ReBlabb'])){ ?><strong>RePics</strong><?php } else {?>RePics<?php } ?></a></div>

           </div>

         <!--tabs end-->

           <div id="rightcon">

           		

                	<?php

				//WHERE blabs.user_id = users.user_id AND users.user_id =".$user."

				$Bobj = new dbConfig();

		if(isset($_GET['ReBlabb'])){

						$bqry = "SELECT * FROM blabs,users WHERE blabs.user_id = users.user_id AND blabs.reblab =".$rowblab['blab_id']." ORDER BY blabs.blab_id DESC";

						} 

else {

					  $bqry = "SELECT * FROM likes,users WHERE (likes.user_id = users.user_id) AND (likes.blab_id =".$rowblab['blab_id'].") ORDER BY likes.like_id DESC";

} 

				$Bsql = $Bobj->selectQuery($bqry);

				$noblab = mysql_num_rows($Bsql);

				if($noblab<=0){?><div style="font-size:18px; padding:20px; text-align:center;"> </div><?php }else{

				while($blabs = mysql_fetch_array($Bsql)) {

			 ?><a href="./<?php echo $blabs['uname']; ?>" class="liked">

                    <?php if($blabs['picture']==NULL) { ?> 

               		    <span><img src="images/avatar.png" height="50" /></span>

       		      <?php } else { ?><img src="users_images/small/<?php echo $blabs['picture']; ?>" height="50" /><?php } ?></a>



<?php } }?>

                

         </div>

      </div>

        <!--conetne right end-->

        

        



    </div>

    <!--content 2 end-->

   </div>

   <!--content end-->

    

</div>

<!--wrapper end-->



<!--footer-->

<!--<div id="footer-con">

<div id="footer">

    <div id="left">

    	<img src="images/logo-black.png" width="189" height="40" />

     </div>

     <div id="right">

         <ul>

        	<li><a href="#">About</a></li>

        	<li><a href="#">Help</a></li>

        	<li><a href="#">Terms of conditions</a></li>

        	<li><a href="#">Privacy policy</a></li>

        	<li><a href="#">Points</a></li>

        </ul>

Copyright 2011 <strong>Blabben.com</strong>        

    </div>

    </div>

</div>-->

<!--footer end-->



</body>

</html>

<?php

$content = ob_get_contents();

ob_end_clean();

require_once("mainTemplate.php");

?> 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.