I'm having dificulties with making a paging code. Here is what I have:
Code: Select all
// this is the section where I will like to place the paging in or I should say that I want paging to go beneath the thumbs:
// if(count($p->getcatslist)>0){
// foreach($p->getcatslist as $cval){
// $listc .= '<br><a href="?cid='.$cval['c_id'].'">'.$cval['c_name'].'</a> ';I appreciate all of the help in advanced.
thanks,
jav
Code: Select all
<?
include("include/ws_Core.class.php");
$ws = $_GET['ws'];
switch($ws){
default:
include("include/session.php");
include ("header.php");
$t->readFileIntoString(TEMPLATE.'gallery.tpl',$wspage);
$t->setTemplateString($wspage);
global $database;
$p = new wsCore;
$p->GetCatsList();
if(count($p->getcatslist)>0){
foreach($p->getcatslist as $cval){
$listc .= '<br><a href="?cid='.$cval['c_id'].'">'.$cval['c_name'].'</a> ';
}
}
$cid = intval($_GET['cid']);
$p->LatestImgCat($cid);
if(count($p->latestimgcat) >0){
//get all thumbs for this cat
$p->GetThumbs($p->latestimgcat[0]['c_id']);
if(count($p->getthumbs) >0){
foreach($p->getthumbs as $pval){
if($pval['p_id'] == $p->latestimgcat[0]['p_id']){
$elsel = 'ws-thumbs-sel';
}else{
$elsel = 'ws-thumbs';
}
$thumbs .= '<a href="?ws=viewpic&pid='.$pval['p_id'].'" title="View details"><div class="'.$elsel.'"><img src="pictures/'.$pval['thumb_url'].'" border="0"></div></a>';
}
}
//display in layout
$t->setVar(array(
'LARGEIMG' => 'pictures/'.$p->latestimgcat[0]['img_url'],
));
}
$t->setVar(array(
'LISTCATS' => $listc
));
include ("footer.php");
break;
//view images
case "viewpic":
include("include/session.php");
include ("header.php");
$t->readFileIntoString(TEMPLATE.'view.tpl',$wspage);
$t->setTemplateString($wspage);
global $database;
$p = new wsCore;
$p->GetCatsList();
if(count($p->getcatslist)>0){
foreach($p->getcatslist as $cval){
$listc .= '<a href="?cid='.$cval['c_id'].'">'.$cval['c_name'].'</a> | ';
}
}
$pid = intval($_REQUEST['pid']);
$p->GetPic($pid);
//get all thumbs for this cat
$p->GetThumbs($p->getpic[0]['c_id']);
if(count($p->getthumbs) >0){
foreach($p->getthumbs as $pval){
if($pval['p_id'] == $p->getpic[0]['p_id']){
$elsel = 'ws-thumbs-sel';
}else{
$elsel = 'ws-thumbs';
}
$thumbs .= '<a href="?ws=viewpic&pid='.$pval['p_id'].'" title="View details"><div class="'.$elsel.'"><img src="pictures/'.$pval['thumb_url'].'" border="0"></div></a>';
}
}
//display in layout
$t->setVar(array(
'LARGEIMG' => 'pictures/'.$p->getpic[0]['img_url'],
));
$t->setVar(array(
'LISTCATS' => $listc
));
include ("footer.php");
break;
}
?>