-
Posts
912 -
Joined
-
Last visited
-
Days Won
7
Content Type
Profiles
Forums
Events
Everything posted by Coly010
-
cool mod! i can see a lot of perople using this ;) very neatly laid out:D
-
kk thx for the advice and i did i say it was a flash file? no i said it flashes between the images :D
-
it still works:D
-
so basically this is two images one for events and one for mail. if you get mail the mail image will flash and the same for the events.please dont give negative feedback to start we will create a file called: notify.php (lite) <?php print " <a href='events.php'>"; $d=mysql_query("SELECT COUNT(*) as cnt FROM events WHERE evUSER={$ir['userid']} AND evREAD=0",$c) or die(mysql_error()); $r=mysql_fetch_array($d); if($r['cnt'] > 0) { print "[img=events copy.gif]"; } else { print "[img=events.png]"; } print "</a> <a href='mailbox.php'>"; $d2=mysql_query("SELECT COUNT(*) as cnt FROM mail WHERE mail_to={$ir['userid']} AND mail_read=0",$c) or die(mysql_error()); $r=mysql_fetch_array($d2); if($r['cnt'] > 0) { print "[img=mail copy.gif]"; } else { print "[img=mail.png]"; } print "</a>"; ?> (v2) <?php print " <a href='events.php'>"; $d=db->query("SELECT COUNT(*) as cnt FROM events WHERE evUSER={$ir['userid']} AND evREAD=0",$c) or die(db->_error()); $r=db->_fetch_row($d); if($r['cnt'] > 0) { print "[img=events copy.gif]"; } else { print "[img=events.png]"; } print "</a> <a href='mailbox.php'>"; $d2=db->query("SELECT COUNT(*) as cnt FROM mail WHERE mail_to={$ir['userid']} AND mail_read=0",$c) or die(db->_error()); $r=db->_fetch_row($d2); if($r['cnt'] > 0) { print "[img=mail copy.gif]"; } else { print "[img=mail.png]"; } print "</a>"; ?> and the images are here: http://crossfire.pcriot.com/notify.zip this is my first time coding v2 so dont hate me if i did anything wrong. regards, Coly010
-
Ok! I was wondering "What's the point of having an extra file for the game rules that needs to be coded?" so what i decided to do was create an image that changes between game rules and the description and then either a screenshot or just some writing saying, "If you think you can become the master of all players in this game why not register here/ now." and have the image linked to the register file. like: [url='register.php'][img=imagename.gif][/url] the image i created is: Could you please tell me what you think of my idea.
-
Ok this is basically the same codes as the ones you get along wiht mccodes lite but i have adapted it to suit my needs and hopefully yours too. I designed all the graphics myself which is why they are crap and here is a screenshot: ok the quality might be off but that because of how i saved it. the code for the login is: <?php /* Graphics Designed by: Coly010 */ session_start(); print <<<EOF <html> <head> <title>Souless Warriors</title> <script language="JavaScript"> <!-- function getCookieVal (offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } function GetCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } function SetCookie (name,value,expires,path,domain,secure) { document.cookie = name + "=" + escape (value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } function DeleteCookie (name,path,domain) { if (GetCookie(name)) { document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } } // --> </script> <script language="JavaScript"> var usr; var pw; var sv; function getme() { usr = document.login.username; pw = document.login.password; sv = document.login.save; if (GetCookie('player') != null) { usr.value = GetCookie('username') pw.value = GetCookie('password') if (GetCookie('save') == 'true') { sv[0].checked = true; } } } function saveme() { if (usr.value.length != 0 && pw.value.length != 0) { if (sv[0].checked) { expdate = new Date(); expdate.setTime(expdate.getTime()+(365 * 24 * 60 * 60 * 1000)); SetCookie('username', usr.value, expdate); SetCookie('password', pw.value, expdate); SetCookie('save', 'true', expdate); } if (sv[1].checked) { DeleteCookie('username'); DeleteCookie('password'); DeleteCookie('save'); } } else { alert('You must enter a username/password.'); return false; } } </script> <style> body { font-family:Verdana;font-size:9pt;color:#660000; background-color:#FFFFFF; scrollbar-base-color: #005B70; scrollbar-arrow-color: #F3960B; scrollbar-DarkShadow-Color: #000000; } a:visited,a:active,a:link { color:#330000;text-decoration: none; } a:hover { color:#000000;text-decoration: underline; } table,tr,td { font-size:9pt; } img { border:none; } </style> </head> <center><body onload="getme();">[img=login-logo.png] EOF; $ip = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; if(file_exists('ipbans/'.$ip)) { die("[b]<font color=red size=+1>Your IP has been banned, there is no way around this.</font>[/b]</body></html>"); } print "<h3>>Souless Warriors Log-In</h3> <table align='left'><td background='login-bk.png'><font size='13'>Login</font> "; print "<form action=authenticate.php method=post name=login onsubmit=\"return saveme();\"> Username: <input type=text name=username> Password: <input type=password name=password> Remember me? <input type=\"radio\" value=\"ON\" name=\"save\">Yes <input type=\"radio\" name=\"save\" value=\"OFF\" checked>No <input type=submit value=Submit></form></td></tr></table>"; print " <table><td background='Description-bk.png'><font size='13'>Description</font> "; print "Welcome to Souless Destroyers... Once you enter theres no backing out... you lose your soul but can you keep your mind... When the battle begins where is the end... <font size='4'> no-where...</font>no-where...</font><font size='1'>no-where...</font></td></table> "; print "<table><td background='login-copy.png'>[url='register.php']REGISTER NOW![/url] [i]Powered by codes made by Dabomstew. Copyright © 2010 Coly010[/i]</td></table>"; print " <table align='left'><td background='login-register-bk.png'> [url='register.php'] Register[/url] [url='grules.php'] Game Rules[/url] [url='story.php'] Story[/url] [url='s-shots.php'] Screenshots[/url] </td></table>"; print "</body></center></html>"; ?> if you like it post back and i'll put the images up then
-
thx man!
-
lol! i wanted to see how u would all react. you can just change it too putting them in jail. not fed just jail. its roughly [progressbar=90,#000000]Complete[/progressbar] still need hire member and pay member. i dont know how to do this but... :( and what you all think as it is my first mod
-
okthis is my first mod so it might have bugs. its a simple run youur own business script and its not completely done yet. but here it is <?php /* Business Mod File:business.php Under liscense: GNU Creator: Coly010 For: Mccodes LITE NOTE: Somebody will be able to convert this to V2 */ session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.*,h.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN houses h ON h.hWILL=u.maxwill WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); $header=$ir['head']; require "$header"; $h = new headers; $h->startheaders(); 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(); switch($_GET['action']) { case 'stockup': stock_up(); break; case 'stockupconfirm': stock_up_confirm(); break; case 'upgrade': upgrade(); break; case 'upgradeconfirm': upgrade_confirm(); break; case 'buy': buy(); break; case 'buyconfirm': buy_confirm(); break; case 'sell': sell(); break; case 'selconfirm': sell_confirm(); break; case 'burndown': burn_down(); break; case 'burndownconfirm': burn_down_confirm(); break; case 'hire': hire_a_member(); break; case 'hiresubmit': hire_a_member_submit(); break; case 'pay': pay_member(); break; case 'paysubmit': pay_member_submit(); break; default: business_index(); break; } function business_index() { global $ir,$c,$userid; if($ir['business'] == 1) print "Welcome back to your business of {$ir['b_name']}! Everyday you earn {$ir['b_earn']}! Remember, you need to stock up on your equipment/stocks. To do this click [url='business.php?action=stockup'] here![/url] "; print "<h3>Business Owner Links</h3>"; print " [[url='business.php?action=stockup']Stock Up[/url]] [[url='business.php?action=upgrade']Upgrade Business[/url]] [[url='business.php?action=sell']Sell Your Business[/url]] [[url='business.php?action=burndown']Burn Down Business[/url]] [[url='business.php?action=hire']Hire A Member To Work For You[/url]] [[url='business.php?action=pay']Pay your employee(s)[/url]] "; print " Stocks{$ir['b_stocks']}|Employees:{$ir['b_hires']}|Business Level: {$ir['b_level']} "; if($ir['business'] == 0) print "<h3>Welcome</h3> Here you can buy a business to help you get more money in the game. You can also upgrade this and hire others to work for you. >[url='business.php?action=buy']Buy a Business[/url]"; } function stock_up() { global $ir, $c; print "<h3>Stocking Up</h3> "; print "You currently have {$ir['b_stocks']} Stocks. If You want to stock up click on the link below. Remember you get 100 stocks each time this link is clicked. It Costs 10,000 money to stock up. "; print "[url='business.php?action=stockupconfirm']Stock Up[/url]"; } function stock_up_confirm() { global $ir, $c; mysql_query("UPDATE users SET b_stock=b_stock+100 WHERE userid=$userid",$c); mysql_query("UPDATE users SET money=money-10000 WHERE userid=$userid",$c); print "You have successfully bought 100 Stock!"; } function upgrade() { global $ir, $c; print "<h3>Upgrade you Business</h3>"; print "You can upgrade the level of your business which means your more of your stocks will be bought. "; print "Your business level is {$ir['b_level']}! "; print "It costs 100,000 money to upgrade it! [url='business.php?action=upgradeconfirm']Upgrade Your Business[/url] "; } function upgrade_confirm() { global $ir, $c; mysql_query("UPDATE users SET b_level=b_level+1 WHERE userid=$userid",$c); mysql_query("UPDATE users SET money=money-100000 WHERE userid=$userid",$c); print "You have successfully upgraded your business!"; } function buy() { global $ir, $c; print "<h3>Buying a Business</h3>"; print "It costs 300,000 money to start a business. <form action='business.php?action=buyconfirm' method='post'> Business Name: <input type='text' name='b_name' /> Business Logo: <input type='text' name='b_logo' value='".htmlspecialchars(stripslashes($ir['b_logo']))."' /> <input type='submit' value='Submit' /></form>"; } function buy_confirm() { global $ir, $c; mysql_query("UPDATE users SET (b_name, b_level, b_stock, b_hires, b_earn, b_logo) VALUES( '{$_POST['b_name']}','{$_POST['b_logo']}'), $b_level, 1, $b_stock, 100, $b_hires, 0, $b_earn, 1000)", $c); mysql_query("UPDATE business SET (b_id, b_name, b_level, b_stock, b_hires, b_earn, b_logo) VALUES( '{$_POST['b_name']}','{$_POST['b_logo']}'), $b_id, $userid, $b_level, 1, $b_stock, 100, $b_hires, 0, $b_earn, 1000)", $c); mysql_query("UPDATE users SET money=money-300000 WHERE userid=$userid",$c); print "Business Successfully Bought!"; } function sell() { global $ir, $c; print "<h3>Selling Your Business</h3>"; print " Are you sure you want to sell your business back to the game? You can't undo this and you only gain 50,000 money. "; print "<form action='business.php?action=sellconfirm' method='post'> <input type='submit' value='YES' /></form> <form action='business.php' method='post'><input type='submit' value='NO' /></form> "; } function sell_confirm() { global $ir, $c; mysql_query("UPDATE users SET (business, b_name, b_level, b_stock, b_hires, b_earn, b_logo) VALUES( '',''), $b_level, 0, $b_stock, 0, $b_hires, 0, $b_earn, 0, $business, 0)", $c); mysql_query("UPDATE users SET money=money+50000 WHERE userid=$userid",$c); mysql_query("DELETE FROM `business` WHERE b_id=$userid",$c); print "Business Sucessfully Sold!"; } function burn_down() { global $ir, $c; print "[b]Burining Down Business[/b]"; print " You are thinking of burining down your business to try and claim the insurance on it. You have a 50/50 chance of getting the insurance. [url='business.php?action=burndownconfirm']Burn Down Anyway[/url]"; } function burn_down_confirm() { global $ir, $c; $chance = rand(1,2); if ($chance == 1) { $amnt=rand(10000,200000); if($ir['money'] > $amnt) { print "You have successfully burnt your business and claimed the insurance of $amnt "; mysql_query("UPDATE users SET money=money+ {$amnt } where userid=$userid",$c); $ir['money']-=$amnt; } if ($chance == 2) { print "UNLUCKY! You have been caught and are put into the fedjail for 1 day. "; mysql_query("UPDATE users SET fedjail=fedjail+1 WHERE userid=$userid",$c); } } function hire_a_member() { global $ir, $c; print " coming soon"; } function hire_member_submit() { global $ir, $c; print "coming soon"; } function pay_member() { global $ir, $c; print "coming soon"; } function pay_member_submit() { global $ir, $c; print "coming soon"; } $h->endpage(); ?> i'll post mysql later. no negative comments either please
-
Fixed and changed for LITE users <?php session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.*,h.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN houses h ON h.hWILL=u.maxwill WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); include "header.php"; $h = new headers; $h->startheaders(); 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(); print "<h3>Crystal Market</h3>"; switch($_GET['action']) { case "buy": crystal_buy(); break; case "remove": crystal_remove(); break; case "add": crystal_add(); break; default: cmarket_index(); break; } function cmarket_index() { global $ir,$c,$userid,$h; print "[url='cmarket.php?action=add']> Add A Listing[/url] Viewing all listings... <table width=75% cellspacing=1 class='table'> <tr style='background:gray'> <th>Adder</th> <th>Qty</th> <th>Price each</th> <th>Price total</th> <th>Links</th> </tr>"; $q=mysql_query("SELECT cm.*, u.* FROM crystalmarket cm LEFT JOIN users u ON u.userid=cm.cmADDER ORDER BY cmPRICE/cmQTY ASC"); while($r=mysql_fetch_array($q)) { if($r['cmADDER'] == $userid) { $link = "[url='cmarket.php?action=remove&ID={$r[']Remove[/url]"; } else { $link = "[url='cmarket.php?action=buy&ID={$r[']Buy[/url]"; } $each= abs(intval($r['cmPRICE'] / $r['cmQTY'])); print "\n<tr> <td>[url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userid']}]</td> <td>{$r['cmQTY']}</td> <td> \$" . number_format($each)."</td> <td>\$".number_format($r['cmPRICE'])."</td> <td>[$link]</td> </tr>"; } print "</table>"; } function crystal_remove() { global $db,$ir,$c,$userid,$h; $q=mysql_query("SELECT * FROM `crystalmarket` WHERE `cmID`={$_GET['ID']} AND `cmADDER`=$userid"); if(!mysql_num_rows($q)) { print "Error, either these crystals do not exist, or you are not the owner. [url='cmarket.php']> Back[/url]"; $h->endpage(); exit; } $r=mysql_fetch_array($q); mysql_query("UPDATE `users` SET `crystals`=`crystals`+{$r['cmQTY']} where `userid`=$userid"); mysql_query("DELETE FROM `crystalmarket` WHERE `cmID`={$_GET['ID']}"); print "Crystals removed from market! [url='cmarket.php']> Back[/url]"; } function crystal_buy() { global $db,$ir,$c,$userid,$h; $q=mysql_query("SELECT * FROM crystalmarket cm WHERE cmID={$_GET['ID']}"); if(!mysql_num_rows($q)) { print "Error, either these crystals do not exist, or they have already been bought. [url='cmarket.php']> Back[/url]"; $h->endpage(); exit; } $r=mysql_fetch_array($q); if($r['cmPRICE'] > $ir['money']) { print "Error, you do not have the funds to buy these crystals. [url='cmarket.php']> Back[/url]"; $h->endpage(); exit; } mysql_query("UPDATE `users` SET `crystals`=`crystals`+{$r['cmQTY']} where `userid`=$userid"); mysql_query("DELETE FROM `crystalmarket` WHERE `cmID`={$_GET['ID']}"); mysql_query("UPDATE `users` SET `money`=`money`-{$r['cmPRICE']} where `userid`=$userid"); mysql_query("UPDATE `users` SET `money`=`money`+{$r['cmPRICE']} where `userid`={$r['cmADDER']}"); event_add($r['cmADDER'],"[url='viewuser.php?u=$userid']{$ir['username']}[/url] bought your {$r['cmQTY']} crystals from the market for \$".number_format($r['cmPRICE']).".",$c); print "You bought the {$r['cmQTY']} crystals from the market for \$".number_format($r['cmPRICE'])."."; } function crystal_add() { global $db,$ir,$c,$userid,$h; $_POST['amnt'] = abs(@intval($_POST['amnt'])); $_POST['price'] = abs(@intval($_POST['price'])); if($_POST['amnt']) { if($_POST['amnt'] > $ir['crystals']) { die ("You are trying to add more crystals to the market than you have."); } $tp=$_POST['amnt']*$_POST['price']; mysql_query("INSERT INTO `crystalmarket` VALUES('',$userid, $tp, {$_POST['amnt']})"); mysql_query("UPDATE `users` SET `crystals`=`crystals`-{$_POST['amnt']} WHERE `userid`=$userid"); print "Crystals added to market! [url='cmarket.php']> Back[/url]"; } else { print "[b]Adding a listing...[/b] You have [b]{$ir['crystals']}[/b] crystal(s) that you can add to the market.<form action='cmarket.php?action=add' method='post'><table width=50% border=2><tr> <td>Crystals:</td> <td><input type='text' name='amnt' value='{$ir['crystals']}' /></td></tr><tr> <td>Price Each:</td> <td><input type='text' name='price' value='200' /></td></tr><tr> <td colspan=2 align=center><input type='submit' value='Add To Market' /></tr></table></form>"; } } $h->endpage(); ?>
-
called it. there was only one picture
-
Ok everyone i was thinking of making a template for login.php so i went into to paint and created a couple pictures . then i named the file login.php and saved the format as jpeg. when i went to find the file it was saved as a .php file. now i was wondering, is this normal?
-
brill thx. problem is i dont know how to build a forum.
-
wicked thx. has anyone got a personal website that i could look at and get ideas? btw what would be the best coding language to use? i only know PHP and HTML. oh and this might be much but how do you embed a forum. like with fantastico you can install one but it redirects you away from the main site. any ideas?
-
anyone?? i was thinking about factions but they would waste too much space.
-
i was just wondering what should a personal website include? im thinking of creating one so i can post my mods etc for people download them inn zip files.
-
i have changed this for lite users with help from Sniko <?php /* this has been secured by Redex and edited BY Coly010 for LITE users */ session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm); $h->menuarea(); $_GET['action'] = isset($_GET['action']) && is_string($_GET['action']) ? strtolower(trim($_GET['action'])) : ""; switch($_GET['action']) { case 'sexchange2': do_sex_change(); break; case 'sexchange': conf_sex_change(); break; case 'passchange2': do_pass_change(); break; case 'passchange': pass_change(); break; case 'namechange2': do_name_change(); break; case 'namechange': name_change(); break; case 'picchange2': do_pic_change(); break; case 'picchange': pic_change(); break; case 'forumchange2': do_forum_change(); break; case 'forumchange': forum_change(); break; default: prefs_home(); break; } function prefs_home() { global $db,$ir,$c,$userid,$h; print "<h3>Preferences</h3> [url='preferences.php?action=sexchange']Sex Change[/url] [url='preferences.php?action=passchange']Password Change[/url] [url='preferences.php?action=namechange']Name Change[/url] [url='preferences.php?action=picchange']Display Pic Change[/url] [url='preferences.php?action=forumchange']Forum Info Change[/url] "; } function conf_sex_change() { global $ir,$c,$userid,$h; if($ir['gender'] == "Male") { $g="Female"; } else { $g="Male"; } print "Are you sure you want to become a $g? [url='preferences.php?action=sexchange2']Yes[/url] | [url='preferences.php']No[/url]"; } function do_sex_change() { global $db,$ir,$c,$userid,$h; if($ir['gender'] == "Male") { $g="Female"; } else { $g="Male"; } $db->query("UPDATE `users` SET `gender` = '".$g."' WHERE (`userid` = $userid)"); print "Success, you are now $g! [url='preferences.php']Back[/url]"; } function pass_change() { global $ir,$c,$userid,$h; print "<h3>Password Change</h3><form action='preferences.php?action=passchange2' method='post'>Current Password: <input type='password' name='oldpw' /> New Password: <input type='password' name='newpw' /> Confirm: <input type='password' name='newpw2' /> <input type='submit' value='Change PW' /></form>"; } function do_pass_change() { global $db,$ir,$c,$userid,$h; if(hash("sha512", $_POST['oldpw']) != $ir['userpass']) { echo ('The current password you entered was wrong. [url="preferences.php?action=passchange"]> Back[/url]'); } else if($_POST['newpw'] !== $_POST['newpw2']) { echo ('The new passwords you entered did not match! [url="preferences.php?action=passchange"]> Back[/url]'); } else { $_POST['newpw'] = hash("sha512", $_POST['newpw']); $db->query("UPDATE `users` SET `userpass` = ".$_POST['newpw']." WHERE (`userid`=$userid"); echo ('Password changed!'); } } function name_change() { global $ir,$c,$userid,$h; print "<h3>Name Change</h3> Please note that you still use the same name to login, this procedure simply changes the name that is displayed. <form action='preferences.php?action=namechange2' method='post'> New Name: <input type='text' name='newname' /> <input type='submit' value='Change Name' /></form>"; } function do_name_change() { global $db,$ir,$c,$userid,$h; $_POST['newname']= mysql_real_escape_string(strip_tags($_POST['newname'])); if(empty($_POST['newname'])) { echo 'You didn\'t enter a new name <a href=\'prefernces.php?action=namechange\'>Back</a>'; } else { $_POST['newname']=str_replace(array("<", ">", "\\\'"), array("<", ">", "'"), $_POST['newname']); $db->query("UPDATE `users` SET `username`='".$_POST['newname']."' WHERE (`userid`=$userid)"); print "Username changed!"; } } function pic_change() { global $ir,$c,$userid,$h; print "<h3>Pic Change</h3> Please note that this must be externally hosted, [url='http://imageshack.us']ImageShack[/url] is our recommendation. Any images that are not 150x150 will be automatically resized <form action='preferences.php?action=picchange2' method='post'> New Pic: <input type='text' name='newpic' value='".htmlspecialchars(stripslashes($ir['display_pic']))."' /> <input type='submit' value='Change Name' /></form>"; } function do_pic_change() { global $db,$ir,$c,$userid,$h; $_POST['newpic']= mysql_real_escape_string(strip_tags($_POST['newpic'])); if(empty($_POST['newpic'])) { echo 'you didn\'t enter a new picture <a href=\'preferences.php?action=pic_change\'>Back</a>'; } else { $_POST['newpic']=stripslashes($_POST['newpic']); $db->query("UPDATE `users` SET `display_pic`='".$_POST['newpic']."' WHERE (`userid`=$userid)"); print "Pic changed!"; } } function forum_change() { global $ir,$c,$userid,$h; print "<h3>Forum Info Change</h3> Please note that the avatar must be externally hosted, [url='http://imageshack.us']ImageShack[/url] is our recommendation. Any avatars that are not 100x100 will be automatically resized <form action='preferences.php?action=forumchange2' method='post'> Avatar: <input type='text' name='forums_avatar' value='".htmlspecialchars(stripslashes($ir['forums_avatar']))."' /> Signature (you may use BBcode): <textarea rows=10 cols=50 name='forums_signature'>".$ir['forums_signature']."</textarea> <input type='submit' value='Change Info' /></form>"; } function do_forum_change() { global $db,$ir,$c,$userid,$h; $_POST['forums_avatar']= mysql_real_escape_string(strip_tags($_POST['forums_avatar'])); $_POST['forums_avatar']=str_replace(array("<", ">"), array("<", ">"), $_POST['forums_avatar']); mysql_query("UPDATE `users` SET `forums_avatar`='".$_POST['forums_avatar']."', `forums_signature` = '".$_POST['forums_signature']."' WHERE (`userid`=$userid)"); print "Forum Info changed!"; } $h->endpage(); ?> This has been tested and it works.
-
I'm finding it hard to think of ideas for mods so if any of you have ideas for mods that you dont want to code yourself post them here. thanks Coly010
-
k thx
-
its ok but its still not working
-
oh! it wont be your line 162! it will be 14 lines less
-
sorry to mention this but it comes up Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/colum/public_html/preferences.php on line 162 any ideas what this means?
-
nice one! i've needed the Forum info thing in my prefernces for ages! so thx. i'm going to edit this for lite users.
-
the sql wont work for me it comes up [mysql] Error SQL query: CREATE TABLE `quests` ( `questID` INT( 11 ) NOT NULL AUTO_INCREMENT , `questNAME` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL , `questBRAVE` INT( 11 ) NOT NULL DEFAULT '0', `questPERCFORM` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL , `questSUCCESSMUNY` INT( 11 ) NOT NULL DEFAULT '0', `questSUCCESSCRYS` INT( 11 ) NOT NULL DEFAULT '0', `questSUCCESSITEM` INT( 11 ) NOT NULL DEFAULT '0', `questGROUP` INT( 11 ) NOT NULL DEFAULT '0', `questITEXT` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL , `questSTEXT` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL , `questFTEXT` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL , `questXP` INT( 11 ) NOT NULL DEFAULT '0', PRIMARY KEY ( `questID` ) , FULLTEXT ( `questNAME` , `questPERCFORM` , `questITEXT` , `questSTEXT` , `questFTEXT` )) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci ---------------------------------------- CREATE TABLE `questgroups` ( [...] MySQL said: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '---------------------------------------- CREATE TABLE `questgroups` ( `qgID' at line 21 [/mysql] i fixed it!
-
For any lite users here is the bank code: <?php session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); echo "<h3>Bank</h3>"; switch($_GET['action']) { case 'Withdraw': withdraw(); break; case 'Deposit': deposit(); break; default: index(); break; } if($ir['bankmoney']=='-1') { $cost=20000; if($ir['money']<$cost) { echo "You dont have Enough Money! >[url='index.php']Back[/url]"; $h->endpage(); exit; } $costy=number_format($cost); echo "Congratulation you have Bought a Bank Account for \$$costy >[url='bank.php']Go to Bank[/url]"; mysql_query("UPDATE users SET bankmoney=0, money=money-$cost WHERE userid=$userid"); } function index() { global $ir,$c,$userid; echo " <table width=80% class=h border=1><tr><th>Deposit</th><th>Withdraw</th></tr><tr> <td> When adding to your account 2% is taken from you <form action='?action=Deposit' method='post'> Amount: <input type='text' name='dt' value='{$ir['money']}' /> <input type='submit' value='Deposit' /></form></td> <td> Withdrawl cash. No money is taken for using this <form action='?action=Withdraw' method='post'> Amount: <input type='text' name='wd' value='{$ir['bankmoney']}' /> <input type='submit' value='Withdraw' /></form></td></tr></table> <table width=80% border=1 class=h><tr><th>"; echo "</th></tr></table>"; } function withdraw() { global $ir,$c,$userid,$h,$db; $_POST['wd'] = abs(intval($_POST['wd'])); $with=number_format($_POST['wd']); $bkmon=number_format($ir['bankmoney']); if($ir['bankmoney']<$_POST['wd']) { echo "You Tried Withdrawing [b]\$$with[/b] but you only have [b]\$$bkmon[/b]"; $h->endpage(); exit; } $total=number_format($ir['bankmoney']-$_POST['wd']); echo "You Successfully Withdrew [b]\$$with[/b] You now have [b]\$$total[/b] in your Bank. >[url='bank.php']Back[/url]"; mysql_query("UPDATE users SET bankmoney=bankmoney-{$_POST['wd']}, money=money+{$_POST['wd']} WHERE userid=$userid"); } function deposit() { global $ir,$c,$userid,$h,$db; $_POST['dt'] = abs(intval($_POST['dt'])); $dep=number_format($_POST['dt']); $mon=number_format($ir['money']); if($ir['money']<$_POST['dt']) { echo "You tried depositing [b]\$$dep[/b] but you only have [b]\$$mon[/b] >[url='bank.php']Back[/url]"; $h->endpage(); exit; } $blah=$_POST['dt']/50; if($blah>10000) { $blah=10000; } $taken=number_format($blah); $bank=$_POST['dt']-$blah; $banky=number_format($bank); $total=number_format($ir['bankmoney']+$bank); echo "You successfully deposited [b]\$$banky[/b] out of [b]\$$dep[/b] into your bank account The banker toke his [b]\$$taken[/b] cut You now have [b]\$$total[/b] in your bank. >[url='bank.php']Back[/url]"; mysql_query("UPDATE users SET bankmoney=bankmoney+$bank, money=money-{$_POST['dt']} WHERE userid=$userid"); } $h->endpage(); ?> thx everyone for this mod. i've needed it.