Jump to content

karimali831

Members
  • Posts

    436
  • Joined

  • Last visited

Everything posted by karimali831

  1. So I save my website, and see  at the top of the page but don't know what file has this BOM... It seems to mess up the presentation of my site also, fonts etc. Is it because of BOM I hope and how can I know where the file with the BOM is at? Wasn't sure where to post this. Thanks
  2. Yes, would this be right? if($team1 > $team2 && $team1-$team2 > $setting)
  3. Hi, My example: $setting = 4 //can challenge if opponent has 4 points lesser than you $team1 = 13; //challenger points $team2 = 7; //points In my above case, it should return false because 13-7 = 6, $team2 has 6 points lesser than team 1. If team2 had 4 points or lesser, it should return true. Can someone write the if() statement for me please? Appreciate that alot. Thanks
  4. Me being daft, solved it. Thanks!!
  5. Now I get the CSS right, but it don't show the percent: $ratio = '<div style="width:'.$challenger_ratio.'%; background-color:#333333;">'; http://team-x1.co.uk/site/index.php?site=standings&ladderID=16 Thanks for help!
  6. Hi, Example: echo percent(5, 10, 2)."%"; gives you 50% Instead of this representation, I want to use a bar like this: So what ever percentage it is, it will show on the bar. (out of 100%) anyone help me achieve this please? Thanks function percent($sub, $total, $dec) { if ($sub) { $perc = $sub / $total * 100; $perc = round($perc, $dec); return $perc; } else return 0; }
  7. Hi, This below script selects all text when you click. Is it possible to automatically copy the text to clipboard or use a button/link or something to show copy to clipboard? <script type="text/javascript"> function SelectAll(id) { document.getElementById(id).focus(); document.getElementById(id).select(); } </script> <input type="text" id="txtfld" onClick="SelectAll('txtfld');" style="width:200px" value = "This text you can select all" /> Thanks for any help
  8. I have changed it slightly which I hope it works, yes? function Sec2Time($time){ if(is_numeric($time)){ $value = array( "years" => 0, "days" => 0, "hours" => 0, "minutes" => 0, "seconds" => 0, ); if($time >= 31556926){ return $value["years"] = floor($time/31556926). " Years"; $time = ($time%31556926); } elseif($time >= 86400){ return $value["days"] = floor($time/86400). " Days"; $time = ($time%86400); } elseif($time >= 3600){ return $value["hours"] = floor($time/3600). " Hours"; $time = ($time%3600); } elseif($time >= 60){ return $value["minutes"] = floor($time/60). " Minutes"; $time = ($time%60); } else return $time ." Seconds"; }else{ return (bool) FALSE; } }
  9. Hi! I have got a problem with this function: <?php function Sec2Time($time){ if(is_numeric($time)){ $value = array( "years" => 0, "days" => 0, "hours" => 0, "minutes" => 0, "seconds" => 0, ); if($time >= 31556926){ $value["years"] = floor($time/31556926); $time = ($time%31556926); } if($time >= 86400){ $value["days"] = floor($time/86400); $time = ($time%86400); } if($time >= 3600){ $value["hours"] = floor($time/3600); $time = ($time%3600); } if($time >= 60){ $value["minutes"] = floor($time/60); $time = ($time%60); } $value["seconds"] = floor($time); return (array) $value; }else{ return (bool) FALSE; } } ?> and my output for example: echo Sec2Time(604800); returns = "Array" ?? What I am wanting is to return a time from how many seconds. 604800 is 7 days so I want it to say 7 days. 2419200 is 1 month so I want it to say 1 month or 4 weeks. is (above) the right function for what I want ? thanks.
  10. Yes, sorry I mean single option in dropdown. Then, hide other dropdowns on that page?
  11. Hi ! Lets say I selected an option in a drop down, I want all other dropdown menus to hide upon selecting that single option in the first dropdown. Makes sense? Good... Where can I get this script? Thanks.
  12. I want to order by XP, this is not a column though in my first query: Example: echo ' <table width="100%" bordercolor="'.$border.'"> <tr> <td width="25%" align="left" class="title" colspan="12"><a name="standings"></a> &#8226; '.getladname($laddID).' Standings</td> </tr> <tr> <td width="5%" bgcolor="'.$bg1.'" class="title2" align="center">Rank:</td> <td width="10%" bgcolor="'.$bg1.'" class="title2" align="center">Teamname:</td> <td width="10%" bgcolor="'.$bg1.'" class="title2" align="center">CR:</td> <td width="10%" bgcolor="'.$bg1.'" class="title2" align="center">XP:</td> <td width="10%" bgcolor="'.$bg1.'" class="title2" align="center">Won:</td> <td width="10%" bgcolor="'.$bg1.'" class="title2" align="center">Draw:</td> <td width="10%" bgcolor="'.$bg1.'" class="title2" align="center">Lost:</td> <td width="10%" bgcolor="'.$bg1.'" class="title2" align="center">Streak:</td> <td width="10%" bgcolor="'.$bg1.'" class="title2" align="center">Reg:</td> <td width="10%" bgcolor="'.$bg1.'" class="title2" align="center">Ratio:</td> <td width="10%" bgcolor="'.$bg1.'" class="title2" align="center">Challenge:</td> </tr>'; $rank = 1; $participants = safe_query("SELECT * FROM ".PREFIX."cup_clans WHERE ladID='$laddID' AND 1on1='0' ORDER BY credit DESC"); while($ds=mysql_fetch_array($participants)) { $teamID = $ds['clanID']; $ladmatches = safe_query("SELECT SUM(score1) as totalpoints FROM ".PREFIX."cup_matches WHERE ladID='$laddID' AND clan1='$teamID' AND (clan1 != '0' AND clan2 != '0') AND (clan1 != '2147483647' AND clan2 != '2147483647') AND confirmscore='1' AND einspruch='0'"); $tp1=mysql_fetch_array($ladmatches); $challenger_totalpoints = $tp1['totalpoints']; $xp_points = $challenger_totalpoints+$added_xp; if(empty($xp_points)) $xp = 0; else $xp = $xp_points; echo ' <tr> <td bgcolor="'.$bg1.'" width="5%" align="center">#'.$rank.'</td> <td bgcolor="'.$bg1.'" align="center">'.getusercountry($teamID).' <a href="?site=profile&id='.$teamID.'">'.getnickname($teamID).'</a></td> <td bgcolor="'.$bg1.'" align="center">'.$ds['credit'].'</td> <td bgcolor="'.$bg1.'" align="center">'.$xp.'</td> <td bgcolor="'.$bg1.'" align="center">'.$won.'</td> <td bgcolor="'.$bg1.'" align="center">'.$draw.'</td> <td bgcolor="'.$bg1.'" align="center">'.$lost.'</td> <td bgcolor="'.$bg1.'" align="center">'.$streak.'</td> <td bgcolor="'.$bg1.'" align="center">'.returnTime($ds['registered']).'</td> <td bgcolor="'.$bg1.'" align="center">'.$ratio.'%</td> <td bgcolor="'.$bg1.'" align="center">'.$new_challenge.'</td> </tr> <br>';
  13. Hi, I am using multiple rows in my table and I want to order it in ascending order from a column. With SQL statement it is simple as saying ORDER BY column but how I can do this with just numbers? So I want for example: (goes in correct order) Col 1 Col 2 Col3 # 5 # # 43 # # 87 # # 113 # instead of: Col 1 Col 2 Col3 # 113 # # 43 # # 87 # # 5 # Thanks for any help!!
  14. Hi, When I use the below table in a while loop, it will repeat down the page. I want it to repeat in rows of 3, how can I do this? while () { echo ' <table width="50%" cellpadding="2" cellspacing="1" bgcolor="'.$border.'"> <tr > <td colspan="5" height="20" align="center" class="title" bgcolor="'.$bghead.'"><b>'.$pt['platform'].'</b></td> </tr> </table>'; } Thanks!
  15. Hi I've got a table and each user has their own points. For example: user 1: 254 user 2: 118 user 3: 64 ... user 54: 85 I want to be able to find the top 10 users that has most points. How can I achieve this? Thanks for any help.
  16. Yes got it working mysql_query("INSERT INTO ".PREFIX."cup_matches ($type, matchno, clan1, clan2, comment, 1on1) ( SELECT a.$type, a.matchno, a.clan1, b.clan2, a.comment, a.1on1 FROM ".PREFIX."cup_matches a, ".PREFIX."cup_matches b WHERE a.clan2 != b.clan2 AND a.matchno = '1' AND b.matchno = '1' AND a.ladID='b' AND b.ladID='b')") Thank you VERY much for all the help!!
  17. Yes but it is getting all combinations. Are you using the data I only gave you? I think this may work: WHERE a.clan2 != b.clan2 AND a.matchno = '1' AND b.matchno = '1' AND a.ladID='b' AND b.ladID='b')") I'll give it a shot.. let me know if it won't.
  18. Thanks again for your reply. I made a backup so the table in my post will be the same how it is now. I used your query, and I get this list: Looks like it is getting every combination from all rows. I need all combinations where ladID = 'b' clan1 = 8 clan2 = 2627 clan1 = 101 clan2 = 2627 clan1 = 62 clan2 = 2627 clan1 = 87 clan2 = 2627 clan1 = 118 clan2 = 2627 clan1 = 143 clan2 = 2627 clan1 = 38 clan2 = 2627 clan1 = 75 clan2 = 2627 clan1 = 113 clan2 = 2627 clan1 = 111 clan2 = 2627 clan1 = 205 clan2 = 2627 clan1 = 155 clan2 = 2627 clan1 = 229 clan2 = 2627 clan1 = 258 clan2 = 2627 clan1 = 128 clan2 = 2627 clan1 = 34 clan2 = 2627 clan1 = 340 clan2 = 2627 clan1 = 275 clan2 = 2627 clan1 = 76 clan2 = 2627 clan1 = 379 clan2 = 2627 clan1 = 274 clan2 = 2627 clan1 = 297 clan2 = 2627 clan1 = 342 clan2 = 2627 clan1 = 46 clan2 = 2627 clan1 = 382 clan2 = 2627 clan1 = 2147483647 clan2 = 2627 clan1 = 1 clan2 = 2627 clan1 = 2617 clan2 = 2627 clan1 = 1 clan2 = 2627 clan1 = 2609 clan2 = 2627 clan1 = 2611 clan2 = 2627 clan1 = 2621 clan2 = 2627 clan1 = 2625 clan2 = 2627 clan1 = 2629 clan2 = 2627 clan1 = 8 clan2 = 2619 clan1 = 101 clan2 = 2619 clan1 = 62 clan2 = 2619 clan1 = 87 clan2 = 2619 clan1 = 118 clan2 = 2619 clan1 = 143 clan2 = 2619 clan1 = 38 clan2 = 2619 clan1 = 75 clan2 = 2619 clan1 = 113 clan2 = 2619 clan1 = 111 clan2 = 2619 clan1 = 205 clan2 = 2619 clan1 = 155 clan2 = 2619 clan1 = 229 clan2 = 2619 clan1 = 258 clan2 = 2619 clan1 = 128 clan2 = 2619 clan1 = 34 clan2 = 2619 clan1 = 340 clan2 = 2619 clan1 = 275 clan2 = 2619 clan1 = 76 clan2 = 2619 clan1 = 379 clan2 = 2619 clan1 = 274 clan2 = 2619 clan1 = 297 clan2 = 2619 clan1 = 342 clan2 = 2619 clan1 = 46 clan2 = 2619 clan1 = 382 clan2 = 2619 clan1 = 2147483647 clan2 = 2619 clan1 = 1 clan2 = 2619 clan1 = 2620 clan2 = 2619 clan1 = 1 clan2 = 2619 clan1 = 2609 clan2 = 2619 clan1 = 2611 clan2 = 2619 clan1 = 2621 clan2 = 2619 clan1 = 2625 clan2 = 2619 clan1 = 2629 clan2 = 2619 clan1 = 8 clan2 = 2612 clan1 = 101 clan2 = 2612 clan1 = 62 clan2 = 2612 clan1 = 87 clan2 = 2612 clan1 = 118 clan2 = 2612 clan1 = 143 clan2 = 2612 clan1 = 38 clan2 = 2612 clan1 = 75 clan2 = 2612 clan1 = 113 clan2 = 2612 clan1 = 111 clan2 = 2612 clan1 = 205 clan2 = 2612 clan1 = 155 clan2 = 2612 clan1 = 229 clan2 = 2612 clan1 = 258 clan2 = 2612 clan1 = 128 clan2 = 2612 clan1 = 34 clan2 = 2612 clan1 = 340 clan2 = 2612 clan1 = 275 clan2 = 2612 clan1 = 76 clan2 = 2612 clan1 = 379 clan2 = 2612 clan1 = 274 clan2 = 2612 clan1 = 297 clan2 = 2612 clan1 = 342 clan2 = 2612 clan1 = 46 clan2 = 2612 clan1 = 382 clan2 = 2612 clan1 = 2147483647 clan2 = 2612 clan1 = 1 clan2 = 2612 clan1 = 2620 clan2 = 2612 clan1 = 2617 clan2 = 2612 clan1 = 1 clan2 = 2612 clan1 = 2611 clan2 = 2612 clan1 = 2621 clan2 = 2612 clan1 = 2625 clan2 = 2612 clan1 = 2629 clan2 = 2612 clan1 = 8 clan2 = 2630 clan1 = 101 clan2 = 2630 clan1 = 62 clan2 = 2630 clan1 = 87 clan2 = 2630 clan1 = 118 clan2 = 2630 clan1 = 143 clan2 = 2630 clan1 = 38 clan2 = 2630 clan1 = 75 clan2 = 2630 clan1 = 113 clan2 = 2630 clan1 = 111 clan2 = 2630 clan1 = 205 clan2 = 2630 clan1 = 155 clan2 = 2630 clan1 = 229 clan2 = 2630 clan1 = 258 clan2 = 2630 clan1 = 128 clan2 = 2630 clan1 = 34 clan2 = 2630 clan1 = 340 clan2 = 2630 clan1 = 275 clan2 = 2630 clan1 = 76 clan2 = 2630 clan1 = 379 clan2 = 2630 clan1 = 274 clan2 = 2630 clan1 = 297 clan2 = 2630 clan1 = 342 clan2 = 2630 clan1 = 46 clan2 = 2630 clan1 = 382 clan2 = 2630 clan1 = 2147483647 clan2 = 2630 clan1 = 1 clan2 = 2630 clan1 = 2620 clan2 = 2630 clan1 = 2617 clan2 = 2630 clan1 = 1 clan2 = 2630 clan1 = 2609 clan2 = 2630 clan1 = 2611 clan2 = 2630 clan1 = 2621 clan2 = 2630 clan1 = 2625 clan2 = 2630
  19. Oh how could I forget the AND a.ladID='b' But go to http://cupaddon.com/index.php?site=groups&laddID=1 and look at the disaster it is doing. :'( Stop load immediately.
  20. Result is expected? I only have 800-900 rows. Ok, to test it: $query = mysql_query("SELECT a.clan1, b.clan2 from ".PREFIX."cup_matches a, ".PREFIX."cup_matches b WHERE a.clan2 != b.clan2 AND a.matchno = '1' AND ladID='b'"); while($ds=mysql_fetch_array($query)) { echo 'c1 = '.$ds['clan1'].'<br>'; echo 'c2 = '.$ds['clan2'].'<br>'; } Without AND ladID='b' there is just thousands of $ds['clan1'] and $ds['clan2'] With AND ladID='b' there is nothing? If you take a look at the table structure you can see rows that are "b" in column ladID are the only rows I want altered. Thanks.
  21. huhh?! generated 90000 rows!! Now 503 Service Temporarily Unavailable
  22. What about this? WHERE a.clan2 != b.clan2 AND a.matchno = '$ID')") Either the query is going crazy now.. or my internet is slow.
  23. Uhh for some reason I can't spot the error .. I guess I'm use to the safe_query() and error control with a CMS.
  24. There is not much too it, it is simply this: if($staging && $dv['anzahl'] >= $ds['maxclan']+$ds['maxclan']) mysql_query("INSERT INTO ".PREFIX."cup_matches (clan1, clan2) (SELECT a.clan1, b.clan2 from ".PREFIX."cup_matches a, ".PREFIX."cup_matches b WHERE a.clan2 != b.clan2 AND a.matchno = '$ID'") or die("Query Error : " .mysql_error()); And the error doesn't tell you much: Query Error : 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 '' at line 3 Thanks again!
  25. mysql_query("INSERT INTO ".PREFIX."cup_matches (clan1, clan2) (SELECT a.clan1, b.clan2 from ".PREFIX."cup_matches a, ".PREFIX."cup_matches b WHERE a.clan2 != b.clan2 AND a.matchno = '$ID'"); Does nothing. No errors but no INSERT
×
×
  • 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.