| [ Index ] |
PHP Cross Reference of e107 v1 |
[Summary view] [Print] [Text view]
1 <?php 2 /* 3 + ----------------------------------------------------------------------------+ 4 | e107 website system 5 | 6 | Copyright (C) 2001-2002 Steve Dunstan (jalist@e107.org) 7 | Copyright (C) 2008-2010 e107 Inc (e107.org) 8 | 9 | Released under the terms and conditions of the 10 | GNU General Public License (http://gnu.org). 11 | 12 | $URL: https://e107.svn.sourceforge.net/svnroot/e107/trunk/e107_0.7/banner.php $ 13 | $Revision: 11678 $ 14 | $Id: banner.php 11678 2010-08-22 00:43:45Z e107coders $ 15 | $Author: e107coders $ 16 +----------------------------------------------------------------------------+ 17 */ 18 require_once ("class2.php"); 19 require_once(e_HANDLER."form_handler.php"); 20 $rs = new form; 21 22 if (e_QUERY) { 23 $query_string = intval(e_QUERY); 24 $sql->db_Select("banner", "*", "banner_id = '{$query_string}' "); 25 $row = $sql->db_Fetch(); 26 $ip = $e107->getip(); 27 $newip = (strpos($row['banner_ip'], "{$ip}^") !== FALSE) ? $row['banner_ip'] : "{$row['banner_ip']}{$ip}^"; 28 $sql->db_Update("banner", "banner_clicks = banner_clicks + 1, `banner_ip` = '{$newip}' WHERE `banner_id` = '{$query_string}'"); 29 header("Location: {$row['banner_clickurl']}"); 30 exit; 31 } 32 33 require_once(HEADERF); 34 35 if (isset($_POST['clientsubmit'])) { 36 37 $clean_login = $tp -> toDB($_POST['clientlogin']); 38 $clean_password = $tp -> toDB($_POST['clientpassword']); 39 40 if (!$sql->db_Select("banner", "*", "`banner_clientlogin` = '{$clean_login}' AND `banner_clientpassword` = '{$clean_password}'")) { 41 $ns->tablerender(BANNERLAN_38, "<br /><div style='text-align:center'>".BANNERLAN_20."</div><br />"); 42 require_once(FOOTERF); 43 exit; 44 } 45 46 $row = $sql->db_Fetch(); 47 $banner_total = $sql->db_Select("banner", "*", "`banner_clientname` = '{$row['banner_clientname']}'"); 48 49 if (!$banner_total) { 50 $ns->tablerender(BANNERLAN_38, "<br /><div style='text-align:center'>".BANNERLAN_29."</div><br />"); 51 require_once(FOOTERF); 52 exit; 53 } else { 54 while ($row = $sql->db_Fetch()) { 55 56 $start_date = ($row['banner_startdate'] ? strftime("%d %B %Y", $row['banner_startdate']) : BANNERLAN_31); 57 $end_date = ($row['banner_enddate'] ? strftime("%d %B %Y", $row['banner_enddate']) : BANNERLAN_31); 58 59 $BANNER_TABLE_CLICKPERCENTAGE = ($row['banner_clicks'] && $row['banner_impressions'] ? round(($row['banner_clicks'] / $row['banner_impressions']) * 100)."%" : "-"); 60 $BANNER_TABLE_IMPRESSIONS_LEFT = ($row['banner_impurchased'] ? $row['banner_impurchased'] - $row['banner_impressions'] : BANNERLAN_30); 61 $BANNER_TABLE_IMPRESSIONS_PURCHASED = ($row['banner_impurchased'] ? $row['banner_impurchased'] : BANNERLAN_30); 62 $BANNER_TABLE_CLIENTNAME = $row['banner_clientname']; 63 $BANNER_TABLE_BANNER_ID = $row['banner_id']; 64 $BANNER_TABLE_BANNER_CLICKS = $row['banner_clicks']; 65 $BANNER_TABLE_BANNER_IMPRESSIONS = $row['banner_impressions']; 66 $BANNER_TABLE_ACTIVE = BANNERLAN_36.($row['banner_active'] != "255" ? BANNERLAN_32 : "<b>".BANNERLAN_33."</b>"); 67 $BANNER_TABLE_STARTDATE = BANNERLAN_37." ".$start_date; 68 $BANNER_TABLE_ENDDATE = BANNERLAN_34." ".$end_date; 69 70 if ($row['banner_ip']) 71 { 72 $tmp = explode("^", $row['banner_ip']); 73 $BANNER_TABLE_IP_LAN = (count($tmp)-1); 74 for($a = 0; $a <= (count($tmp)-2); $a++) { 75 $BANNER_TABLE_IP .= $tmp[$a]."<br />"; 76 } 77 } 78 79 if (!$BANNER_TABLE) 80 { 81 if (file_exists(THEME."banner_template.php")) { 82 require(THEME."banner_template.php"); 83 } else { 84 require(e_BASE.$THEMES_DIRECTORY."templates/banner_template.php"); 85 } 86 } 87 $textstring .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_TABLE); 88 } 89 } 90 91 if (!$BANNER_TABLE) 92 { 93 if (file_exists(THEME."banner_template.php")) { 94 require(THEME."banner_template.php"); 95 } else { 96 require(e_BASE.$THEMES_DIRECTORY."templates/banner_template.php"); 97 } 98 } 99 $textstart = preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_TABLE_START); 100 $textend = preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_TABLE_END); 101 $text = $textstart.$textstring.$textend; 102 103 echo $text; 104 105 require_once(FOOTERF); 106 exit; 107 } 108 109 110 $BANNER_LOGIN_TABLE_LOGIN = $rs->form_text("clientlogin", 30, $id, 20, "tbox"); 111 $BANNER_LOGIN_TABLE_PASSW = $rs->form_password("clientpassword", 30, "", 20, "tbox"); 112 $BANNER_LOGIN_TABLE_SUBMIT = $rs->form_button("submit", "clientsubmit", BANNERLAN_18); 113 114 if (!$BANNER_LOGIN_TABLE) { 115 if (file_exists(THEME."banner_template.php")) { 116 require_once(THEME."banner_template.php"); 117 } else { 118 require_once(e_BASE.$THEMES_DIRECTORY."templates/banner_template.php"); 119 } 120 } 121 $text = preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_LOGIN_TABLE); 122 $ns->tablerender(BANNERLAN_19, $text); 123 124 125 require_once(FOOTERF); 126 127 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Mon Mar 12 16:28:38 2012 | Cross Reference PHPXref |