[ Index ] |
PHP Cross Reference of phpwcms V1.5.0 _r431 (28.01.12) |
[Summary view] [Print] [Text view]
1 <?php 2 /************************************************************************************* 3 Copyright notice 4 5 (c) 2002-2012 Oliver Georgi <oliver@phpwcms.de> // All rights reserved. 6 7 This script is part of PHPWCMS. The PHPWCMS web content management system is 8 free software; you can redistribute it and/or modify it under the terms of 9 the GNU General Public License as published by the Free Software Foundation; 10 either version 2 of the License, or (at your option) any later version. 11 12 The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html 13 A copy is found in the textfile GPL.txt and important notices to the license 14 from the author is found in LICENSE.txt distributed with these scripts. 15 16 This script is distributed in the hope that it will be useful, but WITHOUT ANY 17 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 18 PARTICULAR PURPOSE. See the GNU General Public License for more details. 19 20 This copyright notice MUST APPEAR in all copies of the script! 21 *************************************************************************************/ 22 23 // ---------------------------------------------------------------- 24 // obligate check for phpwcms constants 25 if (!defined('PHPWCMS_ROOT')) { 26 die("You Cannot Access This Script Directly, Have a Nice Day."); 27 } 28 // ---------------------------------------------------------------- 29 30 31 /* 32 * module ads/banner managament 33 * ============================ 34 * 35 * some defaults for modules: $phpwcms['modules'][$module] 36 * store all related in here and holds some default values 37 * ['path'], ['type'], ['name'] 38 * language values are store in $BL['modules'][$module] 39 * as defined in lang/en.lang.php 40 * but maybe to keep default language file more lightweight 41 * you can use own language definitions starting within this file 42 * 43 */ 44 45 // first check if neccessary db exists 46 if(isset($phpwcms['modules'][$module]['path']) && file_exists($phpwcms['modules'][$module]['path'].'setup/setup.php')) { 47 48 include_once($phpwcms['modules'][$module]['path'].'setup/setup.php'); 49 50 } elseif(isset($phpwcms['modules'][$module]['path'])) { 51 52 // module default stuff 53 54 // load special backend CSS 55 $BE['HEADER']['module_ads.css'] = ' <link href="'.$phpwcms['modules'][$module]['dir'].'template/css/backend.ads.css" rel="stylesheet" type="text/css">'; 56 57 // put translation back to have easier access to it - use it as relation 58 $BLM = & $BL['modules'][$module]; 59 define('MODULE_HREF', 'phpwcms.php?do=modules&module='.$module); 60 $plugin = array(); 61 62 // edit campaign 63 if(!empty($_GET['campaign'])) { 64 65 if(isset($_GET['edit'])) { 66 67 // handle posts and read data 68 include_once($phpwcms['modules'][$module]['path'].'inc/processing.campaign.inc.php'); 69 70 // edit campaign form 71 include_once($phpwcms['modules'][$module]['path'].'backend.form.campaign.php'); 72 73 } elseif(isset($_GET['verify'])) { 74 75 // active/inactive 76 $sql = 'UPDATE '.DB_PREPEND.'phpwcms_ads_campaign SET '; 77 $sql .= "adcampaign_status=".(intval($_GET['verify']) ? 1 : 0)." "; 78 $sql .= "WHERE adcampaign_id=".intval($_GET['editid']); 79 @_dbQuery($sql, 'UPDATE'); 80 headerRedirect(decode_entities(MODULE_HREF).'&listcampaign=1'); 81 82 } elseif(isset($_GET['delete'])) { 83 84 $adcampaign_id = intval($_GET['delete']); 85 86 // delete 87 $sql = 'UPDATE '.DB_PREPEND.'phpwcms_ads_campaign SET '; 88 $sql .= "adcampaign_status=9 WHERE adcampaign_id=".$adcampaign_id; 89 @_dbQuery($sql, 'UPDATE'); 90 91 //rename deleted campaign 92 @rename(PHPWCMS_CONTENT.'ads/'.$adcampaign_id, PHPWCMS_CONTENT.'ads/_deleted_'.time().'_'.$adcampaign_id); 93 94 headerRedirect(decode_entities(MODULE_HREF).'&listcampaign=1'); 95 96 } elseif(isset($_GET['duplicate'])) { 97 98 @_dbDuplicateRow('phpwcms_ads_campaign', 'adcampaign_id', intval($_GET['duplicate']), 99 array( 100 'adcampaign_title' => '--SELF-- ('.generic_string(3).')', 101 'adcampaign_created' => 'SQL:NOW()', 102 'adcampaign_changed' => 'SQL:NOW()', 103 'adcampaign_curview' => '0', 104 'adcampaign_curclick' => '0', 105 'adcampaign_curviewuser'=> '0' )); 106 headerRedirect(decode_entities(MODULE_HREF).'&listcampaign=1'); 107 } 108 109 110 // edit ad place 111 } elseif(!empty($_GET['adplace'])) { 112 113 if(isset($_GET['edit'])) { 114 115 // handle posts and read data 116 include_once($phpwcms['modules'][$module]['path'].'inc/processing.adplace.inc.php'); 117 118 // edit campaign form 119 include_once($phpwcms['modules'][$module]['path'].'backend.form.adplace.php'); 120 121 } elseif(isset($_GET['verify'])) { 122 123 // active/inactive 124 $sql = 'UPDATE '.DB_PREPEND.'phpwcms_ads_place SET '; 125 $sql .= "adplace_status=".(intval($_GET['verify']) ? 1 : 0)." "; 126 $sql .= "WHERE adplace_id=".intval($_GET['editid']); 127 @_dbQuery($sql, 'UPDATE'); 128 headerRedirect(decode_entities(MODULE_HREF).'&listadplace=1'); 129 130 } elseif(isset($_GET['delete'])) { 131 132 // delete 133 $sql = 'UPDATE '.DB_PREPEND.'phpwcms_ads_place SET '; 134 $sql .= "adplace_status=9 WHERE adplace_id=".intval($_GET['delete']); 135 @_dbQuery($sql, 'UPDATE'); 136 headerRedirect(decode_entities(MODULE_HREF).'&listadplace=1'); 137 } 138 139 140 } else { 141 142 // listing 143 include_once($phpwcms['modules'][$module]['path'].'backend.listing.php'); 144 145 if(isset($_GET['listcampaign'])) { 146 include_once($phpwcms['modules'][$module]['path'].'inc/listing.campaign.inc.php'); 147 } elseif(isset($_GET['listadplace'])) { 148 include_once($phpwcms['modules'][$module]['path'].'inc/listing.adplace.inc.php'); 149 } else { 150 include_once($phpwcms['modules'][$module]['path'].'inc/listing.summary.inc.php'); 151 } 152 153 } 154 155 } 156 157 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Jan 29 16:31:14 2012 | Cross-referenced by PHPXref 0.7.1 |