Gallery Not Working

Started on the old forum in August 2008 · view the original in the archive · old links redirect here

21 replies · 1,302 views · started 18 years ago · 3 min read

5 participants
learner Lead · 587 posts #1

my gallery not work with max.php without max.php like random puics etc work but not with max.php how to remove the option max.php and make it work without it? 😢

here my gallery

CODE<?php

include("core.php"); include("config.php");

header("Content-type: text/html; charset=ISO-8859-1"); echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>"; echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">"; echo "<html xmlns="http://www.w3.org/1999/xhtml">";

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="mw 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"];

if(islogged($sid)==false) {

  echo "

"; echo "You are not logged in "; echo "Or Your session has been expired

"; echo "<a href="index.php">Login</a>"; echo " "; exit(); } $uid = getuid_sid($sid); if(isbanned($uid)) {

  echo "

"; echo "<img src="../images/notok.gif" alt="x"/> "; echo "You are Banned "; $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM mw_penalties WHERE uid='".$uid."' AND penalty='1'")); $remain = $banto[0]- time(); $rmsg = gettimemsg($remain); echo "Time to finish your penalty: $rmsg

"; //echo "<a href="index.php">Login</a>"; echo " "; exit(); }

if($action=="main") { addonline(getuid_sid($sid),"user gallery","");

echo " "; echo "Send your photos to gallery@mwmobile.ws with username and password "; echo "Your pictures will be added within 2 days after being sent!"; echo "

";

$males = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM mw_gallery WHERE sex='M'")); echo "<a href="gallery.php?action=male&sid=$sid"><img src="../images/male.gif" alt=""/>Male Gallery($males[0]) "; echo " "; $females = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM mw_gallery WHERE sex='F'")); echo "<a href="gallery.php?action=female&sid=$sid"><img src="../images/female.gif" alt=""/>Female Gallery($females[0]) "; echo " "; echo "<a href="gallery.php?action=gallery&sid=$sid">+ Upload Photo</a>"; echo "

"; echo "<a href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt="*"/>"; echo "Home</a>"; echo " ";

} else if($action=="gallery") { addonline(getuid_sid($sid),"Adding Photo","");

echo " "; echo "If you have a url to ur photo u may add it to the gallery below Please note that only .jpeg/.jpg files will show in gallery. All other file formats will be removed my staff

"; echo "<form action="genproc.php?action=addgal&sid=$sid" method="post">";
echo "Image URL: <input name="itemurl" type="text" value="http://"/> "; echo " <input type="submit" value="Add Photo"/>"; echo "</form>";

echo "

"; echo "<a href="gallery.php?action=main&sid=$sid">User Gallery</a> "; echo "<a href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt="*"/>"; echo "Home</a>"; echo " ";

} else if($action=="male") { addonline(getuid_sid($sid),"Viewing Male Gallery","");

$uid = getuid_sid($sid);

//////ALL gallery SCRIPT <<

if($page=="" || $page<=0)$page=1;

if($who!="")
{
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM mw_gallery WHERE sex='M'"));
}else{
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM mw_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 mw_gallery WHERE sex='M' ORDER BY uid ASC LIMIT $limit_start, $items_per_page";

echo "

"; $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 mw_gallery WHERE uid='".$who."'")); $lnk = "<a href="gallery.php?action=viewuser&who=$who&sid=$sid">$user($countpics[0])</a> "; echo "$lnk"; } }

echo "

"; echo " "; if($page>1) { $ppage = $page-1; echo "<a href="gallery.php?action=$action&page=$ppage&sid=$sid">«PREV</a> "; } if($page<$num_pages) { $npage = $page+1; echo "<a href="gallery.php?action=$action&page=$npage&sid=$sid">Next»</a>"; } echo " $page/$num_pages "; if($num_pages>2) { $rets = "<form action="gallery.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="gallery.php?action=main&sid=$sid">User Gallery</a> "; echo "<a href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt="*"/>"; echo "Home</a>"; echo " ";

} else if($action=="female") { addonline(getuid_sid($sid),"Viewing Female Gallery","");

$uid = getuid_sid($sid);

//////ALL gallery SCRIPT <<

if($page=="" || $page<=0)$page=1;
if($who!="")
{
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM mw_gallery WHERE sex='F'"));
}else{
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM mw_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 mw_gallery WHERE sex='F' ORDER BY uid ASC LIMIT $limit_start, $items_per_page";

echo "

"; $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 mw_gallery WHERE uid='".$who."'")); $lnk = "<a href="gallery.php?action=viewuser&who=$who&sid=$sid">$user($countpics[0])</a> ";

