Jump to content
MakeWebGames

Easy fix?


JamesRage
 Share

Recommended Posts

Hey guys, I've really wanted a mod which was made by Richard, its his user images mod, but as you know the forum used to mess codes back then and it really interferes when using it in your game, I'm running on Mccodes V2.0.5b and really wanted someone to post a copy which isn't messed due to the forum system:

Here is the code guys:

 

CREATE TABLE `userimages` (
**`imgID` int(11) NOT NULL auto_increment,
**`imgUSER` int(11) NOT NULL,
**`imgURL` varchar(255) NOT NULL,
**PRIMARY KEY* (`imgID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1

 

Error I get with SQL: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '**`imgID` int(11) NOT NULL auto_increment, **`imgUSER` int(11) NOT NULL, **`im' at line 2

userimages.php

 

<?php
include "globals.php";
print "<center><font size='4' face='Arial, Helvetica, sans-serif'>User images</font>
<hr width=90%>";
switch($_GET['action'])
{
case 'view':
view_image();
break;
*
default:
user_images();
break;
}
function user_images()
{
global $db,$ir,$c,$userid,$h;
$_GET['delete'] = abs((int) $_GET['delete']);
if($_GET['delete'])
{
$db->query("DELETE FROM userimages WHERE imgID={$_GET['delete']} AND imgUSER=$userid");
print "
Image deleted from gallery.
*
<hr width=90%>";
}
$_GET['set'] = abs((int) $_GET['set']);
if($_GET['set'])
{
$image=$db->query("SELECT * FROM userimages WHERE imgID={$_GET['set']}",$c);
$imgs=$db->fetch_row($image);
$db->query("UPDATE users SET display_pic='{$imgs['imgURL']}' WHERE userid=$userid");
print "
New display image set.
*
<hr width=90%>";
}
$_GET['XID'] = abs((int) $_GET['XID']);
if(!$_GET['XID'])
{
print "No userID submitted<hr width=90%>> <a href="http://explore.php" target="_blank">Back to city</a><hr width=90%>";
}
else
{
$q=$db->query("SELECT * FROM userimages WHERE imgUSER={$_GET['XID']}",$c);
$x=$db->query("SELECT * FROM users WHERE userid={$_GET['XID']}",$c);
$y=$db->fetch_row($x);
if($db->num_rows($x) == 0)
{
die ("
There is no user with this ID.
*
<hr width=90%>> <a href="http://explore.php" target="_blank">Back to city</a><hr width=90%>");
}
print "<b>{$y['username']}'s uploaded images</b>
*
";
if($db->num_rows($q) == 0)
{
print "<table width=90% bgcolor=#DFDFDF><tr><td><center>This user has no uploaded images</center></td></tr></table><hr width=90%>> <a href="http://viewuser.php?u={$y[" target="_blank">Back to profile</a><hr width=90%>";
}
else
{
print "<table width=90% bgcolor=#DFDFDF cellpadding='3'><tr>";
while($r=$db->fetch_row($q))
{
$br++;
if ($br == 3)
{
$div="</tr><tr>";
$br=0;
}
else
{
$div="";
}
$cn++;
print "<td align='center'><b>#$cn Profile image</b>
*
<a href="http://userimages.php?action=view&ID={$r[" target="_blank">[img={$r[]</a>";
if($_GET['XID'] == $userid)
{
print "
[<a href="http://userimages.php?XID={$r[" target="_blank">Delete</a>]
*
[<a href="http://userimages.php?XID={$r[" target="_blank">Set Image</a>]";
}
print "
*
</td>";
print "$div";
}
print "</tr></table>
<hr width=90%>> <a href="http://viewuser.php?u={$y[" target="_blank">Back to profile</a><hr width=90%>";
}
}
}
function view_image()
{
global $db,$ir,$c,$userid,$h;
$_GET['ID'] = abs((int) $_GET['ID']);
$e=$db->query("SELECT * FROM userimages WHERE imgID={$_GET['ID']}",$c);
$gh=$db->fetch_row($e);
print "[img={$gh[]
*
<hr width=90%>> <a href="http://userimages.php?XID={$gh[" target="_blank">Back to images</a><hr width=90%>";
}
$h->endpage();
?>

 

Error: Links (target blank the "http://" addon etc), and bb image tags mess up with the code and other errors, if you can fix anyone please do, urgently needed. :(

Preferences edit:

 

function pic_change()
{
global $db,$ir,$c,$userid,$h;
print "<center><b>Upload your images here</b>
*
<font color='red'><b>Do not upload any offensive material, please keep it PG13 or your user may be at risk.
*
Uploaded images are only to be used for {$set['game_name']} material.</b></font>
*
150x200 Maximum image width and height, any images exceeding this will be resized.
Try to use only GIF, JPG and PNG formats.<form action='preferences.php?action=picchange2' method='post'>
New Pic: <input type='text' name='newpic' />
*
<input type='submit' value='Upload Image' /></form><hr width=75%>> <a href="http://preferences.php" target="_blank">Back</a><hr width=75%>";
}
function do_pic_change()
{
global $db,$ir,$c,$userid,$h;
print "<center>";
if($_POST['newpic'] == "")
{
print "
You did not type a new image location.
*
*
<hr width=75%>> <a href="http://preferences.php?action=picchange" target="_blank">Back</a><hr width=75%>";
}
else
{
$_POST['newpic']=str_replace('\\\'',''', $_POST['newpic']);
$db->query("UPDATE users SET display_pic='{$_POST['newpic']}' WHERE userid=$userid",$c);
$db->query("INSERT INTO userimages VALUES('',$userid,'{$_POST['newpic']}');",$c);
print "
Image Changed.
*
*
<hr width=75%>> <a href="http://preferences.php?action=picchange" target="_blank">Back</a><hr width=75%>";
}
}

 

In viewuser.php, add below display pic:

 

$pics=$db->query("SELECT * FROM userimages WHERE imgUSER={$r['userid']}", $c);
$pc=$db->num_rows($pics);
print "
[<a href="http://userimages.php?XID={$r[" target="_blank">$pc uploaded images</a>]
";

 

Thanks guys! (:

Edited by JamesRage
Link to comment
Share on other sites

Thanks AnonymousUser, but I still get an error when submitting the SQL: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* (`imgID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1' at line 5

Thanks for trying again. :(

Link to comment
Share on other sites

try this...

<?php
include "globals.php";
print "<center><font size='4' face='Arial, Helvetica, sans-serif'>User images</font>
<hr width=90%>";
switch($_GET['action'])
{
case 'view':
view_image();
break;
default:
user_images();
break;
}
function user_images()
{
global $db,$ir,$c,$userid,$h;
$_GET['delete'] = abs((int) $_GET['delete']);
if($_GET['delete'])
{
$db->query("DELETE FROM userimages WHERE imgID={$_GET['delete']} AND imgUSER=$userid");
print "
Image deleted from gallery.
<hr width=90%>";
}
$_GET['set'] = abs((int) $_GET['set']);
if($_GET['set'])
{
$image=$db->query("SELECT * FROM userimages WHERE imgID={$_GET['set']}",$c);
$imgs=$db->fetch_row($image);
$db->query("UPDATE users SET display_pic='{$imgs['imgURL']}' WHERE userid=$userid");
print "
New display image set.
<hr width=90%>";
}
$_GET['XID'] = abs((int) $_GET['XID']);
if(!$_GET['XID'])
{
print "No userID submitted<hr width=90%>> <a href='explore.php'>Back to city</a><hr width=90%>";
}
else
{
$q=$db->query("SELECT * FROM userimages WHERE imgUSER={$_GET['XID']}",$c);
$x=$db->query("SELECT * FROM users WHERE userid={$_GET['XID']}",$c);
$y=$db->fetch_row($x);
if($db->num_rows($x) == 0)
{
die ("
There is no user with this ID.
<hr width=90%>> <a href='explore.php'>Back to city</a><hr width=90%>");
}
print "<b>{$y['userid']}'username']}'s uploaded images</b>
";
if($db->num_rows($q) == 0)
{
print "<table width=90% bgcolor=#DFDFDF><tr><td><center>This user has no uploaded images</center></td></tr></table><hr width=90%>> <a href='viewuser.php?u={$y['userid']}'userid']}>Back to profile</a><hr width=90%>";
}
else
{
print "<table width=90% bgcolor=#DFDFDF cellpadding='3'><tr>";
while($r=$db->fetch_row($q))
{
$br++;
if ($br == 3)
{
$div="</tr><tr>";
$br=0;
}
else
{
$div="";
}
$cn++;
print "<td align='center'><b>#$cn Profile image</b>
<a href='userimages.php?action=view&ID={$r['userid']}'>[img]{$r['userid']}/img]</a>";
if($_GET['XID'] == $userid)
{
print "
[<a href='userimages.php?XID={$r['userid']}'>Delete</a>]
[<a href='userimages.php?XID={$r['userid']}'>Set Image</a>]";
}
print "
</td>";
print "$div";
}
print "</tr></table>
<hr width=90%>> <a href='viewuser.php?u={$y['userid']}'>Back to profile</a><hr width=90%>";
}
}
}
function view_image()
{
global $db,$ir,$c,$userid,$h;
$_GET['ID'] = abs((int) $_GET['ID']);
$e=$db->query("SELECT * FROM userimages WHERE imgID={$_GET['ID']}",$c);
$gh=$db->fetch_row($e);
print "[img='.$gh.']
<hr width=90%>> <a href="userimages.php?XID='.$gh.'">Back to images</a><hr width=90%>";
}
$h->endpage();
?>
Link to comment
Share on other sites

try this...
<?php
include "globals.php";
print "<center><font size='4' face='Arial, Helvetica, sans-serif'>User images</font>
<hr width=90%>";
switch($_GET['action'])
{
case 'view':
view_image();
break;
default:
user_images();
break;
}
function user_images()
{
global $db,$ir,$c,$userid,$h;
$_GET['delete'] = abs((int) $_GET['delete']);
if($_GET['delete'])
{
$db->query("DELETE FROM userimages WHERE imgID={$_GET['delete']} AND imgUSER=$userid");
print "
Image deleted from gallery.
<hr width=90%>";
}
$_GET['set'] = abs((int) $_GET['set']);
if($_GET['set'])
{
$image=$db->query("SELECT * FROM userimages WHERE imgID={$_GET['set']}",$c);
$imgs=$db->fetch_row($image);
$db->query("UPDATE users SET display_pic='{$imgs['imgURL']}' WHERE userid=$userid");
print "
New display image set.
<hr width=90%>";
}
$_GET['XID'] = abs((int) $_GET['XID']);
if(!$_GET['XID'])
{
print "No userID submitted<hr width=90%>> <a href='explore.php'>Back to city</a><hr width=90%>";
}
else
{
$q=$db->query("SELECT * FROM userimages WHERE imgUSER={$_GET['XID']}",$c);
$x=$db->query("SELECT * FROM users WHERE userid={$_GET['XID']}",$c);
$y=$db->fetch_row($x);
if($db->num_rows($x) == 0)
{
die ("
There is no user with this ID.
<hr width=90%>> <a href='explore.php'>Back to city</a><hr width=90%>");
}
print "<b>{$y['userid']}'username']}'s uploaded images</b>
";
if($db->num_rows($q) == 0)
{
print "<table width=90% bgcolor=#DFDFDF><tr><td><center>This user has no uploaded images</center></td></tr></table><hr width=90%>> <a href='viewuser.php?u={$y['userid']}'userid']}>Back to profile</a><hr width=90%>";
}
else
{
print "<table width=90% bgcolor=#DFDFDF cellpadding='3'><tr>";
while($r=$db->fetch_row($q))
{
$br++;
if ($br == 3)
{
$div="</tr><tr>";
$br=0;
}
else
{
$div="";
}
$cn++;
print "<td align='center'><b>#$cn Profile image</b>
<a href='userimages.php?action=view&ID={$r['userid']}'>[img]{$r['userid']}/img]</a>";
if($_GET['XID'] == $userid)
{
print "
[<a href='userimages.php?XID={$r['userid']}'>Delete</a>]
[<a href='userimages.php?XID={$r['userid']}'>Set Image</a>]";
}
print "
</td>";
print "$div";
}
print "</tr></table>
<hr width=90%>> <a href='viewuser.php?u={$y['userid']}'>Back to profile</a><hr width=90%>";
}
}
}
function view_image()
{
global $db,$ir,$c,$userid,$h;
$_GET['ID'] = abs((int) $_GET['ID']);
$e=$db->query("SELECT * FROM userimages WHERE imgID={$_GET['ID']}",$c);
$gh=$db->fetch_row($e);
print "[img='.$gh.']
<hr width=90%>> <a href="userimages.php?XID='.$gh.'">Back to images</a><hr width=90%>";
}
$h->endpage();
?>

Line 51. - For sure, an error will be thrown.

Line 74. - BBCode is still there.

Line 96. - BBCode is still there.

Line 83 - You don't need quotes.

@AnonymousUser I'd paste your edits on Pastebin or other-like sites.

Link to comment
Share on other sites

Totally different things.

Pastebin will store the code, and parse it 'correctly', less chance of it bugging, like using the php tags on here.

lmfao not regular notepad, i meant notepad++ which does the same thing, i was just simply fixing up the forum xfer bugs whatever else is in there is not me its the author :D

Link to comment
Share on other sites

try this...
<?php
include "globals.php";
print "<center><font size='4' face='Arial, Helvetica, sans-serif'>User images</font>
<hr width=90%>";
switch($_GET['action'])
{
case 'view':
view_image();
break;
default:
user_images();
break;
}
function user_images()
{
global $db,$ir,$c,$userid,$h;
$_GET['delete'] = abs((int) $_GET['delete']);
if($_GET['delete'])
{
$db->query("DELETE FROM userimages WHERE imgID={$_GET['delete']} AND imgUSER=$userid");
print "
Image deleted from gallery.
<hr width=90%>";
}
$_GET['set'] = abs((int) $_GET['set']);
if($_GET['set'])
{
$image=$db->query("SELECT * FROM userimages WHERE imgID={$_GET['set']}",$c);
$imgs=$db->fetch_row($image);
$db->query("UPDATE users SET display_pic='{$imgs['imgURL']}' WHERE userid=$userid");
print "
New display image set.
<hr width=90%>";
}
$_GET['XID'] = abs((int) $_GET['XID']);
if(!$_GET['XID'])
{
print "No userID submitted<hr width=90%>> <a href='explore.php'>Back to city</a><hr width=90%>";
}
else
{
$q=$db->query("SELECT * FROM userimages WHERE imgUSER={$_GET['XID']}",$c);
$x=$db->query("SELECT * FROM users WHERE userid={$_GET['XID']}",$c);
$y=$db->fetch_row($x);
if($db->num_rows($x) == 0)
{
die ("
There is no user with this ID.
<hr width=90%>> <a href='explore.php'>Back to city</a><hr width=90%>");
}
print "<b>{$y['userid']}'username']}'s uploaded images</b>
";
if($db->num_rows($q) == 0)
{
print "<table width=90% bgcolor=#DFDFDF><tr><td><center>This user has no uploaded images</center></td></tr></table><hr width=90%>> <a href='viewuser.php?u={$y['userid']}'userid']}>Back to profile</a><hr width=90%>";
}
else
{
print "<table width=90% bgcolor=#DFDFDF cellpadding='3'><tr>";
while($r=$db->fetch_row($q))
{
$br++;
if ($br == 3)
{
$div="</tr><tr>";
$br=0;
}
else
{
$div="";
}
$cn++;
print "<td align='center'><b>#$cn Profile image</b>
<a href='userimages.php?action=view&ID={$r['userid']}'>[img]{$r['userid']}/img]</a>";
if($_GET['XID'] == $userid)
{
print "
[<a href='userimages.php?XID={$r['userid']}'>Delete</a>]
[<a href='userimages.php?XID={$r['userid']}'>Set Image</a>]";
}
print "
</td>";
print "$div";
}
print "</tr></table>
<hr width=90%>> <a href='viewuser.php?u={$y['userid']}'>Back to profile</a><hr width=90%>";
}
}
}
function view_image()
{
global $db,$ir,$c,$userid,$h;
$_GET['ID'] = abs((int) $_GET['ID']);
$e=$db->query("SELECT * FROM userimages WHERE imgID={$_GET['ID']}",$c);
$gh=$db->fetch_row($e);
print "[img='.$gh.']
<hr width=90%>> <a href="userimages.php?XID='.$gh.'">Back to images</a><hr width=90%>";
}
$h->endpage();
?>

Hey bud, get a error on line 97: Parse error: syntax error, unexpected T_STRING in /home/shahcp1/public_html/userimages.php on line 97 (:

Link to comment
Share on other sites

Hey bud, get a error on line 97: Parse error: syntax error, unexpected T_STRING in /home/shahcp1/public_html/userimages.php on line 97 (:

its not hard to figure it out, if i keep fixing these little minor things how will you learn?, change '.$gh.' to {$gh}

these are common errors and i would suggest a little trial and error before asking ;) at least show you want help and not just someone who will do free work :/

Link to comment
Share on other sites

Okay guys, heres what I managed to edit (removed BBcodes, and edit line 97 needed to take " from the link, but I a query error: InfamousWars - Critical Error

A critical error has occurred, and this page cannot be displayed. Please try again later.

Query failed

 

<?php
include "globals.php";
print "<center><font size='4' face='Arial, Helvetica, sans-serif'>User images</font>
<hr width=90%>";
switch($_GET['action'])
{
case 'view':
view_image();
break;
default:
user_images();
break;
}
function user_images()
{
global $db,$ir,$c,$userid,$h;
$_GET['delete'] = abs((int) $_GET['delete']);
if($_GET['delete'])
{
$db->query("DELETE FROM userimages WHERE imgID={$_GET['delete']} AND imgUSER=$userid");
print "
Image deleted from gallery.
<hr width=90%>";
}
$_GET['set'] = abs((int) $_GET['set']);
if($_GET['set'])
{
$image=$db->query("SELECT * FROM userimages WHERE imgID={$_GET['set']}",$c);
$imgs=$db->fetch_row($image);
$db->query("UPDATE users SET display_pic='{$imgs['imgURL']}' WHERE userid=$userid");
print "
New display image set.
<hr width=90%>";
}
$_GET['XID'] = abs((int) $_GET['XID']);
if(!$_GET['XID'])
{
print "No userID submitted<hr width=90%>> <a href='explore.php'>Back to city</a><hr width=90%>";
}
else
{
$q=$db->query("SELECT * FROM userimages WHERE imgUSER={$_GET['XID']}",$c);
$x=$db->query("SELECT * FROM users WHERE userid={$_GET['XID']}",$c);
$y=$db->fetch_row($x);
if($db->num_rows($x) == 0)
{
die ("
There is no user with this ID.
<hr width=90%>> <a href='explore.php'>Back to city</a><hr width=90%>");
}
print "<b>{$y['userid']}'username']}'s uploaded images</b>
";
if($db->num_rows($q) == 0)
{
print "<table width=90% bgcolor=#DFDFDF><tr><td><center>This user has no uploaded images</center></td></tr></table><hr width=90%>> <a href='viewuser.php?u={$y['userid']}'userid']}>Back to profile</a><hr width=90%>";
}
else
{
print "<table width=90% bgcolor=#DFDFDF cellpadding='3'><tr>";
while($r=$db->fetch_row($q))
{
$br++;
if ($br == 3)
{
$div="</tr><tr>";
$br=0;
}
else
{
$div="";
}
$cn++;
print "<td align='center'><b>#$cn Profile image</b>
<a href='userimages.php?action=view&ID={$r['userid']}'><img src={$r['userid']} /></a>";
if($_GET['XID'] == $userid)
{
print "
[<a href='userimages.php?XID={$r['userid']}'>Delete</a>]
[<a href='userimages.php?XID={$r['userid']}'>Set Image</a>]";
}
print "
</td>";
print "$div";
}
print "</tr></table>
<hr width=90%>> <a href='viewuser.php?u={$y['userid']}'>Back to profile</a><hr width=90%>";
}
}
}
function view_image()
{
global $db,$ir,$c,$userid,$h;
$_GET['ID'] = abs((int) $_GET['ID']);
$e=$db->query("SELECT * FROM userimages WHERE imgID={$_GET['ID']}",$c);
$gh=$db->fetch_row($e);
print "<img src='.$gh.' />
<hr width=90%>> <a href=userimages.php?XID='.$gh.'>Back to images</a><hr width=90%>";
}
$h->endpage();
?>

 

Any suggestions guys? :)

Link to comment
Share on other sites

  • 4 months later...

Tested for parse errors only

Provided there are no more errors. This code has been completely fixed, and a little security has been put in place, alongside preventing E_WARNING | E_NOTICE errors ^.^

<?php
include "globals.php";
?><center><font size='4' face='Arial, Helvetica, sans-serif'>User images</font>
<hr width='90%'><?php
$_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : null;
switch($_GET['action']) {
case 'view': view_image(); break;
default: user_images(); break;
}

function user_images() {
global $db, $ir, $h;
$_GET['delete'] = isset($_GET['delete']) && ctype_digit($_GET['delete']) ? abs(@intval($_GET['delete'])) : null;
if(!empty($_GET['delete'])) {
	$select = $db->query(sprintf("SELECT `imgID` FROM `userimages` WHERE ((`imgUSER` = %u) AND (`imgID` = %u))", $ir['userid'], $_GET['delete']));
	if(!$db->num_rows($select)) {
		echo "Either that image doesn't exist, or it's not yours";
		$h->endpage();
		exit;
	}
	$db->query(sprintf("DELETE FROM `userimages` WHERE (`imgID` = %u)", $_GET['delete']));
	echo "Image deleted from gallery.<hr width='90%'>";
}
$_GET['set'] = isset($_GET['set']) && ctype_digit($_GET['set']) ? abs(@intval($_GET['set'])) : null;
if(!empty($_GET['set'])) {
	$image = $db->query(sprintf("SELECT `imgURL` FROM `userimages` WHERE ((`imgID` = %u) AND (`imgUSER` = %u))", $ir['userid'], $_GET['set']));
	if(!$db->num_rows($image)) {
		echo "Either that image doesn't exist, or it's not yours";
		$h->endpage();
		exit;
	}
	$db->query(sprintf("UPDATE `users` SET `display_pic` = '%s' WHERE (`userid` = %u)", $db->fetch_single($image), $ir['userid']));
	echo "New display image set.<hr width='90%'>";
}
$_GET['XID'] = isset($_GET['XID']) && ctype_digit($_GET['XID']) ? abs(@intval($_GET['XID'])) : null;
if(empty($_GET['XID'])) {
	echo "No user submitted<hr width='90%'>> <a href='explore.php'>Back to city</a><hr width='90%'>";
	$h->endpage();
	exit;
}
$select = $db->query(sprintf("SELECT `ui`.`imgUSER`, `u`.`username` " .
								"FROM `userimages` AS `ui` " .
								"LEFT JOIN `users` AS `u` ON (`ui`.`imgUSER` = `u`.`userid`) " .
								"WHERE (`ui`.`imgUSER` = %u) ", $_GET['XID']));
if(!$db->num_rows($select)) {
	echo "Either that player doesn't exist, or they haven't uploaded any images";
	$h->endpage();
	exit;
}
$player = $db->fetch_row($select);
echo "<strong>",stripslashes(htmlspecialchars($player['username'])),"'s uploaded images</strong>";
if(!$db->num_rows($q)) {
	?><table width='90%' bgcolor=#DFDFDF><tr><td><center>This user has no uploaded images</center></td></tr></table><hr width='90%'>> <a href='viewuser.php?u=<?php echo $y['userid']; ?>'>Back to profile</a><hr width='90%'><?php
	$h->endpage();
	exit;
}
echo "<table width='90%' bgcolor=#DFDFDF cellpadding='3'><tr>";
$br = 0; $cn = 0; $div = '';
while($row = $db->fetch_row($select)) {
	if($br == 3) { $div = "</tr><tr>"; $br* = 0; }
	echo "<td align='center'><strong>#$cn Profile image</strong><a href='userimages.php?action=view&ID=",$row['imgUSER'],"'>View</a>";
	if($_GET['XID'] == $ir['userid']) {
		echo "[<a href='userimages.php?XID=",$row['imgUSER'],"'>Delete</a>] [<a href='userimages.php?XID=",$row['imgUSER'],"'>Set Image</a>]";
	}
	echo "</td>",$div;
	++$br;
	++$cn;
}
echo "</tr></table><hr width='90%'>> <a href='viewuser.php?u=",$player['imgUSER'],"'>Back to profile</a><hr width='90%'>";
}
function view_image() {
global $db, $ir, $h;
$_GET['ID'] = isset($_GET['ID']) && ctype_digit($_GET['ID']) ? abs(@intval($_GET['ID'])) : null;
$e = $db->query(sprintf("SELECT `imgURL` FROM `userimages` WHERE (`imgID` = %u)", $_GET['ID']));
if(!$db->num_rows($e)) {
	echo "Either that player doesn't exist, or they have no images";
	$h->endpage();
	exit;
}
echo "<img src=",stripslashes($db->fetch_single($e))," /><hr width='90%'>> <a href='userimages.php?XID=",$_GET['ID'],">Back to images</a><hr width='90%'>";
}

$h->endpage();
?>
Edited by Magictallguy
Marginal bug fixes - providing this forum doesn't screw it up ... again!
Link to comment
Share on other sites

Thanks bro, love you lol. I get an error here:

Parse error: syntax error, unexpected T_STRING, expecting T_CASE or T_DEFAULT or '}' in /home/chaosc52/public_html/userimages.php on line 7

I think the code works great, just the forum might be messing around with the code, you know my cpanel if you want to edit it bro, thanks again, I actually gave up on this mod. :)

Link to comment
Share on other sites

Thanks bro, love you lol. I get an error here:

Parse error: syntax error, unexpected T_STRING, expecting T_CASE or T_DEFAULT or '}' in /home/chaosc52/public_html/userimages.php on line 7

I think the code works great, just the forum might be messing around with the code, you know my cpanel if you want to edit it bro, thanks again, I actually gave up on this mod. :)

I have details to around 15 sites.. Which one was yours? :P

Edit: Nevermind, just noticed the file path

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...