netsoundrad Posted August 17, 2012 Share Posted August 17, 2012 Hi.... i have running a open-source-clone of travian.... i'm good with html and css, but not good enough to fix the bigbugs in it.... thats why i'm looking for people that are interested in helping make this script running stable enough.... please wrote an answer here in board best wishes Ralf aka netsoundrad Quote Link to comment https://forums.phpfreaks.com/topic/267243-hello-i-need-helping-hands/ Share on other sites More sharing options...
premiso Posted August 17, 2012 Share Posted August 17, 2012 I am not sure what this has to do with jacking off? Why else would you need helping hands? Quote Link to comment https://forums.phpfreaks.com/topic/267243-hello-i-need-helping-hands/#findComment-1370312 Share on other sites More sharing options...
Christian F. Posted August 17, 2012 Share Posted August 17, 2012 I don't think the OP was thinking about that kind of helping hand, premiso. netsoundrad: You have a link to where we can have a look at the source code, before we agree to help? Remember, the more information you give about what it entails, the more likely you are at getting people interested. Quote Link to comment https://forums.phpfreaks.com/topic/267243-hello-i-need-helping-hands/#findComment-1370341 Share on other sites More sharing options...
netsoundrad Posted August 18, 2012 Author Share Posted August 18, 2012 I am not sure what this has to do with jacking off? Why else would you need helping hands? My knowledge about php, ajax and js are not really good, my english too.... I'm still leaning and so i need help! I don't think the OP was thinking about that kind of helping hand, premiso. netsoundrad: You have a link to where we can have a look at the source code, before we agree to help? Remember, the more information you give about what it entails, the more likely you are at getting people interested. Link added Hi folks.... i have a travian-clone-script. in that script a many bugs and i didnt know how to fix it. so i'm looking for some guys that are fit in php i can take here a link to the installed version and when somebody will help me, i will get him access with ftp to the folder with the version. here u can see the installed version . http://designin.pf-control.de/probe2/ for example : here are one of the bugs : when i click on statistics this error will be shown ..................... Warning: Invalid argument supplied for foreach() in /var/customers/webs/designin/probe2/GameEngine/Ranking.php on line 266 Call Stack: 0.0564 708408 1. {main}() /var/customers/webs/designin/probe2/statistiken.php:0 0.0929 11445976 2. Ranking->procRankReq() /var/customers/webs/designin/probe2/statistiken.php:17 0.0929 11445976 3. Ranking->procRankArray() /var/customers/webs/designin/probe2/GameEngine/Ranking.php:134 this the code inside Ranking.php <?php class Ranking { private $rankarray = array(); private $rlastupdate; public function getRank() { return $this->rankarray; } public function getUserRank($id) { $ranking = $this->getRank(); $start = $_SESSION['start']+1; if(count($ranking) > 0) { for($i=$start;$i<($start+20);$i++) { if($ranking[$i]['userid'] == $id && $ranking[$i] != "pad") { $myrank = $i; } } } return $myrank; } public function procRankReq($get) { global $village, $session, $database; if(isset($get['id'])) { switch($get['id']) { case 1: $this->procRankArray(); break; case 8: $this->procHeroRankArray(); break; case 11: $this->procRankRaceArray(1); break; case 12: $this->procRankRaceArray(2); break; case 13: $this->procRankRaceArray(3); break; case 31: $this->procAttRankArray(); break; case 32: $this->procDefRankArray(); break; case 2: $this->procVRankArray(); $this->getStart($this->searchRank($village->wid, "wref")); break; case 4: $this->procARankArray(); if($session->alliance == 0) { $this->getStart(1); } else { $this->getStart($this->searchRank($session->alliance, "id")); } break; case 41: $this->procAAttRankArray(); if($session->alliance == 0) { $this->getStart(1); } else { $this->getStart($this->searchRank($session->alliance, "id")); } break; case 42: $this->procADefRankArray(); if($session->alliance == 0) { $this->getStart(1); } else { $this->getStart($this->searchRank($session->alliance, "id")); } break; } } else { $this->procRankArray(); $this->getStart($this->searchRank($session->uid, "userid")); } } public function procRank($post) { if(isset($post['ft'])) { switch($post['ft']) { case "r1": case "r31": case "r32": if(isset($post['rank']) && $post['rank'] != "") { $this->getStart($post['rank']); } if(isset($post['name']) && $post['name'] != "") { $this->getStart($this->searchRank(stripslashes($post['name']), "username")); } break; case "r2": case "r4": case "r42": case "r41": if(isset($post['rank']) && $post['rank'] != "") { $this->getStart($post['rank']); } if(isset($post['name']) && $post['name'] != "") { $this->getStart($this->searchRank(stripslashes($post['name']), "name")); } break; } } } private function getStart($search) { $multiplier = 1; if(!is_numeric($search)) { $_SESSION['search'] = $search; } else { if($search > count($this->rankarray)) { $search = count($this->rankarray) - 1; } while($search > (20 * $multiplier)) { $multiplier += 1; } $start = 20 * $multiplier - 19 - 1; $_SESSION['search'] = $search; $_SESSION['start'] = $start; } } public function getAllianceRank($id) { $this->procARankArray(); while(1) { if(count($this->rankarray) > 1) { $key = key($this->rankarray); if($this->rankarray[$key]["id"] == $id) { return $key; break; } else { if(!next($this->rankarray)) { return false; break; } } } else { return 1; } } } public function searchRank($name, $field) { while(1) { $key = key($this->rankarray); if($this->rankarray[$key][$field] == $name) { return $key; break; } else { if(!next($this->rankarray)) { return $name; break; } } } } public function procRankArray() { global $database, $multisort; if($database->countUser() > 0){ $holder = array(); $q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username," . TB_PREFIX . "users.alliance alliance, ( SELECT SUM( " . TB_PREFIX . "vdata.pop ) FROM " . TB_PREFIX . "vdata WHERE " . TB_PREFIX . "vdata.owner = userid )totalpop, ( SELECT COUNT( " . TB_PREFIX . "vdata.wref ) FROM " . TB_PREFIX . "vdata WHERE " . TB_PREFIX . "vdata.owner = userid AND type != 99 )totalvillages, ( SELECT " . TB_PREFIX . "alidata.tag FROM " . TB_PREFIX . "alidata, " . TB_PREFIX . "users WHERE " . TB_PREFIX . "alidata.id = " . TB_PREFIX . "users.alliance AND " . TB_PREFIX . "users.id = userid )allitag FROM " . TB_PREFIX . "users WHERE " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . " AND " . TB_PREFIX . "users.tribe <= 3 ORDER BY totalpop DESC, totalvillages DESC, userid DESC"; $result = (mysql_query($q)); while($row = mysql_fetch_assoc($result)) { $datas[] = $row; } foreach($datas as $result) { $value['userid'] = $result['userid']; $value['username'] = $result['username']; $value['alliance'] = $result['alliance']; $value['aname'] = $result['allitag']; $value['totalpop'] = $result['totalpop']; $value['totalvillage'] = $result['totalvillages']; array_push($holder, $value); } $newholder = array("pad"); foreach($holder as $key) { array_push($newholder, $key); } $this->rankarray = $newholder; } } private function procRankRaceArray($race) { global $database, $multisort; //$array = $database->getRanking(); $holder = array(); //$value['totalvillage'] = count($database->getVillagesID($value['id'])); //$value['totalvillage'] = count($database->getVillagesID($value['id'])); //$value['totalpop'] = $database->getVSumField($value['id'],"pop"); //$value['aname'] = $database->getAllianceName($value['alliance']); $q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.tribe tribe, " . TB_PREFIX . "users.username username," . TB_PREFIX . "users.alliance alliance, ( SELECT SUM( " . TB_PREFIX . "vdata.pop ) FROM " . TB_PREFIX . "vdata WHERE " . TB_PREFIX . "vdata.owner = userid )totalpop, ( SELECT COUNT( " . TB_PREFIX . "vdata.wref ) FROM " . TB_PREFIX . "vdata WHERE " . TB_PREFIX . "vdata.owner = userid AND type != 99 )totalvillages, ( SELECT " . TB_PREFIX . "alidata.tag FROM " . TB_PREFIX . "alidata, " . TB_PREFIX . "users WHERE " . TB_PREFIX . "alidata.id = " . TB_PREFIX . "users.alliance AND " . TB_PREFIX . "users.id = userid )allitag FROM " . TB_PREFIX . "users WHERE " . TB_PREFIX . "users.tribe = $race AND " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . " ORDER BY totalpop DESC, totalvillages DESC, userid DESC"; $result = (mysql_query($q)); while($row = mysql_fetch_assoc($result)) { $datas[] = $row; } if(mysql_num_rows($result)) { foreach($datas as $result) { //$value = $array[$result['userid']]; $value['userid'] = $result['userid']; $value['username'] = $result['username']; $value['alliance'] = $result['alliance']; $value['aname'] = $result['allitag']; $value['totalpop'] = $result['totalpop']; $value['totalvillage'] = $result['totalvillages']; //SELECT (SELECT SUM(".TB_PREFIX."vdata.pop) FROM ".TB_PREFIX."vdata WHERE ".TB_PREFIX."vdata.owner = 2) totalpop, (SELECT COUNT(".TB_PREFIX."vdata.wref) FROM ".TB_PREFIX."vdata WHERE ".TB_PREFIX."vdata.owner = 2) totalvillages, (SELECT ".TB_PREFIX."alidata.tag FROM ".TB_PREFIX."alidata WHERE ".TB_PREFIX."alidata.id = ".TB_PREFIX."users.alliance AND ".TB_PREFIX."users.id = 2); array_push($holder, $value); } } else { $value['userid'] = 0; $value['username'] = "No User"; $value['alliance'] = ""; $value['aname'] = ""; $value['totalpop'] = ""; $value['totalvillage'] = ""; array_push($holder, $value); } //$holder = $multisort->sorte($holder, "'totalvillage'", false, 2, "'totalpop'", false, 2); $newholder = array("pad"); foreach($holder as $key) { array_push($newholder, $key); } $this->rankarray = $newholder; } private function procAttRankArray() { global $database, $multisort; //$array = $database->getRanking(); $holder = array(); //$value['totalvillage'] = count($database->getVillagesID($value['id'])); //$value['totalpop'] = $database->getVSumField($value['id'],"pop"); $q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username, " . TB_PREFIX . "users.apall, ( SELECT COUNT( " . TB_PREFIX . "vdata.wref ) FROM " . TB_PREFIX . "vdata WHERE " . TB_PREFIX . "vdata.owner = userid AND type != 99 )totalvillages, ( SELECT SUM( " . TB_PREFIX . "vdata.pop ) FROM " . TB_PREFIX . "vdata WHERE " . TB_PREFIX . "vdata.owner = userid )pop FROM " . TB_PREFIX . "users WHERE " . TB_PREFIX . "users.apall >=0 AND " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . " AND " . TB_PREFIX . "users.tribe <= 3 ORDER BY " . TB_PREFIX . "users.apall DESC, pop DESC, userid DESC"; $result = mysql_query($q) or die(mysql_error()); while($row = mysql_Fetch_assoc($result)) { $datas[] = $row; } foreach($datas as $key => $row) { //$value = $array[$row['userid']]; $value['username'] = $row['username']; $value['totalvillages'] = $row['totalvillages']; //$value['totalvillage'] = $row['totalvillages']; $value['id'] = $row['userid']; $value['totalpop'] = $row['pop']; $value['apall'] = $row['apall']; array_push($holder, $value); printf("\n<!-- %s %s %s %s -->\n", $value['username'], $value['totalvillages'], $value['totalpop'], $value['apall']); } //$holder = $multisort->sorte($holder, "'ap'", false, 2, "'totalvillages'", false, 2, "'ap'", false, 2); $newholder = array("pad"); foreach($holder as $key) { array_push($newholder, $key); } $this->rankarray = $newholder; } private function procDefRankArray() { //global $database, $multisort; //$array = $database->getRanking(); $holder = array(); $q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username, " . TB_PREFIX . "users.dpall, ( SELECT COUNT( " . TB_PREFIX . "vdata.wref ) FROM " . TB_PREFIX . "vdata WHERE " . TB_PREFIX . "vdata.owner = userid AND type != 99 )totalvillages, ( SELECT SUM( " . TB_PREFIX . "vdata.pop ) FROM " . TB_PREFIX . "vdata WHERE " . TB_PREFIX . "vdata.owner = userid )pop FROM " . TB_PREFIX . "users WHERE " . TB_PREFIX . "users.dpall >=0 AND " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . " ORDER BY " . TB_PREFIX . "users.dpall DESC, pop DESC, userid DESC"; $result = mysql_query($q) or die(mysql_error()); while($row = mysql_Fetch_assoc($result)) { $datas[] = $row; } foreach($datas as $key => $row) { //$value = $array[$row['userid']]; $value['username'] = $row['username']; $value['totalvillages'] = $row['totalvillages']; //$value['totalvillage'] = $row['totalvillages']; $value['id'] = $row['userid']; $value['totalpop'] = $row['pop']; $value['dpall'] = $row['dpall']; array_push($holder, $value); } //$holder = $multisort->sorte($holder, "'dpall'", false, 2, "'totalvillage'", false, 2, "'dpall'", false, 2); $newholder = array("pad"); foreach($holder as $key) { array_push($newholder, $key); } $this->rankarray = $newholder; } private function procVRankArray() { global $database, $multisort; $array = $database->getVRanking(); $holder = array(); foreach($array as $value) { $coor = $database->getCoor($value['wref']); $value['x'] = $coor['x']; $value['y'] = $coor['y']; $value['user'] = $database->getUserField($value['owner'], "username", 0); array_push($holder, $value); } $holder = $multisort->sorte($holder, "'x'", true, 2, "'y'", true, 2, "'pop'", false, 2); $newholder = array("pad"); foreach($holder as $key) { array_push($newholder, $key); } $this->rankarray = $newholder; } public function procARankArray() { global $database, $multisort; $array = $database->getARanking(); $holder = array(); foreach($array as $value) { $memberlist = $database->getAllMember($value['id']); $totalpop = 0; foreach($memberlist as $member) { $totalpop += $database->getVSumField($member['id'], "pop"); } $value['players'] = count($memberlist); $value['totalpop'] = $totalpop; if(!isset($value['avg'])) { $value['avg'] = @round($totalpop / count($memberlist)); } else { $value['avg'] = 0; } array_push($holder, $value); } $holder = $multisort->sorte($holder, "'totalpop'", false, 2); $newholder = array("pad"); foreach($holder as $key) { array_push($newholder, $key); } $this->rankarray = $newholder; } private function procHeroRankArray() { global $database, $multisort; $array = $database->getHeroRanking(); $holder = array(); foreach($array as $value) { $value['owner'] = $database->getUserField($value['uid'], "username", 0); $value['level']; $value['uid']; array_push($holder, $value); } $holder = $multisort->sorte($holder, "'experience'", false, 2); $newholder = array("pad"); foreach($holder as $key) { array_push($newholder, $key); } $this->rankarray = $newholder; } private function procAAttRankArray() { global $database, $multisort; $array = $database->getARanking(); $holder = array(); foreach($array as $value) { $memberlist = $database->getAllMember($value['id']); $totalap = 0; foreach($memberlist as $member) { $totalap += $member['ap']; } $value['players'] = count($memberlist); $value['totalap'] = $totalap; if($value['avg'] > 0) { $value['avg'] = round($totalap / count($memberlist)); } else { $value['avg'] = 0; } array_push($holder, $value); } $holder = $multisort->sorte($holder, "'totalap'", false, 2); $newholder = array("pad"); foreach($holder as $key) { array_push($newholder, $key); } $this->rankarray = $newholder; } private function procADefRankArray() { global $database, $multisort; $array = $database->getARanking(); $holder = array(); foreach($array as $value) { $memberlist = $database->getAllMember($value['id']); $totaldp = 0; foreach($memberlist as $member) { $totaldp += $member['dp']; } $value['players'] = count($memberlist); $value['totaldp'] = $totaldp; if($value['avg'] > 0) { $value['avg'] = round($totalap / count($memberlist)); } else { $value['avg'] = 0; } array_push($holder, $value); } $holder = $multisort->sorte($holder, "'totaldp'", false, 2); $newholder = array("pad"); foreach($holder as $key) { array_push($newholder, $key); } $this->rankarray = $newholder; } } ; $ranking = new Ranking; ?> and this are the code in the other file.............................. <?php include("GameEngine/Village.php"); $__start = $generator->pageLoadTimeStart(); if(isset($_GET['rank'])){ $_POST['rank']==$_GET['rank']; } $ranking->procRankReq($_GET); $ranking->procRank($_POST); if(isset($_GET['newdid'])) { $_SESSION['wid'] = $_GET['newdid']; header("Location: ".$_SERVER['PHP_SELF']."?id=".$_GET['id']); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title><?php echo SERVER_NAME ?></title> <link REL="shortcut icon" HREF="favicon.ico"/> <meta http-equiv="cache-control" content="max-age=0" /> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="expires" content="0" /> <meta http-equiv="imagetoolbar" content="no" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <script src="mt-full.js?0faaa" type="text/javascript"></script> <script src="unx.js?0faaa" type="text/javascript"></script> <script src="new.js?0faaa" type="text/javascript"></script> <link href="<?php echo GP_LOCATE; ?>lang/en/lang.css?f4b7c" rel="stylesheet" type="text/css" /> <link href="<?php echo GP_LOCATE; ?>lang/en/compact.css?f4b7c" rel="stylesheet" type="text/css" /> <?php if($session->gpack == null || GP_ENABLE == false) { echo " <link href='".GP_LOCATE."travian.css?e21d2' rel='stylesheet' type='text/css' /> <link href='".GP_LOCATE."lang/en/lang.css?e21d2' rel='stylesheet' type='text/css' />"; } else { echo " <link href='".$session->gpack."travian.css?e21d2' rel='stylesheet' type='text/css' /> <link href='".$session->gpack."lang/en/lang.css?e21d2' rel='stylesheet' type='text/css' />"; } ?> <script type="text/javascript"> window.addEvent('domready', start); </script> </head> <body class="v35 ie ie8"> <div class="wrapper"> <img style="filter:chroma();" src="img/x.gif" id="msfilter" alt="" /> <div id="dynamic_header"> </div> <?php include("Templates/header.tpl"); ?> <div id="mid"> <?php include("Templates/menu.tpl"); ?> <div id="content" class="statistics"> <h1>Statistics</h1> <div id="textmenu"> <a href="statistiken.php" <?php if(!isset($_GET['id']) || (isset($_GET['id']) && ($_GET['id'] == 1 || $_GET['id'] == 31 || $_GET['id'] == 32 || $_GET['id'] == 7))) { echo "class=\"selected \""; } ?>>Player</a> | <a href="statistiken.php?id=4" <?php if(isset($_GET['id']) && ($_GET['id'] == 4 || $_GET['id'] == 41 || $_GET['id'] == 42 || $_GET['id'] == 47)) { echo "class=\"selected \""; } ?>>Alliances</a> | <a href="statistiken.php?id=2" <?php if(isset($_GET['id']) && $_GET['id'] == 2) { echo "class=\"selected \""; } ?>>Villages</a> | <a href="statistiken.php?id=8" <?php if(isset($_GET['id']) && $_GET['id'] == { echo "class=\"selected \""; } ?>>Heroes</a> | <a href="statistiken.php?id=0" <?php if(isset($_GET['id']) && $_GET['id'] == 0) { echo "class=\"selected \""; } ?>>General</a> <?php if(WW == true) { echo '|'; } else { echo ''; } ?></a> <a href="statistiken.php?id=99" <?php if(isset($_GET['id']) && $_GET['id'] == 99) { echo "class=\"selected \""; } ?>><?php if(WW == true) { echo 'WW'; } else { echo ''; }?></a> </div> <?php if(isset($_GET['id'])) { switch($_GET['id']) { case 31: include("Templates/Ranking/player_attack.tpl"); break; case 32: include("Templates/Ranking/player_defend.tpl"); break; case 7: include("Templates/Ranking/player_top10.tpl"); break; case 2: include("Templates/Ranking/villages.tpl"); break; case 4: include("Templates/Ranking/alliance.tpl"); break; case 8: include("Templates/Ranking/heroes.tpl"); break; case 11: include("Templates/Ranking/player_1.tpl"); break; case 12: include("Templates/Ranking/player_2.tpl"); break; case 13: include("Templates/Ranking/player_3.tpl"); break; case 41: include("Templates/Ranking/alliance_attack.tpl"); break; case 42: include("Templates/Ranking/alliance_defend.tpl"); break; case 43: include("Templates/Ranking/ally_top10.tpl"); break; case 0: include("Templates/Ranking/general.tpl"); break; case 1: default: include("Templates/Ranking/overview.tpl"); break; case 99: default: include("Templates/Ranking/ww.tpl"); break; } } else { include("Templates/Ranking/overview.tpl"); } ?> </div> </td> </tr> </table> </div> </br></br></br></br><div id="side_info"> <?php include("Templates/multivillage.tpl"); include("Templates/quest.tpl"); include("Templates/news.tpl"); include("Templates/links.tpl"); ?> </div> <div class="clear"></div> </div> <div class="footer-stopper"></div> <div class="clear"></div> <?php include("Templates/footer.tpl"); include("Templates/res.tpl"); ?> <div id="stime"> <div id="ltime"> <div id="ltimeWrap"> Calculated in <b><?php echo round(($generator->pageLoadTimeEnd()-$__start)*1000); ?></b> ms <br />Server time: <span id="tp1" class="b"><?php echo date('H:i:s'); ?></span> </div> </div> </div> <div id="ce"></div> </body> </html> i hope it will help solving that poblem .... best wishes Ralf Quote Link to comment https://forums.phpfreaks.com/topic/267243-hello-i-need-helping-hands/#findComment-1370384 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.