echo "$lnk";

}
}else{

echo "female gallery is empty"; } echo " "; echo " "; if($page>1) { $ppage = $page-1; echo "<a href="gallery.php?action=$action&page=$ppage&sid=$sid">«PREV</a> "; } if($page<$num_pages) { $npage = $page+1; echo "<a href="gallery.php?action=$action&page=$npage&sid=$sid">Next»</a>"; } echo " $page/$num_pages "; if($num_pages>2) { $rets = "<form action="gallery.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="gallery.php?action=main&sid=$sid">User Gallery</a> "; echo "<a href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt="*"/>"; echo "Home</a>"; echo " ";

} else if($action=="viewuser") { $who = $_GET["who"]; addonline(getuid_sid($sid),"Viewing user Photos","");

$uid = getuid_sid($sid);

//////ALL gallery SCRIPT <<

if($page=="" || $page<=0)$page=1;
if($who!="")
{
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM mw_gallery WHERE uid='".$who."'"));
}else{
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM mw_gallery"));
}
$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;

if($who!="")
{
	$sql = "SELECT id, sex, itemurl FROM mw_gallery WHERE uid='".$who."' ORDER BY id DESC LIMIT $limit_start, $items_per_page";
	}else{

$sql = "SELECT id, sex, itemurl, uid FROM mw_gallery ORDER BY id DESC LIMIT $limit_start, $items_per_page"; }

echo " "; $items = mysql_query($sql); echo mysql_error(); if(mysql_num_rows($items)>0) { while ($item = mysql_fetch_array($items)) { $id = $item[0]; $img = $item[2];

	$lnk = "<img src=\"max.php?filename=$img\" alt=\"$id\"/>

"; $rinfo = mysql_fetch_array(mysql_query("SELECT COUNT() as nofr, SUM(prate) as nofp FROM mw_prate WHERE pid='".$id."'")); $counts = mysql_fetch_array(mysql_query("SELECT COUNT() FROM mw_prate WHERE pid='".$id."'")); if($counts[0]>0) { $ther = $rinfo[1]/$rinfo[0]; $rating = "Rating: $ther/$rinfo[1] (votes($counts[0])) "; }else{ $rating = ""; }

	 $gall = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM mw_galcomments WHERE pid='".$id."'"));

$me = getuid_sid($sid); if($who=="$me") { $use = "<a href="genproc.php?action=useav&sid=$sid&gid=$item[0]">Use as Avatar</a> | "; }else{ $use = ""; } if(candelgal($uid, $item[0])) { $delnk = "<a href="genproc.php?action=delgal&sid=$sid&gid=$item[0]">Remove Photo</a>"; }else{ $delnk = ""; } echo "$lnk$rating<a href="$img">Download Photo</a> $use$delnk <a href="gallery.php?who=$who&action=comments&sid=$sid&gid=$item[0]">Comments($gall[0])</a> ";

}
}
echo "

"; echo " "; if($page>1) { $ppage = $page-1; echo "<a href="gallery.php?action=$action&page=$ppage&sid=$sid&who=$who">«PREV</a> "; } if($page<$num_pages) { $npage = $page+1; echo "<a href="gallery.php?action=$action&page=$npage&sid=$sid&who=$who">Next»</a>"; } echo " $page/$num_pages "; if($num_pages>2) { $rets = "<form action="gallery.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 .= "</form>";

	echo $rets;
}

echo "<a href="gallery.php?action=main&sid=$sid">User Gallery</a> "; echo "<a href="index.php?action=main&sid=$sid">Home</a>";

echo "

";

} else if($action=="comments") { $who = $_GET["who"]; $gid = $_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 mw_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 mw_galcomments WHERE pid='".$gid."' ORDER BY id DESC LIMIT $limit_start, $items_per_page";

echo "

"; $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 ";

$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 "; echo "$bs"; echo " "; echo "";

}
}
echo "

"; echo " "; if($page>1) { $ppage = $page-1; echo "<a href="gallery.php?action=$action&page=$ppage&sid=$sid&who=$who&gid=$gid">«PREV</a> "; } if($page<$num_pages) { $npage = $page+1; echo "<a href="gallery.php?action=$action&page=$npage&sid=$sid&who=$who&gid=$gid">Next»</a>"; } echo " $page/$num_pages "; if($num_pages>2) { $rets = "<form action="gallery.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 "

