lists.php
Customize your needs...I think you do this part of the file lists.php
else if($action=="vault")
{
$who = $_GET["who"];
addonline(getuid_sid($sid),"U Galeriji!","");
echo "<card id=\"main\" title=\"Galerija\">";
$uid = getuid_sid($sid);
//////ALL LISTS SCRIPT <<
if($page=="" || $page<=0)$page=1;
if($who!="")
{
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
}else{
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault"));
}
$num_items = $noi[0]; //changable
$items_per_page= 10;
$num_pages = ceil($num_items/$items_per_page);
if(($page>$num_pages)&&$page!=1)$page= $num_pages;
$limit_start = ($page-1)*$items_per_page;
if($who!="")
{
$sql = "SELECT id, title, itemurl FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
}else{
$sql = "SELECT id, title, itemurl, uid FROM ibwf_vault ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
}
echo "<p><small>";
$items = mysql_query($sql);
echo mysql_error();
if(mysql_num_rows($items)>0)
{
while ($item = mysql_fetch_array($items))
{
$ext = getext($item[2]);
$ime = getextimg($ext);
$lnk = "<a href=\"$item[2]\">$ime".htmlspecialchars($item[1])."</a>";
if(candelvl($uid, $item[0]))
{
$delnk = "<a href=\"genproc.php?action=delvlt&sid=$sid& vid=$item[0]\">[obrisi]</a>";
}else{
$delnk = "";
}
if($who!="")
{
$byusr="";
}else{
$unick = getnick_uid($item[3]);
$ulnk = "<a href=\"index.php?action=viewuser&sid=$sid& who=$item[3]\">$unick</a>";
$byusr = "- Od: $ulnk";
}
echo "$lnk $byusr $delnk<br/>";
}
}
echo "</small></p>";
echo "<p align=\"center\">";
if($page>1)
{
$ppage = $page-1;
echo "<a href=\"lists.php?action=$action&page=$ppage&am p;sid=$sid&who=$who\">«Nazad</a> ";
}
if($page<$num_pages)
{
$npage = $page+1;
echo "<a href=\"lists.php?action=$action&page=$npage&am p;sid=$sid&who=$who\">Napred»</a>";
}
echo "<br/>$page/$num_pages<br/>";
if($num_pages>2)
{
$rets = "Na stranu: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
$rets .= "<anchor>IDI";
$rets .= "<go href=\"lists.php\" method=\"get\">";
$rets .= "<postfield name=\"action\" value=\"$action\"/>";
$rets .= "<postfield name=\"who\" value=\"$who\"/>";
$rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
$rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
$rets .= "</go></anchor>";
echo $rets;
}
echo "</p>";
////// UNTILL HERE >>
echo "<p align=\"center\">";
if($uid==$who && getplusses($uid)>25)
{
echo "<a href=\"index.php?action=addvlt&sid=$sid\">";
echo "Dodaj Sliku</a><br/>";
}
if($who!="")
{
echo "<a href=\"index.php?action=viewuser&sid=$sid& who=$who\">";
$whonick = getnick_uid($who);
echo "$whonick Profil</a><br/>";
}else{
echo "<a href=\"index.php?action=stats&sid=$sid\">";
echo "<img src=\"images/stat.gif\" alt=\"*\"/>Statistika</a><br/>";
}
echo "<img src=\"images/home.gif\" alt=\"*\"/> <a href=\"index.php?action=main&sid=$sid\">";
echo "HAPPY</a>";
echo "</p>";
echo "</card>";
}
{
$who = $_GET["who"];
addonline(getuid_sid($sid),"U Galeriji!","");
echo "<card id=\"main\" title=\"Galerija\">";
$uid = getuid_sid($sid);
//////ALL LISTS SCRIPT <<
if($page=="" || $page<=0)$page=1;
if($who!="")
{
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'"));
}else{
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault"));
}
$num_items = $noi[0]; //changable
$items_per_page= 10;
$num_pages = ceil($num_items/$items_per_page);
if(($page>$num_pages)&&$page!=1)$page= $num_pages;
$limit_start = ($page-1)*$items_per_page;
if($who!="")
{
$sql = "SELECT id, title, itemurl FROM ibwf_vault WHERE uid='".$who."' ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
}else{
$sql = "SELECT id, title, itemurl, uid FROM ibwf_vault ORDER BY pudt DESC LIMIT $limit_start, $items_per_page";
}
echo "<p><small>";
$items = mysql_query($sql);
echo mysql_error();
if(mysql_num_rows($items)>0)
{
while ($item = mysql_fetch_array($items))
{
$ext = getext($item[2]);
$ime = getextimg($ext);
$lnk = "<a href=\"$item[2]\">$ime".htmlspecialchars($item[1])."</a>";
if(candelvl($uid, $item[0]))
{
$delnk = "<a href=\"genproc.php?action=delvlt&sid=$sid& vid=$item[0]\">[obrisi]</a>";
}else{
$delnk = "";
}
if($who!="")
{
$byusr="";
}else{
$unick = getnick_uid($item[3]);
$ulnk = "<a href=\"index.php?action=viewuser&sid=$sid& who=$item[3]\">$unick</a>";
$byusr = "- Od: $ulnk";
}
echo "$lnk $byusr $delnk<br/>";
}
}
echo "</small></p>";
echo "<p align=\"center\">";
if($page>1)
{
$ppage = $page-1;
echo "<a href=\"lists.php?action=$action&page=$ppage&am p;sid=$sid&who=$who\">«Nazad</a> ";
}
if($page<$num_pages)
{
$npage = $page+1;
echo "<a href=\"lists.php?action=$action&page=$npage&am p;sid=$sid&who=$who\">Napred»</a>";
}
echo "<br/>$page/$num_pages<br/>";
if($num_pages>2)
{
$rets = "Na stranu: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
$rets .= "<anchor>IDI";
$rets .= "<go href=\"lists.php\" method=\"get\">";
$rets .= "<postfield name=\"action\" value=\"$action\"/>";
$rets .= "<postfield name=\"who\" value=\"$who\"/>";
$rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
$rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
$rets .= "</go></anchor>";
echo $rets;
}
echo "</p>";
////// UNTILL HERE >>
echo "<p align=\"center\">";
if($uid==$who && getplusses($uid)>25)
{
echo "<a href=\"index.php?action=addvlt&sid=$sid\">";
echo "Dodaj Sliku</a><br/>";
}
if($who!="")
{
echo "<a href=\"index.php?action=viewuser&sid=$sid& who=$who\">";
$whonick = getnick_uid($who);
echo "$whonick Profil</a><br/>";
}else{
echo "<a href=\"index.php?action=stats&sid=$sid\">";
echo "<img src=\"images/stat.gif\" alt=\"*\"/>Statistika</a><br/>";
}
echo "<img src=\"images/home.gif\" alt=\"*\"/> <a href=\"index.php?action=main&sid=$sid\">";
echo "HAPPY</a>";
echo "</p>";
echo "</card>";
}
Comment