Can Any One Fix It Please

Started on the old forum in July 2011 · view the original in the archive · old links redirect here

4 replies · 643 views · started 15 years ago · 1 min read

3 participants
Ahzan3 Newbie · 8 posts #1

hey m8s... I am using this script in ma Wapdesire gallery I know its too old but I am beginner!

<?php
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
//header('Content-type: application/vnd.wap.xhtml+xml'); 
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<?php
include("../web/config.php");
include("../web/core.php");
connectdb();
$action = ($_GET["action"]);
$sid = ($_GET["sid"]);
$page = ($_GET["page"]);
$who = ($_GET["who"]);
$pmid = ($_GET["pmid"]);
$uid = getuid_sid($sid);
$sitename = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='sitename'"));
$sitename = $sitename[0];
$theme = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE id='".$uid."'"));
$lastloc=$_GET["lstloc"];

if($lastloc=="cht"){
   $rid= mysql_real_escape_string($_GET["rid"]);
    $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
    $rname = $rooms[1];
}

if(islogged($sid)==false)
{
      echo "<head>";
      echo "<title>Error!!!</title>";
      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/white_medium.css\">";
      echo "</head>";
      echo "<body>";
      echo "<p align=\"center\">";
      echo "You are not logged in<br/>";
      echo "Or Your session has been expired<br/><br/>";
      echo "<a href=\"index.php\">Login</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
}
$uid = getuid_sid($sid);
if(isbanned($uid))
    {
      echo "<head>";
      echo "<title>Error!!!</title>";
      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
      echo "</head>";
      echo "<body>";
      echo "<p align=\"center\">";
      echo "<img src=\"../images/notok.gif\" alt=\"x\"/><br/>";
      echo "<b>You are Banned</b><br/><br/>";
      $banto = mysql_fetch_array(mysql_query("SELECT timeto, pnreas, exid FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1' OR uid='".$uid."' AND penalty='2'"));
   $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'"));
      $remain = $banto[0]- time();
      $rmsg = gettimemsg($remain);
      echo "<b>Time Left: </b>$rmsg<br/>";
      $nick = getnick_uid($banto[2]);
   echo "<b>By: </b>$nick<br/>";
   echo "<b>Reason: </b>$banto[1]";
      //echo "<a href=\"index.php\">Login</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      exit();
    }
    ///////////////////////////////////Extra menu

	if ($action == "main") {
		addonline(getuid_sid($sid), "User Gallery", "");
		echo "<head>";
		echo "<title>User Gallery</title>";
		echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
		echo "</head>";
		echo "<body>";
		echo "<div align=\"center\">";
            echo "Photo Gallery<br/>";
  $random = mysql_fetch_array(mysql_query("SELECT id, filename FROM ibwf_gallery ORDER BY RAND() LIMIT 1"));
 
  $rando = mysql_fetch_array(mysql_query("SELECT id, filename FROM ibwf_gallery ORDER BY RAND() LIMIT 1"));
 
  $rand = mysql_fetch_array(mysql_query("SELECT id, filename FROM ibwf_gallery ORDER BY RAND() LIMIT 1"));

  $ran = mysql_fetch_array(mysql_query("SELECT id, filename FROM ibwf_gallery ORDER BY RAND() LIMIT 1"));

  $ra = mysql_fetch_array(mysql_query("SELECT id, filename FROM ibwf_gallery ORDER BY RAND() LIMIT 1"));

  echo "<img src=\"thumb.php?image=../pics/$random[1]&w=37&h=37&type=jpg\" alt=\"$random[0]\"/>";

  echo " <img src=\"thumb.php?image=../pics/$rando[1]&w=37&h=37&type=jpg\" alt=\"$rando[0]\"/>";

  echo " <img src=\"thumb.php?image=../pics/$rand[1]&w=37&h=37&type=jpg\" alt=\"$rand[0]\"/>";

  echo " <img src=\"thumb.php?image=../pics/$ran[1]&w=37&h=37&type=jpg\" alt=\"$ran[0]\"/>";

  echo " <img src=\"thumb.php?image=../pics/$ra[1]&w=37&h=37&type=jpg\" alt=\"$ra[0]\"/>";
  
  echo "</div>";

            echo "<div>";
		$males = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_gallery WHERE sex='M'"));
		echo "<img src=\"../images/male.gif\" alt=\"\"/> <a href=\"index.php?action=male&sid=$sid\">Male Gallery</a> ($males[0])<br/>";
		$females = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_gallery WHERE sex='F'"));
		echo "<img src=\"../images/female.gif\" alt=\"\"/> <a href=\"index.php?action=female&sid=$sid\">Female Gallery</a> ($females[0])<br/>";
		$un = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_gallery WHERE sex=''"));
		echo "<img src=\"../images/female.gif\" alt=\"\"/> <a href=\"index.php?action=unknow&sid=$sid\">Unknow Gender</a> ($un[0])<br/>";
		echo "</div>";
        echo "<div align=center>";
          	$me = getuid_sid($sid);
		echo "<img src=\"../images/images1.gif\" alt=\"*\"/> <a href=\"gallery2.php?action=main&who=$me&sid=$sid\">My Album</a><br/>";
		echo "<img src=\"../images/addfoto.gif\" alt=\"*\"/> <a href=\"index.php?action=upload&sid=$sid\">Upload Photo</a>";

		echo "</div><div align=\"center\">";
            echo "<a href=\"index.php?action=main&sid=$sid\">©$sitename</a>";    
		echo "</div>";
		echo "</body>";
	}
	else if($action == "male") {
		addonline(getuid_sid($sid), "Viewing Male Gallery", "");
		$uid = getuid_sid($sid);
		echo "<head>";
		echo "<title>Male Gallery</title>";
		echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
		echo "</head>";
		echo "<body>";

  echo "<div align=\"center\">";  
  echo "<b><i>Male Gallery</i></b><br/>";
  $random = mysql_fetch_array(mysql_query("SELECT id, filename FROM ibwf_gallery WHERE sex='M' ORDER BY RAND() LIMIT 1"));
 
  $rando = mysql_fetch_array(mysql_query("SELECT id, filename FROM ibwf_gallery WHERE sex='M' ORDER BY RAND() LIMIT 1"));
 
  $rand = mysql_fetch_array(mysql_query("SELECT id, filename FROM ibwf_gallery WHERE sex='M' ORDER BY RAND() LIMIT 1"));

  $ran = mysql_fetch_array(mysql_query("SELECT id, filename FROM ibwf_gallery WHERE sex='M' ORDER BY RAND() LIMIT 1"));

  $ra = mysql_fetch_array(mysql_query("SELECT id, filename FROM ibwf_gallery WHERE sex='M' ORDER BY RAND() LIMIT 1"));

  echo "<img src=\"thumb.php?image=../pics/$random[1]&w=37&h=37&type=jpg\" alt=\"$random[0]\"/>";

  echo " <img src=\"thumb.php?image=../pics/$rando[1]&w=37&h=37&type=jpg\" alt=\"$rando[0]\"/>";

  echo " <img src=\"thumb.php?image=../pics/$rand[1]&w=37&h=37&type=jpg\" alt=\"$rand[0]\"/>";

  echo " <img src=\"thumb.php?image=../pics/$ran[1]&w=37&h=37&type=jpg\" alt=\"$ran[0]\"/>";

  echo " <img src=\"thumb.php?image=../pics/$ra[1]&w=37&h=37&type=jpg\" alt=\"$ra[0]\"/>";
  
  echo "</div>";

		//////ALL gallery SCRIPT <<
		if ($page == "" || $page <= 0)$page = 1;
		if ($who != "") {
			$noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_gallery WHERE sex='M'"));
		} else {
			$noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_gallery WHERE sex='M'"));
		}
		$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;
		$sql = "SELECT DISTINCT uid FROM ibwf_gallery WHERE sex='M' ORDER BY uid ASC LIMIT $limit_start, $items_per_page";
            echo "<div>";
		$items = mysql_query($sql);
		echo mysql_error();
		if (mysql_num_rows($items) > 0) {
			while ($item = mysql_fetch_array($items)) {
				$who = $item[0];
				$user = getnick_uid($who);
				$countpics = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_gallery WHERE uid='".$who."'"));
				$lnk = "» <a href=\"gallery2.php?action=main&who=$who&sid=$sid\">$user</a>($countpics[0])<br/>";
				echo "$lnk";
			}
        echo "<p align=center>";
		}
		if ($page > 1) {
			$ppage = $page-1;
			echo "<a href=\"index.php?action=$action&page=$ppage&sid=$sid\">«PREV</a> ";
		}
		if ($page < $num_pages) {
			$npage = $page+1;
			echo "<a href=\"index.php?action=$action&page=$npage&sid=$sid\">Next»</a>";
		}
		echo "<br/>$page/$num_pages<br/>";
		if ($num_pages > 2) {
			$rets = "<form action=\"index.php\" method=\"get\">";
			$rets .= "Jump to page<input name=\"page\" format=\"*N\" size=\"3\"/>";
			$rets .= "<input type=\"submit\" value=\"GO\"/>";
			$rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
			$rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
			$rets .= "</form>";
			echo $rets;
		}
		echo "</p>";
		echo "</div>";
		echo "<div align=center>";
		echo "<a href=\"index.php?action=main&sid=$sid\">User Gallery</a><br/>";
            echo "<a href=\"index.php?action=main&sid=$sid\">© $sitename</a>";
		echo "</div>";
		echo "</body>";
	}
	else if($action == "female") {
		addonline(getuid_sid($sid), "Viewing Female Gallery", "");
		$uid = getuid_sid($sid);
		echo "<head>";
		echo "<title>Female GalleRy</title>";
		echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
		echo "</head>";
		echo "<body>";

  echo "<div align=\"center\">";  
  echo "<b><i>FeMale Gallery</i></b><br/>";
  $random = mysql_fetch_array(mysql_query("SELECT id, filename FROM ibwf_gallery WHERE sex='F' ORDER BY RAND() LIMIT 1"));
 
  $rando = mysql_fetch_array(mysql_query("SELECT id, filename FROM ibwf_gallery WHERE sex='F' ORDER BY RAND() LIMIT 1"));
 
  $rand = mysql_fetch_array(mysql_query("SELECT id, filename FROM ibwf_gallery WHERE sex='F' ORDER BY RAND() LIMIT 1"));

  $ran = mysql_fetch_array(mysql_query("SELECT id, filename FROM ibwf_gallery WHERE sex='F' ORDER BY RAND() LIMIT 1"));

  $ra = mysql_fetch_array(mysql_query("SELECT id, filename FROM ibwf_gallery WHERE sex='F' ORDER BY RAND() LIMIT 1"));

  echo "<img src=\"thumb.php?image=../pics/$random[1]&w=37&h=37&type=jpg\" alt=\"$random[0]\"/>";

  echo " <img src=\"thumb.php?image=../pics/$rando[1]&w=37&h=37&type=jpg\" alt=\"$rando[0]\"/>";

  echo " <img src=\"thumb.php?image=../pics/$rand[1]&w=37&h=37&type=jpg\" alt=\"$rand[0]\"/>";

  echo " <img src=\"thumb.php?image=../pics/$ran[1]&w=37&h=37&type=jpg\" alt=\"$ran[0]\"/>";

  echo " <img src=\"thumb.php?image=../pics/$ra[1]&w=37&h=37&type=jpg\" alt=\"$ra[0]\"/>";
  
  echo "</div>";
  echo "<div>";

		//////ALL gallery SCRIPT <<
		if ($page == "" || $page <= 0)$page = 1;
		if ($who != "") {
			$noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_gallery WHERE sex='F'"));
		} else {
			$noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_gallery WHERE sex='F'"));
		}
		$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;
		$sql = "SELECT DISTINCT uid FROM ibwf_gallery WHERE sex='F' ORDER BY uid ASC LIMIT $limit_start, $items_per_page";
		$items = mysql_query($sql);
		echo mysql_error();
		if (mysql_num_rows($items) > 0) {
			while ($item = mysql_fetch_array($items)) {
				$who = $item[0];
				$user = getnick_uid($who);
				$countpics = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_gallery WHERE uid='".$who."'"));
				$lnk = "» <a href=\"gallery2.php?action=main&who=$who&sid=$sid\">$user($countpics[0])</a><br/>";
				echo "$lnk";
			}
		} else {
			echo "female gallery is empty";
		}
		echo "<p align=center>";
		if ($page > 1) {
			$ppage = $page-1;
			echo "<a href=\"index.php?action=$action&page=$ppage&sid=$sid\">«PREV</a> ";
		}
		if ($page < $num_pages) {
			$npage = $page+1;
			echo "<a href=\"index.php?action=$action&page=$npage&sid=$sid\">Next»</a>";
		}
		echo "<br/>$page/$num_pages<br/>";
		if ($num_pages > 2) {
			$rets = "<form action=\"index.php\" method=\"get\">";
			$rets .= "Jump to page<input name=\"page\" format=\"*N\" size=\"3\"/>";
			$rets .= "<input type=\"submit\" value=\"GO\"/>";
			$rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
			$rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
			$rets .= "</form>";
			echo $rets;
		}
		echo "</p>";
		echo "</div>";
		echo "<div align=center>";
		echo "<a href=\"index.php?action=main&sid=$sid\">User Gallery</a><br/>";
            echo "<a href=\"index.php?action=main&sid=$sid\">© $sitename</a>";
		echo "</div>";
		echo "</body>";
	}
	else if($action == "unknow") {
		addonline(getuid_sid($sid), "Viewing Uknow Gallery", "");
		$uid = getuid_sid($sid);
		echo "<head>";
		echo "<title>User Gallery</title>";
		echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
		echo "</head>";
		echo "<body>";

  echo "<div align=\"center\">";  
  echo "<b><i>Unknow Gender Gallery</i></b></div>";
  $random = mysql_fetch_array(mysql_query("SELECT id, filename FROM ibwf_gallery WHERE sex='' ORDER BY RAND() LIMIT 1"));
 
  $rando = mysql_fetch_array(mysql_query("SELECT id, filename FROM ibwf_gallery WHERE sex='' ORDER BY RAND() LIMIT 1"));
 
  $rand = mysql_fetch_array(mysql_query("SELECT id, filename FROM ibwf_gallery WHERE sex='' ORDER BY RAND() LIMIT 1"));

  $ran = mysql_fetch_array(mysql_query("SELECT id, filename FROM ibwf_gallery WHERE sex='' ORDER BY RAND() LIMIT 1"));

  $ra = mysql_fetch_array(mysql_query("SELECT id, filename FROM ibwf_gallery WHERE sex='' ORDER BY RAND() LIMIT 1"));

  echo "<p align=\"center\">";  

  echo "<img src=\"thumb.php?image=../pics/$random[1]&w=37&h=37&type=jpg\" alt=\"$random[0]\"/>";

  echo " <img src=\"thumb.php?image=../pics/$rando[1]&w=37&h=37&type=jpg\" alt=\"$rando[0]\"/>";

  echo " <img src=\"thumb.php?image=../pics/$rand[1]&w=37&h=37&type=jpg\" alt=\"$rand[0]\"/>";

  echo " <img src=\"thumb.php?image=../pics/$ran[1]&w=37&h=37&type=jpg\" alt=\"$ran[0]\"/>";

  echo " <img src=\"thumb.php?image=../pics/$ra[1]&w=37&h=37&type=jpg\" alt=\"$ra[0]\"/>";
  
  echo "</p>";

		//////ALL gallery SCRIPT <<
		if ($page == "" || $page <= 0)$page = 1;
		if ($who != "") {
			$noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_gallery WHERE sex=''"));
		} else {
			$noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_gallery WHERE sex=''"));
		}
		$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;
		$sql = "SELECT DISTINCT uid FROM ibwf_gallery WHERE sex='' ORDER BY uid ASC LIMIT $limit_start, $items_per_page";
		$items = mysql_query($sql);
		echo mysql_error();
		if (mysql_num_rows($items) > 0) {
			while ($item = mysql_fetch_array($items)) {
				$who = $item[0];
				$user = getnick_uid($who);
				$countpics = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_gallery WHERE uid='".$who."'"));
				$lnk = "» <a href=\"gallery2.php?action=main&who=$who&sid=$sid\">$user($countpics[0])</a><br/>";
				echo "$lnk";
			}
		} else {
			echo "Female Gallery is empty";
		}
		echo "</p>";
		echo "<p align=\"center\">";
		if ($page > 1) {
			$ppage = $page-1;
			echo "<a href=\"index.php?action=$action&page=$ppage&sid=$sid\">«PREV</a> ";
		}
		if ($page < $num_pages) {
			$npage = $page+1;
			echo "<a href=\"index.php?action=$action&page=$npage&sid=$sid\">Next»</a>";
		}
		echo "<br/>$page/$num_pages<br/>";
		if ($num_pages > 2) {
			$rets = "<form action=\"index.php\" method=\"get\">";
			$rets .= "Jump to page<input name=\"page\" format=\"*N\" size=\"3\"/>";
			$rets .= "<input type=\"submit\" value=\"GO\"/>";
			$rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
			$rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
			$rets .= "</form>";
			echo $rets;
		}
		echo "<a href=\"index.php?action=main&sid=$sid\">User Gallery</a><br/>";
            echo "<a href=\"index.php?action=main&sid=$sid\">© $sitename</a>";
		echo "</p>";
		echo "</body>";
	}

	else if($action == "comments") {
		$who = cleanQuery($_GET["who"]);
		$gid = cleanQuery($_GET["gid"]);
		addonline(getuid_sid($sid), "Viewing Photo Comments", "");
		$uid = getuid_sid($sid);
		//////ALL LISTS SCRIPT <<
		if ($page == "" || $page <= 0)$page = 1;
		$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_galcomments WHERE pid='".$gid."'"));
		$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;
		$sql = "SELECT id, pid, text, byuser, time FROM ibwf_galcomments WHERE pid='".$gid."' ORDER BY id DESC LIMIT $limit_start, $items_per_page";
		echo "<head>";
		echo "<title>User Gallery</title>";
		echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
		echo "</head>";
		echo "<body>";
		echo "<p>";
		$items = mysql_query($sql);
		echo mysql_error();
		if (mysql_num_rows($items) > 0) {
			while ($item = mysql_fetch_array($items)) {
				if (isonline($item[3])) {
					$iml = "<img src=\"../images/onl.gif\" alt=\"+\"/>";
				} else {
					$iml = "<img src=\"../images/ofl.gif\" alt=\"-\"/>";
				}
				$snick = getnick_uid($item[3]);
				$lnk = "<a href=\"index.php?action=viewuser&who=$item[3]&sid=$sid\">$iml$snick</a>:";
				$bs = date("d m y-H:i:s", $item[4]);
				echo "$lnk<br/><small>";
				$me = getuid_sid($sid);
				if ($who == "$me") {
					$can = "a";
				} else {
					$can = "b";
				}
				if (ismod($uid) || $can == "a") {
					$delnk = "<a href=\"modproc.php?action=delcmt&sid=$sid&id=$item[0]\">[x]</a>";
				} else {
					$delnk = "";
				}
				$text = parsepm($item[2], $sid);
				echo "$text $delnk<br/>";
				echo "$bs";
				echo "<br/>";
				echo "</small>";
			}
		}
		echo "</p>";
		echo "<p align=\"center\">";
		if ($page > 1) {
			$ppage = $page-1;
			echo "<a href=\"index.php?action=$action&page=$ppage&sid=$sid&who=$who&gid=$gid\">«PREV</a> ";
		}
		if ($page < $num_pages) {
			$npage = $page+1;
			echo "<a href=\"index.php?action=$action&page=$npage&sid=$sid&who=$who&gid=$gid\">Next»</a>";
		}
		echo "<br/>$page/$num_pages<br/>";
		if ($num_pages > 2) {
			$rets = "<form action=\"index.php\" method=\"get\">";
			$rets .= "Jump to page<input name=\"page\" format=\"*N\" size=\"3\"/>";
			$rets .= "<input type=\"submit\" value=\"GO\"/>";
			$rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
			$rets .= "<input type=\"hidden\" name=\"who\" value=\"$who\"/>";
			$rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
			$rets .= "<input type=\"hidden\" name=\"gid\" value=\"$gid\"/>";
			$rets .= "</form>";
			echo $rets;
		}
		echo "</p>";
		////// UNTILL HERE >>
		echo "<p align=\"center\">";
		$me = getuid_sid($sid);
		if ($me != "$who") {
			echo "<a href=\"index.php?action=addcomment&sid=$sid&who=$who&gid=$gid\">Add Comment</a><br/>";
		}
		echo "<a href=\"index.php?action=main&sid=$sid\">User Gallery</a><br/>";
            echo "<a href=\"index.php?action=main&sid=$sid\">© $sitename</a>";
		echo "</p>";
		echo "</body>";
	}
