Jump to content
MakeWebGames

Klikoka

Members
  • Posts

    382
  • Joined

  • Last visited

    Never

Everything posted by Klikoka

  1. This Is From This Topic http://criminalexistence.com/ceforums/index.php?topic=14829.0 I Edited It A Little And Here Is My Finished Product:: rating.php::: <?php /* Simple user rating system (Free Mod) For mccodes v1 Property of [url]www.ganjasworld.com[/url] Edited By Klikoka To Fit His Needs. */ 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']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); $ID = $_GET['ID']; $action = $_GET['action']; switch($action) { case 'goodrating': good_rating(); break; case 'badrating': good_rating(); break; } if(!$ID) { echo "Error - invaild player id."; $h->endpage(); exit; } if(!$action) { echo "Error - invaild action."; $h->endpage(); exit; } function good_rating() { global $ir,$userid; if($ir['rates'] > 0){ $ID = $_GET['ID']; if($ID == $userid) { echo "You cannot rate yourself."; } else { $result = mysql_query("SELECT * FROM users WHERE userid='{$ID}'"); while($row = mysql_fetch_array($result)) { $ratings = $row['ratings']; } mysql_query("UPDATE users SET ratings = {$ratings}+1 WHERE userid='{$ID}'"); mysql_query("UPDATE users SET rates = '0' WHERE userid='{$userid}'"); echo "You gave 1 rating to this player"; } } else { echo "You can only rate once a day."; } } function bad_rating() { if($ir['rates'] > 0){ $ID = $_GET['ID']; if($ID == $userid) { echo "You cannot rate yourself."; } else { $result = mysql_query("SELECT * FROM users WHERE userid='{$ID}'"); while($row = mysql_fetch_array($result)) { $ratings = $row['ratings']; } mysql_query("UPDATE users SET ratings = {$ratings}-1 WHERE userid='{$ID}'"); mysql_query("UPDATE users SET rates = '0' WHERE userid='{$userid}'"); echo "You gave took 1 rating away from the player"; } } else { echo "You can only rate once a day."; } } $h->endpage(); ?>   Daily Cron $db->query("UPDATE 'users' SET rates=1");   SQL's ALTER TABLE `users` ADD `ratings` INT( 11 ) NOT NULL DEFAULT '0'; ALTER TABLE `users` ADD `rates` INT( 11 ) NOT NULL DEFAULT '1';
  2. Re: Updated Mailbox [v1] No Problem
  3. Re: Updated Mailbox [v1] Here It Is For V2: <?php include "globals.php"; if($ir['mailban']) { die("<center><font color=red><font size='4' face='Arial, Helvetica, sans-serif'>Error</font> You have been mail banned for {$ir['mailban']} days. [b]Reason: {$ir['mb_reason']}</font>[/b]"); } $_GET['ID'] = abs((float) $_GET['ID']); print "<center><font size='4' face='Arial, Helvetica, sans-serif'>Mail Box</font><hr width=90%><table width=90% border=0><tr> <td width=20% align=center>> [url='mailbox.php?action=compose'] Compose[/url]</td> <td width=20% align=center>> [url='mailbox.php?action=outbox'] Outbox[/url]</td> <td width=20% align=center>> [url='mailbox.php?action=archive'] Save[/url]</td> <td width=20% align=center>> [url='mailbox.php?action=delall'] Delete All[/url]</td> <td width=20% align=center>> [url='mailbox.php?action=mailhome'] Inbox[/url]</td> </tr></table><hr width=90%>"; switch($_GET['action']) { case 'inbox': mail_inbox(); break; case 'outbox': mail_outbox(); break; case 'compose': mail_compose(); break; case 'delete': mail_delete(); break; case 'send': mail_send(); break; case 'delall': mail_delall(); break; case 'delall2': mail_delall2(); break; case 'archive': mail_archive(); break; case 'read': mail_view(); break; case 'mailhome': mail_home(); break; default: mail_home(); break; } function mail_home() { global $ir,$c,$userid,$h; print "Below are the Last 10 Messages Sent to You<hr width=90%> <table width=90% cellpadding=3 class=maintable><tr bgcolor=AAAAAA><th width=30%>From</th><th width=40%>Subject</th><th width=15%>Status</th><th width=15%>Manage</th></tr>"; $q=$db->query("SELECT m.*,u.* FROM mail m LEFT JOIN users u ON m.mail_from=u.userid WHERE m.mail_to=$userid ORDER BY mail_time DESC LIMIT 10",$c); while($r=$db->fetch_row($q)) { $sent=date('F j, Y, g:i:s a',$r['mail_time']); print "<tr><td>"; if($r['userid']) { print "[url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userid']}]"; } else { print "SYSTEM"; } $fm=urlencode($r['mail_subject']); if($r['mail_read'] == 0) { $status="<font color=red>Unread</font>"; } else { $status="<font color=green>Read</font>"; } print "</td>\n<td>[b]Subject:[/b] [url='mailbox.php?action=read&ID={$r[']{$r['mail_subject']}[/url] [i]Sent at: $sent[/i]</td><td><center> $status</td><td><center>[[url='mailbox.php?action=delete&ID={$r[']Delete[/url]] [[url='mailbox.php?action=read&ID={$r[']Read[/url]]</td></tr>"; } } function mail_view() { global $ir,$c,$userid,$h; print " <table width=90% cellpadding=3 class=maintable>"; $id= abs((int) $_GET['ID']); $q=$db->query("SELECT m.*,u.* FROM mail m LEFT JOIN users u ON m.mail_from=u.userid WHERE m.mail_id=$id LIMIT 1"); while($r=$db->fetch_row($q)) { $sent=date('F j, Y, g:i:s a',$r['mail_time']); print "<tr><td bgcolor=#AAAAAA>"; if($r['userid']) { print "[b]Mail From: [/b][url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userid']}]"; } else { print "SYSTEM"; } $fm=urlencode($r['mail_text']); print "<th bgcolor=#AAAAAA width=75%>[b]Subject:[/b] {$r['mail_subject']}</th></tr><tr><td>Sent at: $sent [url='mailbox.php?action=compose&ID={$r[']Reply[/url] [url='mailbox.php?action=delete&ID={$r[']Delete[/url] [url='preport.php?ID={$r[']Report[/url]</td><td>{$r['mail_text']}</td></tr></table> <form action='mailbox.php?action=send' method='post'> <table width=90% cellpadding=3 class='maintable'><th colspan=2 bgcolor=#AAAAAA>[b]Reply To This Message[/b]</th> <tr> <td>User's ID:</td> <td><input type='text' name='userid' value='{$r['userid']}' size='5' maxlength='10' /> [i]<font size=1.9>(E.g. 123456)</font>[/i]</td></tr><tr> <td>Subject:</td> <td><input type='text' name='subject' size='50' maxlength='50' value=' ' /> [i]<font size=1.9>(E.g. Hello there)</font>[/i]</td></tr><tr> <td>Message:</td> <td><textarea rows='10' cols='75%' name='message'></textarea></td></tr><tr> <td colspan=2><center><input type='submit' value='Send' /></td></tr></form>"; } $db->query("UPDATE mail SET mail_read=1 WHERE mail_id=$id",$c); } function mail_outbox() { global $ir,$c,$userid,$h; print "Below are the Last 10 Messages You have Sent<hr width=90%> <table width=90% cellpadding=3 class=maintable><tr bgcolor=AAAAAA><th width=35%>From</th><th width=50%>Subject</th><th width=15%>Manage</th></tr>"; $q=$db->query("SELECT m.*,u.* FROM mail m LEFT JOIN users u ON m.mail_to=u.userid WHERE m.mail_from=$userid ORDER BY mail_time DESC LIMIT 10",$c); while($r=$db->fetch_row($q)) { $sent=date('F j, Y, g:i:s a',$r['mail_time']); print "<tr><td>"; if($r['userid']) { print "[url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userid']}]"; } else { print "SYSTEM"; } $fm=urlencode($r['mail_subject']); if($r['mail_read'] == 0) { $status="<font color=red>Unread</font>"; } else { $status="<font color=green>Read</font>"; } print "</td>\n<td>[b]Subject:[/b] [url='mailbox.php?action=read&ID={$r[']{$r['mail_subject']}[/url] [i]Sent at: $sent[/i]</td><td><center>[[url='mailbox.php?action=read&ID={$r[']Read[/url]]</td></tr>"; } } function mail_compose() { global $ir,$c,$userid,$h; print "<form action='mailbox.php?action=send' method='post'> <table width=90% cellpadding=3 class='maintable'> <tr><td colspan=3 bgcolor=#AAAAAA>[b] Send a Message[/b]</td></tr><tr> <td>User's ID:</td> <td><input type='text' name='userid' value='' size='5' maxlength='10' /> [i]<font size=1.9>(E.g. 123456)</font>[/i]</td></tr><tr> <td>Subject:</td> <td><input type='text' name='subject' size='50' maxlength='50' value=' ' /> [i]<font size=1.9>(E.g. Hello there)</font>[/i]</td></tr><tr> <td>Message:</td> <td><textarea rows='10' cols='75%' name='message'></textarea></td></tr><tr> <td colspan=2><center><input type='submit' value='Send' /></td></tr></table></form><hr width=90%>> [url='mailbox.php']Back to Messages[/url]<hr width=90%>"; if($_GET['ID']) { print " <table width=90% cellpadding=3 class='maintable'><tr><td colspan=2 bgcolor=#AAAAAA>[b]Your last 5 mails to/from this person:[/b]</td></tr>"; $q=$db->query("SELECT m.*,u1.username as sender from mail m left join users u1 on m.mail_from=u1.userid WHERE (m.mail_from=$userid AND m.mail_to={$_GET['ID']}) OR (m.mail_to=$userid AND m.mail_from={$_GET['ID']}) ORDER BY m.mail_time DESC LIMIT 5",$c); while($r=$db->fetch_row($q)) { $sent=date('F j, Y, g:i:s a',$r['mail_time']); print "<tr><td bgcolor=#AAAAAA>$sent</td> <td bgcolor=#AAAAAA>[b]{$r['sender']} wrote:[/b] {$r['mail_text']}</td></tr>"; } print "</table>"; } } function mail_send() { global $ir,$c,$userid,$h; $subj=str_replace(array("\n"),array(" "),strip_tags($_POST['subject'])); $msg=str_replace(array("\n"),array(" "),strip_tags($_POST['message'])); $codes = array( ':]', ':D', ':oo:', 'O.o', ':/', ':angry:', ':?:', ':lol:', ':-:', ':O', ':(', 'O.O', ':roll:', ':zzz:', ':)', ':P', ':S', ':nut:', ';)', ':heart:', 'XD', ); $images = array( '[img=smilies/happy.gif]', '[img=smilies/biggrin.gif]', '[img=smilies/cool.gif]', '[img=smilies/blink.gif]', '[img=smilies/dry.gif]', '[img=smilies/angry.gif]', '[img=smilies/huh.gif]', '[img=smilies/laugh.gif]', '[img=smilies/mellow.gif]', '[img=smilies/ohmy.gif]', '[img=smilies/sad.gif]', '[img=smilies/ph34r.gif]', '[img=smilies/rolleyes.gif]', '[img=smilies/sleep.gif]', '[img=smilies/smile.gif]', '[img=smilies/tongue.gif]', '[img=smilies/unsure.gif]', '[img=smilies/wacko.gif]', '[img=smilies/wink.gif]', '[img=smilies/wub.gif]', '[img=smilies/XD.gif]', ); $newmsg = str_replace($codes, $images, $msg); $to= (int) $_POST['userid']; $db->query("INSERT INTO mail VALUES ('',0,$userid,$to,unix_timestamp(),'$subj','$newmsg')",$c) or die(mysql_error()); print "Your Message has been Sent. [url='mailbox.php']> Back[/url]"; } function mail_delete() { global $ir,$c,$userid,$h; $db->query("DELETE FROM mail WHERE mail_id={$_GET['ID']} AND mail_to=$userid",$c); print "Message deleted. [url='mailbox.php']> Back[/url]"; } function mail_delall() { global $ir,$c,$userid,$h; print "This will delete all the messages in your inbox. There is [b]NO[/b] undo, so be sure. [url='mailbox.php?action=delall2']> Yes, delete all messages[/url] [url='mailbox.php']> No, go back[/url]"; } function mail_delall2() { global $ir,$c,$userid,$h; $db->query("DELETE FROM mail WHERE mail_to=$userid",$c); print "All ".mysql_affected_rows($c)." mails in your inbox were deleted. [url='mailbox.php']> Back[/url]"; } function mail_archive() { global $ir,$c,$userid,$h; print "This tool will download an archive of all your messages. [url='dlarchive.php?a=inbox']> Download Inbox[/url] [url='dlarchive.php?a=outbox']> Download Outbox[/url]"; } $h->endpage(); ?>
  4. Re: STAFF RANKS there is a topic about this and i think its in the BDS Support section
  5. Re: How To...... Thank You Iso
  6. How Would You Add To A Script So That The User Needed A Certain Item/Items To Use The Mod :?
  7. Re: Donator's Bank[MCV2] Banks Are The Simplest Code To Do :)
  8. Re: Free Jail feature Bribe The guard   Try if($ir['jail'] == 0)
  9. Re: Drugs and Hoes help The SQL Comes With The Mod!
  10. Re: [V2]Crystal Smuggling Mod[V2]   It Should Be :::: case 'smug'1: smug_1(); break; case 'smugsub': smug_1_sub(); break; case 'smug2': smug_2(); break; case 'smugsub': smug_2_sub(); break; case 'smug3': smug_3(); break; case 'smug3sub': smug_3_sub(); break; case 'smug4': smug_4(); break; case 'smug4sub': smug_4_sub(); break; case 'smug5': smug_5(); break; case 'smug5sub': smug_5_sub(); break; case 'smug6': smug_6(); break; case 'smug6sub': smug_6_sub(); break; default: smug_index('action'); break; }
  11. Re: Register Prob... 50 users no more can join... Are You Usig Captcha Test On?
  12. Re: Html And Learn CSS
  13. Re: Help With Crons If Anyone Could .. Or PM Me For Help
  14. Re: Not A Problem Just Wondering... Its Ok I Know Now
  15. Re: Generate Password Oh Kk
  16. Re: Generate Password So :: print "You have signed up, enjoy the game. > [url='login.php']Login[/url]";   Would Be:: print "Your Pasword Is ::['$pgenerate'] You have signed up, enjoy the game. > [url='login.php']Login[/url]";   Or Something Like That
  17. Re: crime hospital time   Wouldnt You Need To Take Away The Jail Time Part Of The Code So You Would Edit if(rand(1, 2) == 1) { print $r['crimeFTEXT']; } else { print $r['crimeJTEXT']; $db->query("UPDATE `users` SET `jail` = '$r[crimeJAILTIME]', `jail_reason` = '$r[crimeJREASON]' WHERE `userid` = '$userid'"); } }   To if(rand(1, 2) == 1) { print $r['crimeFTEXT']; } else { print $r['crimeJTEXT']; $db->query("UPDATE `users` SET `hospital` = '$r[crimeJAILTIME]', `hospreason` = 'Failed To Do A Crime' WHERE `userid` = '$userid'"); } }   Then You Would Go Into Hospital For Amount Of Time That You Would Have Spent In Jail
  18. Re: MCcode V1.1 New Jobs[Free] Thats Cool Nice One :-D
  19. Re: Gift.php [edited]  
  20. Re: Generate Password Its A Good Little Addition Ty But Wont It Need To Show The User The Generated Pass?
  21. Re: new login.php Its Ok But Nothing Maraculus Id Give It A 6/10 So Good Job
  22. Re: userlist.php with a few mods to it V2 I Was Thinking Of Making A New One Of Theese But Might Just Use Ur One Instead Ty
  23. Re: Old vs. New Music I Like Old But I Also Like Some New Ones
  24. Please Vote Im Interested
  25. Re: How do i make myself staff? I Have Made Something For This In Free Game Modifcations
×
×
  • Create New...