Jump to content

karimali831

Members
  • Posts

    436
  • Joined

  • Last visited

Everything posted by karimali831

  1. Hmm.. they are duplicates if they are not the same length or are the same? Some maps however are the same length and some not: bloodgulch sidewinder thanks again.
  2. Hi, When a user POSTS 10 maps (dropdown), I don't want any two or more being the same. From my knowledge, only way I know of doing this, is this very long messy way: if($_POST['map1']==$_POST['map2'] || $_POST['map1']==$_POST['map3'] || $_POST['map1']==$_POST['map4'] || $_POST['map1']==$_POST['map5']) etc... then I need to type if $_POST['map2']==$_POST['map1'] etc... How can I put this in its simplest form so that there are no POST duplicates? Thanks for any help.
  3. Ah ? I really couldn't remember opening this topic (delete this)
  4. I get registered spammers on my website, they seem to bypass captcha (manually spamming I believe) and we all know why IP ban is no good so I want to be able to simply delete all rows on my database where this user comes from. Can you use one query to delete from all tables with WHERE userID= '$userID' ??
  5. You can simply use the default timezone with this: date_default_timezone_set(Europe/London); Change Europe/London to your preferred timezone.
  6. Thanks again! And my second question is, I would like to pick a row that has max SUM in "score1" column: E.g. SELECT clan1 FROM ".PREFIX."cup_matches WHERE score1='(MAX SUM)"); Can this be done?
  7. On my table the longest streak is only 1, and is outputting this correctly. And.. I must use a while loop for what I want to achieve? $streak = safe_query("SELECT COUNT(matchID) as streak, clan1 FROM ".PREFIX."cup_matches WHERE clan1='$teamID' AND score1 > score2 GROUP BY clan1 ORDER BY streak DESC LIMIT 1"); while($sk1=mysql_fetch_array($streak)) { $challenger_streak = $sk1['streak']; } if(empty($challenger_streak)) $streak = 0; else $streak = $challenger_streak; Thanks alot for your help!
  8. You can try: $makalequery = "INSERT INTO `jos_content` (`title`) VALUES ('$seo_link')"; If col `id` is the auto_increment there is no need to insert it.
  9. This may help, works for me: <option selected value="'.$value.'">Current: '.$value.'</option> <option value="Pacific/Midway">(GMT-11:00) Midway Island, Samoa</option> <option value="America/Adak">(GMT-10:00) Hawaii-Aleutian</option> <option value="Etc/GMT+10">(GMT-10:00) Hawaii</option> <option value="Pacific/Marquesas">(GMT-09:30) Marquesas Islands</option> <option value="Pacific/Gambier">(GMT-09:00) Gambier Islands</option> <option value="America/Anchorage">(GMT-09:00) Alaska</option> <option value="America/Ensenada">(GMT-08:00) Tijuana, Baja California</option> <option value="Etc/GMT+8">(GMT-08:00) Pitcairn Islands</option> <option value="America/Los_Angeles">(GMT-08:00) Pacific Time (US & Canada)</option> <option value="America/Denver">(GMT-07:00) Mountain Time (US & Canada)</option> <option value="America/Chihuahua">(GMT-07:00) Chihuahua, La Paz, Mazatlan</option> <option value="America/Dawson_Creek">(GMT-07:00) Arizona</option> <option value="America/Belize">(GMT-06:00) Saskatchewan, Central America</option> <option value="America/Cancun">(GMT-06:00) Guadalajara, Mexico City, Monterrey</option> <option value="Chile/EasterIsland">(GMT-06:00) Easter Island</option> <option value="America/Chicago">(GMT-06:00) Central Time (US & Canada)</option> <option value="America/New_York">(GMT-05:00) Eastern Time (US & Canada)</option> <option value="America/Havana">(GMT-05:00) Cuba</option> <option value="America/Bogota">(GMT-05:00) Bogota, Lima, Quito, Rio Branco</option> <option value="America/Caracas">(GMT-04:30) Caracas</option> <option value="America/Santiago">(GMT-04:00) Santiago</option> <option value="America/La_Paz">(GMT-04:00) La Paz</option> <option value="Atlantic/Stanley">(GMT-04:00) Faukland Islands</option> <option value="America/Campo_Grande">(GMT-04:00) Brazil</option> <option value="America/Goose_Bay">(GMT-04:00) Atlantic Time (Goose Bay)</option> <option value="America/Glace_Bay">(GMT-04:00) Atlantic Time (Canada)</option> <option value="America/St_Johns">(GMT-03:30) Newfoundland</option> <option value="America/Araguaina">(GMT-03:00) UTC-3</option> <option value="America/Montevideo">(GMT-03:00) Montevideo</option> <option value="America/Miquelon">(GMT-03:00) Miquelon, St. Pierre</option> <option value="America/Godthab">(GMT-03:00) Greenland</option> <option value="America/Argentina/Buenos_Aires">(GMT-03:00) Buenos Aires</option> <option value="America/Sao_Paulo">(GMT-03:00) Brasilia</option> <option value="America/Noronha">(GMT-02:00) Mid-Atlantic</option> <option value="Atlantic/Cape_Verde">(GMT-01:00) Cape Verde Is.</option> <option value="Atlantic/Azores">(GMT-01:00) Azores</option> <option value="Europe/Belfast">(GMT) Greenwich Mean Time : Belfast</option> <option value="Europe/Dublin">(GMT) Greenwich Mean Time : Dublin</option> <option value="Europe/Lisbon">(GMT) Greenwich Mean Time : Lisbon</option> <option value="Europe/London">(GMT) Greenwich Mean Time : London</option> <option value="Africa/Abidjan">(GMT) Monrovia, Reykjavik</option> <option value="Europe/Amsterdam">(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna</option> <option value="Europe/Belgrade">(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague</option> <option value="Europe/Brussels">(GMT+01:00) Brussels, Copenhagen, Madrid, Paris</option> <option value="Africa/Algiers">(GMT+01:00) West Central Africa</option> <option value="Africa/Windhoek">(GMT+01:00) Windhoek</option> <option value="Asia/Beirut">(GMT+02:00) Beirut</option> <option value="Africa/Cairo">(GMT+02:00) Cairo</option> <option value="Asia/Gaza">(GMT+02:00) Gaza</option> <option value="Africa/Blantyre">(GMT+02:00) Harare, Pretoria</option> <option value="Asia/Jerusalem">(GMT+02:00) Jerusalem</option> <option value="Europe/Minsk">(GMT+02:00) Minsk</option> <option value="Asia/Damascus">(GMT+02:00) Syria</option> <option value="Europe/Moscow">(GMT+03:00) Moscow, St. Petersburg, Volgograd</option> <option value="Africa/Addis_Ababa">(GMT+03:00) Nairobi</option> <option value="Asia/Tehran">(GMT+03:30) Tehran</option> <option value="Asia/Dubai">(GMT+04:00) Abu Dhabi, Muscat</option> <option value="Asia/Yerevan">(GMT+04:00) Yerevan</option> <option value="Asia/Kabul">(GMT+04:30) Kabul</option> <option value="Asia/Yekaterinburg">(GMT+05:00) Ekaterinburg</option> <option value="Asia/Tashkent">(GMT+05:00) Tashkent</option> <option value="Asia/Kolkata">(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi</option> <option value="Asia/Katmandu">(GMT+05:45) Kathmandu</option> <option value="Asia/Dhaka">(GMT+06:00) Astana, Dhaka</option> <option value="Asia/Novosibirsk">(GMT+06:00) Novosibirsk</option> <option value="Asia/Rangoon">(GMT+06:30) Yangon (Rangoon)</option> <option value="Asia/Bangkok">(GMT+07:00) Bangkok, Hanoi, Jakarta</option> <option value="Asia/Krasnoyarsk">(GMT+07:00) Krasnoyarsk</option> <option value="Asia/Hong_Kong">(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi</option> <option value="Asia/Irkutsk">(GMT+08:00) Irkutsk, Ulaan Bataar</option> <option value="Australia/Perth">(GMT+08:00) Perth</option> <option value="Australia/Eucla">(GMT+08:45) Eucla</option> <option value="Asia/Tokyo">(GMT+09:00) Osaka, Sapporo, Tokyo</option> <option value="Asia/Seoul">(GMT+09:00) Seoul</option> <option value="Asia/Yakutsk">(GMT+09:00) Yakutsk</option> <option value="Australia/Adelaide">(GMT+09:30) Adelaide</option> <option value="Australia/Darwin">(GMT+09:30) Darwin</option> <option value="Australia/Brisbane">(GMT+10:00) Brisbane</option> <option value="Australia/Hobart">(GMT+10:00) Hobart</option> <option value="Asia/Vladivostok">(GMT+10:00) Vladivostok</option> <option value="Australia/Lord_Howe">(GMT+10:30) Lord Howe Island</option> <option value="Etc/GMT-11">(GMT+11:00) Solomon Is., New Caledonia</option> <option value="Asia/Magadan">(GMT+11:00) Magadan</option> <option value="Pacific/Norfolk">(GMT+11:30) Norfolk Island</option> <option value="Asia/Anadyr">(GMT+12:00) Anadyr, Kamchatka</option> <option value="Pacific/Auckland">(GMT+12:00) Auckland, Wellington</option> <option value="Etc/GMT-12">(GMT+12:00) Fiji, Kamchatka, Marshall Is.</option> <option value="Pacific/Chatham">(GMT+12:45) Chatham Islands</option> <option value="Pacific/Tongatapu">(GMT+13:00) Nuku\'alofa</option> <option value="Pacific/Kiritimati">(GMT+14:00) Kiritimati</option> date_default_timezone_set($value);
  10. Hello Please take a look at attatchment: Lets say for example I wanted to check the streak of clan1 (column) = 9 (rows) The streak would be 5 because each row has score1 greater than score2. So I want to calculate the streak of the value in clan1 column that has score1 greater than score2 in rows, if score2 is greater than score1 in a row then the streak breaks if that makes sense? let me know if I need to re-phrase. Secondly, if there are two streaks, I want it to calculate the highest one. Thanks for any help !! [attachment deleted by admin]
  11. Also, am I able to pick this value from each row using a variable?
  12. Hi, I need a simple command to delete all rows where userID = 2567 I had a shot but didn't work: DELETE FROM * WHERE userID='2567' || usgID='2567' My website is spammed by this user so I want to delete all records by this userID in my database. Hope someone can help and thanks!
  13. managed to get it working with "map1='".$_POST['map1']."', ... thanks alot for your help
  14. Before I waste my time, can you tell me please if this will work: $select_map = "map1='".$_POST['map1']."', map2='".$_POST['map2']."', map3='".$_POST['map3']."', map4='".$_POST['map4']."', map5='".$_POST['map5']."',"; instead of : $select_map = 'map1=\'".$_POST[\'map1\']."\', map2=\'".$_POST[\'map2\']."\', map3=\'".$_POST[\'map3\']."\', map4=\'".$_POST[\'map4\']."\', map5=\'".$_POST[\'map5\']."\',';
  15. Ok. Here is two: $select_date = 'date1=\'".$_POST[\'date1\']."\', date2=\'".$_POST[\'date2\']."\', date3=\'".$_POST[\'date3\']."\', date4=\'".$_POST[\'date4\']."\', date5=\'".$_POST[\'date5\']."\','; and $select_map = 'map1=\'".$_POST[\'map1\']."\', map2=\'".$_POST[\'map2\']."\', map3=\'".$_POST[\'map3\']."\', map4=\'".$_POST[\'map4\']."\', map5=\'".$_POST[\'map5\']."\','; Thanks.
  16. The double ;; is a mistake I done when I posted this topic. Here is the echo: UPDATE webs_cup_challenges SET reply_date='943938000', map1='".$_POST['map1']."', map2='".$_POST['map2']."', map3='".$_POST['map3']."', date1='".$_POST['date1']."', date2='".$_POST['date2']."', date3='".$_POST['date3']."', date4='".$_POST['date4']."', challenged_info='', status='2' WHERE chalID='7'Query failed!
  17. Hi This does not make sense to me, I hope someone can tell me why this query don't work: safe_query("UPDATE ".PREFIX."cup_challenges SET reply_date='$postdate', $select_map $select_date challenged_info='".$_POST['info']."', status='2' WHERE chalID='".$_GET['challID']."'");; and this query does work: safe_query("UPDATE ".PREFIX."cup_challenges SET reply_date='$postdate', map1='".$_POST['map1']."', map2='".$_POST['map2']."', map3='".$_POST['map3']."', date1='".$_POST['date1']."', date2='".$_POST['date2']."', date3='".$_POST['date3']."', date4='".$_POST['date4']."', challenged_info='".$_POST['info']."', status='2' WHERE chalID='".$_GET['challID']."'"); Variables in $select_map and $select_date makes the query fail but when I copy/paste this (bold) in query it works: $select_map = map1='".$_POST['map1']."', map2='".$_POST['map2']."', map3='".$_POST['map3']."', $select date = date1='".$_POST['date1']."', date2='".$_POST['date2']."', date3='".$_POST['date3']."', date4='".$_POST['date4']."', am I using the variable in query incorrectly?
  18. Hi! The below dropdown will show dates/times every 15 minutes from 12am to 11:45pm for only 1 day. I want it to show for 5 days, anyway I can do this? Below code: $start = strtotime('12:00am'); $end = strtotime('11:45pm'); echo '<select name="time">'; for ($i = $start; $i <= $end; $i += 900) { echo '<option>' . date('F j, Y, \a\t g:i a', $i); } echo '</select>'; Thanks for any help.
  19. Hi! When I echo $m below, it will show all selected options fine. Instead, I want it to show many I selected. So if I selected 3 in dropdown, I want it to say I selected 3 instead of showing their values. $allmaps=$_POST['maps']; foreach ($allmaps as $m) { echo 'm = '.$m.''; } <select name="maps[]" multiple>'.$maps.'</select>
  20. $getladders = safe_query("SELECT * FROM ".PREFIX."cup_ladders WHERE ID='$laddID'"); if(!mysql_num_rows($getladders)) { echo 'No ladders for '.getplatname($platID).''; }else $ds=mysql_fetch_array(safe_query("SELECT platID FROM ".PREFIX."cup_ladders WHERE ID='$laddID'")); echo ' <table width="100%" bordercolor="'.$border.'"> <tr> <td width="25%" align="left" class="title" colspan="7"> &#8226; Standings</td> <td width="25%" align="center" class="title" colspan="3"> <a href="?site=ladders&platID='.$ds['platID'].'"><img border="0" width="16" height=16" src="images/cup/icons/goback.png"> <b>Ladders</b></a> | <a href="?site=matches&laddID='.$laddID.'"><b>Matches</b> <img border="0" width="16" height=16" src="images/cup/icons/goforward.png"></a></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">XP:</td> <td width="10%" bgcolor="'.$bg1.'" class="title2" align="center">Activity:</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">Ratio:</td> <td width="10%" bgcolor="'.$bg1.'" class="title2" align="center">Challenge:</td> </tr>'; while($ld=mysql_fetch_array($getladders)) { $laddID = $ld['ID']; if(ladderis1on1($laddID)) { $participants = safe_query("SELECT * FROM ".PREFIX."cup_clans WHERE ladID='$laddID' AND 1on1='1'"); }else $participants = safe_query("SELECT * FROM ".PREFIX."cup_clans WHERE ladID='$laddID' AND 1on1='0'"); while($ds=mysql_fetch_array($participants)) { $teamID = $ds['clanID']; if(ladderis1on1($ds['ladID'])) { echo ' <tr> <td bgcolor="'.$bg1.'" width="5%" align="center">#'.$rank.'</td> <td bgcolor="'.$bg1.'" width="10%" align="center"><a href="?site=profile&id='.$ds['clanID'].'">'.getnickname($ds['clanID']).'</a></td> <td bgcolor="'.$bg1.'" width="10%" align="center"></td> <td bgcolor="'.$bg1.'" width="10%" align="center"></td> <td bgcolor="'.$bg1.'" width="10%" align="center"></td> <td bgcolor="'.$bg1.'" width="10%" align="center"></td> <td bgcolor="'.$bg1.'" width="10%" align="center"></td> <td bgcolor="'.$bg1.'" width="10%" align="center"></td> <td bgcolor="'.$bg1.'" width="10%" align="center"></td> <td bgcolor="'.$bg1.'" width="10%" align="center"></td> </tr> <br>'; }else{ echo ' <tr> <td bgcolor="'.$bg1.'" width="5%" align="center">#'.$rank.'</td> <td bgcolor="'.$bg1.'" width="10%" align="center"><a href="?site=clans&action=show&clanID='.$ds['clanID'].'">'.getclanname($teamID).'</a></td> <td bgcolor="'.$bg1.'" width="10%" align="center"></td> <td bgcolor="'.$bg1.'" width="10%" align="center"></td> <td bgcolor="'.$bg1.'" width="10%" align="center"></td> <td bgcolor="'.$bg1.'" width="10%" align="center"></td> <td bgcolor="'.$bg1.'" width="10%" align="center"></td> <td bgcolor="'.$bg1.'" width="10%" align="center"></td> <td bgcolor="'.$bg1.'" width="10%" align="center"></td> <td bgcolor="'.$bg1.'" width="10%" align="center"></td> </tr> <br>'; } } }echo '</table>'; Have nothing for $rank, that's what I want: $rank = #1, #2 etc Thank you!
  21. Hi I'm looking something simular to this: http://cupaddon.com/index.php?site=halloffame Under the place column, it shows #1 #2 #3 for each row. How can I use php to use this on my table for each row? And please say if this question makes no sense to you. I simply want to use #1 #2 etc for each of my rows for my table. I am using a while loop for my table also. I really appreciate if anyone can help me on this, thanks very much!
  22. Hi all, Visit my website at http://cupaddon.com/?site=platforms as you can see there is "Console Platform" and two for "PC Platform". I want to group these platforms together so that all ladders are shown in each platform instead of showing each platform for each ladder if that makes sense? Here is the code: if($show_inactive_platforms) $activity = ''; else $activity = "WHERE status='1'"; $getplatforms = safe_query("SELECT * FROM ".PREFIX."cup_platforms $activity ORDER BY ID DESC"); echo '<table width="100%" bordercolor="'.$border.'">'; while($pl=mysql_fetch_array($getplatforms)) { $getladders = safe_query("SELECT * FROM ".PREFIX."cup_ladders WHERE platID='$platID'"); $total_ladder_rows = mysql_num_rows($getladders); $getmatches = safe_query("SELECT * FROM ".PREFIX."cup_standings WHERE platID='$platID'"); $played_matches = mysql_num_rows($getmatches); eval ("\$one_head = \"".gettemplate("platforms_head")."\";"); echo $one_head; eval ("\$one_head = \"".gettemplate("platforms_content")."\";"); echo $one_head; }echo '</table>'; platforms_head.html template: <tr bgcolor="$bghead"> <td colspan="5" height="20" align="center" class="title">$pl[platform]</td> </tr> platforms_content.html template: <tr> <td width="25%" align="center" bgcolor="$bg1" rowspan="6">$logo</td> <td width="55%" bgcolor="$border">$pl[name]</td> </tr> <tr> <td bgcolor="$bg1">$pl[descrip]</td> </tr> <tr> <td bgcolor="$bg2">$total_ladder_rows Total Ladders</td> </tr> <tr> <td bgcolor="$bg1">$active_teams/$all_teams Active Teams</td> </tr> <tr> <td bgcolor="$bg1">$played_matches Played Matches</td> </tr> <tr> <td bgcolor="$bg2"><img src="images/cup/icons/go.png"> <a href="?site=ladders&platID=$platID">View Ladders</a></td> </tr> <tr> <td colspan="2"></td> </tr> any help is appreciated, thank you!
×
×
  • 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.