mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 20:58:30 +01:00
Banner plugin: Added default banner item during installation.
This commit is contained in:
parent
0a1a6b9250
commit
c357a420cc
@ -407,6 +407,7 @@ class banner_form_ui extends e_admin_form_ui
|
||||
break;
|
||||
|
||||
case 'write': // Edit Page
|
||||
$text = '';
|
||||
if (count($this->clients))
|
||||
{
|
||||
$text = $frm->select('banner_clientname_sel',$this->clients, $curVal,'', LAN_SELECT);
|
||||
@ -473,7 +474,7 @@ class banner_form_ui extends e_admin_form_ui
|
||||
|
||||
case 'filter':
|
||||
case 'batch':
|
||||
return $array;
|
||||
return array();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -515,7 +516,7 @@ class banner_form_ui extends e_admin_form_ui
|
||||
{
|
||||
if($mode != 'read')
|
||||
{
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
$frm = e107::getForm();
|
||||
@ -526,8 +527,8 @@ class banner_form_ui extends e_admin_form_ui
|
||||
$clickpercentage = ($banner_row['banner_clicks'] && $banner_row['banner_impressions'] ? round(($banner_row['banner_clicks'] / $banner_row['banner_impressions']) * 100,1)."%" : "-");
|
||||
|
||||
return $clickpercentage;
|
||||
$impressions_left = ($banner_row['banner_impurchased'] ? $banner_row['banner_impurchased'] - $banner_row['banner_impressions'] : BANNERLAN_30);
|
||||
$impressions_purchased = ($banner_row['banner_impurchased'] ? $banner_row['banner_impurchased'] : BANNERLAN_30);
|
||||
//$impressions_left = ($banner_row['banner_impurchased'] ? $banner_row['banner_impurchased'] - $banner_row['banner_impressions'] : BANNERLAN_30);
|
||||
// $impressions_purchased = ($banner_row['banner_impurchased'] ? $banner_row['banner_impurchased'] : BANNERLAN_30);
|
||||
}
|
||||
|
||||
|
||||
|
69
e107_plugins/banner/banner_setup.php
Normal file
69
e107_plugins/banner/banner_setup.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (c) 2008-2016 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class banner_setup
|
||||
{
|
||||
/*
|
||||
function install_pre($var)
|
||||
{
|
||||
// print_a($var);
|
||||
// echo "custom install 'pre' function<br /><br />";
|
||||
}
|
||||
*/
|
||||
function install_post($var)
|
||||
{
|
||||
$sql = e107::getDb();
|
||||
$mes = e107::getMessage();
|
||||
|
||||
$insert = array(
|
||||
'banner_id' => 0,
|
||||
'banner_clientname' => '',
|
||||
'banner_clientlogin' => '',
|
||||
'banner_clientpassword' => '',
|
||||
'banner_image' => '{e_PLUGIN}banner/images/banner1.png',
|
||||
'banner_clickurl' => 'http://e107.org',
|
||||
'banner_impurchased' => '0',
|
||||
'banner_startdate' => '0',
|
||||
'banner_enddate' => '0',
|
||||
'banner_active' => '0',
|
||||
'banner_clicks' => '0',
|
||||
'banner_impressions' => '0',
|
||||
'banner_ip' => '',
|
||||
'banner_description' => 'click to visit',
|
||||
'banner_campaign' => 'e107promo'
|
||||
);
|
||||
|
||||
$status = ($sql->insert('banner', $insert)) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
|
||||
$mes->add("Adding Default table data to table: banner", $status); //TODO Generic LAN "LAN_DEFAULT_TABLE_DATA"
|
||||
|
||||
|
||||
}
|
||||
/*
|
||||
function uninstall_options()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
function uninstall_post($var)
|
||||
{
|
||||
// print_a($var);
|
||||
}
|
||||
|
||||
function upgrade_post($var)
|
||||
{
|
||||
// $sql = e107::getDb();
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user