Jump to content
MakeWebGames

Suggestion mod that was here earlier


gurpreet

Recommended Posts

I have half of the script for some reason of a suggestion mod that was posted here previously. However, I don't have the SQLs or the other half of the script (not sure why), so if anyone has it could they please post it? Here's what I got:

 

<?php
require "globals.php";
$sd=mysql_query("SELECT * FROM `suggestion` WHERE `s_from` = '$userid'",$c);
if($_GET['x'] == "add" and mysql_num_rows($sd) < 7)
{
if($_POST['urgency'] and $_POST['description'])
{
//Secure the webpage. My favourite :>
$_POST['description']=str_replace("/n", "<br />", strip_tags($_POST['description']));
$time=time(); //Insert the time log.
$ip=$_SERVER['REMOTE_ADDR']; //The users IP - logged. ha ha!
$nf="Not Added"; //The text for startup
mysql_query("INSERT INTO `suggestion` (`s_id`, `s_posted`, `s_from`, `s_description`, `s_read`, `s_replyfrom`, `s_reply_one`, `s_replytext`, `s_urgency`, `s_iplogged`) VALUES ('NULL', '$time', '$userid', '$_POST[description]', '0', '0', '$nf', 'N/A', '$_POST[urgency]', '$ip');",$c) or die("Your suggestion couldn't be processed at the moment, Either contact a admin or wait until tommorrow.<br />Thanks and sorry for any inconvenience caused<br /><a href='suggestion.php'>Back</a><br />");
print "Your suggestion has initially been added!<br />
<a href='suggestion.php'>Back</a><br />";
$h->endpage(); exit();
} else {
print "<b>Submit your suggestion</b><br />
<font color=red>Your IP logged: ".$_SERVER['REMOTE_ADDR']."</font><br />
<BR />
Your IP is logged for our benefits and yours, To make sure that you are posting a safe and clean spaced suggestion!<br />
Once suggestion has been prosesed, your suggestion will be shown as hidden to any other player except you.<br />
<br />
NOTE: This is only to report suggestions, If it's related to players open a player dispute. suggestions are adicions to the game that you feel it needs<br />
<form action='suggestion.php?x=add' method='post'>
Urgency: <select name='urgency'><option value='Brief'>Brief</option>
<option value='Basic'>Basic</option><option value='Vital'>Vital</option></select><br />
Description (include as much detail as possible, links will be a help aswell): <textarea name='description' cols=40 rows=11></textarea><br />
<input type=submit value='Submit Suggestion'></form><br />";
$h->endpage(); exit();
}
} else if($ir['user_level'] > 1 and $_GET['x'] == "remove" and $_GET['report'])
{
mysql_query("DELETE FROM `suggestion` WHERE `s_id` = '$_GET[suggestion]'",$c);
print "Suggestion Row Removed<br />
<a href='suggestion.php'>Back</a><br />";
$h->endpage(); exit();
} elseif($ir['user_level'] > 1 and $_GET['x'] == "reply" and $_GET['suggestion'])
{
if($_POST['text'])
{
//Make sure the text is ready to go, clean and safe.
$text=str_replace(array("<",">","/n"),array("","",""),$_POST['text']);
mysql_query("UPDATE `suggestion` SET `s_replyfrom` = '$userid', `s_replytext` = '$text' WHERE `s_id` = '$_GET[suggestion]'",$c);
print "Suggestion Row Edited<br />
<a href='suggestion.php'>Back</a><br />";
$h->endpage(); exit();
} else {
print "<b>Make a reply</b><br />
<form action='suggestion.php?x=reply&report=$_GET[suggestion]' method='post'>
Reply: <textarea name='text' cols=40 rows=11>Your reply here...</textarea><br />
<input type=submit value='Submit Reply!'>
</form>";
$h->endpage(); exit();
}
}
$_GET['st'] = abs((int) $_GET['st']);
$st=($_GET['st']) ? $_GET['st'] : 0;
print "<center><h3>Suggestions</h3>";
$sd=mysql_query("SELECT * FROM `suggestion` WHERE `s_from` = '$userid'",$c);
if(mysql_num_rows($sd) < 7)
{
print "<a href='suggestion.php?x=add'>[Add A Suggestion]</a><br />";
}
print "<b>You can record suggestion</b><br />";
if(!$_GET['selectSug'])
{
$reports=mysql_num_rows(mysql_query("SELECT * FROM `suggestion`",$c));
$shown=10; //How many rows should be shown in one row
$pages=(int) ($suggestions/$shown)+1;
if($membs % $shown == 1)
{
$pages--;
}
print "Pages: ";
for($i=1;$i <= $pages;$i++)
{
$stl=($i-1)*$shown;
print "<a href='suggestion.php?st=$stl'>$i</a> ";
}
}
if($ir["user_level"] > 1) { $man="<th>Manage</th>"; $cols=8;
mysql_query("UPDATE `suggestion` SET `s_read` = '1' WHERE `s_read` = '0'",$c);
} else { $cols=7; }
print "<br /><table width=90% border=1><tr><th colspan={$cols}>Viewing all suggestions - </th></tr>
<tr><th>Suggestion ID</th><th>From</th><th>Urgency</th><th>Status</th><th>Reply Comments</th><th>Description</th><th>Read</th>".$man."</tr>";
if(!$_GET['selectBug'])
{
$q=mysql_query("SELECT * FROM `suggestion` ORDER BY `s_posted` DESC LIMIT $st,10",$c);
} else {
$q=mysql_query("SELECT * FROM `suggestion` WHERE `s_id` = '$_GET[selectSug]' LIMIT 1;",$c);
}
if(mysql_num_rows($q) == 0)
{
print "<tr><td colspan={$cols}>There are no current suggestions been posted.</td></tr>";
}
while($r=mysql_fetch_array($q))
{
if($r['s_from'] == $userid or $ir['user_level'] >= 2)
{
$user_q=mysql_query("SELECT * FROM `users` WHERE `userid` = '$r[s_from]'",$c);
$p=mysql_fetch_array($user_q);
if($r['s_replyfrom'] > 0)
{
$user_q2=mysql_query("SELECT * FROM `users` WHERE `userid` = '$r[s_from]'",$c);
$d=mysql_fetch_array($user_q2);
}

 

If anyone can help please do.

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...