Jump to content
MakeWebGames

PHPDevil

Members
  • Posts

    38
  • Joined

  • Last visited

Everything posted by PHPDevil

  1. This is a small mod, my first one aswell. Basically when someone wants to change their username it will charge them a set amount of donator days to prevent them from changing it time and time again. The file you want to work with will be preferences.php We want to check that the user has enough donator days firstly to be charged! (For my example I'll use eight but you can use whatever amount you like) First find this code in the do name change function.   function do_name_change() { global $db,$ir,$c,$userid,$h; if($_POST['newname'] == "") { print "You did not enter a new name.<br /> <a href='preferences.php?action=namechange'>> Back</a>"; }   Directly underneath you want to place   else if ($ir['donatordays'] <=8) { print "You do not have eight donator days to spend on changing your name.<br /> <a href='preferences.php?action=namechange'>> Back</a><br /> <a href='donator.php'>View donator packages!</a><br /> "; }   Next we want to update the database to deduct the eight donator days IF the name change is succesful so find this code first in the same do name change function. Should be a bit lower then the previous code   $db->query("UPDATE users SET username='{$_POST['newname']}' WHERE userid=$userid");   Add underneath $db->query("UPDATE users SET donatordays = donatordays-8 where userid =$userid");   That should really be it. Any issues let me know. Remember it is my first mod so I ain't aware of any security problems with that at the moment.
  2. Thanks mate. I thought DJK had replied with the correct statement. Should have read more closely =/ I used the above code. It now happily changes from white to black!
  3. I made the changes. Appreciate the help aswell but still the colour isn't changing   function hof_level() { global $db,$ir,$c,$userid, $myf; if ($p % 2 == 0) { $color = 'FFFFFF'; } else { $color = '000000'; } print "Showing the 50 users with the highest levels <table width=75% cellspacing=1 class=tablehof><tr style='background:gray'> <th>Rank</th> <th>User</th> <th>Level</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY level DESC,userid ASC LIMIT 50"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $userid) { $t="<b><font color=red>";$et="</font></b>"; } else { $t="";$et=""; } print "<tr style=background-color:#'.$color.'> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td>$t{$r['level']}$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div></div></div></div></div></div>"; }
  4. Made the change dayo! still no luck O,o. I bet im missing something ever so small =/
  5. Hi dayo, I tried what you suggested and came to this   if ($i % 2 == 0) { $color = '#FFFFFF'; } else { $color = '#000000'; }   and for the actual table row I have used   print "<tr style=background-color:#'.$color.'> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td>$t{$r['level']}$et</td> </tr>";   still haven't managed to get it. :( the code for that entire table is   function hof_level() { global $db,$ir,$c,$userid, $myf; print "Showing the 50 users with the highest levels<br /> <table width=75% cellspacing=1 class=tablehof><tr style='background:gray'> <th>Rank</th> <th>User</th> <th>Level</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY level DESC,userid ASC LIMIT 50"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $userid) { $t="<b><font color=red>";$et="</font></b>"; } else { $t="";$et=""; } print "<tr style=background-color:#'.$color.'> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td>$t{$r['level']}$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>"; }
  6. i still haven't had any luck and have tried all the suggestions above :(
  7. i did what u said and have : <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <script> $(document).ready(function() { $("table#idtable1 tr:even").css("background-color", "#F4F4F8"); $("table#idtable1 tr:odd").css("background-color", "#EFF1F1"); }); </script> But still no luck
  8. Hey guys, I'm having some problems with MCCODES and incorporating Jquery into it. Hopefully someone can help. Be much appreciated! The jquery code I am using is: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"> $(document).ready(function() { $("table#idtable1 tr:even").css("background-color", "#F4F4F8"); $("table#idtable1 tr:odd").css("background-color", "#EFF1F1"); }); </script> It's been placed towards the bottom of the head section on header.php Now I want it to work on Halloffame.php so I have used:   <table width=75% cellspacing=1 class=tablehof id=table1 ><tr style='background:gray'> <th>Rank</th> <th>User</th> <th>Level</th> </tr>";   I want it to work on one table. However I haven't recieved any luck! Is anyone able to see where I have gone wrong :(
  9. Yeah PHP.net is hard to understand. Sometimes they make the simplest of codes into something in which you need a degree in PHP to know lol. W3SCHOOLS and TIZAG i would recommend for beginners
  10. I don't see how xat gets on peoples nerves. In fact out of like a thousand people I know who use it you are the only one which has disagreed with it.
  11. You could save money by using an external website which a game i use to play use. ¬This chatroom has admins, mods, members and guests ¬Ability to have private chats ¬Basically admins control the chatroom with full power. Mods have limited power. Members have none and guest if you make can't view the chat unless made into a member ¬Names are changeable ¬Admin powers include: Banning users for life or as many hours as they wish, Creating mods, members and guests, able to delete chat convos ¬Mods power includes: banning users up to 6 hours, creating members and guests ¬Admin colour is orange, mods are white, members are blue and guests are green. Hope you like it :D The site is http://www.xat.com
  12. Re: MCCODE V2 LOGIN PAGE thanks iamwicked someone gave me a mod of yours before but i couldn't use it as were it said GAME NAME it was difficult around there lol....but ill use another one of yours by the way do you know K1NGSCORP1O I used the red and black layout you had up however you are missing a line <form action='authenticate.php' method='post'>
  13. hi im not the best of coders and was wondering if anyone would be kind enough to share a decent login page with me
×
×
  • Create New...