//////////////////////////////////////////Update photo
else if($action=="uphoto")
{
    addonline(getuid_sid($sid),"Updating Photo","");

    $dir = cleanQuery($_POST["dir"]);
    $usig = cleanQuery($_POST["usig"]);
    $gid = cleanQuery($_GET["gid"]);

      echo "<head>";
      echo "<title>$sitename</title>";
      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
      echo "</head>";
      echo "<body>";
  echo "<p align=\"center\">";
  //$uid = getuid_sid($sid);
  $res = mysql_query("UPDATE ibwf_gallery SET dir='".$dir."', inpo='".$usig."' WHERE id='".$gid."'");
  if($res)
  {
    echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Your Photo was updated successfully<br/>";
  }else{
    echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Error updating your Photo<br/>";
  }
 echo "<a href=\"index.php?action=main&sid=$sid\">User Gallery</a><br/>";
 echo "<a href=\"index.php?action=main&sid=$sid\">© $sitename</a>";
  echo "</p></body>";
}
else if($action=="upload")
{
   addonline(getuid_sid($sid),"Upload Foto","");
   echo "<head>";
   echo "<title>Uploading</title>";
   echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
   echo "</head>";
   echo "<body>";
   echo "<p align=\"center\">";
   echo "<b>Upload Photo</b><br/><br/>";
   echo "<form align=\"left\" action=\"upload.php?action=upload&sid=$sid\" method=\"post\" ENCTYPE=\"multipart/form-data\">";
   echo "<input type=\"file\" size=\"15\" name=\"my_field\" value=\"\" />";
   echo "<input type=\"hidden\" name=\"action\" value=\"image\" /><br/>";
   echo "<input type=\"submit\" name=\"Submit\" value=\"upload\" />";
   echo "</form>";
   echo "</p>"; 
   ////// UNTILL HERE >> 
   echo "<p align=\"center\">";
   echo "<a href=\"index.php?action=main&sid=$sid\">User Gallery</a><br/>";
   echo "<a href=\"index.php?action=main&sid=$sid\">© $sitename</a>";
   echo "</p>";
   echo "</body>";
	}

	else if($action == "addcomment") {
		$who = cleanQuery($_GET["who"]);
		$gid = cleanQuery($_GET["gid"]);
		addonline(getuid_sid($sid), "Adding Photo Comments", "");
		$uid = getuid_sid($sid);
		$sql = "SELECT filename FROM ibwf_gallery  WHERE id='".$gid."'";
		echo "<head>";
		echo "<title>User Gallery</title>";
		echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
		echo "</head>";
		echo "<body>";
		echo "<p align=\"center\">";
		$items = mysql_query($sql);
		echo mysql_error();
		if (mysql_num_rows($items) > 0) {
			while ($item = mysql_fetch_array($items)) {
				$img = $item[0];
                        $lnk = "<img src=\"thumb.php?image=../pics/$img&w=80&h=95&type=jpg\" alt=\"$id\"/><br/>";
				echo "$lnk";
				echo "<form action=\"genproc.php?action=commentadd&sid=$sid&gid=$gid\" method=\"post\">";
				$vb = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_prate WHERE uid='".$uid."' AND pid='".$gid."'"));
				if ($vb[0] == 0) {
					echo "Rate Photo: <select name=\"prate\">";
					echo "<option value=\"1\">1</option>";
					echo "<option value=\"2\">2</option>";
					echo "<option value=\"3\">3</option>";
					echo "<option value=\"4\">4</option>";
					echo "<option value=\"5\">5</option>";
					echo "<option value=\"6\">6</option>";
					echo "<option value=\"7\">7</option>";
					echo "<option value=\"8\">8</option>";
					echo "<option value=\"9\">9</option>";
					echo "<option value=\"10\">10</option>";
					echo "</select><br/>";
				} else {
					$rinfo = mysql_fetch_array(mysql_query("SELECT COUNT(*) as nofr, SUM(prate) as nofp FROM ibwf_prate WHERE pid='".$gid."'"));
					$counts = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_prate WHERE pid='".$gid."'"));
					if ($counts[0] > 0) {
						$ther = $rinfo[1]/$rinfo[0];
						$rating = "Rating: $ther/$rinfo[1] (votes($counts[0]))<br/>";
					} else {
						$rating = "";
					}
					echo "$rating";
				}
				echo "Comment:<br/>";
				echo "<input type=\"text\" maxlength=\"150\" name=\"text\"/><br/>";
				echo "<input type=\"submit\" value=\"Add\"/>";
				echo "</form>";
			}
		}
		echo "<a href=\"index.php?action=main&sid=$sid\">User Gallery</a><br/>";
            echo "<a href=\"index.php?action=main&sid=$sid\">© $sitename</a>";
		echo "</p>";
		echo "</body>";
	} else {
		addonline(getuid_sid($sid), "Lost in user Gallery lol", "");
		echo "<p align=\"center\">";
		echo "I don't know how did you get into here, but there's nothing to show<br/><br/>";
		echo "<a href=\"index.php?action=main&sid=$sid\">User Gallery</a><br/>";
		echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
		echo "Home</a>";
		echo "</p>";
	}
	echo "</body>";
	echo "</html>";
