deepson2 Posted May 15, 2009 Share Posted May 15, 2009 Hello, I am trying to use jCarousel in my php script to show all records on the same page. like this http://sorgalla.com/projects/jcarousel/examples/static_simple.html I have form where user has to logged in and then on his/her page he/she can see these record. i have page where user is logged in. where this JS is not working. then i copied my same code with different name and tried there. its working. but the small difference is the page was not having userid. i mean that is not interlinked page with login page and other. we can say it was dummy page of profile.php i know little bit of JS. can anyone here tell me why this is happening. and whats wrong with my code. if anyone ll try this code there it ll work. i am quite sure about it. then why its not working with when user is logged in.( to top of it i have to show my database selection into this.. so i need to consider here this logged in thing.) here is my code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>BlogAdda - Profile of <?if($blogdata->fullname==""){echo ucwords(strtolower($blogdata->username));}else{ echo ucwords(strtolower($blogdata->fullname));}; ?></title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <link rel="stylesheet" type="text/css" href="<?=$retpath;?>/includes/adda2.css" media="screen" /> <script type="text/javascript" language="javascript" src="<?=$retpath;?>/includes/functions.js"></script> <!-- jQuery library --> <script type="text/javascript" src="lib/jquery-1.2.3.pack.js"></script> <!-- jCarousel library --> <script type="text/javascript" src="lib/jquery.jcarousel.pack.js"></script> <!-- jCarousel core stylesheet --> <link rel="stylesheet" type="text/css" href="lib/jquery.jcarousel.css" /> <!-- jCarousel skin stylesheet --> <link rel="stylesheet" type="text/css" href="skins/tango/skin.css" /> <style type="text/css"> /** * Overwrite for having a carousel with dynamic width. */ .jcarousel-skin-tango .jcarousel-container-horizontal { width: 100%; } .jcarousel-skin-tango .jcarousel-clip-horizontal { width: 100%; } </style> <script type="text/javascript"> jQuery(document).ready(function() { jQuery('#mycarousel').jcarousel({ visible: 4 }); }); </script> </head> <?if(!$userid){?> <body id="free"> <?}else{ ?> <body> <?}?> <div id="wrapper"> <div id="mainContent"><div class="blogcontainer"> <?if($blogdata->username==""){ ?> <p> </p> <div id="artMsg"><?=$usrname;?> does not exist on site.<br />If you want <?=$usrname;?> as your username, <a href="/register">grab it now</a></div> <?}else{?> <? $result = $op->runsql("SELECT a.username,b.id, b.title, b.url, b.descr, b.blogpath, a.fname as fullname, LEFT(b.descr, 200) as newdescr FROM ".tbl_bloginfo." b,".tbl_author." a WHERE (b.author = a.id) AND a.id = '$uid' AND b.approve !='P' ORDER BY b.id DESC"); if(mysql_num_rows($result) > 0){ while($row1 = $op->select($result)){ $bloglist[$i]=$row1['title']; $blogurl[$i]=$row1['blogpath']; $i++;} }else{ $row = $op->select($result) ?> <? } }?> <div id="userProfile"> <ul class="nav"> <li><span class="<?if($blogdata->gender=='M'){ echo 'male';}else if($blogdata->gender=='F'){ echo 'female';} ?>"><? echo $blogdata->fullname; if($blogdata->authoredby=='M'){ echo" Multi author";} ?></span></li> <li><span class="DOB"><?=date('d M', strtotime($blogdata->birthdt));?></span></li> <li class="last"><span class="city"><?=$blogdata->city?></span></li> </ul> </div> <?} //?> <h3 class="interestText">Recent Visitor's</h3> <div class="NewArrivals"> <div id="New_Arrivalsthum1"> <ul id="mycarousel" class="jcarousel-skin-tango"> <li><a href="<?=$retpath;?>/dining-sets/35388">neha</a></li> <li><a href="<?=$retpath;?>/dining-sets/35389">jimmy</a></li> <li><a href="<?=$retpath;?>/centre-side-tables/35391">john</a></li> <li><a href="<?=$retpath;?>/centre-side-tables/35392">rahul</a></li> <li><a href="<?=$retpath;?>/leather-sofa-sets/37415">nilesh</a></li> </ul> </div> </div> </div> <!-- blog conatiner ends --> </form> <br class="clear" /> <?//}?> </div><!-- Main Content ends --> </div> <!-- Wrapper ends --> <div id="footerNav"><? include("templates/footer.tpl"); ?></div> <!-- footer ends --> </body> </html> Link to comment https://forums.phpfreaks.com/topic/158261-jcarousel-with-php-script/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.