Jump to content

zackcez

Members
  • Posts

    95
  • Joined

  • Last visited

    Never

Everything posted by zackcez

  1. But that doesn't solve my problem :s
  2. Here's what I came up with: $percent = ("total_uptime" / ("total_uptime" + "total_downtime")) * 100; Where total total_uptime starts at 1 and total_downtime at 0...I've create a cron job to automatically add one to uptime if the server is up and if down add one to down. But I'm getting this message: Warning: Division by zero in [path]\modules\server_status\index.php on line 262 If anyone could either correct my math or help me find a different way to do this I'd very much appreciate it. PS: The total_uptime and total_downtime are rows in my mysql database.
  3. I'd like to know how I can make a simple fsock return a server uptime percent likewise: http://e-topbiz.com/trafficdemos/server1/results.php Here's my current code : <? $fp = fsockopen("localhost", "3306", $err_no, $err_msg, 10) or die ("$err_msg"); echo "MySql Server Online" ?>
  4. I'm attempting to make it search through the database to get one result, the user with the highest value that also has $e of 0.... Also here would be the function: function getExclude($id) { $excludeQuery = mysql_query("SELECT * FROM usergroup WHERE usergroupid='$id'"); $excludeData = mysql_fetch_array($excludeQuery); switch ($excludeData['highscores_perms']) { case 2: $exclude = 1; break; case 3: $exclude = 1; break; default: $exclude = 0; break; } return $exclude; }
  5. Umm, would you have a function in mind you could suggestion :s?
  6. Here's my code: $i = '0'; $q = mysql_query("SELECT * FROM user ORDER BY ".$skill."xp DESC"); $row = mysql_fetch_array($q); $e = getExclude($row['usergroupid']); do { if ($e == '1') { $i++; } else { $pre = getPre($row['usergroupid']); $suf = getSuf($row['usergroupid']); $usernamer = $pre."".$row['username']."".$suf; echo"<tr><td class=\"alt1\" align=\"center\" nowrap=\"nowrap\">"; // "Layout" echo"<img src=\"http://rshelp.net/modules/highscores/icons/".$skill.".gif\"></td>"; //Image echo"<td class=\"alt1\" nowrap=\"nowrap\"><a href=\"index.php?pageid=highscores&action=user&user=" . $row['username'] . "\">$usernamer</a> (" . $row[''.$skill.'lvl'] . ")</td></tr>"; //User Info } } while ($i>0); //LINE 77 Everything is defined....it just sits for the max time and stops .... Fatal error: Maximum execution time of 30 seconds exceeded in myfile.php on line 77
  7. I only want this to display ONE column of data....
  8. Here's my code: foreach ($skillNames as $skill) { $q = "SELECT * FROM user ORDER BY ".$skill."xp DESC LIMIT 1"; $r = mysql_query($q) or die(mysql_error()); while($row = mysql_fetch_array($r)){ $perms = getPerms($row['usergroupid']); if ($perms == '1' || $perms == '0') { $pre = getPre($row['usergroupid']); $suf = getSuf($row['usergroupid']); $usernamer = $pre."".$row['username']."".$suf; echo"<tr><td class=\"alt1\" align=\"center\" nowrap=\"nowrap\">"; // "Layout" echo"<img src=\"http://rshelp.net/modules/highscores/icons/".$skill.".gif\"></td>"; //Image echo"<td class=\"alt1\" nowrap=\"nowrap\"><a href=\"index.php?pageid=highscores&action=user&user=" . $row['username'] . "\">$usernamer</a> (" . $row[''.$skill.'lvl'] . ")</td></tr>"; //User Info } } unset($q); unset($r); } Everything is correctly defined...lets say the person the query selects first doesn't have the right permissions, it then echo's nothing....how could i make it so if it returns without anything that it 'continues down the line'
  9. Warning: fsockopen() [function.fsockopen]: unable to connect to :80 in [path]\modules\products\index.php on line 168 Error 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
  10. Well here's my initial form: echo"<form action=\"index.php?pageid=products&do=done\" method=\"post\" name=\"vbform\" onsubmit=\"return form_continue();\" id=\"prodform\">"; echo"<table class=\"tborder\" cellpadding=\"6\" cellspacing=\"1\" border=\"0\" width=\"100%\" align=\"center\">"; echo"<tr><td class=\"thead\">Licence Information</td></tr>"; echo"<tr><td class=\"panelsurround\" align=\"center\"><div class=\"panel\">"; for ($counter = 1; $counter <= $quantity; $counter += 1) { echo"<div align=\"left\"><fieldset class=\"fieldset\"><legend>" . $product['name'] . " License #$counter</legend> <div class=\"smallfont\">Web Site URL:<br /><input type=\"text\" size=\"30\" name=\"url_$counter\" value=\"http://\" /></div> <div><input id=\"install_service_$counter\" type=\"checkbox\" name=\"install_$counter\" value=\"1\" /> <label for=\"install_service_7-1\">Installation Service ($1.99)</label></div> <div><input id=\"branding_free_$counter\" type=\"checkbox\" name=\"copy_$counter\" value=\"1\" /> <label for=\"branding_free_7-1\">Copyright Removal ($3.99)</label></div></fieldset></div>"; } echo"<input type=\"hidden\" name=\"qan\" value=\"$quantity\">"; echo"</td></tr></div>"; echo"<div align=\"center\" id=\"please_wait\" style=\"display:none; margin-top:6px\"> <img style=\"vertical-align: middle;\" src=\"/images/misc/progress.gif\" alt=\"Checking URL\" id=\"wait_img\" /> <strong>Processing - Please Wait</strong></div></td></tr> <tr><td align=\"center\" class=\"tfoot\"><input class=\"button\" type=\"submit\" value=\"Continue\" /></td></tr></form></td></tr></table>"; And here's my done page: $qan = $_POST['qan']; for ($counter = 1; $counter <= $qan; $counter += 1) { $install = $_POST['install_$counter']; $copyright = $_POST['copy_$counter']; $url = $_POST['url_$counter']; $valid = @fsockopen("$url", 80, $errno, $errstr, 10); if (!$valid) { echo "$url is not valid; therefore was not registered!<br>"; } else { echo "$url is valid; therefore has been registered!<br>"; } } It always returns that it is NOT valid, even when it is, if anyone has a suggestion or knows how to fix this I'd appreciate it
  11. I don't know how I missed that lol, thanks
  12. Well here's my messy code: echo"<table class=\"tborder\" cellpadding=\"6\" cellspacing=\"1\" border=\"0\" width=\"100%\" align=\"center\"> <tr><td class=\"thead\">Order</td></tr> <tr><td align=\"center\" class=\"panelsurround\"><div class=\"panel\"><div align=\"left\"><fieldset class=\"fieldset\"><legend>Licence Quantity</legend><div class=\"smallfont\" style=\"padding:3\">Please enter the quantity of <b>" . $product['name'] . "</b> licenses that you wish to obtain for <b>$price</b> each.</div><table cellpadding=\"0\" cellspacing=\"4\"><tr><td><input class=\"bginput\" size=\"2\" type=\"text\" name=\"quantity\" value=\"1\" /></td></tr></table> <form method=\"post\" action=\"index.php?pageid=products&do=confirm\"> <input type=\"hidden\" name=\"pay\" value=\"$pay\"> <input type=\"hidden\" name=\"id\" value=\"" . $product['id'] . "\"> <tr><td class=\"thead\">License Agreement</td></tr><td class=\"panelsurround\" align=\"center\"><div class=\"panel\"><div align=\"left\"> <fieldset class=\"fieldset\"><legend>Terms & Conditions</legend><div class=\"alt1\" overflow:auto style=\"border:thin inset; padding:6px; height:166px;\"> Please take your time to read over our licence agreement; If you fail to compel with it we have the right to get your software removed/and or take legal action against you. <style> <!-- .pad3 { padding: 3px; } --> </style> <ol><li class=\"pad3\"><b>Limitations</b> - You may only use each licence on one forum at a time; If you wish to switch your licence over to a different forum, you have to ability through the usercp. <table cellpadding=\"2\" cellspacing=\"0\"> </table></li> <li class=\"pad3\"><b>Copyright Removal</b> - You are under no circumstance may you remove the copyright on any of our products/licenced or not. Although you may purchase copyright removal via usercp.</li> <li class=\"pad3\"><b>Liability</b> - By agreeing to our terms and conditions you agree that you will follow all of the above and that anything illegally you do you <font color=\"red\"><b>WILL</font></b> be your own problem </li> </ol></div> <div style=\"margin-top:4px;margin-bottom:4px\"><label for=\"agree_terms\"><input type=\"checkbox\" name=\"agree\" id=\"agree_terms\" value=\"1\" /><strong>I have read and agree to the Terms and Conditions.</strong></label><br /> </div> </fieldset></div></div></td></tr><tr><td align=\"center\" class=\"tfoot\"><input class=\"button\" type=\"submit\" value=\"Continue\" /></td></tr></table></form></td></tr>"; That all turns up fine, but when I click submit nothing shows up, here's what I have for my confirm page: $quantity = $_POST['quantity']; echo $quantity; Any suggestions :s?
  13. Well here's my current code: $getFeatures = $db->query("SELECT * FROM features WHERE product='1'"); $feature = mysql_fetch_array($getFeatures); $features = array($feature['text']); foreach ($features as $featuree) { echo"<li>$featuree</li>"; } Any one have any suggestions :s?
  14. Well I'm trying to make it so if the value is in the array it does something like this: $mod_access = array("3", "4"); if ($loggedusergroup == '$mod_access') { echo"Stuff I do"; } anyone know how I can make that work?
  15. It's in the global.php file, this is a vbulletin module.
  16. Well, here's my code from line 43+: $getRankQuery = $db->query_read("SELECT * FROM user ORDER BY $end DESC"); while ($rankData = $db->fetch_array($getRankQuery)) { $endRank[$rankData['username']] = $rank++; } $db->free_result($getRankQuery); unset($rankData); And the error: Fatal error: Call to a member function on a non-object in C:\Inetpub\vhosts\MYSITE\httpdocs\modules\test.php on line 43
  17. What I'm trying to do is have a variable like this: $skill = Attack; $PlayerXp[$skill] = number_format($row[$skill . "xp"]); I'd like it to add the word xp at the end of the $skill variable without physically changing the variable.
  18. Kind of, but I don't want the value to be a number...
  19. I would like to make it so I don't have to define something like this a million times: $PlayerXp["Bla"] = getXp(Bla); And simply make it easier by something like this: $PlayerXp[string Skill] = getXp(Skill); I'm not sure exactly how to explain it tbh :s....So I'll try comparing it to java public int PlayerXp[]
  20. I'm just wondering if something like this is possible: $PlayerXp[string Skill] = getXp(Skill); And I can simply use it has echo $PlayerXp[Whateverhere]; And the 'Whateverhere' will be the Skill value in getXp....
  21. Well, I'm not sure if this would work but I was messing around and I came up with this: <?php $user = Zack; function getRank($user){ $query = "SELECT * FROM user"; $rank = 0; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ $rank++; $test_rank[" . $row['username'] . "] = $rank; echo $test_rank[$user]; } } getRank($user); ?> Anyone Know if that'd work?
  22. I know that this will not work...but here's what I have: <?php $user = Zack; function getRank($user){ $query = "SELECT * FROM user ORDER BY score"; $rank = 0; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ $rank++; $user_rank = "$rank WHERE username='$user'"; } } ?> What I'm trying to do is make it find the rank for every user but store the one for a certain user (Zack). If anyone knows how I can make that work or a better way to do it, please post here
  23. Well I have a script that I made: http://rshelp.net/index.php?pageid=highscores But, I'm using a loop...and what I want to do Is make it so when you click the users name it'll show you all the users stats and rank for each one(The main page gets ranks like this: $i then $i++...which works fine...) If you don't understand what I'm saying...please tell me what I need to 'explain' more :s Btw this is the page I want the ranks on: http://rshelp.net/index.php?pageid=highscores&search=Zack
  24. Well, I got the basics down but...how could I make this code: if($m_stat == 'attack') { $stat = Attackxp; $skill_name = Attack; $skill_lvl = Attacklvl; } elseif($m_stat == 'defence'){ $stat = Defencexp; $skill_name = Defence; $skill_lvl = Defencelvl; } elseif($m_stat == 'hitpoints'){ $stat = Hitpointsxp; $skill_name = Hitpoints; $skill_lvl = Hitpointslvl; } elseif($m_stat == 'Crafting'){ $stat = Craftingxp; $skill_name = Crafting; $skill_lvl = Craftinglvl; } elseif($m_stat == 'farming'){ $stat = Farmingxp; $skill_name = Farming; $skill_lvl = Farminglvl; } elseif($m_stat == 'strength'){ $stat = Strengthxp; $skill_name = Strength; $skill_lvl = Strengthlvl; } elseif($m_stat == 'range'){ $stat = Rangexp; $skill_name = Range; $skill_lvl = Rangelvl; } elseif($m_stat == 'prayer'){ $stat = Prayerxp; $skill_name = Prayer; $skill_lvl = Prayerlvl; } elseif($m_stat == 'magic'){ $stat = Magicxp; $skill_name = Magic; $skill_lvl = Magiclvl; } elseif($m_stat == 'cooking'){ $stat = Cookingxp; $skill_name = Cooking; $skill_lvl = Cookinglvl; } elseif($m_stat == 'woodcutting'){ $stat = Woodcuttingxp; $skill_name = Woodcutting; $skill_lvl = Cookinglvl; } elseif($m_stat == 'fletching'){ $stat = Fletchingxp; $skill_name = Fletching; $skill_lvl = Fletchinglvl; } elseif($m_stat == 'fishing'){ $stat = Fishingxp; $skill_name = Fishing; $skill_lvl = Fishinglvl; } elseif($m_stat == 'firemaking'){ $stat = Firemakingxp; $skill_name = Firemaking; $skill_lvl = Firemakinglvl; } elseif($m_stat == 'mining'){ $stat = Miningxp; $skill_name = Mining; $skill_lvl = Mininglvl; } elseif($m_stat == 'herblore'){ $stat = Herblorexp; $skill_name = Herblore; $skill_lvl = Herblorelvl; } elseif($m_stat == 'agility'){ $stat = Agilityxp; $skill_name = Agility; $skill_lvl = Agilitylvl; } elseif($m_stat == 'thieving'){ $stat = Thievingxp; $skill_name = Thieving; $skill_lvl = Thievinglvl; } elseif($m_stat == 'slayer'){ $stat = Slayerxp; $skill_name = Slayer; $skill_lvl = Slayerlvl; } elseif($m_stat == 'runecrafting'){ $stat = Runecraftingxp; $skill_name = Runecrafting; $skill_lvl = Runecraftinglvl; } else { $skill_name = Overall; $m_stat; $totalAAA = "Attackxp + Woodcuttingxp + Defencexp + Strengthxp + Hitpointsxp + Rangexp + Prayerxp + Magicxp + Cookingxp + Fletchingxp + Fishingxp + Firemakingxp + Craftingxp + Smithingxp + Miningxp + Herblorexp + Agilityxp + Thievingxp + Slayerxp + Farmingxp + Runecraftingxp"; $stat = $totalAAA; $skill_lvl = $total; } Smaller...?
  25. K, it's a bit sloppy...but go crazy lol: http://rshelp.net/modules/here.txt
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.