?>

But problem isn't here..

here is the big problem or maybe my mystake...

<?php

header("Content-type: text/html; charset=ISO-8859-1");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";

?>

<?php
   include("class.upload.php");
   include("core.php");
   include("config.php");

   echo "<head>";
   echo "<title>$stitle</title>";
   echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />";
   echo "
      <meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />
      <meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>
      <meta name=\"description\" content=\"ibwf mobile :)\">
      <meta name=\"keywords\" content=\"free, community, forums, chat, wap, communicate\">
      ";
   echo "</head>";
   echo "<body>";
   connectdb();
   $action = ($_GET["action"]);
   $sid = ($_GET["sid"]);
   $page = ($_GET["page"]);
   $who = ($_GET["who"]);
   $uid = getuid_sid($sid);
$theme = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE id='".$uid."'"));
$sitename = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='sitename'"));
$sitename = $sitename[0];

   

   $theme = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE id='".$uid."'"));
   if (islogged($sid) == false) {
      echo "<p align=\"center\">";
      echo "You are not logged in<br/>";
      echo "Or Your session has been expired<br/><br/>";
      echo "<a href=\"index.php\">Login</a>";
      echo "</p>";
      exit();
   }
   $uid = getuid_sid($sid);
   if (isbanned($uid)) {
      echo "<p align=\"center\">";
      echo "<img src=\"../images/notok.gif\" alt=\"x\"/><br/>";
      echo "You are <b>Banned</b><br/>";
      $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1'"));
      $remain = $banto[0]- time();
      $rmsg = gettimemsg($remain);
      echo "Time to finish your penalty: $rmsg<br/><br/>";
      //echo "<a href=\"index.php\">Login</a>";
      echo "</p>";
      exit();
   }

