instructions
-----------
////
hello my mates this is a free script by me spiderwebs
this is gallery script for irisblaze wapforum:)
////
you can use it destribute it but dont dare to sale my 
work always put my name in this script cause its my
work :)
///
add this code to your index.php
echo "<a href=\"lists.php?action=gal&amp;sid=$sid\">&#187;Gallery</a><br/>";
///
copy and paste the code below at your list.php
any where and run the sql formate with this 
script in your database its done enjoy :)
///
if you do any updates kindly send to admin@fonomatrix.net.in
visit http://fonomatrix.net.in
http://swszone.org
http://fonex.uk.to
 for more
///
copy from here=>

//////////////////////////////////gallery :)

else if($action=="gal")
{
    addonline(getuid_sid($sid),"viewing pics List","");
    echo "<card id=\"main\" title=\"Gallery\">";
    
    //////ALL LISTS SCRIPT <<

    if($page=="" || $page<=0)$page=1;
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_gallery"));
    $num_items = $noi[0]; //changable
    $items_per_page= 5;
    $num_pages = ceil($num_items/$items_per_page);
    if(($page>$num_pages)&&$page!=1)$page= $num_pages;
    $limit_start = ($page-1)*$items_per_page;

    //changable sql

        $sql = "SELECT id, gcode, imgsrc FROM ibwf_gallery ORDER BY id DESC LIMIT $limit_start, $items_per_page";


    echo "<p>";
    $items = mysql_query($sql);
	
    echo mysql_error();
    if(mysql_num_rows($items)>0)
    {
    while ($item = mysql_fetch_array($items))
   {
		if(ismod(getuid_sid($sid)))
		{
			$delsl = "<a href=\"galcp.php?action=deluser&amp;sid=$sid&amp;smid=$item[0]\">[x]</a>";
		}else{
			$delsl = "";
		}
        echo "$item[1] &#187; ";
        echo "<img src=\"$item[2]\" alt=\"$item[1]\"/> $delsl<br/>";
    }
    }
    echo "</p>";
    echo "<p align=\"center\">";
    if($page>1)
    {
      $ppage = $page-1;
      echo "<a href=\"lists.php?action=gal&amp;page=$ppage&amp;sid=$sid&amp;view=$view\">&#171;PREV</a> ";
    }
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"lists.php?action=gal&amp;page=$npage&amp;sid=$sid&amp;view=$view\">Next&#187;</a>";
    }
    echo "<br/>$page/$num_pages<br/>";
    if($num_pages>2)
    {
      $rets = "Jump to page<input name=\"pg\" format=\"*N\" size=\"3\"/>";
        $rets .= "<anchor>[GO]";
        $rets .= "<go href=\"lists.php\" method=\"get\">";
        $rets .= "<postfield name=\"action\" value=\"$action\"/>";
        $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(ismod(getuid_sid($sid)))
		{
    echo "<a href=\"galcp.php?action=addu&amp;sid=$sid\">[Add Pics]</a><br/>";
    }
    echo "<a href=\"index.php?action=extra&amp;sid=$sid\">";
echo "Extras</a><br/>";
    echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "<small><b>&#169;fonomatrix</b></small><br/>";
echo "<small><b>Script By:</b> <u>spiderwebs</u></small><br/>";

  echo "</p>";
    echo "</card>";
}