Jump to content
MakeWebGames

BaLoP

Members
  • Posts

    25
  • Joined

  • Last visited

    Never
  • Days Won

    1

Everything posted by BaLoP

  1. anyone?
  2. i am getting this error some some reason Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/iseeyou9/public_html/preferences.php on line 163   this is line 163 and the ones around it   print " You did not type a new image location.   <hr width=75%>> Back<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%>> Back<hr width=75%>"; }
  3. is there any way someone could make a mod for v2 where people can rate peoples posts in the game forums so that people can give people +1 or -1 kinda like the one on torn
  4. ya so far mine is very simple and thanks to the people that said anything if anyone has more ideas just let me know
  5. oh kk sorry about that lol
  6. i never seen that before but you guys can think what you want to think i can see why you think it but i really made myself
  7. it works now thanks
  8. <?php include "sglobals.php"; //This contains item stuffs switch($_GET['action']) { case 'newitem': new_item_form(); break; case 'newitemsub': new_item_submit(); break; case 'giveitem': give_item_form(); break; case 'giveitemsub': give_item_submit(); break; case 'killitem': kill_item_form(); break; case 'killitemsub': kill_item_submit(); break; case 'edititem': edit_item_begin(); break; case 'edititemform': edit_item_form(); break; case 'edititemsub': edit_item_sub(); break; case 'newitemtype': newitemtype(); break; default: print "Error: This script requires an action."; break; } function new_item_form() { global $db,$ir,$c; if($ir['user_level'] > 2) { die("403"); } print "<h3>Adding an item to the game</h3><form action='staff_items.php?action=newitemsub' method='post'> Item Name: <input type='text' name='itmname' value='' /> Item Desc.: <input type='text' name='itmdesc' value='' /> Item Type: ".itemtype_dropdown($c,'itmtype')." Item Buyable: <input type='checkbox' name='itmbuyable' checked='checked' /> Item Price: <input type='text' name='itmbuyprice' /> Item Sell Value: <input type='text' name='itmsellprice' /> <hr /> [b]Usage Form[/b]<hr /> [b]<u>Effect 1</u>[/b] On? <input type='radio' name='effect1on' value='1' /> Yes <input type='radio' name='effect1on' value='0' checked='checked' /> No Stat: <select name='effect1stat' type='dropdown'> <option value='energy'>Energy</option> <option value='will'>Will</option> <option value='brave'>Brave</option> <option value='hp'>Health</option> <option value='strength'>Strength</option> <option value='agility'>Agility</option> <option value='guard'>Guard</option> <option value='labour'>Labour</option> <option value='IQ'>IQ</option> <option value='hospital'>Hospital Time</option> <option value='jail'>Jail Time</option> <option value='money'>Money</option> <option value='crystals'>Crystals</option> <option value='cdays'>Education Days Left</option> <option value='bankmoney'>Bank money</option> <option value='cybermoney'>Cyber money</option> <option value='crimexp'>Crime XP</option> </select> Direction: <select name='effect1dir' type='dropdown'> <option value='pos'>Increase</option> <option value='neg'>Decrease</option> </select> Amount: <input type='text' name='effect1amount' value='0' /> <select name='effect1type' type='dropdown'> <option value='figure'>Value</option> <option value='percent'>Percent</option> </select><hr /> [b]<u>Effect 2</u>[/b] On? <input type='radio' name='effect2on' value='1' /> Yes <input type='radio' name='effect2on' value='0' checked='checked' /> No Stat: <select name='effect2stat' type='dropdown'> <option value='energy'>Energy</option> <option value='will'>Will</option> <option value='brave'>Brave</option> <option value='hp'>Health</option> <option value='strength'>Strength</option> <option value='agility'>Agility</option> <option value='guard'>Guard</option> <option value='labour'>Labour</option> <option value='IQ'>IQ</option> <option value='hospital'>Hospital Time</option> <option value='jail'>Jail Time</option> <option value='money'>Money</option> <option value='crystals'>Crystals</option> <option value='cdays'>Education Days Left</option> <option value='bankmoney'>Bank money</option> <option value='cybermoney'>Cyber money</option> <option value='crimexp'>Crime XP</option> </select> Direction: <select name='effect2dir' type='dropdown'> <option value='pos'>Increase</option> <option value='neg'>Decrease</option> </select> Amount: <input type='text' name='effect2amount' value='0' /> <select name='effect2type' type='dropdown'> <option value='figure'>Value</option> <option value='percent'>Percent</option> </select><hr /> [b]<u>Effect 3</u>[/b] On? <input type='radio' name='effect3on' value='1' /> Yes <input type='radio' name='effect3on' value='0' checked='checked' /> No Stat: <select name='effect3stat' type='dropdown'> <option value='energy'>Energy</option> <option value='will'>Will</option> <option value='brave'>Brave</option> <option value='hp'>Health</option> <option value='strength'>Strength</option> <option value='agility'>Agility</option> <option value='guard'>Guard</option> <option value='labour'>Labour</option> <option value='IQ'>IQ</option> <option value='hospital'>Hospital Time</option> <option value='jail'>Jail Time</option> <option value='money'>Money</option> <option value='crystals'>Crystals</option> <option value='cdays'>Education Days Left</option> <option value='bankmoney'>Bank money</option> <option value='cybermoney'>Cyber money</option> <option value='crimexp'>Crime XP</option> </select> Direction: <select name='effect3dir' type='dropdown'> <option value='pos'>Increase</option> <option value='neg'>Decrease</option> </select> Amount: <input type='text' name='effect3amount' value='0' /> <select name='effect3type' type='dropdown'> <option value='figure'>Value</option> <option value='percent'>Percent</option> </select><hr /> [b]Combat Usage[/b] Weapon Power: <input type='text' name='weapon' value='0' /> Armor Defense: <input type='text' name='armor' value='0' /><hr /> <input type='submit' value='Add Item To Game' /></form>"; } function new_item_submit() { global $db,$ir,$c,$h; if($ir['user_level'] > 2) { die("403"); } if(!isset($_POST['itmname']) || !isset($_POST['itmdesc']) || !isset($_POST['itmtype']) || !isset($_POST['itmbuyprice']) || !isset($_POST['itmsellprice'])) { print "You missed one or more of the fields. Please go back and try again. [url='admin.php?action=newitem']> Back[/url]"; $h->endpage(); exit; } $itmname=$db->escape($_POST['itmname']); $itmdesc=$db->escape($_POST['itmdesc']); $weapon=abs((int) $_POST['weapon']); $armor=abs((int) $_POST['armor']); if($_POST['itmbuyable'] == 'on') { $itmbuy=1; } else { $itmbuy=0; } $efx1=$db->escape(serialize(array("stat" => $_POST['effect1stat'], "dir" => $_POST['effect1dir'], "inc_type" => $_POST['effect1type'], "inc_amount" => abs((int) $_POST['effect1amount'])))); $efx2=$db->escape(serialize(array("stat" => $_POST['effect2stat'], "dir" => $_POST['effect2dir'], "inc_type" => $_POST['effect2type'], "inc_amount" => abs((int) $_POST['effect2amount'])))); $efx3=$db->escape(serialize(array("stat" => $_POST['effect3stat'], "dir" => $_POST['effect3dir'], "inc_type" => $_POST['effect3type'], "inc_amount" => abs((int) $_POST['effect3amount'])))); $m=$db->query("INSERT INTO items VALUES('',{$_POST['itmtype']},'$itmname','$itmdesc',{$_POST['itmbuyprice']},{$_POST['itmsellprice']},$itmbuy, '{$_POST['effect1on']}', '$efx1', '{$_POST['effect2on']}', '$efx2', '{$_POST['effect3on']}', '$efx3', $weapon, $armor)"); print "The {$_POST['itmname']} Item was added to the game."; stafflog_add("Created item {$_POST['itmname']}"); } function give_item_form() { global $db,$ir,$c; if($ir['user_level'] > 3) { die("403"); } print "<h3>Giving Item To User</h3> <form action='staff_items.php?action=giveitemsub' method='post'> User: ".user_dropdown($c,'user')." Item: ".item_dropdown($c,'item')." Quantity: <input type='text' name='qty' value='1' /> <input type='submit' value='Give Item' /></form>"; } function give_item_submit() { global $db,$ir,$c; if($ir['user_level'] > 3) { die("403"); } $db->query("INSERT INTO inventory VALUES('',{$_POST['item']},{$_POST['user']},{$_POST['qty']})",$c) or die(mysql_error()); print "You gave {$_POST['qty']} of item ID {$_POST['item']} to user ID {$_POST['user']}"; stafflog_add("Gave {$_POST['qty']} of item ID {$_POST['item']} to user ID {$_POST['user']}"); } function kill_item_form() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } print "<h3>Deleting Item</h3> The item will be permanently removed from the game. <form action='staff_items.php?action=killitemsub' method='post'> Item: ".item_dropdown($c,'item')." <input type='submit' value='Kill Item' /></form>"; } function kill_item_submit() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM items WHERE itmid={$_POST['item']}"); $itemi=$db->fetch_row($d); $db->query("DELETE FROM items WHERE itmid={$_POST['item']}"); $db->query("DELETE FROM shopitems WHERE sitemITEMID={$_POST['item']}"); $db->query("DELETE FROM inventory WHERE inv_itemid={$_POST['item']}"); $db->query("DELETE FROM itemmarket WHERE imITEM={$_POST['item']}"); print "The {$itemi['itmname']} Item was removed from the game."; stafflog_add("Deleted item {$itemi['itmname']}"); } function edit_item_begin() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } print "<h3>Editing Item</h3> You can edit any aspect of this item. <form action='staff_items.php?action=edititemform' method='post'> Item: ".item_dropdown($c,'item')." <input type='submit' value='Edit Item' /></form>"; } function edit_item_form() { global $db,$ir,$c,$h; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM items WHERE itmid={$_POST['item']}"); $itemi=$db->fetch_row($d); print "<h3>Editing Item</h3> <form action='staff_items.php?action=edititemsub' method='post'> <input type='hidden' name='itmid' value='{$_POST['item']}' /> Item Name: <input type='text' name='itmname' value='{$itemi['itmname']}' /> Item Desc.: <input type='text' name='itmdesc' value='{$itemi['itmdesc']}' /> Item Type: ".itemtype_dropdown($c,'itmtype',$itemi['itmtype'])." Item Buyable: <input type='checkbox' name='itmbuyable'"; if ($itemi['itmbuyable']) { print " checked='checked'"; } print " /> Item Price: <input type='text' name='itmbuyprice' value='{$itemi['itmbuyprice']}' /> Item Sell Value: <input type='text' name='itmsellprice' value='{$itemi['itmsellprice']}' /><hr />[b]Usage Form[/b]<hr />"; $stats=array( "energy" => "Energy", "will" => "Will", "brave" => "Brave", "hp" => "Health", "strength" => "Strength", "agility" => "Agility", "guard" => "Guard", "labour" => "Labour", "IQ" => "IQ", "hospital" => "Hospital Time", "jail" => "Jail Time", "money" => "Money", "crystals" => "Crystals", "cdays" => "Education Days Left", "bankmoney" => "Bank money", "cybermoney" => "Cyber money", "crimexp" => "Crime XP"); for($i=1;$i<=3;$i++) { if($itemi["effect".$i]) { $efx=unserialize($itemi["effect".$i]); } else { $efx=array("inc_amount" => 0); } $switch1=($itemi['effect'.$i.'_on'] > 0) ? " checked='checked'" : ""; $switch2=($itemi['effect'.$i.'_on'] > 0) ? "" : " checked='checked'"; print "[b]<u>Effect {$i}</u>[/b] On? <input type='radio' name='effect{$i}on' value='1'$switch1 /> Yes <input type='radio' name='effect{$i}on' value='0'$switch2 /> No Stat: <select name='effect{$i}stat' type='dropdown'>"; foreach($stats as $k => $v) { if($k==$efx['stat']) { print "<option value='{$k}' selected='selected'>{$v}</option>\n"; } else { print "<option value='$k'>{$v}</option>\n"; } } if($efx['dir']=="neg") { $str="<option value='pos'>Increase</option><option value='neg' selected='selected'>Decrease</option>"; } else { $str="<option value='pos' selected='selected'>Increase</option><option value='neg'>Decrease</option>"; } if($efx['inc_type']=="percent") { $str2="<option value='figure'>Value</option><option value='percent' selected='selected'>Percent</option>"; } else { $str2="<option value='figure' selected='selected'>Value</option><option value='percent'>Percent</option>"; } print "</select> Direction: <select name='effect{$i}dir' type='dropdown'>{$str} </select> Amount: <input type='text' name='effect{$i}amount' value='{$efx['inc_amount']}' /> <select name='effect{$i}type' type='dropdown'>{$str2}</select><hr />"; } print "[b]Combat Usage[/b] Weapon Power: <input type='text' name='weapon' value='{$itemi['weapon']}' /> Armor Defense: <input type='text' name='armor' value='{$itemi['armor']}' /><hr /> <input type='submit' value='Edit Item' /></form>"; } function edit_item_sub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } if(!isset($_POST['itmname']) || !isset($_POST['itmdesc']) || !isset($_POST['itmtype']) || !isset($_POST['itmbuyprice']) || !isset($_POST['itmsellprice'])) { print "You missed one or more of the fields. Please go back and try again. [url='staff_items.php?action=edititem']> Back[/url]"; $h->endpage(); exit; } $itmname=$_POST['itmname']; $itmdesc=$_POST['itmdesc']; $weapon=abs((int) $_POST['weapon']); $armor=abs((int) $_POST['armor']); if($_POST['itmbuyable'] == 'on') { $itmbuy=1; } else { $itmbuy=0; } $db->query("DELETE FROM items WHERE itmid={$_POST['itmid']}",$c); $efx1=$db->escape(serialize(array("stat" => $_POST['effect1stat'], "dir" => $_POST['effect1dir'], "inc_type" => $_POST['effect1type'], "inc_amount" => abs((int) $_POST['effect1amount'])))); $efx2=$db->escape(serialize(array("stat" => $_POST['effect2stat'], "dir" => $_POST['effect2dir'], "inc_type" => $_POST['effect2type'], "inc_amount" => abs((int) $_POST['effect2amount'])))); $efx3=$db->escape(serialize(array("stat" => $_POST['effect3stat'], "dir" => $_POST['effect3dir'], "inc_type" => $_POST['effect3type'], "inc_amount" => abs((int) $_POST['effect3amount'])))); $m=$db->query("INSERT INTO items VALUES('{$_POST['itmid']}',{$_POST['itmtype']},'$itmname','$itmdesc',{$_POST['itmbuyprice']},{$_POST['itmsellprice']},$itmbuy, '{$_POST['effect1on']}', '$efx1', '{$_POST['effect2on']}', '$efx2', '{$_POST['effect3on']}', '$efx3', $weapon, $armor)"); print "The {$_POST['itmname']} Item was edited successfully."; stafflog_add("Edited item {$_POST['itmname']}"); } function newitemtype() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } if($_POST['name']) { $db->query("INSERT INTO itemtypes VALUES(NULL, '{$_POST['name']}')"); print "Item Type {$_POST['name']} added."; stafflog_add("Added item type {$_POST['name']}"); } else { print "<h3>Add Item Type</h3><hr /> <form action='staff_items.php?action=newitemtype' method='post'> Name: <input type='text' name='name' /> <input type='submit' value='Add Item Type' /></form>"; } } $h->endpage(); ?>
  9. i am trying to make my first item and its giving this error   QUERY ERROR: 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 '0,0, '1', 'a:4:{s:4:\"stat\";s:4:\"will\";s:3:\"dir\";s:3:\"pos\";s:8:\"inc_type' at line 1 Query was INSERT INTO items VALUES('',1,'Weed','Improve your concentration and happiness.',,0,0, '1', 'a:4:{s:4:\"stat\";s:4:\"will\";s:3:\"dir\";s:3:\"pos\";s:8:\"inc_type\";s:7:\"percent\";s:10:\"inc_amount\";i:100;}', '0', 'a:4:{s:4:\"stat\";s:6:\"energy\";s:3:\"dir\";s:3:\"pos\";s:8:\"inc_type\";s:6:\"figure\";s:10:\"inc_amount\";i:0;}', '0', 'a:4:{s:4:\"stat\";s:6:\"energy\";s:3:\"dir\";s:3:\"pos\";s:8:\"inc_type\";s:6:\"figure\";s:10:\"inc_amount\";i:0;}', 0, 0)     does anyone know how to fix this?
  10. thanks for the feedback and thanks Equinox for the better coded one
  11. this is just a small mod it just allows user to punch someone and it gives the user a event saying they where punched and it will also show how many people you have punched on your profile ok add punches int 11 default 0 into your users table then make a file called punch.php and in it put <?php include "globals.php"; $_GET['ID']=abs((int) $_GET['ID']); if(!$_GET['ID']) { print "STOP IT!"; $h->endpage(); exit; } else if($_GET['ID'] == $userid) { print "Why are you trying to punch yourself."; $h->endpage(); exit; } $p=$db->query("SELECT * FROM users WHERE userid={$_GET['ID']}"); $r=$db->fetch_row($p); echo "You have punched {$r['username']}"; event_add($r['userid'],"you have been punched by [url='viewuser.php?u=$userid']{$ir['username']}[/url]. Click [url='punch.php?ID=$userid']Here[/url] to punch him back",$c); $db->query("UPDATE users SET punches=punches+1 WHERE userid={$ir['userid']}"); ?> then add Punches {$r['punches']} and [[url='punch.php?ID={$r[']Punch[/url]] to viewuser.php
  12. i need some layout ideas any suggestions?
  13. does anyone know how to make this one kinda like the one on facebook
  14. no i did it was working but nvm i fixed it
  15. i have a weard problem with my login for some reason its not saying the game name or decription unless i type them into the logins code instead of having it in the db
  16. does anyone know how to make this one kinda like the one on facebook
  17. im not sure what to do with the game im working on whats some good colors to have and what are some good themes i need some ideas
  18. that one dont work :/ and the only problem with the one i made is that it dont show who it is from and when i hit reply the userid is 0 not the one you are replying to i dont know the query to put in it
  19. I know this is simple but i stopped coding for a while and dont remember how to do it can anyone help me make my mailbox where when you first go into yourmailbox you can only see who it is from and the subject and you have to chick the subject t see the message kinda like tho one on torn
  20. BaLoP

    teach

    ok thanks
  21. BaLoP

    teach

    can anyone on here teach me php i did know it but then my computer crashed and i havent done it in a while and now im a bit rusty so if there is one willing to teach me please email me at [email protected]
  22. nice mod
  23. it does not let me switch where the menu is
  24. I made it look a little bit better <?php session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm); $h->menuarea(); print "<font face='Arial' size='4'><center>Forums</center></font><hr width='90%'>"; if ($ir['forum_ban']) { die (" You are banned from the forums for ".number_format($ir['forum_ban'])." more days. The reason for this is {$ir['forum_reason']}. <hr width='90%'>> [url='explore.php']Back[/url]<hr width='90%'>"); } switch ($_GET['view']) { case 'topic': view_topic(); break; case 'section': view_section(); break; case 'reply': reply_forum(); break; case 'edit': edit_reply(); break; case 'editpost': edit_message(); break; case 'delpost': delete_post(); break; case 'deltop': delete_topic(); break; case 'newtopic': create_topic(); break; case 'newsect': create_section(); break; default: forums_index(); break; } function forums_index() { global $ir,$c,$userid,$h; $sql = sprintf("SELECT * FROM `forums_sections` fs LEFT JOIN `users` u ON (u.userid = fs.fsCREATOR) ORDER BY fs.fsID DESC"); $sql = mysql_query($sql); print "<table width='90%' cellspacing='1' border='1' align='center'><tr bgcolor='#AAAAAA'><td colspan='4'>[b]<center>Public Forums[/b]"; if ($ir['user_level'] == '2') { print " >> [[url='forums.php?view=newsect'][b]New Forum[/url]][/b]"; } print "</center></td></tr> <tr bgcolor='#AAAAAA'><th align='left'>Forum Name</th><th>Topics</th></tr>"; while($r = mysql_fetch_array($sql)) { print "<tr><td width='50%'>[url='forums.php?view=section&ID={$r[']{$r['fsNAME']}[/url] [size="1"][i]{$r['fsDESC']}[/i][/size]</td> <td width='25%'><center>{$r['fsPOSTS']}</center></td></tr>"; } print "</table><hr width='90%'>"; } function view_section() { global $ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $sql = sprintf("SELECT * FROM `forums_topics` ft LEFT JOIN `users` u ON (u.userid = ft.ftUSER) LEFT JOIN `forums_sections` fs ON (fs.fsID = ft.ftFORUM) WHERE (ft.ftFORUM = %u)", $_GET['ID']); $sql = mysql_query($sql); print "<table width='90%' cellspacing='1' border='1' align='center'><tr bgcolor='#AAAAAA'><td colspan='3'>[b]<center>[url='forums.php']Public Forums[/url] >> [[url='forums.php?view=newtopic'][b]New Topic[/url]]</center>[/b]</td></tr> <tr bgcolor='#AAAAAA'><th align='left'>Topic</th><th>Posts</th><th>Starter</th></tr>"; while($r = mysql_fetch_array($sql)) { print "<tr><td width='50%'>[url='forums.php?view=topic&ID={$r[']{$r['ftNAME']}[/url]"; if ($r['fpUSER'] == $ir['userid'] || $ir['user_level'] == 2) { print " [[url='forums.php?view=deltop&ID={$r[']Delete[/url]]"; } print " [size="1"][i]{$r['ftDESC']}[/i][/size]</td> <td width='25%'><center>{$r['ftPOSTS']}</center></td> <td width='25%'><center>[url='viewuser.php?u={$r[']{$r['username']}[/url]</center></td></tr>"; } print "</table><hr width='90%'>"; } function view_topic() { global $ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $sql = sprintf("SELECT * FROM `forums_posts` fp LEFT JOIN `users` u ON (u.userid = fp.fpUSER) LEFT JOIN `forums_topics` ft ON (ft.ftID = fp.fpTOPIC) LEFT JOIN `forums_sections` fs ON (fs.fsID = ft.ftFORUM) WHERE (fp.fpTOPIC = %u)", $_GET['ID']); $sql = mysql_query($sql); print "<table width='90%' cellspacing='1' border='1' align='center'>"; while($r = mysql_fetch_array($sql)) { print "<tr bgcolor='#AAAAAA'><td colspan='4'>[b][url='forums.php']Public Forums[/url] >> [url='forums.php?view=section&ID={$r[']{$r['fsNAME']}[/url] >> {$r['ftNAME']}[/b]</td></tr> <tr><td width='10%' valign='top'>[url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userid']}] Level {$r['level']} {$r['posts']} Posts </td> <td width='90%' valign='top'> [b]Subject: [/b]{$r['fpSUBJECT']} "; if ($r['fpUSER'] == $ir['userid']) { print "[[url='forums.php?view=editpost&ID={$r[']Edit[/url]]"; } if ($r['fpUSER'] == $ir['userid'] || $ir['user_level'] != 2) { print " [[url='forums.php?view=delpost&ID={$r[']Delete[/url]]"; } print " [i]Posted at ".date('F j Y, g:i:s a',$r['fpTIME'])."[/i] <hr />{$r['fpPOST']} "; if ($r['fpEDIT']) { print "[i]Last edited by [url='viewuser.php?u={$r[']{$r['username']}[/url] at ".date('F j Y, g:i:s a',$r['fpTIME']).".[/i] "; } print "</td> </tr>"; } print "</table><hr width='90%'><center> <form action='forums.php?view=reply' method='post'> [b]Reply to this Topic:[/b] <input type='hidden' name='ID' value='{$_GET['ID']}' /> Subject <input type='text' name='subject' /> Message <textarea name='message' cols='40' rows='7'></textarea> <input type='submit' value='Reply' /></form></center> <hr width='90%'>"; } function create_section() { global $ir,$c,$userid,$h; if($ir['user_level'] != '2') { print " You are not permitted to access this area of the forums. <hr width='90%'>> [url='explore.php']Back[/url]<hr width='90%'>"; } else if($_POST['name'] AND $_POST['description']) { $sql = sprintf("INSERT INTO `forums_sections` (`fsID`, `fsNAME`, `fsDESC`, `fsCREATOR`, `fsPOSTS`) VALUES ('NULL','%s', '%s', '%d', '%d')", mysql_real_escape_string($_POST['name']), mysql_real_escape_string($_POST['description']), $userid, 0); mysql_query($sql); print " The {$_POST['name']} forum section was successfully created. <hr width='90%'>> [url='forums.php']Back[/url]<hr width='90%'>"; } else { print " <form action='forums.php?view=newsect' method='post'> Create Forum Section: Name <input type='text' name='name' /> Description <textarea name='description' cols='40' rows='7'></textarea> <input type='submit' value='Create' /></form> <hr width='90%'>> [url='forums.php']Back[/url]<hr width='90%'>"; } } function create_topic() { global $ir,$c,$userid,$h; if($_POST['name'] AND $_POST['description'] AND $_POST['section'] AND $_POST['subject'] AND $_POST['message']) { $_POST['section'] = abs((int) $_POST['section']); $sql = sprintf("INSERT INTO `forums_topics` (`ftID`, `ftFORUM`, `ftNAME`, `ftDESC`, `ftUSER`) VALUES ('NULL','%d', '%s', '%s', '%d')", $_POST['section'], mysql_real_escape_string($_POST['name']), mysql_real_escape_string($_POST['description']), $userid); mysql_query($sql); $i = mysql_insert_id($c); $fm = sprintf("INSERT INTO `forums_posts` (`fpID`, `fpTOPIC`, `fpSUBJECT`, `fpPOST`, `fpUSER`, `fpTIME`) VALUES ('NULL','%d', '%s', '%s', '%d', '%d')", $i, mysql_real_escape_string($_POST['subject']), mysql_real_escape_string($_POST['message']), $userid, time()); mysql_query($fm); $upd = sprintf("UPDATE `forums_sections` SET fsPOSTS = fsPOSTS + 1 WHERE (`fsID` = %u)", $_POST['section']); mysql_query($upd); print " The {$_POST['name']} forum topic was successfully created. <hr width='90%'>> [url='forums.php']Back[/url]<hr width='90%'>"; } else { print " <form action='forums.php?view=newtopic' method='post'> Create Forum Topic: Name <input type='text' name='name' /> Forum <select name='section' type='dropdown'> <option value='0'>None</option>"; $q = sprintf("SELECT * FROM `forums_sections`",$c); $q = mysql_query($q); while($r = mysql_fetch_array($q)) { print "<option value='{$r['fsID']}'>{$r['fsNAME']}</option>"; } print "</select> Description <textarea name='description' cols='40' rows='7'></textarea> [b]First Message:[/b] Subject <input type='text' name='subject' /> Message <textarea name='message' cols='40' rows='7'></textarea> <input type='submit' value='Create' /></form> <hr width='90%'>> [url='forums.php']Back[/url]<hr width='90%'>"; } } function reply_forum() { global $ir,$c,$userid,$h; if($_POST['subject'] AND $_POST['message'] AND $_POST['ID']) { $_POST['ID'] = abs((int) $_POST['ID']); $sql = sprintf("INSERT INTO `forums_posts` (`fpID`, `fpTOPIC`, `fpSUBJECT`, `fpPOST`, `fpUSER`, `fpTIME`) VALUES ('NULL','%d', '%s', '%s', '%d', '%d')", $_POST['ID'], mysql_real_escape_string($_POST['subject']), mysql_real_escape_string($_POST['message']), $userid, time()); mysql_query($sql); $upd = sprintf("UPDATE `forums_topics` SET ftPOSTS = ftPOSTS + 1 WHERE (`ftID` = %u)", $_POST['ID']); mysql_query($upd); $upda = sprintf("UPDATE `users` SET posts = posts + 1 WHERE (`userid` = %u)", $ir['userid']); mysql_query($upda); print " Your reply was successfully posted. <hr width='90%'>> [url='forums.php?view=topic&ID={$_POST[']Back[/url]<hr width='90%'>"; } else { print " You missed one or more of the required fields. Go back and try again. <hr width='90%'>> [url='forums.php']Back[/url]<hr width='90%'>"; } } function edit_message() { global $ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $sql = sprintf("SELECT * FROM `forums_posts` WHERE (fpID = %u)", $_GET['ID']); $sql = mysql_query($sql); $r = mysql_fetch_array($sql); if ($ir['userid'] != $r['fpUSER']) { print " You are not the owner of this message. <hr width='90%'>> [url='forums.php']Back[/url]<hr width='90%'>"; } else { print "<form action='forums.php?view=edit&ID={$_GET['ID']}' method='post'> [b]Edit Message:[/b] Subject <input type='text' name='subject' value='{$r['fpSUBJECT']}' /> Message <textarea name='message' cols='40' rows='7'>{$r['fpPOST']}</textarea> <input type='submit' value='Edit' /></form> <hr width='90%'>> [url='forums.php']Back[/url]<hr width='90%'>"; } } function edit_reply() { global $ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $sql = sprintf("SELECT * FROM `forums_posts` WHERE (fpID = %u)", $_GET['ID']); $sql = mysql_query($sql); $r = mysql_fetch_array($sql); if ($ir['userid'] != $r['fpUSER'] || $ir['user_level'] != 2) { print " You are not authorised to edit this message. <hr width='90%'>> [url='forums.php']Back[/url]<hr width='90%'>"; } else if($_POST['subject'] AND $_POST['message'] AND $_GET['ID']) { $edit = sprintf("UPDATE `forums_posts` SET `fpSUBJECT` = '%s', `fpPOST` = '%s', `fpEDIT` = '%d' WHERE (`fpID` = %u)", mysql_escape_string($_POST['subject']), mysql_escape_string($_POST['message']), time(), $_GET['ID']); mysql_query($edit); print " Your post was successfully edited. <hr width='90%'>> [url='forums.php?view=topic&ID={$_GET[']Back[/url]<hr width='90%'>"; } else { print " You missed one or more of the required fields. Go back and try again. <hr width='90%'>> [url='forums.php']Back[/url]<hr width='90%'>"; } } function delete_post() { global $ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $sql = sprintf("SELECT * FROM `forums_posts` WHERE (fpID = %u)", $_GET['ID']); $sql = mysql_query($sql); $r = mysql_fetch_array($sql); if ($ir['user_level'] != 2) { print " You are not authorised to remove this message. <hr width='90%'>[url='forums.php']Back[/url]<hr width='90%'>"; } else if($r['fpID'] ) { //////update Topic Post Count//// mysql_query($sql); $upd = sprintf("UPDATE `forums_topics` SET ftPOSTS = ftPOSTS - 1 WHERE (`ftID` = {$r['fpTOPIC']})"); mysql_query($upd); ////////////////////////////// $edit = sprintf("DELETE FROM `forums_posts` WHERE (`fpID` = %u)",$_GET['ID']); mysql_query($edit); print " The post was successfully removed. <hr width='90%'>[url='forums.php']Back[/url]<hr width='90%'>"; } else { print " This post has already been deleted. <hr width='90%'>[url='forums.php']Back[/url]<hr width='90%'>"; } } function delete_topic() { global $ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $sql = sprintf("SELECT * FROM `forums_topics` WHERE (ftID = %u)", $_GET['ID']); $sql = mysql_query($sql); $r = mysql_fetch_array($sql); if ($ir['user_level'] != 2) { print " You are not authorised to remove this topic. <hr width='90%'>[url='forums.php']Back[/url]<hr width='90%'>"; } else if($r['ftID']) { ///update Section Topic Count///// $upd = sprintf("UPDATE `forums_sections` SET fsPOSTS = fsPOSTS - 1 WHERE (`fsID` = {$r['ftFORUM']})"); mysql_query($upd); ////////////////////////////// $posts = sprintf("DELETE FROM `forums_posts` WHERE (`fpTOPIC` = %u)", $_GET['ID']); mysql_query($posts); $edit = sprintf("DELETE FROM `forums_topics` WHERE (`ftID` = %u)", $_GET['ID']); mysql_query($edit); print " The topic was successfully removed. <hr width='90%'>[url='forums.php']Back[/url]<hr width='90%'>"; } else { print " This topic has already been deleted. <hr width='90%'>[url='forums.php']Back[/url]<hr width='90%'>"; } } $h->endpage(); ?>
  25. can can someone convert this to v1 lite for me please
×
×
  • Create New...