//////////////////////////////////Members List

error_reporting(E_ALL); 

$userinfo = mysql_fetch_array(mysql_query("SELECT name, sex FROM ibwf_users WHERE id='".$uid."'"));
$membername = $userinfo[0];

if ($_POST['action'] == 'image') {
      
      echo "<p align=\"center\">";

    $handle = new Upload($_FILES['my_field']);

    if ($handle->uploaded) {
        
        $handle->image_resize            = true;
        $handle->image_ratio_y           = true;
        $handle->image_x                 = 240;
        $handle->Process('../pics/');
        if ($handle->processed) {

            echo '  file uploaded with success<br/>';
            echo '  <img src="../pics/' . $handle->file_dst_name . '" /><br/>';
            $info = getimagesize($handle->file_dst_pathname);
            echo '  link to the file just uploaded: <a href="../pics/' . $handle->file_dst_name . '">' . $handle->file_dst_name . '</a><br/>';
            $imageurl = "../pics/$handle->file_dst_name";
            $avatarurl = "/pics/$handle->file_dst_name";
            $date=(date("D, j F Y"));
            $reg = mysql_query("INSERT INTO ibwf_gallery SET uid='".$uid."', itemurl='".$imageurl."', avatarurl='".$avatarurl."', date='".$date."', filename='" . $handle->file_dst_name . "', sex='".$userinfo[1]."'");

        } else {

            echo '  file not uploaded to the wanted location<br/>';
            echo '  Error: ' . $handle->error . '<br/>';

        }

        $handle-> Clean();

    } else {

        echo '  file not uploaded on the server<br/>';
        echo '  Error: ' . $handle->error . '';
    }
    

    echo "</p>"; 
  ////// UNTILL HERE >> 
    echo "<p align=\"center\">";
   echo "<br/><br/><a href=\"gallery.php?action=main&sid=$sid\">«Back to Gallery</a><br/>";
    echo "<a href=\"index.php?action=main&sid=$sid\">";
echo "© $sitename</a>";
  echo "</p></body>";

}
?>
</HTML>

After selecting any file if user clicks on upload tab... It shows an error like....

Warning: include(class.upload.php) [function.include]: failed to open stream: No such file or directory in /home/htdocs/pics/upload.php on line 11

Warning: include() [function.include]: Failed opening 'class.upload.php' for inclusion (include_path='.') in /home/htdocs/pics/upload.php on line 11

Warning: include(core.php) [function.include]: failed to open stream: No such file or directory in /home/htdocs/pics/upload.php on line 12

Warning: include() [function.include]: Failed opening 'core.php' for inclusion (include_path='.') in /home/htdocs/pics/upload.php on line 12

Warning: include(config.php) [function.include]: failed to open stream: No such file or directory in /home/htdocs/pics/upload.php on line 13

Warning: include() [function.include]: Failed opening 'config.php' for inclusion (include_path='.') in /home/htdocs/pics/upload.php on line 13

Fatal error: Call to undefined function connectdb() in /home/htdocs/pics/upload.php on line 26

Added after 9 minutes:

Please m8s fix it or attach any secure gallery script, I want to save ma site from session hackers....

mFreak Developer · 66 posts #2

You just need to check your include dirs (does those files you want to include even exist,or you specified wrong dirs), script cant find files you want to include.

$("#mfreak").find(".head brain").clone();

Progress:

[|||___________________________] : 5%

Output:

Memory limit reached, unable to complete operation.

Support answer:

Try using a super uber strong mega computer to reach at least 10%.

👋

Ahzan3 Newbie · 8 posts #3

Thanks

Guys let me try1st

Ahzan3 Newbie · 8 posts #4

Want SQL File

Dear frnds I got a gallery script,

<?
// -------------------------------------------------------------------------------------
$EnableGZipEncoding = true;
// -------------------------------------------------------------------------------------
// Helper function to detect if GZip is supported by client!
// If not supported the tricks are pointless
function acceptsGZip(){
    $accept = str_replace(" ","",
        strtolower($_SERVER['HTTP_ACCEPT_ENCODING'])
    );
    $accept = explode(",",$accept);
    return in_array("gzip",$accept);
}
// -------------------------------------------------------------------------------------
function playWithHtml($OutputHtml){
    // This will mess up HTML code like my site has done!
    // View the source to understand! All ENTERs are removed.
    // If your site has PREformated code this will break it!
    // Use regexp to find it and save it and place it back ...
    // or just uncomment the next line to keep enters
    // return $OutputHtml;
    return preg_replace("/\s+/"," ",$OutputHtml);
}
// -------------------------------------------------------------------------------------
function obOutputHandler($OutputHtml){
    global $EnableGZipEncoding;
    //-- Play with HTML before output
    $OutputHtml = playWithHtml($OutputHtml);
    //-- If GZIP not supported compression is pointless.
    // If headers were sent we can not signal GZIP encoding as
    // we will mess it all up so better drop it here!
    // If you disable GZip encoding to use plain output buffering we stop here too!
    if(!acceptsGZip() || headers_sent() || !$EnableGZipEncoding) return $OutputHtml;
    //-- We signal GZIP compression and dump encoded data
    header("Content-Encoding: gzip");
    return gzencode($OutputHtml);
}
// This code has to be before any output from your site!
// If output exists uncompressed HTML will be delivered!
ob_start("obOutputHandler");
// -------------------------------------------------------------------------------------
?>
<?php
include("config.php");
include("core.php");
header("Content-type: text/html; charset=ISO-8859-1");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
?>

<?php
$bcon = connectdb();
if (!$bcon)
{
    echo xhtmlheadnotheme("$sitetitle (DB Error!)");
    echo "<p align=\"center\">";
    echo "<img src=\"images/exit.gif\" alt=\"*\"/><br/>";
    echo "ERROR! cannot connect to database<br/><br/>";
    echo "This error happens usually when backing up the database, please be patient, The site will be up any minute<br/><br/>";
    echo "<b>THANK YOU VERY MUCH</b><br/><br/>";
    echo "<a href=\"http://wapb2b.playfon.com/?d_e=79772025\">1000's of Downloads</a><br/>";
  	echo "<a href=\"http://click.buzzcity.com/click.php?bid=1&partnerid=10019\"><img src=\"http://ads.buzzcity.com/show.php?bid=1&partnerid=10019\" alt=\"\" /></a>";
    echo "</p>";
    echo xhtmlfoot();
    exit();
}

$action = $_GET["action"];
$page = $_GET["page"];
$sid = $_GET["sid"];
$whoimage = $_GET["whoimage"];
$uid = getuid_sid($sid);
if(islogged($sid)==false)
    {
      echo xhtmlheadnotheme("$sitetitle (Not Logged In!)");
      echo "<p align=\"center\">";
      echo "You are not logged in<br/>";
      echo "Or Your session has been expired<br/><br/>";
      echo "</p>";
      echo "<p align=\"center\">";
      echo "<form action=\"login.php\" method=\"get\">";
      echo "Username:<input name=\"loguid\" size=\"8\" maxlength=\"30\"/><br/>";
      echo "Password:<input name=\"logpwd\" size=\"8\" maxlength=\"30\" type=\"password\" /><br/>";
      echo "<input type=\"submit\" value=\"Login\"/>";
      echo "</form>"; 
      echo "</p>";
      echo xhtmlfoot();
      exit();
    } 

