function Frendsaction ()
{
$uid =$_get[uid];
$db =&new DataBase ();
$page =isset ($_get[page]) $_get[page]:1;
if ($page <1)
{
$page = 1;
}
$pagerow how many =71;//per page
$sql = "Select A.friendid,b.avatar from Dbo_u2m_friends a inner join Discuz.cdb_memberfields B on A.friendid=b.uid where Mem Berid= ". $uid//calculation of how many
$getPage =&new page ($db);
$getPage->getpage ($page, $pagerow, $sql);
$rows = $getPage->allrow;
$t = new Template ("Views/user");
$t->set_file ("index", "frendsindex.lhtml");
$t->set_file ("header", "header.lhtml");
$t->set_file ("Footer", "footer.lhtml");
$t->set_var (Array (' UID ' => $uid));
$t->parse ("header", "header");
$t->parse ("Footer", "footer");
$div = "";
$n = 0;
For ($i =1 $i <=8; $i + +)
{
For ($j =1 $j <=9; $j + +)
{
$x = ($j-1) *99+58;
$y = ($i-1) *99+62;
if ($i ==1&& $j ==1)
{
$div. = "<div class=\" friendsnav\ "style=\" Position:absolute;top: ". $y." Px;left: ". $x." Px;height:99px;width:99px\ "></div>";
}
Else
{
if ($_cookie[' user '] [' userid ']== $uid)
{
$sback = "onmouseover=\" Showbackground (' addactive ', this) \ ";
}
Else
{
$sback = "";
}
if ($i ==8&& $j ==9)
{
$div. = "<div class=\" mainbox\ "". $sback. "Style=\" Position:absolute;top: ". $y." Px;left: ". $x." Px;height:99px;width:99px\ "> </div>";
}
Else
{
if (Isset ($rows) && $n <=count ($rows))
{
$div. = "<div id=\" "$rows [$n -1][friendid]." \ "onclick=\" javascript:window.location= ' controller=user&uid= ". $rows [$n -1][friendid]." ' \ "Class=\" activitiesitem\ "style=\" Position:absolute;top: ". $y." Px;left: ". $x." Px;height:99px;width:99px;background:url (". $rows [$n -1][avatar].") Center No-repeat;cursorointer\ "Onmouseover=\" Showdiv (' Friendsinfo ', ' ". $i. $j" ', this); \ "Onmouseout=\" Hidediv (' friendsinfo ', ' ". $i. $j."); \ ></div>";
}
Else
{
$div. = "<div class=\" mainbox\ ". $sback." Style=\ "Position:absolute;top:". $y. " Px;left: ". $x." Px;height:99px;width:99px\ "> </div>";
}
}
}
$n + +;
}
}
$t->set_var (Array ("PageCount" => $getPage->pagecount, "Frendscount" => $getPage->rowcount, "divshow" = > $div, "UID" => $uid));
$t->parse ("Out", "index");
$t->p ("Out");
}
<script type= "Text/javascript" src= "Views/scripts/page.js" ></script> calling JS
<script language= "JavaScript" >
<!--
var pg = new Showpages (' PG ');
Pg.pagecount ={pagecount}; Define total pages (necessary)
Pg.detail= ' A total of {frendscount} friend ';
pg.argname = ' P '; Define parameter names (optional, default is page)
document.write (' <br>show times: ' + Pg.showtimes + ', Mood 2 ');
document.write (' 1 ');
Pg.printhtml (2);
-->
</script>