"; ////// UNTILL HERE >> echo " "; $me = getuid_sid($sid); if($me!="$who") { echo "<a href="gallery.php?action=addcomment&sid=$sid&who=$who&gid=$gid">Add Comment</a> "; } echo "<a href="gallery.php?action=main&sid=$sid">User Gallery</a> "; echo "<a href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt="*"/>"; echo "Home</a>"; echo " ";

} else if($action=="addcomment") { $who = $_GET["who"]; $gid = $_GET["gid"]; addonline(getuid_sid($sid),"Adding Photo Comments","");

$uid = getuid_sid($sid);
$sql = "SELECT itemurl FROM mw_gallery  WHERE id='".$gid."'";

echo " "; $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=\"max.php?filename=$img\" alt=\"$id\"/>

";

  echo "$lnk";

echo "<form action="genproc.php?action=commentadd&sid=$sid&gid=$gid" method="post">";

$vb = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM mw_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> ";

}else{ $rinfo = mysql_fetch_array(mysql_query("SELECT COUNT() as nofr, SUM(prate) as nofp FROM mw_prate WHERE pid='".$gid."'")); $counts = mysql_fetch_array(mysql_query("SELECT COUNT() FROM mw_prate WHERE pid='".$gid."'")); if($counts[0]>0) { $ther = $rinfo[1]/$rinfo[0]; $rating = "Rating: $ther/$rinfo[1] (votes($counts[0])) "; }else{ $rating = ""; } echo "$rating"; }

echo "Comment: "; echo "<input type="text" maxlength="150" name="text"/> "; echo "<input type="submit" value="Add"/>"; echo "</form>"; } } echo "<a href="gallery.php?action=main&sid=$sid">User Gallery</a> ";

echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";

echo "Home</a>"; echo " ";

}else{ addonline(getuid_sid($sid),"Lost in user gallery lol","");

echo " "; echo "I don't know how did you get into here, but there's nothing to show

"; echo "<a href="gallery.php?action=main&sid=$sid">User Gallery</a> "; echo "<a href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt="*"/>"; echo "Home</a>"; echo " "; }

echo "</body>";
echo "</html>";

?>

max.php

CODE<?php $height= 100; $width= 100; // Content type header('Content-type: image/jpeg'); if(!$filename) $filename="./images/nopic.jpg"; // Get new dimensions list($width_orig, $height_orig) = getimagesize($filename);

if ($width && ($width_orig < $height_orig)) { $width = ($height / $height_orig) * $width_orig; } else { $height = ($width / $width_orig) * $height_orig; }

// Resample $image_p = imagecreatetruecolor($width, $height); $image = imagecreatefromjpeg($filename); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);

// Output imagejpeg($image_p, null, 100); ImageDestroy ($image_p); ?>

please help ake work without max.php or it not work 😀

Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

BEST MOBILE ADVERTISER

External image (may be gone)

busterkeaton10 Developer · 68 posts #3

Max.php had been removed and remember that max.php only shows jpg,png only and it will not show you when you use gif etc extension! CODE<?php

include("core.php"); include("config.php");

header("Content-type: text/html; charset=ISO-8859-1"); echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>"; echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">"; echo "<html xmlns="http://www.w3.org/1999/xhtml">";

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="mw 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"];

if(islogged($sid)==false) {

  echo "

"; echo "You are not logged in "; echo "Or Your session has been expired

"; echo "<a href="index.php">Login</a>"; echo " "; exit(); } $uid = getuid_sid($sid); if(isbanned($uid)) {

  echo "

"; echo "<img src="../images/notok.gif" alt="x"/> "; echo "You are Banned "; $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM mw_penalties WHERE uid='".$uid."' AND penalty='1'")); $remain = $banto[0]- time(); $rmsg = gettimemsg($remain); echo "Time to finish your penalty: $rmsg

"; //echo "<a href="index.php">Login</a>"; echo " "; exit(); }