if(isbanned($uid))
    {
      echo xhtmlheadnotheme("$sitetitle (BANNED!)");
      echo "<p align=\"center\">";
      echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";
      echo "You are <b>Banned</b><br/>";
      $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_metpenaltiespl WHERE uid='".$uid."' AND penalty='1'"));
	  $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'"));	  
      $remain = $banto[0]- time() ;
      $rmsg = gettimemsg($remain);
      echo "Time to finish your penalty: $rmsg<br/><br/>";
	  echo "Ban Reason: $banres[0]";
      echo "</p>";
      echo xhtmlfoot();
      exit();
    }
////////////////////////////////////////GALLERY MAIN PAGE
else if($action=="main")
{
addonline(getuid_sid($sid),"Gallery Pics","");
echo "<head>";
echo "<title>Gallery Pics</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://humtum.mansoon.net/themes/black_medium.css\">";
echo "</head>";
echo "<body>";
echo "<div>";
echo "$sitetitle Member's Gallery</div>";
echo "<p align=\"left\">";
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery WHERE sex='M'"));
echo "<a href=\"gallery.php?action=males&sid=$sid\"><img src=\"../images/male.gif\" alt=\"*\"/>Males</a>($noi[0])<br/>";
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery WHERE sex='F'"));
echo "<a href=\"gallery.php?action=females&sid=$sid\"><img src=\"../images/female.gif\" alt=\"*\"/>Females</a>($noi[0])";
echo "</p>";
echo "<p align=\"center\">";
echo "<div class=\"ahblock2\">\n";
echo "<b>[Random Gallery Items]</b>";
echo "</div>\n";
echo "<div class=\"ahblock2\">\n";
echo "<img src=\"../images/male.gif\" alt=\"M\" /> Male<br/>\n";
echo "</div>";
echo "<div style=\"border: #99CCFF medium solid\" align=\"left\">\n";
$randomm = mysql_fetch_array(mysql_query("SELECT imageurl, uid FROM ibwf_usergallery WHERE sex='M' ORDER BY RAND() LIMIT 1")); 
echo "<img src=\"$randomm[0]\" height=\"50\" width=\"50\" alt=\"$randomm[1]\"/>";
echo "<br/>";
$nick = getnick_uid($randomm[1]);
$urlnick = "$nick";
echo "by: $urlnick";
echo "<br/>";
echo "</div>\n";
echo "<div class=\"ahblock2\">\n";
echo "<img src=\"../images/female.gif\" alt=\"F\" /> Female<br/>\n";
echo "</div>\n"; 
echo "<div style=\"border: #FF99FF medium solid\" align=\"left\">\n";
$randomf = mysql_fetch_array(mysql_query("SELECT imageurl, uid FROM ibwf_usergallery WHERE sex='F' ORDER BY RAND() LIMIT 1")); 
echo "<img src=\"$randomf[0]\" height=\"50\" width=\"50\" alt=\"$randomf[1]\"/>";
echo "<br/>";
$nick = getnick_uid($randomf[1]);
$urlnick = "$nick";
echo "by: $urlnick";
echo "</div>";
echo "<div align=\"center\">\n";
      echo "<small>MMS or E-MAIL your Photo to <b>Keshavlucknath@gmail.com</b> including your membername, or just click the Link below to Upload a Photo straight from your Phone.</small><br/><br/>";
      echo "<a href=\"gallery.php?action=upload&sid=$sid\">Add Your Photo</a>";
    echo "</p>";    
    
  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "Gallery";
  echo "</small></p>";
echo "<b>0 </b><a accesskey=\"0\" href=\"../web/index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
echo "</center>";
echo "</body>";
}
////////////////////////////////////////MALE GALLERY
else if($action=="males")
{
  addonline(getuid_sid($sid),"Male Gallery - xHML:v3","");
echo "<head>";
echo "<title>Male Gallery</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://humtum.mansoon.net/themes/white_medium.css\">";
echo "</head>";
echo "<body>";
echo "<div>";	
echo popup($sid);
echo "<center>Male Gallery</center></div>";
$unreadinbox=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE unread='1' AND touid='".$uid."'"));
      $unrd="".$unreadinbox[0]."";
      if ($unreadinbox[0]>0)
      {
      echo "<a href=\"inbox.php?action=main&sid=$sid&lstloc=cht&rid=$rid\">$unrd New Inbox!</a><br/>";
      }
					    if($page=="" || $page<=0)$page=1;					
					
					    if($who!="")
					    {
					    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_usergallery WHERE sex='M'"));
					    }else{
					    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_usergallery WHERE sex='M'"));
					    }
					
					    $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;
					
						$sql = "SELECT DISTINCT `uid` FROM `ibwf_usergallery` WHERE sex='M' ORDER BY `id` DESC LIMIT $limit_start , $items_per_page";
					
					    $items = mysql_query($sql);
					    echo mysql_error();
					    
					    if(mysql_num_rows($items)>0)
					    {
					    while ($item = mysql_fetch_array($items))
					    {
						$who = $item[0];
						
						$user=getnick_uid($who);
					
						$countpics = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_usergallery WHERE uid='".$who."'"));
					        $lnk = "<a href=\"gallery.php?action=viewuserphoto&who=$who&sid=$sid\">$user($countpics[0])</a><br/>";
					       echo "$lnk"; 
					    }
					    }    
    echo "<p align=\"center\">";
    if($page>1)
    {
      $ppage = $page-1;
      echo "<a href=\"gallery.php?action=$action&page=$ppage&sid=$sid\"><small>« Prev</small></a> ";
    }
    echo "<small> $page/$num_pages </small>";
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"gallery.php?action=$action&page=$npage&sid=$sid\"><small>Next »</small></a>";
    }    
    if($num_pages>2)
    {     
        $rets = "<center><form action=\"gallery.php\" method=\"get\">";
        $rets .= "Jump to page:<input name=\"page\" format=\"*N\" size=\"3\"/><br/>";
        $rets .= "<input type=\"submit\" value=\"GO\"/>";
        $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
        $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
        $rets .= "</form></center>";
        echo $rets;  
    }
    echo "</p>";    
    
  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"gallery.php?action=main&sid=$sid\">Gallery</a>";
  echo " > ";
  echo "Male Gallery";
  echo "</small></p>";  
echo "</body>";
exit();
}
////////////////////////////////////////FEMALE GALLERY
else if($action=="females")
{
  addonline(getuid_sid($sid),"Female Gallery - xHML:v3","");
echo "<head>";
echo "<title>Female Gallery</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://humtum.mansoon.net/themes/white_medium.css\">";
echo "</head>";
echo "<body>";
echo "<div>";	
echo "<center>Female Gallery</center></div>";
echo popup($sid);
$unreadinbox=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE unread='1' AND touid='".$uid."'"));
      $unrd="".$unreadinbox[0]."";
      if ($unreadinbox[0]>0)
      {
      echo "<a href=\"inbox.php?action=main&sid=$sid&lstloc=cht&rid=$rid\">$unrd New Inbox!</a><br/>";
      }
					    if($page=="" || $page<=0)$page=1;					
					
					    if($who!="")
					    {
					    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_usergallery WHERE sex='F'"));
					    }else{
					    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM ibwf_usergallery WHERE sex='F'"));
					    }
					
					    $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;
					
						$sql = "SELECT DISTINCT `uid` FROM `ibwf_usergallery` WHERE sex='F' ORDER BY `id` DESC LIMIT $limit_start , $items_per_page";
					
					    $items = mysql_query($sql);
					    echo mysql_error();
					    
					    if(mysql_num_rows($items)>0)
					    {
					    while ($item = mysql_fetch_array($items))
					    {
						$who = $item[0];
						
						$user=getnick_uid($who);
					
						$countpics = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_usergallery WHERE uid='".$who."'"));
					        $lnk = "<a href=\"gallery.php?action=viewuserphoto&who=$who&sid=$sid\">$user($countpics[0])</a><br/>";
					       echo "$lnk"; 
					    }
					    }
  
    echo "<p align=\"center\">";
    if($page>1)
    {
      $ppage = $page-1;
      echo "<a href=\"gallery.php?action=$action&page=$ppage&sid=$sid\"><small>« Prev</small></a> ";
    }
    echo "<small> $page/$num_pages </small>";
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"gallery.php?action=$action&page=$npage&sid=$sid\"><small>Next »</small></a>";
    }    
    if($num_pages>2)
    {     
        $rets = "<center><form action=\"gallery.php\" method=\"get\">";
        $rets .= "Jump to page:<input name=\"page\" format=\"*N\" size=\"3\"/><br/>";
        $rets .= "<input type=\"submit\" value=\"GO\"/>";
        $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
        $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
        $rets .= "</form></center>";
        echo $rets;  
    }
    echo "</p>";    
    
  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"gallery.php?action=main&sid=$sid\">Gallery</a>";
  echo " > ";
  echo "Female Gallery";
  echo "</small></p>";  
