Jump to content
MakeWebGames

Uridium

Members
  • Posts

    2,667
  • Joined

  • Last visited

  • Days Won

    75

Everything posted by Uridium

  1. 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(); ?>
  2. 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>"; }
  3. 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
  4. Re: admins cant be feded [v2] I remodded my installer.php so when your the first one to Reg your placed into a different table called Admin saves anyone harrasing you ;)
  5. Re: [mccode v2] Gift.php [edited] Yep Gotta Agree worked for me to as i used Jasons Copy
  6. Re: always running from a fight   Would you like the long or short version for that question lol heres my Theory.... The Attack Script on MCC has never been decent. We make it loook good Graphically but i donit think anyone has ever cured its problems
  7. Re: [MCCODES v2] Trivia Quiz Creator I keep running into problems damn thing wont put the added questions in correct order. Im slacking in my old age lol
  8. Re: [v2] Fish & Chippy mod OH heck did i just help soeone with stolen source codes ?? SORRY GUYS wasnt aware...
  9. Re: [v2] Fish & Chippy mod if you have still got time to edit your post you need to change all links to chippy.php as they are pointing to bar24.php
  10. Re: [v2] Fish & Chippy mod Im going to give you +1 just for the reason its a british Chippy mod :) Nicely done
  11. Re: Mccodes Mono District     lol now thats one phrase i have to remember..
  12. Re: i need help again >.< You just need this bit   $used=array(); $q=$db->query("SELECT * FROM inventory WHERE inv_userid=$userid"); while ( $r=mysql_fetch_array($q) ) { if ( ! in_array ( $r['inv_id'], $used ) ) { $currdel=array(); $used[] =$r['inv_id']; $currdel[]=$r['inv_id']; $amount=$r['inv_qty']; //grab sellers others $q2=$db->query("SELECT * FROM inventory WHERE inv_userid=$userid AND inv_itemid = {$r['inv_itemid']} AND inv_id != {$r['inv_id']}"); while ( $r2 = mysql_fetch_array($q2) ) { $used[]=$r2['inv_id']; $currdel[]=$r2['inv_id']; $amount+=$r2['inv_qty']; } //if($userid == 1) //print "DEBUG: DELETE FROM inventory WHERE inv_id IN(".implode(",",$currdel).") "; $db->query("DELETE FROM inventory WHERE inv_id IN(".implode(",",$currdel).")"); //if($userid == 1) //print "DEBUG: INSERT INTO inventory VALUES('', {$r['inv_itemid']}, $userid, $amount) "; $db->query("INSERT INTO inventory VALUES('', {$r['inv_itemid']}, $userid, $amount)"); } }   Paste afther the include "globals.php";
  13. Re: Funney Error I had the same issue Haunted sorted mine out for me you may be as well asking how he fixed mine :)
  14. Re: Mccodes Mono District   it would Cost you $500 just to kill the damn bugs ;)You dont need Beta testers you need a hacker coz if they cant get in i'll pay 500 if they do then i pay nothing. :)
  15. Re: always running from a fight JON dont forget the one in header.php theres also one in there that will take all EXP....
  16. Re: Have any mod ideas post here! I have an Idea get Rid of the Attack System make more options for users at signup so they can choose what they want to be. let users intergrate with other users so the game isnt just about YOU its about a team effort.. and i dont mean joining a Gang... make users that chose a different Charcter Style from the Reg page Work for stats by accomplishing schooling and when successful can join a wider group of new Characters...
  17. Re: [MCCODES v1 + V2] Flash Login Iv'e sent details to you via the CE Messages The FLA file will allow you to edit the actionscript and Graphics of the login to suit your needs...
  18. Seeing as i havent seen a flash version of a login for MCC i decided to make one. Dont worry about SQL Injections from the file it wont happen The swf doesnt contain any call for your database via the file and simply works by calling for the authenticate.php file. Now open up your login.php file and remove... <form action=authenticate.php method=post name=login onsubmit=\"return saveme();\">User: <input type='text' name='username' size=15 /> Pass: <input type='password' name='password' size=15 /> <input type='submit' value='Submit' /></form></fieldset> and replace with <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="300" height="300" id="begin3" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="movie" value="begin3.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#cccccc" /><embed src="begin3.swf" quality="high" bgcolor="#cccccc" width="300" height="300" name="begin3" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object> DOWNLOAD FLASH FILE You will now have a working flash login if you want the FLA file for this Login im afraid thats $5 complete with above swf + fla + source.
  19. Re: Help Header Problem Call me stupid but i cliked the link he provided and a youporn website came up lol
  20. My Final Free Mod :) DOWNLOAD ZIP FILE the download contains the flash player + fla file and the html source You can add any website url that has a valid mp3 track or just download the mp3 Player to your pc and use it with your own offline music tracks,, FOR OFFLINE you will need the FULL PATH to the track example C:\My Documents\my music\farcry.mp3 Well thats it from me im outta here :)
  21. Re: [Mccodes V2]Prayer Mod Why would you want to pary when the whole idea of a game is to beat someone up lol
  22. Re: i need help again >.< Find   $q=$db->query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$_GET['ID']}"); $odata=$db->fetch_row($q); $myabbr=($ir['gender']=="Male") ? "his" : "her"; $oabbr=($ir['gender']=="Male") ? "his" : "her"; if($odata['hp'] == 1) { print "<h3>You come all this way only too find your opponent unconscious. You could have stayed home and watched some TV</h3> [url='index.php'][img=messages_back_014.gif][/url]</a>"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; }   Underneath add this the above may be slightly different to yours but the male female part is the same to look for   if($_GET['nextstep'] > 50) { print"<center><h1><font color='red'>STALEMATE!</h1> <h2>This fight is going knowhere you may as well go home!</h2> [url='index.php']> Back[/url]</center>"; $h->endpage(); event_add($odata['userid'],"[url='viewuser.php?u=$userid']{$youdata['username']}[/url] Tried to beat you but stalemated.",$c); event_add($youdata['userid']," You Tried to beat [url='viewuser.php?u=$userid']{$odata['username']}[/url] but stalemated.",$c); exit; }
  23. Re: i need help again >.< use this one its one ive amended so it updates the SQL each time something new is found. as soon as a user clicks on inventory.php it will auto update..   <?php include "globals.php"; $used=array(); $q=$db->query("SELECT * FROM inventory WHERE inv_userid=$userid"); while ( $r=mysql_fetch_array($q) ) { if ( ! in_array ( $r['inv_id'], $used ) ) { $currdel=array(); $used[] =$r['inv_id']; $currdel[]=$r['inv_id']; $amount=$r['inv_qty']; //grab sellers others $q2=$db->query("SELECT * FROM inventory WHERE inv_userid=$userid AND inv_itemid = {$r['inv_itemid']} AND inv_id != {$r['inv_id']}"); while ( $r2 = mysql_fetch_array($q2) ) { $used[]=$r2['inv_id']; $currdel[]=$r2['inv_id']; $amount+=$r2['inv_qty']; } //if($userid == 1) //print "DEBUG: DELETE FROM inventory WHERE inv_id IN(".implode(",",$currdel).") "; $db->query("DELETE FROM inventory WHERE inv_id IN(".implode(",",$currdel).")"); //if($userid == 1) //print "DEBUG: INSERT INTO inventory VALUES('', {$r['inv_itemid']}, $userid, $amount) "; $db->query("INSERT INTO inventory VALUES('', {$r['inv_itemid']}, $userid, $amount)"); } } $equip = array( $ir['equip_primary'] => 0, $ir['equip_secondary'] => 0, $ir['equip_armor'] => 0 ); $q = $db->query("SELECT * FROM items WHERE itmid IN({$ir['equip_primary']}, {$ir['equip_secondary']}, {$ir['equip_armor']})"); while($r=$db->fetch_row($q)) { $equip[$r['itmid']]=$r; } print "<table width='75%' border='0'> <tr> <td width='25%' align='center'>[b]Primary Weapon[/b]</td> <td width='25%' align='center'>[b]Armour[/b]</td> <td width='25%' align='center'>[b]Secondary Weapon[/b]</td> </tr> <tr> <td align='center'>"; if($equip[$ir['equip_primary']]['itmpic']['itmdesc']) { print"[img=/itmpics/{$equip[$ir[]"; } else { print "No item image."; } print "</td> <td align='center'>"; if($equip[$ir['equip_armor']]['itmpic']['itmdesc']) { print"[img=/itmpics/{$equip[$ir[]"; } else { print "No item image."; } print "</td> <td align='center'>"; if($equip[$ir['equip_secondary']]['itmpic']['itmdesc']) { print"[img=/itmpics/{$equip[$ir[] {$ir['itmname']}"; } else { print "No item image."; } print "</td> </tr> <tr> <td align='center'>"; if($equip[$ir['equip_primary']]['itmid']) { print"[url='unequip.php?type=equip_primary']Unequip Item[/url]"; } else { print "Nothing equipped."; } print "</td> <td align='center'>"; if($equip[$ir['equip_armor']]['itmid']) { print"[url='unequip.php?type=equip_armor']Unequip Item[/url]"; } else { print "Nothing equipped."; } print "</td> <td align='center'>"; if($equip[$ir['equip_secondary']]['itmid']) { print"[url='unequip.php?type=equip_secondary']Unequip Item[/url]"; } else { print "Nothing equipped."; } print "</td> </tr> </table><hr width='95%'> <h3>Inventory</h3><hr width='95%'>"; $inv=$db->query("SELECT iv.*,i.*,it.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.inv_userid={$userid} ORDER BY i.itmtype ASC, i.itmname ASC"); if ($db->num_rows($inv) == 0) { print "[b]You have no items![/b]"; } else { print "[b]Your items are listed below.[/b] <table width=95% class=\"table\" border=\"0\" cellspacing=\"1\"> <tr> <td class=\"h\">Item</td> <td class=\"h\">Sell Value</td> <td class=\"h\">Total Sell Value</td> <td class=\"h\">Image</td> <td class=\"h\">Links</td> </tr>"; $lt=""; while($i=$db->fetch_row($inv)) { if($lt!=$i['itmtypename']) { $lt=$i['itmtypename']; print "\n<tr><td colspan=5>[b]{$lt}[/b]</td></tr>"; } if($i['weapon']) { $i['itmname']="<font color='red'>*</font>".$i['itmname']; } if($i['armor']) { $i['itmname']="<font color='green'>*</font>".$i['itmname']; } print "<tr><td>{$i['itmname']}"; if ($i['inv_qty'] > 1) { print " x{$i['inv_qty']}"; } print "</td><td>\${$i['itmsellprice']}</td><td>"; print "$".($i['itmsellprice']*$i['inv_qty']); print"</td><td>[img=itmpics/{$i[]"; print "</td><td>[[url='#']Info[/url]]"; print " [[url='itemsend.php?ID={$i[']Send[/url]] [[url='itemsell.php?ID={$i[']Sell[/url]] [[url='imadd.php?ID={$i[']Add To Market[/url]]"; if($i['effect1_on'] || $i['effect2_on'] || $i['effect3_on']) { print " [[url='itemuse.php?ID={$i[']Use[/url]]"; } if($i['weapon']) { print " [[url='equip_weapon.php?ID={$i[']Equip as Weapon[/url]]"; } if($i['armor']) { print " [[url='equip_armor.php?ID={$i[']Equip as Armor[/url]]"; } print " [[url='displayadd.php?ID=$userid&action=add&itm={$i[']Display[/url]]"; print "</td></tr>"; } print "</table>"; print "[size="1"][b]NB:[/b] Items with a small red [/size]<font color='red'>*</font>[size="1"] next to their name can be used as weapons in combat. Items with a small green [/size]<font color='green'>*</font>[size="1"] next to their name can be used as armor in combat.[/size] "; } $h->endpage(); ?>   MAKE A BACKUP COPY OF YOUR OLD INVENTORY.PHP BEFORE OVERWRITING WITH THIS ONE.
  24. Re: [MCCODES V2[ Announcements mod only visible to staff Or just use the one ive posted which works and doesnt confuse the hell out of new members to CE :)
  25. Re: cmarket.php HELP   AMD Athlon 64 Processor 3500+ 2.2gz 1gb ram Compaq :P AMD Athlon 64 Processor 5000+ 3.5gz 8 gb ram I only use all that cos im a musician and hate it when you play something back and the CPU cant handle it.
×
×
  • Create New...