if($action=="main") { addonline(getuid_sid($sid),"user gallery","");

echo " "; echo "Send your photos to gallery@mwmobile.ws with username and password "; echo "Your pictures will be added within 2 days after being sent!"; echo "

";

$males = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM mw_gallery WHERE sex='M'")); echo "<a href="gallery.php?action=male&sid=$sid"><img src="../images/male.gif" alt=""/>Male Gallery($males[0]) "; echo " "; $females = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM mw_gallery WHERE sex='F'")); echo "<a href="gallery.php?action=female&sid=$sid"><img src="../images/female.gif" alt=""/>Female Gallery($females[0]) "; echo " "; echo "<a href="gallery.php?action=gallery&sid=$sid">+ Upload Photo</a>"; echo "

"; echo "<a href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt="*"/>"; echo "Home</a>"; echo " ";

} else if($action=="gallery") { addonline(getuid_sid($sid),"Adding Photo","");

echo " "; echo "If you have a url to ur photo u may add it to the gallery below Please note that only .jpeg/.jpg files will show in gallery. All other file formats will be removed my staff

"; echo "<form action="genproc.php?action=addgal&sid=$sid" method="post">";
echo "Image URL: <input name="itemurl" type="text" value="http://"/> "; echo " <input type="submit" value="Add Photo"/>"; echo "</form>";

echo "

"; echo "<a href="gallery.php?action=main&sid=$sid">User Gallery</a> "; echo "<a href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt="*"/>"; echo "Home</a>"; echo " ";

} else if($action=="male") { addonline(getuid_sid($sid),"Viewing Male Gallery","");

$uid = getuid_sid($sid);

//////ALL gallery SCRIPT <<

if($page=="" || $page<=0)$page=1;

if($who!="")
{
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM mw_gallery WHERE sex='M'"));
}else{
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM mw_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 mw_gallery WHERE sex='M' ORDER BY uid ASC LIMIT $limit_start, $items_per_page";

echo "

"; $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 mw_gallery WHERE uid='".$who."'")); $lnk = "<a href="gallery.php?action=viewuser&who=$who&sid=$sid">$user($countpics[0])</a> "; echo "$lnk"; } }

echo "

"; echo " "; if($page>1) { $ppage = $page-1; echo "<a href="gallery.php?action=$action&page=$ppage&sid=$sid">«PREV</a> "; } if($page<$num_pages) { $npage = $page+1; echo "<a href="gallery.php?action=$action&page=$npage&sid=$sid">Next»</a>"; } echo " $page/$num_pages "; if($num_pages>2) { $rets = "<form action="gallery.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="gallery.php?action=main&sid=$sid">User Gallery</a> "; echo "<a href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt="*"/>"; echo "Home</a>"; echo " ";

} else if($action=="female") { addonline(getuid_sid($sid),"Viewing Female Gallery","");

$uid = getuid_sid($sid);

//////ALL gallery SCRIPT <<

if($page=="" || $page<=0)$page=1;
if($who!="")
{
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM mw_gallery WHERE sex='F'"));
}else{
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT uid) FROM mw_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 mw_gallery WHERE sex='F' ORDER BY uid ASC LIMIT $limit_start, $items_per_page";

echo "

"; $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 mw_gallery WHERE uid='".$who."'")); $lnk = "<a href="gallery.php?action=viewuser&who=$who&sid=$sid">$user($countpics[0])</a> ";

