Jump to content
MakeWebGames

Uridium

Members
  • Posts

    2,691
  • Joined

  • Last visited

  • Days Won

    85

Everything posted by Uridium

  1. Re: [V2]New Explore   Sorry but why do people do that. Put things on here and then decide not to test it. This is probably a decent script and will probably work but for gods sake quit being lazy and test the thing before you add it on here.
  2. Re: [mccode] Advanced Warning System have my copy cos i know this one works and if it dont work on yours then you have an error on another file... This version also includes the Event to inform a user.... THIS FOR THE V2 VERSION warnings.php   <?php /*----------------------------------------------------- -- Mono Country v2.0 -- A product of DBS-entertainment -- Copyright held 2005 by Dabomstew -- INDEX.php -----------------------------------------------------*/ include "globals.php"; if($ir['user_level'] > 2) { echo'You do not have the power to do this!'; $h->endpage();exit(); } switch($_GET['action']) { case 'add': addwarning(); break; case 'addsub': addwarning2(); break; case 'del': deletewarning(); break; case 'edit': editwarning(); break; case 'edit2': editwarning2(); break; default: index(); break; } function index() { global $ir,$userid,$db; print "<h3>Viewing Warnings For ID: <a href=viewuser.php?u={$_GET['user']}>{$_GET['user']}</a></h3> "; $q=$db->query("SELECT w.*,u.* FROM warnings w LEFT JOIN users u ON w.warner=u.userid WHERE w.user={$_GET['user']} ORDER BY w.time DESC"); print "<center><font color=red><h4>Total Warnings: ".$db->num_rows($q)." </font></h4> [<a href=warnings.php?action=add&userid={$_GET['user']}><font color=#DCDCDC>Add Warning</font></a>] <table width=90% border='1' align=center><tr><tr class='h'><td><font color=#DCDCDC>Warned By:</font></td><td width=40%><font color=#DCDCDC>Reason</font></td><td><font color=#DCDCDC>Date</font></td><td><font color=#DCDCDC>Links</font></td></tr>"; while($r=$db->fetch_row($q)) { $warned=date('F j, Y, g:i:s a',$r['time']); print "<tr><td><a href=viewuser.php?u={$r['userid']}>{$r['username']}</a></td><td>{$r['warnedfor']}</td><td>$warned</td><td>"; if($ir['userid'] == 1) { print "[<a href=warnings.php?action=del&ID={$r['id']}>Remove</a>] "; } if($ir['warner'] == $userid || $userid == 1) { print "[<a href=warnings.php?action=edit&ID={$r['id']}>Edit</a>]"; } print "</td></tr>"; }} function addwarning() { global $ir,$userid,$db; print "<form action=warnings.php?action=addsub method=post> <input style='visibility: hidden' name=user value={$_GET['userid']}> Reason: <textarea rows=7 cols=30 name=reason></textarea> <input type=submit value='Add warning'></form>"; } function addwarning2() { global $ir,$userid,$db; $_POST['user']=($_POST['user']); $_POST['reason']=($_POST['reason']); $db->query("INSERT INTO warnings VALUES ('','{$_POST['user']}','{$_POST['reason']}','$userid',unix_timestamp())"); $checkfed=$db->query("SELECT * FROM warnings WHERE user='{$_POST['user']}'"); if($db->num_rows($checkfed) > 2) { $db->query("UPDATE users SET fedjail=1 WHERE userid='{$_POST['user']}'"); $db->query("INSERT INTO fedjail VALUES('','{$_POST['user']}','300','$userid','Reached 3 warnings in game. Account jailed.')"); } print "Warning Added! [*]<a href=viewuser.php?u={$_POST['user']}>Back to users profile</a>"; event_add($_POST['user'],"You have received the Following Warning {$_POST['reason']}",$c); } function deletewarning() { global $ir,$userid,$db; if($ir['userid'] != 1) { die("Owner Only");} $db->query("DELETE FROM warnings WHERE id={$_GET['ID']}"); print "Warning Deleted"; } function editwarning() { global $ir,$userid,$db; $target=$_GET['ID']; $edit=$db->query("SELECT * FROM warnings WHERE id='$target'"); while($r=$db->fetch_row($edit)) { if($r['warner'] != $userid || $userid != 1) { die("You never set this warning, therefore cannot edit it"); } print "<h3>Edit Warning</h3> <form action=warnings.php?action=edit2 method=post> <input style='visibility: hidden;' name=id value=$target> <textarea rows=7 cols=30 name=reason>{$r['warnedfor']}</textarea> <input type=submit value='Edit Warning'></form>"; } } function editwarning2() { global $ir,$userid,$db; $db->query("UPDATE warnings SET warnedfor={$_POST['reason']} WHERE id={$_POST['id']}"); print "Warning Updated. [*]<a href=index.php>Home</a>"; } ?>
  3. Re: [mccode] Advanced Warning System Someone asked me to include an EVENT when users get warning so heres the fix. open warnings.php find   print "Warning Added! [*]<a href=viewuser.php?u={$_POST['user']}>Back to users profile</a>";   Directly underneath add.   event_add($_POST['user'],"You have received the Following Warning {$_POST['reason']}",$c);   Users who get warnngs will also receive an Event.
  4. Stumbled Across this one by pure Accident and WOW its worth a look. Download site http://dragonprime.net/ Excellent scripts and a massive game very easy to install and comes with Masses of options for the user and staff.
  5. Re: [mccode] Diamond gems, with a Diamondtemple.php for v2.0   i wanted him to know what an epic fail that was I wish people would Bump my threads theyve been collecting dust for ages lol
  6. Re: Bank Layout V2 +1 Excellent addition its people like you that make Mcc better looking Graphicaly. Nicely created and a long over due addition. finaly added :)
  7. Re: [MCCODES V1 +V2] So who's viewing your profile   Yep i just seen that I was testing it on an offline version with only me viewing UNTIL i uploaded it to someone elses game then saw it was my ID all the time.. So sorry guys Scrap this one if ya will
  8. Very small mod just thought it might make a difference add this to your viewuser.php and you can see whos viewing profiles...   print" <h1>[url='viewuser.php?u=$userid']{$ir['username']}[/url]</h1><h3> Is currently viewing your profile.</h3>";   Thats it :)
  9. Re: [mccode] Additional Currency If you are wanting Gems instead of Crystals or if you wanted Gems and Crystals. You will need to edit EVERY file on your FTP that gives out crystals either renaming Crystals to Gems ( for gems only ) or adding an extra Query so users gain Gems + Crystals........ or reduce gems + crystrals.
  10. Re: [V1] Russian Roulette [V1] Menice im assuming this is how you wanted it to look. call this file russian.php << as its the ony link i can see in the script   <?php require"globals.php"; if($ir['jail'] or $ir['hospital']) { die("This page cannot be accessed while in jail or hospital."); } if ($_GET['action'] != 'Shoot') { print "Well. Here you are, sitting with a guy you dont know ready to die!! dont waist a shot you only got {$ir['shots']} shot left for the day . "; print " Choose how many turns you want to use <form method=post action=russian.php?action=Shoot><input type=hidden name=action value=Shoot><input type='text' name='pow' value='{$ir['shots']}'> <input type=submit value='Shoot'></form>"; } else { $pow=abs((int) $_POST['pow']); for($i=0;$i<$pow;$i++) { if ($ir['shots'] < 0) { print("You dont have enough shots to shoot!!! "); } else { $chance = rand(1,6); mysql_query("update users set shots=shots-1 where userid=$userid",$c); if ($chance == 1) { $hosptime = rand(1,10); $healthl = rand(50,100); { Print("you Grab the gun and Pull the trigger!!!![b]POW>>>>> WOW[b] YOUR DEAD MAN.....HE Wins You Lose {$healthl} Health and are in the hospital for {$hosptime} "); mysql_query("UPDATE users SET hp=hp-{$healthl} WHERE userid=$userid",$c); $ir['hospital']+=$hosptime; $ir['hp']=$healthl; $reason = "Lost russian roulette"; mysql_query("UPDATE users SET hospital=hospital+{$hosptime}, hospreason = '$reason' WHERE userid=$userid",$c); } } } if ($chance == 2) { $hosptime = rand(1,10); $healthl = rand(50,100); Print("You Grab the gun and Pull the trigger!!!![b]POW>>>>> WOW[b] YOUR DEAD MAN.....HE Wins You Lose {$healthl} Health and are in the hospital for {$hosptime} minutes!!! "); mysql_query("UPDATE users SET hp=hp-{$healthl} WHERE userid=$userid",$c); $ir['hospital']+=$hosptime; $ir['hp']=$healthl; $reason = "Lost russian roulette"; mysql_query("UPDATE users SET hospital=hospital+{$hosptime}, hospreason='$reason' WHERE userid=$userid",$c); print"you have [b]{$ir['shots']}[/b] Shots left "; } if ($chance == 3) { $amnt = rand(500,1000000); if($ir['money'] > $amnt) print "You Grab the gun and Pull the trigger!!!![b]CLICK.....CLICK WOW[b] The Man in the bar Pulls The trigger.....Pow you win the \$ {$amnt}!!!! "; mysql_query("update users set money=money+{$amnt} where userid=$userid",$c); $ir['money']=$amnt; print"you have [b]{$ir['shots']}[/b] Shots left "; } if ($chance == 6) { $hosptime = rand(1,10); $healthl = rand(50,100); Print("You Grab the gun and Pull the trigger!!!![b]POW>>>>> WOW[b] YOUR DEAD MAN.....HE Wins You Lose {$healthl} Health and are in the hospital for {$hosptime} minutes!!! "); mysql_query("UPDATE users SET hp=hp-{$healthl} WHERE userid=$userid",$c); $ir['hospital']+=$hosptime; $ir['hp']=$healthl; $reason ="Lost russian roulette"; mysql_query("UPDATE users SET hospital=hospital+{$hosptime}, hospreason = '$reason' WHERE userid=$userid",$c); print"you have [b]{$ir['shots']}[/b] Shots left "; } if ($chance == 5) { $hosptime = rand(1,10); $healthl = rand(50,100); Print("ou Grab the gun and Pull the trigger!!!![b]POW>>>>> WOW[b] YOUR DEAD MAN.....HE Wins You Lose {$healthl} Health and are in the hospital for {$hosptime} minutes!!! "); mysql_query("UPDATE users SET hp=hp-{$healthl} WHERE userid=$userid",$c); $ir['hospital']+=$hosptime; $ir['hp']=$healthl; $reason = "Lost russian roulette"; mysql_query("UPDATE users SET hospital=hospital+{$hosptime}, hospreason = '$reason' WHERE userid=$userid",$c); print"you have [b]{$ir['shots']}[/b] Shots left "; } if ($chance == 4) { $hosptime = rand(1,10); $healthl = rand(50,100); Print("ou Grab the gun and Pull the trigger!!!![b]POW>>>>> WOW[b] YOUR DEAD MAN.....HE Wins You Lose {$healthl} Health and are in the hospital for {$hosptime} minutes "); mysql_query("UPDATE users SET hp=hp-{$healthl} WHERE userid=$userid",$c); $ir['hospital']+=$hosptime; $ir['hp']=$healthl; $reason ="Lost russian roulette"; mysql_query("UPDATE users SET hospital=hospital+{$hosptime}, hospreason = '$reason' WHERE userid=$userid",$c); print"you have [b]{$ir['shots']}[/b] Shots left "; } print " Choose how many Shots you want to use <form method=post action=russian.php?action=Shoot><input type=hidden name=action value=Shoot><input type='text' name='pow' value='{$ir['shots']}'> <input type=submit value='Shoot'></form>"; } } if($ir['shots']==0) { print "Sorry, all turns used! "; } $h->endpage(); ?>   Add this to cron_day $db->query("UPDATE users SET shots=6"); CRON   ALTER TABLE users ADD shots INT (11) NOT NULL default=6;     And the final part just confused me :)
  11. Re: [V1] V1 Help Please Bless him i think he means Illusions lol Glad to have helped matey any more probs gizza hout on MSN.
  12. Re: [mccode v2] Tag Mod (Complete) Not sure why these are called ARENA when the original sqls were named tagmarket so change   CREATE TABLE `arena` ( `tmID` INT(11) NOT NULL AUTO_INCREMENT, `tmQTY` BIGINT(50) UNSIGNED NOT NULL DEFAULT '0', `tmADDER` INT(11) NOT NULL DEFAULT '0', `tmPRICE` BIGINT(50) UNSIGNED NOT NULL DEFAULT '0' PRIMARY KEY (`tmID`) ) ENGINE=MyISAM ;   to   CREATE TABLE `tagmarket` ( `tmID` INT(11) NOT NULL AUTO_INCREMENT, `tmQTY` BIGINT(50) UNSIGNED NOT NULL DEFAULT '0', `tmADDER` INT(11) NOT NULL DEFAULT '0', `tmPRICE` BIGINT(50) UNSIGNED NOT NULL DEFAULT '0' PRIMARY KEY (`tmID`) ) ENGINE=MyISAM ;
  13. Re: [mccode v2] Tag Mod (Complete) if your using auto_increment you will need a primary key   CREATE TABLE `arena` ( `tmID` INT(11) NOT NULL AUTO_INCREMENT, `tmQTY` BIGINT(50) UNSIGNED NOT NULL DEFAULT '0', `tmADDER` INT(11) NOT NULL DEFAULT '0', `tmPRICE` BIGINT(50) UNSIGNED NOT NULL DEFAULT '0' PRIMARY KEY (`tmID`) ) ENGINE=MyISAM ;
  14. Re: [mccode v2]My Simple Search Streets   The one your referring to is a more advanced Search area nothing to do with streets. Damn glad i could edit lol
  15. Re: [mccode v2] Item needed to perform crime.   I dont want paying for the help but whats your website
  16. Re: attack.php help what you could do is add a Query to the following pages jail.php and hospital.php Create a new SQL ALTER TABLE users ADD nocache INT (11) NOT NULL DEFAULT 0; and place this in the above pages   if($ir['nocache']==1) { die("<h2>Your Currently Engaged in a Fight"); }   open up attack take and put $db->query("UPDATE users SET nocache=1 WHERE userid=$userid"); Now in attackwin and attackbeat and attacklose place $db->query("UPDATE users SET nocache=0 WHERE userid=$userid"); that will stop them from using 2 pages
  17. Re: Help the reason your probably getting that error is cos your staff_items.php has more Queries than your actual SQL so if youve adde extra in the past to the staff_items.php you will have to replace those SQLS back to phpmyadmin.. That will resolve your problem :)
  18. Re: [MCCODES v2] Trivia Quiz Creator I havent completed that part yet the SCRIPT above is for the admin section so you can build your quizzes.. Shouldt be too long before its fully functional..
  19. Re: Login & Register & Header & Lost Password Just a quick note to those NEW Members of CE if your using this Script. Remove all mentions of $IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; and replace with   $IP = $_SERVER['REMOTE_ADDR'];
  20. Re: admins cant be feded [v2]   It creates 2 accounts one in the users and one in a new table called admin just incase someone did decide to ban you. you just login via a seperate page other than the register.php and you can edit yourself. Think of it as a GOD account
  21. Re: [mccode v2]My Simple Search Streets There are a few street scripts on here and some are able to place items into your inventory. have a browse about or even look at how your own items are placed into your inventory. on the staff_items.php theres a insert in the script that will help do what your looking for. But bare in mind when you do this with the above script the chances of finding the item will be far greater so make a small uncostly item. print"BLAH BLAH BLAH you found an hidden item check your inventory"; $db->query("INSERT INTO inventory VALUES('',1,$userid,1)",$c); } Change the 1 value to that of one of your own inventory item VALUES('',1,$userid,1)",$c);
  22. Re: [MCCODES v2] Trivia Quiz Creator now open up smenu.php and add these links   [url='staff_trivia.php?action=addtrivia']Create New Trivia[/url] [url='staff_trivia.php?action=edittrivia']Edit Exsisting Trivia[/url] [url='staff_trivia.php?action=deletetrivia']Delete Trivia[/url] [url='staff_trivia.php?action=addquestions']Create New Questions[/url] [url='staff_trivia.php?action=editquestions']Edit Exsisting Questions[/url] [url='staff_trivia.php?action=deletequestions']Delete Questions[/url]   Staff Panel works 100% tested kicked and booted it to make sure and a final kick for good measure When creating a TIVIA NAME and giving it an ID the ID must match that of the Questions for that particular QUIZ........
  23. Re: [MCCODES v2] Trivia Quiz Creator PART 2 of 2 just join together from Part 1   function edit_trivia_sub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] != 2) { die("403"); } global $ir,$c,$h,$userid, $db; $db->query("UPDATE trivia_games SET gamename='{$_POST['gamename']}', gamedesc='{$_POST['gamedesc']}', prize='{$_POST['prize']}', price='{$_POST['price']}', game='{$_POST['triviaid']}', timer='{$_POST['timer']}' WHERE id={$_POST['id']}"); print "<h1>Trivia <font color='cyan'>{$_POST['gamename']} </font>Edited...</h1> <h3>OPTIONS</h3> [url='staff_trivia.php?action=addtrivia']Create New Trivia[/url] [url='staff_trivia.php?action=edittrivia']Edit Exsisting Trivia[/url] [url='staff_trivia.php?action=deletetrivia']Delete Trivia[/url]"; stafflog_add("Edited Trivia {$_POST['gamename']}"); } /* START OF THE QUESTIONS SECTION */ function add_questions_begin() { global $db,$ir, $c; if($ir['user_level'] != 2) { die("403"); } print "<table width='169' cellpadding='0' cellspacing='0'> <tr> <td width='169' height='39' background='block_01.jpg'><center>Trivia Form Creator</td></center></tr> <tr> <td width='169' background='block_02.jpg' valign='top'> <form action='staff_trivia.php?action=addquestionssub' method='post'> Question : <textarea rows='6' cols='25' name='question' /></textarea> Answer 1 : <input type='text' name='answer1' /> Answer 2 : <input type='text' name='answer2' /> Answer 3 : <input type='text' name='answer3' /> Answer 4 : <input type='text' name='answer4' /> Correct Answer ID : <input type='text' name='answer' /> Use this with game user ID#: <input type='text' name='triviaid' /> <input type='submit' value='Create Questions' /></form> <tr> <td width='169' height='21' height='21' background='block_03.jpg'><center></td></tr><tr><td> </center></td></tr> <tr></table>"; } function add_questions_submit() { global $db,$ir,$c,$userid; if($ir['user_level'] != 2) { die("403"); } if(!isset($_POST['question']) || !isset($_POST['answer1']) || !isset($_POST['answer2']) || !isset($_POST['answer3']) || !isset($_POST['answer4']) || !isset($_POST['answer']) || !isset($_POST['triviaid'])) { print "You missed one or more of the required fields. Please go back and try again. [url='staff_trivia.php?action=addquestions']> Back[/url]"; $h->endpage(); exit; } $gname=$db->query("SELECT * FROM trivia_questions WHERE question='{$_POST['question']}'"); if($db->num_rows($gname) != 0) { print "<h1><font color='red'>Duplicated Question Entry Detected!</h1> <h3>Sorry Question <font color='yellow'>{$_POST['question']} </font>already in use</h3>"; $query='SELECT * FROM trivia_questions'; $result=mysql_query($query); $num=mysql_numrows($result); print"<table border='2' cellspacing='2' cellpadding='2'> <tr> <th><font face='Arial, Helvetica, sans-serif'><h3><font color='yellow'>Question</h3></font></th> <th><font face='Arial, Helvetica, sans-serif'><h3><font color='cyan'>Answer 1</h3></font></th> <th><font face='Arial, Helvetica, sans-serif'><h3><font color='blue'>Answer 2</h3></font></th> <th><font face='Arial, Helvetica, sans-serif'><h3><font color='cyan'>Answer 3</h3></font></th> <th><font face='Arial, Helvetica, sans-serif'><h3><font color='blue'>Answer 4</h3></font></th> <th><font face='Arial, Helvetica, sans-serif'><h3><font color='blue'>Correct Answer</h3></font></th> <th><font face='Arial, Helvetica, sans-serif'><h3><font color='blue'>User Game ID#</h3></font></th> </tr> "; $i=0; while ($i < $num) { $f1=mysql_result($result,$i,'question'); $f2=mysql_result($result,$i,'answer1'); $f3=mysql_result($result,$i,'answer2'); $f4=mysql_result($result,$i,'answer3'); $f5=mysql_result($result,$i,'answer4'); $f6=mysql_result($result,$i,'answer'); $f6=mysql_result($result,$i,'game'); print" <table border='2' cellspacing='3' cellpadding='3'> <tr> <td><font face='Arial, Helvetica, sans-serif'>[b]<h3><font color='yellow'>$f1</h3></font>[/b]</font></td> <td><font face='Arial, Helvetica, sans-serif'><h3><font color='cyan'>$f2</h3></font></font></td> <td><font face='Arial, Helvetica, sans-serif'><h3><font color='blue'>$f3</h3></font></font></td> <td><font face='Arial, Helvetica, sans-serif'>[b]<h3><font color='yellow'>$f4</h3></font>[/b]</font></td> <td><font face='Arial, Helvetica, sans-serif'><h3><font color='cyan'>$f5</h3></font></font></td> <td><font face='Arial, Helvetica, sans-serif'><h3><font color='blue'>$f6</h3></font></font></td> <td><font face='Arial, Helvetica, sans-serif'><h3><font color='red'>[url='staff_trivia.php?action=deletequestions']X[/url]</h3></font></font></td> </tr>"; $i++; } print " <a href='staff_trivia.php?action=addquestions'><center><font size=3>Return To Questions Editor </center></font></a> "; Print"<center><h3><font color='lightgreen'>Lastest Addition listed Below</h3></font>"; exit; } $idupe=$db->query("SELECT * FROM trivia_questions WHERE game='{$_POST['triviaid']}'"); if($db->fetch_row($idupe) != 0) { print "<h1><font color='red'>Duplicated Game ID# Entry Detected!</h1> <h3>Sorry game ID# <font color='yellow'>{$_POST['triviaid']} </font>already in use</h3>"; $query='SELECT * FROM trivia_questions'; $result=mysql_query($query); $num=mysql_numrows($result); print"<table border='2' cellspacing='2' cellpadding='2'> <tr> <th><font face='Arial, Helvetica, sans-serif'><h3><font color='yellow'>Question</h3></font></th> <th><font face='Arial, Helvetica, sans-serif'><h3><font color='cyan'>Answer 1</h3></font></th> <th><font face='Arial, Helvetica, sans-serif'><h3><font color='blue'>Answer 2</h3></font></th> <th><font face='Arial, Helvetica, sans-serif'><h3><font color='cyan'>Answer 3</h3></font></th> <th><font face='Arial, Helvetica, sans-serif'><h3><font color='blue'>Answer 4</h3></font></th> <th><font face='Arial, Helvetica, sans-serif'><h3><font color='blue'>Correct Answer</h3></font></th> <th><font face='Arial, Helvetica, sans-serif'><h3><font color='blue'>User Game ID#</h3></font></th> </tr> "; $i=0; while ($i < $num) { $f1=mysql_result($result,$i,'question'); $f2=mysql_result($result,$i,'answer1'); $f3=mysql_result($result,$i,'answer2'); $f4=mysql_result($result,$i,'answer3'); $f5=mysql_result($result,$i,'answer4'); $f6=mysql_result($result,$i,'answer'); $f6=mysql_result($result,$i,'game'); print" <table border='2' cellspacing='3' cellpadding='3'> <tr> <td><font face='Arial, Helvetica, sans-serif'>[b]<h3><font color='yellow'>$f1</h3></font>[/b]</font></td> <td><font face='Arial, Helvetica, sans-serif'><h3><font color='cyan'>$f2</h3></font></font></td> <td><font face='Arial, Helvetica, sans-serif'><h3><font color='blue'>$f3</h3></font></font></td> <td><font face='Arial, Helvetica, sans-serif'>[b]<h3><font color='yellow'>$f4</h3></font>[/b]</font></td> <td><font face='Arial, Helvetica, sans-serif'><h3><font color='cyan'>$f5</h3></font></font></td> <td><font face='Arial, Helvetica, sans-serif'><h3><font color='blue'>$f6</h3></font></font></td> <td><font face='Arial, Helvetica, sans-serif'><h3><font color='red'>[url='staff_trivia.php?action=deletequestions']X[/url]</h3></font></font></td> </tr>"; $i++; } print " <a href='staff_trivia.php?action=addquestions'><center><font size=3>Return To Questions Editor </center></font></a> "; Print"<center><h3>Lastest Addition listed Below</h3>"; exit; } $db->query("INSERT INTO trivia_questions (question, answer1, answer2, answer3, answer4, answer, game) VALUES( '{$_POST['question']}', '{$_POST['answer1']}', '{$_POST['answer2']}', '{$_POST['answer3']}', '{$_POST['answer4']}', '{$_POST['answer']}','{$_POST['triviaid']}')"); print "<h1>Trivia Created! <font color='cyan'>{$_POST['question']} </font></h1> <h3>OPTIONS</h3> [url='staff_trivia.php?action=addquestions']Create New Trivia[/url] [url='staff_trivia.php?action=editquestions']Edit Exsisting Trivia[/url] [url='staff_trivia.php?action=deletequestions']Delete Trivia[/url]"; stafflog_add("Created Trivia {$_POST['question']} for exsisting Trivia called {$_POST['gamename']}"); } function deletequestions() { global $db,$ir,$c,$h,$userid; if($_POST['id']) { $q=$db->query("SELECT * FROM trivia_questions WHERE id={$_POST['id']}"); $old2=$db->fetch_row($q); $db->query("DELETE FROM trivia_questions WHERE id={$_POST['id']}"); print "<h2>Trivia Game {$old2['question']} Removed.</h2> <h3>OPTIONS</h3> [url='staff_trivia.php?action=addquestions']Create New Trivia[/url] [url='staff_trivia.php?action=editquestions']Edit Exsisting Trivia[/url] <a href='staff_trivia.php?action=deletequestions'>Delete Questions/a>"; stafflog_add("Deleted Trivia Game {$old2['gamenanme']}"); } else { print "<h3>Deleting a Question</h3><hr /> <form action='staff_trivia.php?action=deletequestions' method='post'> <h2>Delete Question:</h2> ".delquestion_dropdown($c, "id")." <input type='submit' value='Delete This Catagory' /></form>"; } } function edit_questions_begin() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] != 2) { die("403"); } print "<h3>Editing Question Form</h3> <form action='staff_trivia.php?action=editquestionsform' method='post'> <h2>Edit Question ?:</h2> ".question_dropdown($c,"question")." <input type='submit' value='Edit Trivia Question' /></form>"; } function edit_questions_form() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] != 2) { die("403"); } $edq1=$db->query("SELECT * FROM trivia_questions WHERE id={$_POST['question']}"); $quizquestedit=$db->fetch_row($edq1); print "<h3>Editing Question</h3> <table width='169' cellpadding='0' cellspacing='0'> <tr> <td width='169' height='39' background='block_01.jpg'><center>Questions Editor</td></center></tr> <tr> <td width='169' background='block_02.jpg' valign='top'> <form action='staff_trivia.php?action=editquestionssub' method='post'> <input type='hidden' name='id' value='{$quizquestedit['id']}'/> Question: <input type='text' name='question' value='{$quizquestedit['question']}'/> Answer 1 <input type='text' name='answer1' value='{$quizquestedit['answer1']}'/> Answer 2 <input type='text' name='answer2' value='{$quizquestedit['answer2']}'/> Answer 3 <input type='text' name='answer3' value='{$quizquestedit['answer3']}'/> Answer 4 <input type='text' name='answer4' value='{$quizquestedit['answer4']}'/> Correct Answer <input type='text' name='answer' value='{$quizquestedit['answer']}'/> Question for trivia ID#<input type='text' name='triviaid' value='{$quizquestedit['game']}'/> <input type='submit' value='Edit Trivia' /></form>"; } function edit_questions_submit() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] != 2) { die("403"); } global $ir,$c,$h,$userid, $db; $db->query("UPDATE trivia_questions SET question='{$_POST['question']}', answer1='{$_POST['answer1']}', answer2='{$_POST['answer2']}', answer3='{$_POST['answer3']}', answer4='{$_POST['answer4']}', answer='{$_POST['answer']}', game='{$_POST['triviaid']}' WHERE id={$_POST['id']}"); print "<h1>Trivia <font color='cyan'>{$_POST['question']} </font>Edited...which is in use with Trivia Quiz {$_POST['gamename']}</h1> <h3>OPTIONS</h3> [url='staff_trivia.php?action=addquestions']Create New Trivia[/url] [url='staff_trivia.php?action=editquestions']Edit Exsisting Trivia[/url] [url='staff_trivia.php?action=deletequestions']Delete Trivia[/url]"; stafflog_add("Edited Trivia {$_POST['question']}"); } /* END OF QUESTIONS SECTION */ $h->endpage(); ?>
  24. Re: [MCCODES v2] Trivia Quiz Creator call this file staff_trivia.php PART 1 of 2 Exceeds 20000 Charaters   <?PHP include "sglobals.php"; switch($_GET['action']) { case 'addtrivia': add_trivia_begin(); break; case 'addtriviasub': add_trivia_submit(); break; case 'deletetrivia': deletetrivia(); break; case 'edittrivia': edit_trivia_begin(); break; case 'edittriviaform': edit_trivia_form(); break; case 'edittriviasub': edit_trivia_sub(); break; case 'addquestions': add_questions_begin(); break; case 'addquestionssub': add_questions_submit(); break; case 'editquestions': edit_questions_begin(); break; case 'editquestionsform': edit_questions_form(); break; case 'editquestionssub': edit_questions_submit(); break; case 'deletequestions': deletequestions(); break; default: print "Error: This script requires an action."; break; } function htmlspcl($in) { return str_replace("'", "'", htmlspecialchars($in)); } function add_trivia_begin() { global $db,$ir, $c; if($ir['user_level'] != 2) { die("403"); } print "<table width='169' cellpadding='0' cellspacing='0'> <tr> <td width='169' height='39' background='block_01.jpg'><center>Trivia Form Creator</td></center></tr> <tr> <td width='169' background='block_02.jpg' valign='top'> <form action='staff_trivia.php?action=addtriviasub' method='post'> Trivia Name: <input type='text' name='gamename' /> Trivia Description: <input type='text' name='gamedesc' /> Trivia Price <input type='text' name='prize' /> For Getting Per Question Correct Trivia Cost: <input type='text' name='price' /> Set Timer : <input type='text' name='timer' /> Trivia ID#: <input type='text' name='triviaid' /> <input type='submit' value='Create Trivia Form' /></form> <tr> <td width='169' height='21' height='21' background='block_03.jpg'><center></td></tr><tr><td> </center></td></tr> <tr></table>"; } function add_trivia_submit() { global $db,$ir,$c,$userid; if($ir['user_level'] != 2) { die("403"); } if(!isset($_POST['gamename']) || !isset($_POST['gamedesc']) || !isset($_POST['prize']) || !isset($_POST['price']) || !isset($_POST['timer']) || !isset($_POST['triviaid'])) { print "You missed one or more of the required fields. Please go back and try again. [url='staff_trivia.php?action=addtrivia']> Back[/url]"; $h->endpage(); exit; } $prize=abs((int) $_POST['prize']); $price=abs((int) $_POST['price']); $timer=abs((int) $_POST['timer']); $gname=$db->query("SELECT * FROM trivia_games WHERE gamename='{$_POST['gamename']}'"); if($db->num_rows($gname) != 0) { print "<h1><font color='red'>Duplicated Game Name Entry Detected!</h1> <h3>Sorry game name <font color='yellow'>{$_POST['gamename']} </font>already in use</h3>"; $query='SELECT * FROM trivia_games'; $result=mysql_query($query); $num=mysql_numrows($result); print"<table border='2' cellspacing='2' cellpadding='2'> <tr> <th><font face='Arial, Helvetica, sans-serif'><h3><font color='yellow'>Description</h3></font></th> <th><font face='Arial, Helvetica, sans-serif'><h3><font color='cyan'>Game Name</h3></font></th> <th><font face='Arial, Helvetica, sans-serif'><h3><font color='blue'>User Entry ID#</h3></font></th> <th><font face='Arial, Helvetica, sans-serif'><h3><font color='blue'>Timer Seconds</h3></font></th> </tr> "; $i=0; while ($i < $num) { $f1=mysql_result($result,$i,'gamedesc'); $f2=mysql_result($result,$i,'gamename'); $f3=mysql_result($result,$i,'game'); $f4=mysql_result($result,$i,'timer'); print" <table border='2' cellspacing='3' cellpadding='3'> <tr> <td><font face='Arial, Helvetica, sans-serif'>[b]<h3><font color='yellow'>$f1</h3></font>[/b]</font></td> <td><font face='Arial, Helvetica, sans-serif'><h3><font color='cyan'>$f2</h3></font></font></td> <td><font face='Arial, Helvetica, sans-serif'><h3><font color='blue'>$f3</h3></font></font></td> <td><font face='Arial, Helvetica, sans-serif'><h3><font color='green'>$f4</h3></font></font></td> <td><font face='Arial, Helvetica, sans-serif'><h3><font color='red'>[url='staff_trivia.php?action=deletetrivia']X[/url]</h3></font></font></td> </tr>"; $i++; } print " <a href='staff_trivia.php?action=addtrivia'><center><font size=3>Return To Editor </center></font></a> "; Print"<center><h3><font color='lightgreen'>Lastest Addition listed Below</h3></font>"; exit; } $idupe=$db->query("SELECT * FROM trivia_games WHERE game='{$_POST['triviaid']}'"); if($db->fetch_row($idupe) != 0) { print "<h1><font color='red'>Duplicated Game ID# Entry Detected!</h1> <h3>Sorry game ID# <font color='yellow'>{$_POST['triviaid']} </font>already in use</h3>"; $query='SELECT * FROM trivia_games'; $result=mysql_query($query); $num=mysql_numrows($result); print"<table border='2' cellspacing='2' cellpadding='2'> <tr> <th><font face='Arial, Helvetica, sans-serif'><h3><font color='yellow'>Description</h3></font></th> <th><font face='Arial, Helvetica, sans-serif'><h3><font color='cyan'>Game Name</h3></font></th> <th><font face='Arial, Helvetica, sans-serif'><h3><font color='blue'>User Entry ID#</h3></font></th> <th><font face='Arial, Helvetica, sans-serif'><h3><font color='blue'>Timer Seconds</h3></font></th> </tr> "; $i=0; while ($i < $num) { $f1=mysql_result($result,$i,'gamedesc'); $f2=mysql_result($result,$i,'gamename'); $f3=mysql_result($result,$i,'game'); $f4=mysql_result($result,$i,'timer'); print" <table border='2' cellspacing='3' cellpadding='3'> <tr> <td><font face='Arial, Helvetica, sans-serif'>[b]<h3><font color='yellow'>$f1</h3></font>[/b]</font></td> <td><font face='Arial, Helvetica, sans-serif'><h3><font color='cyan'>$f2</h3></font></font></td> <td><font face='Arial, Helvetica, sans-serif'><h3><font color='blue'>$f3</h3></font></font></td> <td><font face='Arial, Helvetica, sans-serif'><h3><font color='green'>$f4</h3></font></font></td> <td><font face='Arial, Helvetica, sans-serif'><h3><font color='red'>[url='staff_trivia.php?action=deletetrivia']X[/url]</h3></font></font></td> </tr>"; $i++; } print " <a href='staff_trivia.php?action=addtrivia'><center><font size=3>Return To Editor </center></font></a> "; Print"<center><h3>Lastest Addition listed Below</h3>"; exit; } $db->query("INSERT INTO trivia_games (gamename, gamedesc, prize, price, timer, game) VALUES( '{$_POST['gamename']}', '{$_POST['gamedesc']}', '{$_POST['prize']}', '{$_POST['price']}', '{$_POST['timer']}', '{$_POST['triviaid']}')"); print "<h1>Trivia Created! <font color='cyan'>{$_POST['gamename']} </font></h1> <h3>OPTIONS</h3> [url='staff_trivia.php?action=addtrivia']Create New Trivia[/url] [url='staff_trivia.php?action=edittrivia']Edit Exsisting Trivia[/url] [url='staff_trivia.php?action=deletetrivia']Delete Trivia[/url]"; stafflog_add("Created Trivia {$_POST['gamename']} "); } function deletetrivia() { global $db,$ir,$c,$h,$userid; if($_POST['id']) { $q=$db->query("SELECT * FROM trivia_games WHERE id={$_POST['id']}"); $old=$db->fetch_row($q); $db->query("DELETE FROM trivia_games WHERE id={$_POST['id']}"); print "<h2>Trivia Game {$old['gamename']} Removed.</h2> <h3>OPTIONS</h3> [url='staff_trivia.php?action=addtrivia']Create New Trivia[/url] [url='staff_trivia.php?action=edittrivia']Edit Exsisting Trivia[/url] [url='staff_trivia.php?action=deletetrivia']Delete Trivia[/url]"; stafflog_add("Deleted Trivia Game {$old['gamenanme']}"); } else { print "<h3>Deleting a id</h3><hr /> <form action='staff_trivia.php?action=deletetrivia' method='post'> <h2>Delete Trivia Game </h2> ".id_dropdown($c, "id")." <input type='submit' value='Delete This Game' /></form>"; } } function edit_trivia_begin() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] != 2) { die("403"); } print "<h3>Editing Trivia Form</h3> <form action='staff_trivia.php?action=edittriviaform' method='post'> <h2>Edit Which Trivia ?</h2> ".id_dropdown($c,'id')." <input type='submit' value='Edit Trivia Game' /></form>"; } function edit_trivia_form() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] != 2) { die("403"); } $edq=$db->query("SELECT * FROM trivia_games WHERE id={$_POST['id']}"); $quizedit=$db->fetch_row($edq); print "<h3>Editing Trivia Form</h3> <form action='staff_trivia.php?action=edittriviasub' method='post'> <input type='hidden' name='id' value='{$quizedit['id']}'/> Trivia Name: <input type='text' name='gamename' value='{$quizedit['gamename']}'/> Trivia Description: <input type='text' name='gamedesc' value='{$quizedit['gamedesc']}'/> Trivia Price <input type='text' name='prize' value='{$quizedit['prize']}'/> For getting Per Question Correct Trivia Cost: <input type='text' name='price' value='{$quizedit['price']}'/> Game Timer: <input type='text' name='timer' value='{$quizedit['timer']}'/> <input type='hidden' name='triviaid' value='{$quizedit['game']}'/> <input type='submit' value='Edit Trivia' /></form>"; }
  25. Re: [MCCODES v2] Trivia Quiz Creator For now i'll Post the Admin section for the Trivia Creator just so i dont muck it up later whilst editing stuff..... SQLS   CREATE TABLE IF NOT EXISTS `trivia_games` ( `id` int(11) NOT NULL auto_increment, `gamename` varchar(32) NOT NULL default '', `gamedesc` varchar(128) NOT NULL default '', `prize` int(11) NOT NULL default '0', `price` int(11) NOT NULL default '0', `game` int(11) NOT NULL default '0', `timer` int(11) NOT NULL default '60', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; CREATE TABLE IF NOT EXISTS `trivia_questions` ( `id` int(11) NOT NULL auto_increment, `question` varchar(255) NOT NULL default '', `answer1` varchar(128) NOT NULL default '', `answer2` varchar(128) NOT NULL default '', `answer3` varchar(128) NOT NULL default '', `answer4` varchar(128) NOT NULL default '', `answer` tinyint(4) NOT NULL default '0', `game` int(11) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; CREATE TABLE IF NOT EXISTS `trivia_records` ( `id` int(11) NOT NULL auto_increment, `userid` int(11) NOT NULL default '0', `last_question` int(11) NOT NULL default '0', `playagain` int(11) NOT NULL default '0', `game` int(11) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;   Open up global_func.php and add   function delquestion_dropdown($connection,$ddname="id",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM trivia_questions ORDER BY id ASC"); if($selected < 1) { $ret.="<option value='0' selected='selected'>-- None --</option>"; } else { $ret.="<option value='0'>-- None --</option>"; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['id']}'"; if ($selected == $r['id']) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['question']}</option>"; } $ret.="\n</select>"; return $ret; } function question_dropdown($connection,$ddname="question",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM trivia_questions ORDER BY question ASC"); if($selected < 1) { $ret.="<option value='0' selected='selected'>-- None --</option>"; } else { $ret.="<option value='0'>-- None --</option>"; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['id']}'"; if ($selected == $r['id']) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['question']}</option>"; } $ret.="\n</select>"; return $ret; } function id_dropdown($connection,$ddname="id",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM trivia_games ORDER BY gamename ASC"); if($selected < 1) { $ret.="<option value='0' selected='selected'>-- None --</option>"; } else { $ret.="<option value='0'>-- None --</option>"; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['id']}'"; if ($selected == $r['id']) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['gamename']}</option>"; } $ret.="\n</select>"; return $ret; }   Part 2 BELOW
×
×
  • Create New...