1:
2:
3:
4:
5:
|
get("toplist_logtin")."\";"); require("acp/lib/options.inc.php"); if(isset($_REQUEST['mode'])) $mode = $_REQUEST['mode']; else $mode=""; $result = $db->query_first("SELECT username from bb".$n."_users where userid= '$wbbuserdata[userid]'"); ##### Einlesen der Einstellungen ##### $result = $db->query_first("SELECT items, refresh_dates, last_update, vote_lock from bb".$n."_toplist_config"); $image = $db->query_first("SELECT banner_width, banner_height from bb".$n."_toplist_config"); $breite = $image['banner_width']; $hoehe = $image['banner_height']; $tage = $result['refresh_dates']; $next_refresh = $result['last_update'] + ($tage * 86400); $lock_interval = $result['vote_lock']; if(time() > $next_refresh) { $next_refresh = time() + ($tage * 86400); $db->query("UPDATE bb".$n."_toplist_config set last_update=".time()); $db->query("UPDATE bb".$n."_toplist set page_out=0, page_in=0, votes=0, count=0"); } $actual_time = time(); $db->query("DELETE FROM bb".$n."_toplist_vote where time < ".$actual_time); $next_refresh_lesbar = strftime("%d.%m.%Y %H:%M", $next_refresh); $items_per_page = $result['items']; $iponline=getenv("REMOTE_ADDR"); ##### Klick auf einen Eintrag in der Toplist ##### if($mode == "link") { $result = $db->query("UPDATE bb".$n."_toplist SET page_out=page_out+1 WHERE pageid='$_REQUEST[page]'"); $link = $db->query_first("SELECT * FROM bb".$n."_toplist WHERE pageid='$_REQUEST[page]'"); header("Location:".$link['page_link']); } ##### Bei einem Klick auf den Eintrag NEUE SEITE HINZUFÜGEN ##### if($mode == "add") { if(!$wbbuserdata[userid]) { eval("\$tpl->output(\"".$tpl->get("access_error")."\");"); exit; } eval ("\$toplist = \"".$tpl->get("toplist_add")."\";"); } ##### Speichern einer neuen Seite ##### if($mode == "save") { if(!$wbbuserdata[userid]) { eval("\$tpl->output(\"".$tpl->get("access_error")."\");"); exit; } if($ppicture != "") { $file = @fopen ($ppicture, "r"); if (!$file) { $error_value = "{$lang->items['LANG_GLOBAL_TOPLIST_TEXT29']} [".$ppicture."] {$lang->items['LANG_GLOBAL_TOPLIST_TEXT30']}"; eval("\$tpl->output(\"".$tpl->get("toplist_error2")."\");"); exit; }else{ $save = getimagesize($ppicture); if($save[0] <= $image['banner_width'] && $save[1] < $image['banner_height']) { $ppicture = strip_tags("$ppicture"); $pdescription = strip_tags(str_replace("\n\r","
\n\r", $pdescription)); $userinfos = $db->query_first("SELECT username, email from bb".$n."_users where userid='$wbbuserdata[userid]'"); mailer($webmastermail, "{$lang->items['LANG_GLOBAL_TOPLIST_TEXT31']}", "{$lang->items['LANG_GLOBAL_TOPLIST_TEXT32']}\r\nBoardname: ".$ptitle."\r\n{$lang->items['LANG_GLOBAL_TOPLIST_TEXT33']} ".$userinfos['username']."\r\n{$lang->items['LANG_GLOBAL_TOPLIST_TEXT34']} ".$userinfos['email']); $result = $db->query("INSERT INTO bb".$n."_toplist (pageid, userid, page_name, page_description, page_picture, page_link) VALUES ('', '$wbbuserdata[userid]', '".addslashes($_POST[ptitle])."', '".addslashes($_POST[pdescription])."', '$_POST[ppicture]', '$_POST[plink]')"); $pageid = $db->insert_id(); $mode=""; header("Location: toplist.php?mode=viewcode&pageid=$pageid{$SID_ARG_2ND}"); exit(); $mode="add"; exit; } } eval ("\$toplist = \"".$tpl->get("toplist_add")."\";"); } else { $pdescription = str_replace("\n\r","
\n\r", $pdescription); $userinfos = $db->query_first("SELECT username, email from bb".$n."_users where userid='$wbbuserdata[userid]'"); mailer($webmastermail, "{$lang->items['LANG_GLOBAL_TOPLIST_TEXT31']}", "{$lang->items['LANG_GLOBAL_TOPLIST_TEXT32']}\r\n{$lang->items['LANG_GLOBAL_TOPLIST_TEXT35']} ".$ptitle."\r\n{$lang->items['LANG_GLOBAL_TOPLIST_TEXT33']} ".$userinfos['username']."\r\n{$lang->items['LANG_GLOBAL_TOPLIST_TEXT34']} ".$userinfos['email']); $result = $db->query("INSERT INTO bb".$n."_toplist (pageid, userid, page_name, page_description, page_picture, page_link) VALUES ('', '$wbbuserdata[userid]', '".addslashes($_POST[ptitle])."', '".addslashes($_POST[pdescription])."', '$_POST[ppicture]', '$_POST[plink]')"); $pageid = $db->insert_id(); $mode=""; header("Location: toplist.php?mode=viewcode&pageid=$pageid{$SID_ARG_2ND}"); exit(); } } ##### Anzeige des HTML-Codes für die eingegebene Seite ###### if($mode == "viewcode") { $seiteid = $_REQUEST[pageid]; //$result = $db->query_first("SELECT pageid from bb".$n."_toplist where page_name='$ptitle'"); $userinfos = $db->query_first("SELECT username, email from bb".$n."_users where userid='$wbbuserdata[userid]'"); $textlink = "<a href=\"".$url2board."/toplist.php?mode=vote&page=$seiteid\" target=\"_blank\">$master_board_name-Toplist</a>"; $bildlink = "<a href=\"".$url2board."/toplist.php?mode=vote&page=$seiteid\" target=\"_blank\"><img src=\"".$url2board."/images/vote_toplist.gif\" alt=\"{$lang->items['LANG_GLOBAL_TOPLIST_TEXT36']} $master_board_name-Toplist {$lang->items['LANG_GLOBAL_TOPLIST_TEXT37']}\" title=\"{$lang->items['LANG_GLOBAL_TOPLIST_TEXT36']} $master_board_name-Toplist {$lang->items['LANG_GLOBAL_TOPLIST_TEXT37']}\" border=\"0\" /></a>"; $textlink_mail = str_replace("<", "<", $textlink); $textlink_mail = str_replace(">", ">", $textlink_mail); $bildlink_mail = str_replace("<", "<", $bildlink); $bildlink_mail = str_replace(">", ">", $bildlink_mail); mailer($userinfos['email'], "{$lang->items['LANG_GLOBAL_TOPLIST_TEXT38']}", "{$lang->items['LANG_GLOBAL_TOPLIST_TEXT39']}\r\n\n{$lang->items['LANG_GLOBAL_TOPLIST_TEXT3']} ".$textlink_mail."\r\n{$lang->items['LANG_GLOBAL_TOPLIST_TEXT4']} ".$bildlink_mail); eval ("\$toplist = \"".$tpl->get("toplist_links")."\";"); } ##### Wenn jemand von einer externen Seite auf einen Toplist-Link geklickt hat ##### if($mode=="vote") { if($_POST[wert]=="") { $iponline=getenv("REMOTE_ADDR"); $rueckgabe = $db->query_first("SELECT count(*) from bb".$n."_toplist_vote where pageid='$_REQUEST[page]' AND ip='$iponline'"); $result = $db->query_first("SELECT page_name from bb".$n."_toplist where pageid='$_REQUEST[page]'"); $page_name = $result['page_name']; if($rueckgabe[0] > 0) { eval ("\$toplist = \"".$tpl->get("toplist_error1")."\";"); } else { $page = $_REQUEST[page]; eval ("\$toplist = \"".$tpl->get("toplist_vote")."\";"); } } else { $iponline=getenv("REMOTE_ADDR"); $result = $db->query("UPDATE bb".$n."_toplist set page_in=page_in+1, votes=votes+1, count=count+".$_POST[wert]." where pageid=".$_REQUEST[page].""); $delete_time = time()+($lock_interval*3600); $result = $db->query("INSERT INTO bb".$n."_toplist_vote (pageid, ip, time) VALUES ('$_REQUEST[page]', '$iponline', '$delete_time')"); header("Location: toplist.php{$SID_ARG_1ST}"); unset($mode); } } if($mode=="novote") { $result = $db->query("UPDATE bb".$n."_toplist set page_in=page_in+1 where pageid='$_REQUEST[page]'"); header("Location: toplist.php{$SID_ARG_1ST}"); unset($mode); } ##### Bei einem Klick auf den Eintrag EINGEREICHTE SEITE BEARBEITEN ##### if($mode == "edit") { if(!$wbbuserdata[userid]) { eval("\$tpl->output(\"".$tpl->get("access_error")."\");"); exit; } if(!$_REQUEST[page]) { $list = $db->query("SELECT * from bb".$n."_toplist where userid='$wbbuserdata[userid]'"); eval ("\$toplist_header = \"".$tpl->get("toplist_edit_header")."\";"); while($list_array = $db->fetch_array($list)) { $pagename = strip_tags($list_array['page_name']); $page_id = strip_tags($list_array['pageid']); $pagedescription = strip_tags($list_array['page_description']); $textlink = "<a href=\"".$url2board."/toplist.php?mode=vote&page=".$list_array['pageid']."\" target=\"_blank\">$master_board_name-Toplist</a>"; $bildlink = "<a href=\"".$url2board."/toplist.php?mode=vote&page=".$list_array['pageid']."\" target=\"_blank\"><img src=\"".$url2board."/images/vote_toplist.gif\" alt=\"{$lang->items['LANG_GLOBAL_TOPLIST_TEXT36']} $master_board_name-Toplist {$lang->items['LANG_GLOBAL_TOPLIST_TEXT37']}\" title=\"{$lang->items['LANG_GLOBAL_TOPLIST_TEXT36']} $master_board_name-Toplist {$lang->items['LANG_GLOBAL_TOPLIST_TEXT37']}\" border=\"0\" /></a>"; eval ("\$toplist .= \"".$tpl->get("toplist_edit_list")."\";"); } } else { $result1 = $db->query("SELECT * from bb".$n."_toplist where pageid='$_REQUEST[page]' AND userid='$wbbuserdata[userid]'"); if(!$result1) { eval("\$tpl->output(\"".$tpl->get("access_error")."\");"); exit; } while($result=$db->fetch_array($result1)){ $ptitle = $result['page_name']; $ppicture = $result['page_picture']; $pdescription = $result['page_description']; $pdescription = str_replace("
\n\r", "\n\r", $pdescription); $plink = $result['page_link']; $page = $result['pageid']; eval ("\$toplist = \"".$tpl->get("toplist_edit")."\";"); } } } ##### Speichern einer geänderten Seite ##### if($mode == "editsave") { if(!$wbbuserdata[userid]) { eval("\$tpl->output(\"".$tpl->get("access_error")."\");"); exit; } $_POST[pdescription] = str_replace("\n\r","
\n\r", $_POST[pdescription]); $result = $db->query("UPDATE bb".$n."_toplist set page_name='".addslashes($_POST[ptitle])."', page_description='".addslashes($_POST[pdescription])."', page_picture='$_POST[ppicture]', page_link='$_POST[plink]' where pageid='$_POST[page]'"); unset($mode); } ##### Bei einem Klick auf den Eintrag EINGEREICHTE SEITE LÖSCHEN ##### if($mode == "delete") { if(!$wbbuserdata[userid]) { eval("\$tpl->output(\"".$tpl->get("access_error")."\");"); exit; } if(!$_REQUEST[page]) { $list = $db->query("SELECT * from bb".$n."_toplist where userid='$wbbuserdata[userid]'"); eval ("\$toplist_header = \"".$tpl->get("toplist_delete_header")."\";"); while($list_array = $db->fetch_array($list)) { $pagename = $list_array['page_name']; $page_id = $list_array['pageid']; $pagepicture = $list_array['page_picture']; if($pagepicture) $banner = ''; else $banner=""; $pagedescription = $list_array['page_description']; eval ("\$toplist .= \"".$tpl->get("toplist_delete_list")."\";"); } } else { $result = $db->query_first("SELECT * from bb".$n."_toplist where userid='$wbbuserdata[userid]'"); if(!$result) { eval("\$tpl->output(\"".$tpl->get("access_error")."\");"); exit; } $result = $db->query("DELETE from bb".$n."_toplist where pageid='$_REQUEST[page]'"); unset($mode); } } ##### Toplist-Ansicht ##### if(!$mode) { $pageperpage = $items_per_page; // Zahl pro Seite $pagecount = $db->query_first("SELECT COUNT(*) FROM bb".$n."_toplist"); $pagecount = $pagecount[0]; if(isset($_GET['page'])) { $page=intval($_GET['page']); if($page==0) $page=1; } else $page=1; $pages = ceil($pagecount/$pageperpage); if($pages>1) $pagelink=makepagelink("toplist.php?{$SID_ARG_2ND}",$page,$pages,$showpagelinks-1); $pagelink = str_replace("&","",$pagelink); $list = $db->query("SELECT * from bb".$n."_toplist order by page_in desc, page_out desc, count desc LIMIT ".($pageperpage*($page-1)).",".$pageperpage.""); $number = $pagesite * $items_per_page; $toplist=""; while($list_array = $db->fetch_array($list)) { $number++; $pagename = $list_array['page_name']; $page_id = $list_array['pageid']; $pagepicture = $list_array['page_picture']; if($pagepicture) $banner = ''; else $banner=""; $pagedescription = $list_array['page_description']; $page_in = $list_array['page_in']; $page_out = $list_array['page_out']; if($list_array['votes'] > 0) { $rating = sprintf("%d", $list_array['count'] / $list_array['votes']); } else { $rating = "0"; } eval ("\$page = \"".$tpl->get("toplist_page")."\";"); eval ("\$toplist_header = \"".$tpl->get("toplist_header")."\";"); eval ("\$toplist .= \"".$tpl->get("toplist_listbit")."\";"); eval ("\$pageclick = \"".$tpl->get("toplist_pageclick")."\";"); } } eval("\$tpl->output(\"".$tpl->get("toplist_main")."\");"); ?> |