ERROR: '.$error.'

'); } if(!(strlen(trim($league)))) { $error="you forgot to enter a league!"; die('ERROR: '.$error.'

'); } if(!(strlen(trim($map)))) { $error="you forgot to enter a map!"; die('ERROR: '.$error.'

'); } if(!(strlen(trim($server)))) { $error="you forgot to enter a server!"; die('ERROR: '.$error.'

'); } $sem = '^[a-z0-9_\.-]+@[a-z0-9_-]+\.[a-z0-9_\.-]+$'; if(!(eregi($sem, $email))) { $error="your e-mail is not valid!"; die('ERROR: '.$error.'

'); } $sem = '^[http://]+[a-z0-9_\.-]+[a-z0-9_-]+$'; if(!(eregi($sem, $opphp))) { $error="your homepage is not a valid url!"; die('ERROR: '.$error.'

'); } $date=time(); $cwdate=mktime($hour,$minute,0,$month,$day,$year); safe_query("INSERT INTO ".PREFIX."challenge ( date, cwdate, squadID, opponent, opphp, oppcountry, league, map, server, email, info) values( '$date', '$cwdate', '$squad', '$opponent', '$opphp', '$oppcountry', '$league', '$map', '$server', '$email', '$info' ) "); $ergebnis=safe_query("SELECT userID FROM ".PREFIX."squads_members WHERE warmember='1' AND squadID='".$squad."'"); while($ds=mysql_fetch_array($ergebnis)) { $touser[]=$ds[userID]; } if($touser[0] != "") { $date = time(); $message = '[b]There is a new challenge entry![/b]\n\n Click here: [URL]index.php?site=challenge[/URL]'; foreach($touser as $id) { safe_query("INSERT INTO ".PREFIX."messenger (userID, date, fromuser, touser, title, message, viewed) values('$id', '$date', '1', '$id', 'Fight us', '".$message."', '0')"); // eintrag für empfänger safe_query("UPDATE ".PREFIX."user SET pmgot=pmgot+1 WHERE userID='$id'"); } } redirect('index.php?site=challenge', 'thank you for your entry.'); } elseif($action=="delete") { $chID = $_GET['chID']; if(isclanwaradmin($userID)) { safe_query("DELETE FROM ".PREFIX."challenge WHERE chID='$chID'"); redirect('index.php?site=challenge', 'the entry has been deleted.'); } else redirect('index.php?site=challenge', 'no access!'); } else { echo'

challenge

'; $type = $_GET['type']; for($i=1; $i<32; $i++) { if($i==date("d", time())) $day.=''; else $day.=''; } for($i=1; $i<13; $i++) { if($i==date("n", time())) $month.=''; else $month.=''; } for($i=2000; $i<2010; $i++) { if($i==date("Y", time())) $year.=''; else $year.=''; } $squads=getgamesquads(); eval ("\$challenge_new = \"".gettemplate("challenge_new")."\";"); echo $challenge_new; eval ("\$title_challenge = \"".gettemplate("title_challenge")."\";"); echo $title_challenge; $ergebnis = safe_query("SELECT * FROM ".PREFIX."challenge ORDER BY date $type"); $anz=mysql_num_rows($ergebnis); if($anz) { if(!isset($type)) $type = "DESC"; if($type=="ASC") echo'Sort:    '; else echo'Sort:    '; echo'

'; while ($ds = mysql_fetch_array($ergebnis)) { $date = date("d.m.Y", $ds[date]); $cwdate = date("d.m.Y - H:i", $ds[cwdate]); $squad=getsquadname($ds[squadID]); $oppcountry="[flag]".$ds[oppcountry]."[/flag]"; $country=flags($oppcountry); $opponent=''.clearfromtags($ds[opponent]).''; $league=clearfromtags($ds[league]); $map=clearfromtags($ds[map]); $server=clearfromtags($ds[server]); $info=cleartext($ds[info]); $email = ''.$ds[email].''; $sem = '^[http://]+[a-z0-9_\.-]+[a-z0-9_-]+$'; if(!(eregi($sem, $ds[hp]))) $homepage=''; else $homepage='homepage'; $name=cleartext($ds[name]); $message=cleartext($ds[comment]); if(isclanwaradmin($userID)) $actions=' '; else $actions=''; eval ("\$challenges = \"".gettemplate("challenges")."\";"); echo $challenges; } echo'
'; } else echo'no entries'; } ?>