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>

<body>
<div id="wrapper">
<div id="header"><? include("templates/header.tpl"); ?></div>  <!--
Header ends -->
<? include("templates/banner.tpl"); ?>

<div id="mainContent">
<div class="blogcontainer">



<h3 class="interestText">Recent Visitor's</h3>
<div class="NewArrivals">
<div id="New_Arrivalsthum1">
<ul id="mycarousel" class="jcarousel-skin-tango">
<li>
<?
$sqlpage    = $op->runsql("SELECT
a.username,a.avatar,r.visitor_id,r.visiting_count,TIMESTAMPDIFF
(MINUTE, r.recent_visited, NOW()) AS MinsSinceLastVisit FROM
recent_visitor as r ,author as a WHERE (r.visitor_id = a.id) AND
r.profile_owner = '$blogdata->author' ORDER BY r.recent_visited DESC
LIMIT $start, $limit_value");
 if(mysql_num_rows($sqlpage) > 0){
?>
<p class="msgText">Total <strong><?=$total_records;?></strong><?if
($total_records >1){
?> Recent Visitor's<?}else{?> Recent Visitor<?}}?></p>
<?
                   if(mysql_num_rows($sqlpage) > 0){

           while($row1 = $op->select($sqlpage)){
           $minutes_dif = $row1['MinsSinceLastVisit'];

           $imagearr = explode(",",$row1['avatar']);
        $imagearr[0]= preg_replace("/\/avatar\//","/small/", $imagearr
[0]);


          ?>
          <a href='/profile/<?=$blog->spacereplace($row1['username']);?>/'
title="<?=$row1['username']?>"><img src="<?=$retpath;?>/<?=$imagearr
[0];?>" width="40" height="40" alt="<?=$row1['username']?>"/></a><?

           $minutes_dif = $row1['MinsSinceLastVisit'];
       $Ymin = 60 * 24 * 365;
       $Mmin = 60 * 24 * 30;
       $Wmin = 60 * 24 * 7;
       $Dmin = 60 * 24;
       $Hmin = 60;


       $Y = (int)($minutes_dif / $Ymin);
       $minutes_dif = $minutes_dif % $Ymin;

       $MON = (int)($minutes_dif / $Mmin);
       $minutes_dif = $minutes_dif % $Mmin;

       $W = (int)($minutes_dif / $Wmin);
       $minutes_dif = $minutes_dif % $Wmin;

       $D = (int)($minutes_dif / $Dmin);
       $minutes_dif = $minutes_dif % $Dmin;

       $H = (int)($minutes_dif / $Hmin);
       $minutes_dif = $minutes_dif % $Hmin;

        if($Y > 0 ){
                   echo "$Y year(s) ";

                   }else if($MON > 0){
                   echo "$MON month(s) ";
                   }
                   else if($W > 0){
                   echo "$W week(s) ";
                   }
                   else if($D > 0){
                   echo "$D day(s) ";
                   }
                   else if($H > 0){

                   echo "$H hour(s) ";
                   }


else if($minutes_dif > 0) echo "$minutes_dif minute(s) ";
      echo "ago";   ?>(<?=$row1['visiting_count']?>visits)<? echo"\t";

                 $i++;
                 }
                }
                /*------Paging starts-----*/
                                $redirect = "/profile/$usrname";
                                 if($total_records > $limit_value){
                                 echo "<div class='shoutboxPage'>";
                                 msg_paging($total_records, $total_rows, 
$limit_value,
$start, $page, $total_pages, $redirect);
                                 echo "</div>";
                                 /*-------Paging ends------*/
                        //}
                              }
                              mysql_free_result($result);
        mysql_free_result($sqlpage);
}}
?>

</li>

 </ul>
</div></div>

<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</
p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>
</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>

can anyone tell me can i achive this?
thanks in advance

Reply via email to