echo "</body>";

exit();
}

else if($action=="viewuserphoto")
{
  addonline(getuid_sid($sid),"Viewing Users Photo''s - xHTML:v3","");
echo "<head>";
echo "<title>Viewing Users Photo's</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://humtum.mansoon.net/themes/white_medium.css\">";
echo "</head>";
echo "<body>";
echo popup($sid);
  $who = $_GET["who"];
  $uid1 = getuid_sid($sid);
  $nick = getnick_uid($who);
  echo "<div>";	
  echo "<center><a href=\"index.php?action=viewuser&who=$who&sid=$sid\">$nick</a>'s Gallery</center></div>";
$unreadinbox=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE unread='1' AND touid='".$uid."'"));
      $unrd="".$unreadinbox[0]."";
      if ($unreadinbox[0]>0)
      {
      echo "<a href=\"inbox.php?action=main&sid=$sid&lstloc=cht&rid=$rid\">$unrd New Inbox!</a><br/>";
      }
					echo "<center>";
					    if($page=="" || $page<=0)$page=1;
					    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery WHERE uid='".$who."'"));
					    $num_items = $noi[0]; //changable
					    $items_per_page= 1;
					    $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 uid, id, imageurl, sex, descript FROM ibwf_usergallery WHERE uid='".$who."' ORDER BY time DESC LIMIT $limit_start, $items_per_page";

					    $items = mysql_query($sql);
						
					    echo mysql_error();
					    if(mysql_num_rows($items)>0)
					    {
					    while ($item = mysql_fetch_array($items))
					    {
							$sql = "SELECT rating FROM ibwf_usergallery_rating WHERE imageid='".$item[1]."'";		
							$imginfo = mysql_query($sql);
							
							echo mysql_error();
					        if(mysql_num_rows($imginfo)>0)
					        {
					           while ($imginfos = mysql_fetch_array($imginfo)){ 
					              $ratingtotal = $ratingtotal + $imginfos[0];}
					        }
							
					
							if($totalcomments<1){$totalcomments=0;}         
							$norm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery_rating WHERE imageid='".$item[1]."'"));
							if ($norm[0]>0){
							$rating = ceil($ratingtotal/$norm[0]);
							}else{$rating=0;}
							
							$rated = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery_rating WHERE byuid='".$uid1."' and imageid ='".$item[1]."'"));
							$totalcomments = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery_rating WHERE imageid ='".$item[1]."' and commentsyn ='Y'"));
							$userinfo = mysql_fetch_array(mysql_query("SELECT name FROM ibwf_users WHERE id='".$item[0]."'"));
							
					        
					        if(canratephoto($uid1, $item[0]) and ($rated[0]==0))
					    	{
					         echo "<a href=\"gallery.php?action=rate&sid=$sid&whoimage=$item[1]\">Rate This Photo</a>";
					        }
					        if($uid1==$item[0])
					    	{
					         echo "<a href=\"genproc.php?action=upavg&sid=$sid&avsrc=$item[2]\">Use As Avatar</a>";
					        }
					        if(isadmin(getuid_sid($sid)) or ($uid1==$item[0]))
    	{
					         echo " / <a href=\"gallery.php?action=del&sid=$sid&whoimage=$item[1]\">Delete</a>";
					        }
					        echo "<br/><a href=\"$item[2]\"><img src=\"$item[2]\" alt=\"$userinfo[0]: $page\"/></a><br/>";					        
					        if($uid1==$item[0])
					    	{
					    	if(strlen($item[4])>1){
					        $edtlnk = "<a href=\"gallery.php?action=edtdescript&sid=$sid&whoimage=$item[1]\">*</a>";
					        }else{
					        $edtlnk = "<a href=\"gallery.php?action=edtdescript&sid=$sid&whoimage=$item[1]\">*Add Description*</a>";
					        }
					        echo "<small>$item[4] </small>$edtlnk<br/><br/>";
					        }
					        echo "Rating: $rating/10 (<a href=\"gallery.php?action=votes&sid=$sid&whoimage=$item[1]\">$norm[0]</a> Votes)<br/><a href=\"gallery.php?action=comments&sid=$sid&whoimage=$item[1]\">Comments</a>($totalcomments[0])";
					        echo "<br/>";
					        $ratingtotal = 0;
					        $sex = $item[3];        
					    }
					    }
					echo "</center>";
    echo "<p><center>";
    if($page>1)
    {
      $ppage = $page-1;
      echo "<a href=\"gallery.php?action=$action&sid=$sid&page=$ppage&who=$who\"><small>« Prev</small></a> ";
    }
    echo "<small> $page/$num_pages </small>";
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"gallery.php?action=$action&sid=$sid&page=$npage&who=$who\"><small>Next »</small></a>";
    }
    
    if($num_pages>2)
    {
        $rets = "<center><form action=\"gallery.php\" method=\"get\">";
        $rets .= "Jump to Photo:<input name=\"page\" format=\"*N\" size=\"3\"/><br/>";
        $rets .= "<input type=\"submit\" value=\"GO\"/>";
        $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
        $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
        $rets .= "<input type=\"hidden\" name=\"who\" value=\"$who\"/>";
        $rets .= "</form></center>";
        echo $rets;  
    }
    echo "</center></p>";    
    
  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"gallery.php?action=main&sid=$sid\">Gallery</a>";  
  echo " > ";
  if ($sex=="M"){
  echo "<a href=\"gallery.php?action=males&sid=$sid\">Male Gallery</a>";
  }else{
  echo "<a href=\"gallery.php?action=females&sid=$sid\">Female Gallery</a>";
  }
  echo " > ";
  echo "$userinfo[0]";
  echo "</small></p>";  
