Jump to content
MakeWebGames

Newspaper error


Bennyh789

Recommended Posts

Hi all after installing a free news paper mod from here I get the following error:

Parse error: syntax error, unexpected T_STRING in /home/murderco/public_html/newspaper6.php on line 8

 

This is the code:

<?php
include "globals.php";
*
print "<h3>Newspaper</h3>";
print "
<table width=90% cellspacing=1 class='table' border=2>
<tr>
<td class=h><center><a href="http://job.php" target="_blank"><font color='red'>YOUR JOB</font></a></td>
<td class=h><center><a href="http://gym.php" target="_blank"><font color='red'>LOCAL GYM</font></a></td>
<td class=h><center><a href="http://halloffame.php" target="_blank"><font color='red'>HALL OF FAME</font></a></td>
<td class=h><center><a href="http://gangcentral.php" target="_blank"><font color='red'>LOCAL GANGS</font></a></td>
<td class=h><center><a href="http://index.php" target="_blank"><font color='red'>MY HOUSE</font></a></td>
</tr>
<tr>
<td class=h><center><a href="http://userlist.php" target="_blank"><font color='red'>LOCAL RESIDENTS</font></a></td>
<td class=h><center><a href="http://stats.php" target="_blank"><font color='red'>CITY STATS</font></a></td>
<td class=h><center><a href="http://usersonline.php" target="_blank"><font color='red'>PEOPLE AWAKE</font></a></td>
<td class=h><center><a href="http://gangwars.php" target="_blank"><font color='red'>CURRENT WARS</font></a></td>
<td class=h><center><a href="http://estate.php" target="_blank"><font color='red'>HOUSES FOR SALE</font></a></td>
</tr>
<tr>
<td colspan=6>";
*
print "
*
<table width=90% cellspacing=1 class='table'><center><h3>Player Advertisements</h3><center> | <a href="http://newspaper.php?action=add" target="_blank"><b>Buy An Advertisement ($10,000)</b></a>";
if($ir['user_level'] > 1)
{
print " | <a href=newspaper.php?action=all><b>DELETE ALL</b></a>";
}
$anpdata=mysql_query("SELECT * FROM npaper");
$q=mysql_query("SELECT user_level FROM users WHERE userid=$userid");
$r=$db->fetch_row($q);
print "<marquee speed=2 direction=up onmouseover='this.stop()' onmouseout='this.start()' class='textbox'>";
*
while($npdata=$db->fetch_row($anpdata))
{
$us=mysql_query("SELECT username FROM users WHERE userid={$npdata['npADDER']}");
$us=$db->fetch_single($us);
$time=date('F j',$npdata['npTIME']);
print "
<hr>
<b>Ad By: <a href="http://viewuser.php?u={$npdata[" target="_blank"><font color=red>{$us}</font> [{$npdata['npADDER']}]</a> | Added On: {$time}</b>";
if($r['user_level'] != 1)
{
print " | <a href=newspaper.php?action=npID&npID={$npdata['npID']}><b>DELETE</b></a>";
}
print "
*
<i><u>{$npdata['npTITLE']}</i></u>
*
<i>{$npdata['npBODY']}</i>
*
*
";
}
print "<hr /></marquee>
</table>";
$q=mysql_query("SELECT user_level FROM users WHERE userid=$userid");
$r=$db->fetch_row($q);
if($r['user_level'] != 1)
{
if($_GET['action'] == "all")
{
if($r['user_level'] != 1)
{
mysql_query("TRUNCATE TABLE npaper");
print "Newspaper Ads All Cleared!
<META HTTP-EQUIV=Refresh CONTENT='1;url=newspaper.php'>";
}
}
else if($_GET['action'] == "npID")
{
if($r['user_level'] != 1)
{
mysql_query("DELETE FROM npaper WHERE npID={$_GET['npID']}");
print "News Paper Ad ID {$_GET['npID']} deleted!
<META HTTP-EQUIV=Refresh CONTENT='1;url=newspaper.php'>";
}
}
}
if($_GET['action'] == "add")
{
print "<h3>Add Advertisement ($10,000)</h3>
<form action='newspaper.php?action=added' method='post'>
Ad Title:*
<input type='text' name='npTITLE' class='textbox'>
*
Ad Body:*
<textarea rows=14 cols=65 name='npBODY' class='textbox'></textarea>
*
<input class='textbox' type='submit' value='Place Ad ($10,000)' />
</form>
<font color=red><b>WARNING:</b> Only plain text will work
Do not advertise other games
Follow the rules.";
}
*
if($_GET['action'] == "added")
{
if($ir['money']>9999)
{
print "Congratulations, you bought an ad for \$10,000!
";
mysql_query("UPDATE users SET money=money-10000 WHERE userid=$userid");
$title=str_replace(array("\n"),array("
"),strip_tags($_POST['npTITLE']));
$body=str_replace(array("\n"),array("
"),strip_tags($_POST['npBODY']));
$q=mysql_query("INSERT INTO `npaper` VALUES (NULL, '$userid', '$title', '$body', unix_timestamp())");
print "Advertisement was successfully added!
<META HTTP-EQUIV=Refresh CONTENT='5;url=newspaper.php'>";
}
else
{
print "You do not have enough money to place an advertisement.
*
<a href="http://newspaper.php" target="_blank">>Back</a>";
}
}
print"</td></tr>
<tr>
<td td colspan=6>
*
<center>$content</td>
</tr>
</table>";
$h->endpage();
?>

 

I would post in the original free mod section but the codes over 2 years old

Thanks ben

Link to comment
Share on other sites

I don't know if copying and pasting messed up that code, but that had soo many errors. On line 43, they don't say what part of $npdata they are referencing, and I don't know MCCodes at all. So I put $npdata['npADDER'], if that doesn't work then replace that with something else. (line 43 on your code, no clue on mine)

 

<?php
include "globals.php";
print "<h3>Newspaper</h3>";
print <<<EOF
<table width=90% cellspacing=1 class='table' border=2>
<tr>
<td class=h><center><a href="http://job.php" target="_blank"><font color='red'>YOUR JOB</font></a></td>
<td class=h><center><a href="http://gym.php" target="_blank"><font color='red'>LOCAL GYM</font></a></td>
<td class=h><center><a href="http://halloffame.php" target="_blank"><font color='red'>HALL OF FAME</font></a></td>
<td class=h><center><a href="http://gangcentral.php" target="_blank"><font color='red'>LOCAL GANGS</font></a></td>
<td class=h><center><a href="http://index.php" target="_blank"><font color='red'>MY HOUSE</font></a></td>
	</tr>
	<tr>
	<td class=h><center><a href="http://userlist.php" target="_blank"><font color='red'>LOCAL RESIDENTS</font></a></td>
		<td class=h><center><a href="http://stats.php" target="_blank"><font color='red'>CITY STATS</font></a></td>
			<td class=h><center><a href="http://usersonline.php" target="_blank"><font color='red'>PEOPLE AWAKE</font></a></td>
				<td class=h><center><a href="http://gangwars.php" target="_blank"><font color='red'>CURRENT WARS</font></a></td>
					<td class=h><center><a href="http://estate.php" target="_blank"><font color='red'>HOUSES FOR SALE</font></a></td>
						</tr>
						<tr>
						<td colspan=6>";
EOF;
						print <<<EOF
<table width=90% cellspacing=1 class='table'><center><h3>Player Advertisements</h3><center> | <a href="http://newspaper.php?action=add" target="_blank"><b>Buy An Advertisement ($10,000)</b></a>'
EOF;
						if($ir['user_level'] > 1)
						{
						print " | <a href=newspaper.php?action=all><b>DELETE ALL</b></a>";
						}
						$anpdata=mysql_query("SELECT * FROM npaper");
						$q=mysql_query("SELECT user_level FROM users WHERE userid=$userid");
						$r=$db->fetch_row($q);
						print "<marquee speed=2 direction=up onmouseover='this.stop()' onmouseout='this.start()' class='textbox'>";
						while($npdata=$db->fetch_row($anpdata))
						{
						$us=mysql_query("SELECT username FROM users WHERE userid={$npdata['npADDER']}");
						$us=$db->fetch_single($us);
						$time=date('F j',$npdata['npTIME']);
				print <<<EOF
					<hr>
					<b>Ad By: <a href="http://viewuser.php?u={$npdata["npADDER"]} target="_blank"><font color=red>{$us}</font> [{$npdata['npADDER']}]</a> | Added On: {$time}</b>
EOF;
				if($r['user_level'] != 1)
				{
			print " | <a href=newspaper.php?action=npID&npID={$npdata['npID']}><b>DELETE</b></a>";
			}
			print "
		<i><u>{$npdata['npTITLE']}</i></u>
		<i>{$npdata['npBODY']}</i>
	";
	}
	print "<hr /></marquee></table>";
	$q=mysql_query("SELECT user_level FROM users WHERE userid=$userid");
	$r=$db->fetch_row($q);
	if($r['user_level'] != 1)
	{
	if($_GET['action'] == "all")
	{
	if($r['user_level'] != 1)
	{
	mysql_query("TRUNCATE TABLE npaper");
	print "Newspaper Ads All Cleared!
	<META HTTP-EQUIV=Refresh CONTENT='1;url=newspaper.php'>";
	}
	}
	else if($_GET['action'] == "npID")
	{
	if($r['user_level'] != 1)
	{
mysql_query("DELETE FROM npaper WHERE npID={$_GET['npID']}");
print "News Paper Ad ID {$_GET['npID']} deleted!
<META HTTP-EQUIV=Refresh CONTENT='1;url=newspaper.php'>";
}
}
}
if($_GET['action'] == "add")
{
print "<h3>Add Advertisement ($10,000)</h3>
<form action='newspaper.php?action=added' method='post'>
Ad Title:*
<input type='text' name='npTITLE' class='textbox'>
*
Ad Body:*
<textarea rows=14 cols=65 name='npBODY' class='textbox'></textarea>
*
<input class='textbox' type='submit' value='Place Ad ($10,000)' />
</form>
<font color=red><b>WARNING:</b> Only plain text will work
Do not advertise other games
Follow the rules.";
}
if($_GET['action'] == "added")
{
if($ir['money']>9999)
{
print "Congratulations, you bought an ad for \$10,000!
";
mysql_query("UPDATE users SET money=money-10000 WHERE userid=$userid");
$title=str_replace(array("\n"),array("
"),strip_tags($_POST['npTITLE']));
$body=str_replace(array("\n"),array("
"),strip_tags($_POST['npBODY']));
$q=mysql_query("INSERT INTO `npaper` VALUES (NULL, '$userid', '$title', '$body', unix_timestamp())");
print "Advertisement was successfully added!
<META HTTP-EQUIV=Refresh CONTENT='5;url=newspaper.php'>";
}
else
{
print <<<EOF
You do not have enough money to place an advertisement.
<a href="http://newspaper.php" target="_blank">Back</a>
EOF;
}
}
print"</td></tr>
<tr>
<td td colspan=6>
<center>$content</td>
</tr>
</table>";
$h->endpage();
?>

 

If you trust me enough to put the file in its place with the rest of the files, I can fix any other errors.

Edited by Neon
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.

×
×
  • Create New...