echo "$lnk";

}
}else{

echo "female gallery is empty"; } echo " "; echo " "; if($page>1) { $ppage = $page-1; echo "<a href="gallery.php?action=$action&page=$ppage&sid=$sid">«PREV</a> "; } if($page<$num_pages) { $npage = $page+1; echo "<a href="gallery.php?action=$action&page=$npage&sid=$sid">Next»</a>"; } echo " $page/$num_pages "; if($num_pages>2) { $rets = "<form action="gallery.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="gallery.php?action=main&sid=$sid">User Gallery</a> "; echo "<a href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt="*"/>"; echo "Home</a>"; echo " ";

} else if($action=="viewuser") { $who = $_GET["who"]; addonline(getuid_sid($sid),"Viewing user Photos","");

$uid = getuid_sid($sid);

//////ALL gallery SCRIPT <<

if($page=="" || $page<=0)$page=1;
if($who!="")
{
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM mw_gallery WHERE uid='".$who."'"));
}else{
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM mw_gallery"));
}
$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;

if($who!="")
{
	$sql = "SELECT id, sex, itemurl FROM mw_gallery WHERE uid='".$who."' ORDER BY id DESC LIMIT $limit_start, $items_per_page";
	}else{

$sql = "SELECT id, sex, itemurl, uid FROM mw_gallery ORDER BY id DESC LIMIT $limit_start, $items_per_page"; }

echo " "; $items = mysql_query($sql); echo mysql_error(); if(mysql_num_rows($items)>0) { while ($item = mysql_fetch_array($items)) { $id = $item[0]; $img = $item[2];

	$lnk = "<img src=\"$img\" alt=\"$id\"/>

"; $rinfo = mysql_fetch_array(mysql_query("SELECT COUNT() as nofr, SUM(prate) as nofp FROM mw_prate WHERE pid='".$id."'")); $counts = mysql_fetch_array(mysql_query("SELECT COUNT() FROM mw_prate WHERE pid='".$id."'")); if($counts[0]>0) { $ther = $rinfo[1]/$rinfo[0]; $rating = "Rating: $ther/$rinfo[1] (votes($counts[0])) "; }else{ $rating = ""; }

	 $gall = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM mw_galcomments WHERE pid='".$id."'"));

$me = getuid_sid($sid); if($who=="$me") { $use = "<a href="genproc.php?action=useav&sid=$sid&gid=$item[0]">Use as Avatar</a> | "; }else{ $use = ""; } if(candelgal($uid, $item[0])) { $delnk = "<a href="genproc.php?action=delgal&sid=$sid&gid=$item[0]">Remove Photo</a>"; }else{ $delnk = ""; } echo "$lnk$rating<a href="$img">Download Photo</a> $use$delnk <a href="gallery.php?who=$who&action=comments&sid=$sid&gid=$item[0]">Comments($gall[0])</a> ";

}
}
echo "

"; echo " "; if($page>1) { $ppage = $page-1; echo "<a href="gallery.php?action=$action&page=$ppage&sid=$sid&who=$who">«PREV</a> "; } if($page<$num_pages) { $npage = $page+1; echo "<a href="gallery.php?action=$action&page=$npage&sid=$sid&who=$who">Next»</a>"; } echo " $page/$num_pages "; if($num_pages>2) { $rets = "<form action="gallery.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 .= "</form>";

	echo $rets;
}

echo "<a href="gallery.php?action=main&sid=$sid">User Gallery</a> "; echo "<a href="index.php?action=main&sid=$sid">Home</a>";

echo "

";

} else if($action=="comments") { $who = $_GET["who"]; $gid = $_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 mw_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 mw_galcomments WHERE pid='".$gid."' ORDER BY id DESC LIMIT $limit_start, $items_per_page";

echo "

"; $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 ";

$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 "; echo "$bs"; echo " "; echo "";

}
}
echo "

"; echo " "; if($page>1) { $ppage = $page-1; echo "<a href="gallery.php?action=$action&page=$ppage&sid=$sid&who=$who&gid=$gid">«PREV</a> "; } if($page<$num_pages) { $npage = $page+1; echo "<a href="gallery.php?action=$action&page=$npage&sid=$sid&who=$who&gid=$gid">Next»</a>"; } echo " $page/$num_pages "; if($num_pages>2) { $rets = "<form action="gallery.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 "

"; ////// UNTILL HERE >> echo " "; $me = getuid_sid($sid); if($me!="$who") { echo "<a href="gallery.php?action=addcomment&sid=$sid&who=$who&gid=$gid">Add Comment</a> "; } echo "<a href="gallery.php?action=main&sid=$sid">User Gallery</a> "; echo "<a href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt="*"/>"; echo "Home</a>"; echo " ";

} else if($action=="addcomment") { $who = $_GET["who"]; $gid = $_GET["gid"]; addonline(getuid_sid($sid),"Adding Photo Comments","");

$uid = getuid_sid($sid);
$sql = "SELECT itemurl FROM mw_gallery  WHERE id='".$gid."'";

echo " "; $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=\"$img\" alt=\"$id\"/>

";

  echo "$lnk";

echo "<form action="genproc.php?action=commentadd&sid=$sid&gid=$gid" method="post">";

$vb = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM mw_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> ";

}else{ $rinfo = mysql_fetch_array(mysql_query("SELECT COUNT() as nofr, SUM(prate) as nofp FROM mw_prate WHERE pid='".$gid."'")); $counts = mysql_fetch_array(mysql_query("SELECT COUNT() FROM mw_prate WHERE pid='".$gid."'")); if($counts[0]>0) { $ther = $rinfo[1]/$rinfo[0]; $rating = "Rating: $ther/$rinfo[1] (votes($counts[0])) "; }else{ $rating = ""; } echo "$rating"; }

