if(!isset($_GET["gl"])){ header("location: gallery.php");exit(); } $nid=intval(substr($_GET["gl"],2)); if($nid==0){ header("location: gallery.php");exit(); } require_once("adpanel/functions.inc.php"); include_once("adpanel/".MYSQL); $dbc=open_connection(); $q="select gid,title,galdesc,date_format(post_date, '%d.%m.%Y' ) AS rdate from gallery where gid='".$nid."' limit 1"; $r=mysql_query($q,$dbc); if(mysql_num_rows($r)!=1){ header("location: gallery.php");exit(); } $row_m=mysql_fetch_array($r,MYSQL_BOTH); $elements["title"]=stripslashes($row_m["title"]); $elements["description"]=stripslashes($row_m["galdesc"]); include("top.inc.php"); ?>
()
if(isset($_GET["pg"]))$pg_a=(int)$_GET["pg"]; if($pg_a<=0)$pg_a=1; $dbc=open_connection(); $broi_q=mysql_query("select count(pid) from pictures where galleryid='".$nid."'",$dbc); $qqq=mysql_fetch_array($broi_q); $obshto=$qqq[0]; if($obshto%20==0)$broi_pg=intval($obshto/20);else $broi_pg=intval($obshto/20)+1; if($pg_a>$broi_pg)$pg_a=$broi_pg; //echo "pg e: ".$broi_pg; $start=($pg_a*20)-20; if($start<0)$start=0; $q="select * from pictures where galleryid='".$nid."' order by pid desc limit $start,20"; $r=mysql_query($q,$dbc); if(mysql_num_rows($r)>0){ ?>| ';?> | if($count%2==0)echo "';break; //case 3:echo ' | ';break; //case 1:echo ' | ';break; } echo " |