echo "</body>";
echo "</html>";
exit();
}
////////////////////////////////////////RATE A PHOTO
else if($action=="rate")
{
  addonline(getuid_sid($sid),"Rating a Photo - xHTML:v3","");
echo "<head>";
echo "<title>Rating a Photo</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://humtum.mansoon.net/themes/white_medium.css\">";
echo "</head>";
echo "<body>";
  $uid1 = getuid_sid($sid);
  $item = mysql_fetch_array(mysql_query("SELECT uid, id, imageurl, sex FROM ibwf_usergallery WHERE uid='".$whoimage."'"));
  
  $rated = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery_rating WHERE byuid='".$uid1."' and imageid ='".$whoimage."'"));
  
  if(canratephoto($uid1, $item[0]) and ($rated[0]==0))
  {  
  echo "<p align=\"center\"><small>";
  echo "Rate this members Photo: 1=Low, 10=High<br/>You can also leave a comment for this photo!<br/>";
  echo "<br/>";
  echo "</small></p>";
  echo "<p>";
    echo "<form action=\"gallery.php?action=rateuser&sid=$sid&whoimage=$whoimage\" method=\"post\">";
    echo "<small>Rate:</small> <select name=\"rate\" value=\"$rate[0]\">";
    echo "<option value=\"1\">1</option>";
    echo "<option value=\"2\">2</option>";
    echo "<option value=\"3\">3</option>";
    echo "<option value=\"4\">4</option>";
    echo "<option value=\"5\">5</option>";
    echo "<option value=\"6\">6</option>";
    echo "<option value=\"7\">7</option>";
    echo "<option value=\"8\">8</option>";
    echo "<option value=\"9\">9</option>";
    echo "<option value=\"10\">10</option>";
    echo "</select><br/>";
    
  echo "<small>Comments:</small> <input name=\"comment\" format=\"*M\" maxlength=\"200\"/><br/>";
  echo "<input type=\"submit\" value=\"Rate\"/>";
  echo "</form>"; 
  }else{
  echo "You have already rated this Photo";
  }
  echo "</p>"; 
    
  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"gallery.php?action=main&sid=$sid\">Gallery</a>";
  echo " > ";
  echo "Rating a Photo";
  echo "</small></p>";  
echo "</body>";
echo "</html>";
exit();
}
////////////////////////////////////////READ COMMENTS
else if($action=="comments")
{
  addonline(getuid_sid($sid),"Reading Photo''s Comments - xHTML:v3","");
echo "<head>";
echo "<title>Reading Photo's Comments</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://humtum.mansoon.net/themes/white_medium.css\">";
echo "</head>";
echo "<body>";
  echo "<p align=\"center\"><small>";
  echo "<br/>";
  echo "</small></p>";
      //////ALL LISTS SCRIPT <<

    if($page=="" || $page<=0)$page=1;
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery_rating WHERE imageid='".$whoimage."' and commentsyn ='Y'"));
    $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;
    
    $uidinfo = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_usergallery WHERE id='".$whoimage."'"));
    $uid = getuid_sid($sid);

    
    $sql = "SELECT rating, comments, byuid, time, commentsreply, id  FROM ibwf_usergallery_rating WHERE imageid ='".$whoimage."' and commentsyn ='Y' ORDER BY time 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(isonline($item[2]))
  {
    $iml = "<img src=\"../images/onl.gif\" alt=\"+\"/>";
    
  }else{
    $iml = "<img src=\"../images/ofl.gif\" alt=\"-\"/>";
  }
    if(strlen($item[1])>1){
         
      $snick = getnick_uid($item[2]);
      $uid1 = getuid_sid($sid);
        
  		if($uid==$uidinfo[0])
  		{  
      		$dellnk = "<a href=\"gallery.php?action=delvote&sid=$sid&whoimage=$item[5]\">*</a>";
      	}else{
			$dellnk = "";      	
      	}
      	
      $lnk = "<small><a href=\"index.php?action=viewuser&who=$item[2]&sid=$sid\">$iml$snick:</a> <b>$item[0]/10</b> $dellnk</small>";
	  echo "$lnk<br/><small>";
      $bs = date("d/m/y",$item[3]);
      $text = parsepm($item[1], $sid);
      if(($uid==$uidinfo[0]) and (strlen($item[4])<1))
      {
        $replylink = "<a href=\"gallery.php?action=commentreply&sid=$sid&id=$item[5]\">Reply to Comment</a><br/><i>$bs</i>";
      }else{
        $replylink = " <i>$bs</i>";
      }
      echo "$text";
      if(strlen($item[4])>1)
      {
      $text1 = parsepm($item[4], $sid);
      echo "<br><b><i>Reply:</i> $text1</b>";
      }
      echo "<br/>$replylink<br/><br/>";
      echo "</small>";
    }
    }
    }
    echo "</p>";
    echo "<p><center>";
    if($page>1)
    {
      $ppage = $page-1;
      echo "<a href=\"gallery.php?action=$action&sid=$sid&page=$ppage&whoimage=$whoimage\"><small>« Prev</small></a> ";
    }
    echo "<small> $page/$num_pages </small>";
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"gallery.php?action=$action&sid=$sid&page=$npage&whoimage=$whoimage\"><small>Next »</small></a>";
    }
    
    if($num_pages>2)
    {
        $rets = "<center><form action=\"gallery.php\" method=\"get\">";
        $rets .= "Jump to Photo:<input name=\"page\" format=\"*N\" size=\"3\"/><br/>";
        $rets .= "<input type=\"submit\" value=\"GO\"/>";
        $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
        $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
        $rets .= "<input type=\"hidden\" name=\"whoimage\" value=\"$whoimage\"/>";
        $rets .= "<input type=\"hidden\" name=\"page\" value=\"$(pg)\"/>";
        $rets .= "</form></center>";
        echo $rets;  
    }
    echo "</center></p>";    
    
  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"gallery.php?action=main&sid=$sid\">Gallery</a>";
  echo " > ";
  echo "Reading Photo's Comments";
  echo "</small></p>";  
echo "</body>";
echo "</html>";
exit();
}
////////////////////////////////////////MAKE A COMMENT
else if($action=="commentreply")
{
  addonline(getuid_sid($sid),"Replying to a Photo''s Comment - xHTML:v3","");
echo "<head>";
echo "<title>Replying to a Photo's Comment</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://humtum.mansoon.net/themes/white_medium.css\">";
echo "</head>";
echo "<body>";
 $id = $_GET["id"];
  
  echo "<p align=\"center\"><small>";
  echo "Reply to a Comment<br/>";
  echo "<br/>";
  echo "</small></p>";
  echo "<p>";
  echo "<form action=\"gallery.php?action=commentreplyaction&sid=$sid&id=$id\" method=\"post\">";
  echo "<small>Reply:</small> <input name=\"reply\" format=\"*M\" maxlength=\"200\"/><br/>";
  echo "<input type=\"submit\" value=\"Reply\"/>";
  echo "</form>"; 
  echo "</p>"; 
    
  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"gallery.php?action=main&sid=$sid\">Gallery</a>";
  echo " > ";
  echo "Replying to a Comment";
  echo "</small></p>";  
echo "</body>";
echo "</html>";
exit();
}
////////////////////////////////////////READ VOTES WITHOUT COMMENTS
else if($action=="votes")
{
  addonline(getuid_sid($sid),"Viewing Votes of a Photo - xHTML:v3","");
echo "<head>";
echo "<title>Viewing Votes of a Photo</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://humtum.mansoon.net/themes/white_medium.css\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\"><small>";
  echo "<br/>";
  echo "</small></p>";

    if($page=="" || $page<=0)$page=1;
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery_rating WHERE imageid='".$whoimage."'"));
    $num_items = $noi[0]; //changable
    $items_per_page= 20;
    $num_pages = ceil($num_items/$items_per_page);
    if(($page>$num_pages)&&$page!=1)$page= $num_pages;
    $limit_start = ($page-1)*$items_per_page;
    
    $imageratinginfo = "SELECT rating, byuid  FROM ibwf_usergallery_rating WHERE imageid='".$item[1]."'";
    $uidinfo = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_usergallery WHERE id='".$whoimage."'"));
    
    $sql = "SELECT rating, byuid, time  FROM ibwf_usergallery_rating WHERE imageid ='".$whoimage."' ORDER BY time 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(isonline($item[1]))
  {
    $iml = "<img src=\"../images/onl.gif\" alt=\"+\"/>";
    
  }else{
    $iml = "<img src=\"../images/ofl.gif\" alt=\"-\"/>";
  }
  
    
    $snick = getnick_uid($item[1]);
    $uid1 = getuid_sid($sid);
        
  		if($uid==$uidinfo[0])
  		{  
      		$dellnk = "<a href=\"gallery.php?action=delvote&sid=$sid&whoimage=$whoimage\">*</a>";
      	}else{
			$dellnk = "";      	
      	}
      $lnk = "<a href=\"index.php?action=viewuser&who=$item[1]&sid=$sid\">$iml$snick:</a> <b>$item[0]/10</b> $dellnk";
      echo "$lnk<br/>";
    
    }
    }
    echo "</p>";
    echo "<p><center>";
    if($page>1)
    {
      $ppage = $page-1;
      echo "<a href=\"gallery.php?action=$action&sid=$sid&page=$ppage&who=$who\"><small>« Prev</small></a> ";
    }
    echo "<small> $page/$num_pages </small>";
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"gallery.php?action=$action&sid=$sid&page=$npage&who=$who\"><small>Next »</small></a>";
    }
    
    if($num_pages>2)
    {
        $rets = "<center><form action=\"gallery.php\" method=\"get\">";
        $rets .= "Jump to Photo:<input name=\"page\" format=\"*N\" size=\"3\"/><br/>";
        $rets .= "<input type=\"submit\" value=\"GO\"/>";
        $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
        $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
        $rets .= "<input type=\"hidden\" name=\"who\" value=\"$who\"/>";
        $rets .= "<input type=\"hidden\" name=\"page\" value=\"$(pg)\"/>";
        $rets .= "</form></center>";
        echo $rets;  
    }
    echo "</center></p>";
    
  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"gallery.php?action=main&sid=$sid\">Gallery</a>";
  echo " > ";
  echo "Votes";
  echo "</small></p>";  