echo "Comment: "; echo "<input type="text" maxlength="150" name="text"/> "; echo "<input type="submit" value="Add"/>"; echo "</form>"; } } echo "<a href="gallery.php?action=main&sid=$sid">User Gallery</a> ";

echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";

echo "Home</a>"; echo " ";

}else{ addonline(getuid_sid($sid),"Lost in user gallery lol","");

echo " "; echo "I don't know how did you get into here, but there's nothing to show

"; echo "<a href="gallery.php?action=main&sid=$sid">User Gallery</a> "; echo "<a href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt="*"/>"; echo "Home</a>"; echo " "; }

echo "</body>";
echo "</html>";

?>

learner Lead · 587 posts #4

cheers bros its working after max removed is there i way setting size i rty big pic and it show big how do i set it a normal size for everyone? 🍬 i put the height and width code on top but no work. 1 question is this script hacker proof? 😛

Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

BEST MOBILE ADVERTISER

External image (may be gone)

busterkeaton10 Developer · 68 posts #5

cheers bros its working after max removed is there i way setting size i rty big pic and it show big how do i set it a normal size for everyone? 🍬 i put the height and width code on top but no work. 1 question is this script hacker proof? 😛

max.php only works on jpeg extension... other images like .gif will not show if you use max.php on it...

<?php
$height= 100;
$width= 100;
// Content type
header('Content-type: image/jpeg');
if(!$filename)
$filename="./images/nopic.jpg";
// Get new dimensions
list($width_orig, $height_orig) = getimagesize($filename);

if ($width && ($width_orig < $height_orig)) {
$width = ($height / $height_orig) * $width_orig;
} else {
$height = ($width / $width_orig) * $height_orig;
}

// Resample
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);

// Output
imagejpeg($image_p, null, 100);
ImageDestroy ($image_p);
?>
busterkeaton10 Developer · 68 posts #8

the so called max.php help you smaller resized thumbnail of mime JPEG type as it was removed this coding will show the real image size which is really bad.I coded an image resizer for jpg,png,gif,bmp image FOR ME

its probably the one that wizards max.php.. but i didnt use it!

if you want to share you can post it here bro! so we can see it if yours is working... 😉 😉

learner Lead · 587 posts #10

I DID LIKE

<?php
$height= 100;
$width= 100;
// Content type
header('Content-type: image/jpeg, image/gif, image/png, image/jpg,');
if(!$filename)
$filename="./images/nopic.jpg";
// Get new dimensions
list($width_orig, $height_orig) = getimagesize($filename);

if ($width && ($width_orig < $height_orig)) {
$width = ($height / $height_orig) * $width_orig;
} else {
$height = ($width / $width_orig) * $height_orig;
}

// Resample
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);

// Output
imagejpeg($image_p, null, 100);
ImageDestroy ($image_p);
?>

but not work 🙁

Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

BEST MOBILE ADVERTISER

External image (may be gone)

sweetangel Lead · 885 posts #16

add this:

// Output imagejpeg($image_p, null, 100); //if is jpg ImageDestroy ($image_p);

imagegif($image_p, null, 100); //if is gif imagepng($image_p, null, 100); //if is png imagewbmp($image_p, null, 100); //if is wbmp

with this change contenet type..

with this: header('Content-type: image/jpeg, image/gif, image/png, image/jpg.');

and now work 😉

GooD

if like my post click:

External image (may be gone)

sweetangel Lead · 885 posts #17

NewMax.php

<?php
$height= 100;
$width= 100;
// Content type
header('Content-type: image/jpeg, image/gif, image/png, image/jpg.');
if(!$filename)
$filename="./images/nopic.jpg";
// Get new dimensions
list($width_orig, $height_orig) = getimagesize($filename);

if ($width && ($width_orig < $height_orig)) {
$width = ($height / $height_orig) * $width_orig;
} else {
$height = ($width / $width_orig) * $height_orig;
}

// Resample
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);

// Output
imagejpeg($image_p, null, 100);
imagegif($image_p, null, 100);
imagepng($image_p, null, 100);
imagewbmp($image_p, null, 100);
ImageDestroy ($image_p);
?>

if like my post click:

External image (may be gone)

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