echo "</body>";
echo "</html>";
exit();
}
////////////////////////////////////////RATE USER
else if($action=="rateuser")
{
  addonline(getuid_sid($sid),"Rating a Photo - xHTML:v3","");
echo "<head>";
echo "<title>Rating a Photo - xHTML</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://humtum.mansoon.net/themes/white_medium.css\">";
echo "</head>";
echo "<body>";
  $rate = $_POST["rate"];
  $comment = $_POST["comment"];

  $uid1 = getuid_sid($sid);
  $item = mysql_fetch_array(mysql_query("SELECT uid, id, imageurl, sex FROM ibwf_usergallery WHERE uid='".$whoimage."'"));
  
  $rated = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery_rating WHERE byuid='".$uid1."' and imageid ='".$whoimage."'"));
  
  if(canratephoto($uid1, $item[0]) and ($rated[0]==0))
  {  
   echo "<p align=\"center\">";
   $uid = getuid_sid($sid);
   if((strlen($comment))>1){   
   $res= mysql_query("INSERT INTO ibwf_usergallery_rating SET imageid='".$whoimage."', rating='".$rate."', comments='".$comment."', byuid='".$uid."', time='".time()."', commentsyn='Y'");
   }else
   if((strlen($comment))<2){   
   $res= mysql_query("INSERT INTO ibwf_usergallery_rating SET imageid='".$whoimage."', rating='".$rate."', comments='".$comment."', byuid='".$uid."', time='".time()."', commentsyn='N'");
   }

   if(($res) and ((strlen($comment))>1)){
   
     echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Rated Successfully<br/>";
     echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Comments added Successfully<br/>";
   }else
   if(($res) and ((strlen($comment))<2)){
   
     echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Rated Successfully<br/>";
     echo "<img src=\"../images/notok.gif\" alt=\"x\"/>No Comments were added<br/>";
   }
   else{
     echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Rated unsuccessfully<br/>";
     echo "<img src=\"../images/notok.gif\" alt=\"x\"/>No Comments were added<br/>";
   }
   }else{
   echo "You have already rated this Photo";
   }
  echo "</p>"; 
    
  echo "<p><small>";
$unreadinbox=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE unread='1' AND touid='".$uid."'"));
      $unrd="".$unreadinbox[0]."";
      if ($unreadinbox[0]>0)
      {
      echo "<a href=\"inbox.php?action=main&sid=$sid&lstloc=cht&rid=$rid\">$unrd New Inbox!</a><br/>";
      }
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"gallery.php?action=main&sid=$sid\">Gallery</a>";
  echo " > ";
  echo "Rating a Photo";
  echo "</small></p>";  
echo "</body>";
echo "</html>";
exit();
}
////////////////////////////////////////REPLY TO COMMENT
else if($action=="commentreplyaction")
{
  addonline(getuid_sid($sid),"Replying To a Photo''s Comment - xHTML:v3","");
echo "<head>";
echo "<title>Replying To a Photo''s Comment - xHTML:v3</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://humtum.mansoon.net/themes/white_medium.css\">";
echo "</head>";
echo "<body>";
  $id = $_GET["id"];
  $reply = $_POST["reply"];
    
  echo "<p align=\"center\">";
  $uid = getuid_sid($sid);
  $res = mysql_query("UPDATE ibwf_usergallery_rating SET commentsreply='".$reply."' WHERE id='".$id."'");
   if($res){
   
     echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Replyed Successfully<br/>";
   }
   else{
     echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Replyed unsuccessfully<br/>";
   }
  echo "</p>"; 
    
  echo "<p><small>";
$unreadinbox=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE unread='1' AND touid='".$uid."'"));
      $unrd="".$unreadinbox[0]."";
      if ($unreadinbox[0]>0)
      {
      echo "<a href=\"inbox.php?action=main&sid=$sid&lstloc=cht&rid=$rid\">$unrd New Inbox!</a><br/>";
      }
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"gallery.php?action=main&sid=$sid\">Gallery</a>";
  echo " > ";
  echo "Replyed to a Comment";
  echo "</small></p>";  
echo "</body>";
echo "</html>";
exit();
}
////////////////////////////////////////UPLOAD PHOTO
else if($action=="upload")
{
  addonline(getuid_sid($sid),"Uploading a Photo - xHTML:v3","");
echo "<head>";
echo "<title>Uploading a Photo - xHTML:v3</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://humtum.mansoon.net/themes/white_medium.css\">";
echo "</head>";
echo "<body>";
  $rate = $_POST["rate"];
  $comment = $_POST["comment"];
  
  echo "<p>";
	echo "<center>Photo Uploader</center><br/>";
  	echo "<small>Note:<br/>";   
  	echo "* File size limit 512kb. If your upload does not work, try a smaller Photo.<br/>";
  	echo "* Allowed formats: <b>.jpg, .gif, .bmp, .png</b><br/>";
  	echo "* You have the right to distribute the Photo<br/>";
  	echo "* The Photo does not violate the <a href=\"index.php?action=terms&sid=$sid\">Terms of Use</a><br/>";
  	echo "<center><br/>Pick a Photo to upload, and press 'Upload'<br/>";
	echo "<form enctype=\"multipart/form-data\" method=\"post\" action=\"upload.php?action=upload&sid=$sid\">";
	echo "<input type=\"file\" name=\"f1\" size=\"15\"><br/>";
	echo "Description: <input name=\"descript\" maxlength=\"100\" size=\"20\"/>";
	echo "<input type=\"hidden\" name=\"action\" value=\"image\" /><br/>";
	echo "<INPUT TYPE=\"submit\" name=\"upl\" VALUE=\"Upload\"></form>";   
  echo "</center></small></p>"; 
    
  echo "<p><small>";
$unreadinbox=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE unread='1' AND touid='".$uid."'"));
      $unrd="".$unreadinbox[0]."";
      if ($unreadinbox[0]>0)
      {
      echo "<a href=\"inbox.php?action=main&sid=$sid&lstloc=cht&rid=$rid\">$unrd New Inbox!</a><br/>";
      }
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"gallery.php?action=main&sid=$sid\">Gallery</a>";
  echo " > ";
  echo "Uploading a Photo";
  echo "</small></p>";  
echo "</body>";
echo "</html>";
exit();
}
////////////////////////////////////////DEL PHOTO
else if($action=="del")
{
echo "<head>";
echo "<title>Gallery Pics</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://humtum.mansoon.net/themes/white_medium.css\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\">";
        
    $imageurl = mysql_fetch_array(mysql_query("SELECT imageurl FROM ibwf_usergallery WHERE id='".$whoimage."'"));
    $imagename = explode("/",$imageurl[0]);
    $delpath = "../usergallery/$imagename[4]";
    unlink($delpath);
    $res = mysql_query("DELETE FROM ibwf_usergallery WHERE id='".$whoimage."'");
    $res = mysql_query("DELETE FROM ibwf_usergallery_rating WHERE imageid='".$whoimage."'");      

        if($res)
      {
        echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Photo and all the Comments have been deleted";
      }else{
        echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Error deleting Photo";
      }
  echo "</p>"; 
    
  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"gallery.php?action=main&sid=$sid\">Gallery</a>";
  echo " > ";
  echo "Deleting a Photo";
  echo "</small></p>";  
echo "</body>";
echo "</html>";
exit();
}
////////////////////////////////////////DEL COMMENT
else if($action=="delvote")
{
echo "<head>";
echo "<title>Gallery Pics</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://humtum.mansoon.net/themes/white_medium.css\">";
echo "</head>";
echo "<body>";
  echo "<p align=\"center\">";
  
      if($res)
      {
        echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Photo and all the Comments have been deleted";
      }else{
        echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Error deleting Photo";
      }      
  echo "</p>"; 
    
  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"gallery.php?action=main&sid=$sid\">Gallery</a>";
  echo " > ";
  echo "Deleting Comment";
  echo "</small></p>";  
echo "</body>";
echo "</html>";
exit();
}
////////////////////////////////////////EDIT DESCRIPTION / ADD DESCRIPTION
else if($action=="edtdescript")
{

echo "<head>";
echo "<title>Gallery Pics</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://humtum.mansoon.net/themes/white_medium.css\">";
echo "</head>";
echo "<body>";
  echo "<p align=\"center\">";
  
      if($res)
      {
        echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Photo and all the Comments have been deleted";
      }else{
        echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Error deleting Photo";
      }      
  echo "</p>"; 
    
  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"gallery.php?action=main&sid=$sid\">Gallery</a>";
  echo " > ";
  echo "Deleting Comment";
  echo "</small></p>";  
echo "</body>";
echo "</html>";
exit();
}
////////////////////////////////////////LOST IN GALLERY
else
{
  addonline(getuid_sid($sid),"Lost in Gallery - xHTML:v3","");
echo "<head>";
echo "<title>Lost In Gallery</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://humtum.mansoon.net/themes/white_medium.css\">";
echo "</head>";
echo "<body>";
  echo "<p align=\"center\">";
  echo "I don't know how did you get into here, but there's nothing to show.";
  echo "</p>";
  
  echo "<p><small>";
  echo "<a href=\"index.php?action=main&sid=$sid\">Home</a>";
  echo " > ";
  echo "<a href=\"gallery.php?action=main&sid=$sid\">Gallery</a>";
  echo " > ";
  echo "LOST";
  echo "</small></p>";  
echo "</body>";
echo "</html>";
exit();
}
?>

but it's not working fine without sql table, exports please create a sql table called usergallery...

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close