From: <ma...@us...> - 2012-06-19 21:05:14
|
Revision: 9676 http://xoops.svn.sourceforge.net/xoops/?rev=9676&view=rev Author: mageg Date: 2012-06-19 21:05:06 +0000 (Tue, 19 Jun 2012) Log Message: ----------- Moving sql tables in the module banner Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/makedata.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/sql/mysql.data.sql XoopsCore/branches/2.6.x/2.6.0/htdocs/install/sql/mysql.structure.sql XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/banners.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/clients.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/form/banner.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/form/bannerclient.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/include/install.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/templates/admin/banners_admin_banners.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/templates/admin/banners_admin_clients.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/xoops_version.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/module.php Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/banner.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/bannerclient.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/sql/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/sql/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/sql/mysql.sql Removed Paths: ------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/banner.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/bannerclient.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/makedata.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/makedata.php 2012-06-19 20:38:24 UTC (rev 9675) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/makedata.php 2012-06-19 21:05:06 UTC (rev 9676) @@ -72,10 +72,6 @@ $dbm->insert("group_permission", " VALUES(0," . $gruops['XOOPS_GROUP_ADMIN'] . ",15,1,'system_admin')"); $dbm->insert("group_permission", " VALUES(0," . $gruops['XOOPS_GROUP_ADMIN'] . ",16,1,'system_admin')"); $dbm->insert("group_permission", " VALUES(0," . $gruops['XOOPS_GROUP_ADMIN'] . ",17,1,'system_admin')"); - // data for table 'banner' - $dbm->insert("banner", " (bid, cid, imptotal, impmade, clicks, imageurl, clickurl, datestart, dateend, htmlbanner, htmlcode, status) VALUES (1, 1, 0, 1, 0, '" . XOOPS_URL . "/uploads/banners/xoops_flashbanner2.swf', 'http://www.xoops.org/', " . time() . ", 0, 0, '', 1)"); - $dbm->insert("banner", " (bid, cid, imptotal, impmade, clicks, imageurl, clickurl, datestart, dateend, htmlbanner, htmlcode, status) VALUES (2, 1, 0, 1, 0, '" . XOOPS_URL . "/uploads/banners/xoops_banner_2.gif', 'http://www.xoops.org/', " . time() . ", 0, 0, '', 1)"); - $dbm->insert("banner", " (bid, cid, imptotal, impmade, clicks, imageurl, clickurl, datestart, dateend, htmlbanner, htmlcode, status) VALUES (3, 1, 0, 1, 0, '" . XOOPS_URL . "/uploads/banners/banner.swf', 'http://www.xoops.org/', " . time() . ", 0, 0, '', 1)"); // default theme $time = time(); $dbm->insert('tplset', " VALUES (1, 'default', 'XOOPS Default Template Set', '', " . $time . ")"); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/install/sql/mysql.data.sql =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/install/sql/mysql.data.sql 2012-06-19 20:38:24 UTC (rev 9675) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/install/sql/mysql.data.sql 2012-06-19 21:05:06 UTC (rev 9676) @@ -10,12 +10,6 @@ # -# Dumping data for table `bannerclient` -# - -INSERT INTO bannerclient VALUES (1,0, 'XOOPS', 'XOOPS Dev Team'); - -# # Dumping data for table `comments` # Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/install/sql/mysql.structure.sql =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/install/sql/mysql.structure.sql 2012-06-19 20:38:24 UTC (rev 9675) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/install/sql/mysql.structure.sql 2012-06-19 21:05:06 UTC (rev 9676) @@ -28,43 +28,6 @@ # -------------------------------------------------------- # -# Table structure for table `banner` -# - -CREATE TABLE banner ( - bid smallint(5) unsigned NOT NULL auto_increment, - cid tinyint(3) unsigned NOT NULL default '0', - imptotal int(10) unsigned NOT NULL default '0', - impmade mediumint(8) unsigned NOT NULL default '0', - clicks mediumint(8) unsigned NOT NULL default '0', - imageurl varchar(255) NOT NULL default '', - clickurl varchar(255) NOT NULL default '', - datestart int(10) NOT NULL default '0', - dateend int(10) NOT NULL default '0', - htmlbanner tinyint(1) NOT NULL default '0', - htmlcode text, - status tinyint(1) NOT NULL default '0', - PRIMARY KEY (bid), - KEY idxbannercid (cid), - KEY idxbannerbidcid (bid,cid) -) ENGINE=MyISAM; -# -------------------------------------------------------- - -# -# Table structure for table `bannerclient` -# - -CREATE TABLE bannerclient ( - cid smallint(5) unsigned NOT NULL auto_increment, - uid mediumint(8) unsigned NOT NULL default '0', - name varchar(60) NOT NULL default '', - extrainfo text, - PRIMARY KEY (cid), - KEY name (name) -) ENGINE=MyISAM; -# -------------------------------------------------------- - -# # Table structure for table `block_module_link` # Deleted: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/banner.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/banner.php 2012-06-19 20:38:24 UTC (rev 9675) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/banner.php 2012-06-19 21:05:06 UTC (rev 9676) @@ -1,57 +0,0 @@ -<?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ - -/** - * XOOPS Kernel Class - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel - * @since 2.6.0 - * @author Gregory Mage (AKA Mage) - * @author trabis <lus...@gm...> - * @version $Id$ - */ - -defined('XOOPS_ROOT_PATH') or die('Restricted access'); - -class XoopsBanner extends XoopsObject -{ - /** - * Constructor - */ - public function __construct() - { - $this->initVar('bid', XOBJ_DTYPE_INT, null, false, 5); - $this->initVar('cid', XOBJ_DTYPE_INT, null, false, 3); - $this->initVar('imptotal', XOBJ_DTYPE_INT, null, false, 8); - $this->initVar('impmade', XOBJ_DTYPE_INT, null, false, 8); - $this->initVar('clicks', XOBJ_DTYPE_INT, null, false, 8); - $this->initVar('imageurl', XOBJ_DTYPE_TXTBOX, null, false); - $this->initVar('clickurl', XOBJ_DTYPE_TXTBOX, null, false); - $this->initVar('datestart', XOBJ_DTYPE_INT, null, false, 10); - $this->initVar('dateend', XOBJ_DTYPE_INT, null, false, 10); - $this->initVar('htmlbanner', XOBJ_DTYPE_INT, null, false, 1); - $this->initVar('htmlcode', XOBJ_DTYPE_TXTBOX, null, false); - $this->initVar('status', XOBJ_DTYPE_INT, null, false, 1); - } -} - -class XoopsBannerHandler extends XoopsPersistableObjectHandler -{ - /** - * @param null|XoopsDatabase $db - */ - public function __construct(XoopsDatabase $db = null) - { - parent::__construct($db, 'banner', 'XoopsBanner', 'bid', 'imageurl'); - } -} \ No newline at end of file Deleted: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/bannerclient.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/bannerclient.php 2012-06-19 20:38:24 UTC (rev 9675) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/bannerclient.php 2012-06-19 21:05:06 UTC (rev 9676) @@ -1,49 +0,0 @@ -<?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ - -/** - * XOOPS Kernel Class - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package kernel - * @since 2.6.0 - * @author Gregory Mage (AKA Mage) - * @author trabis <lus...@gm...> - * @version $Id$ - */ - -defined('XOOPS_ROOT_PATH') or die('XOOPS root path not defined'); - -class XoopsBannerclient extends XoopsObject -{ - /** - * Constructor - */ - public function __construct() - { - $this->initVar('cid', XOBJ_DTYPE_INT, null, false, 5); - $this->initVar('uid', XOBJ_DTYPE_INT, 0, true); - $this->initVar('name', XOBJ_DTYPE_TXTBOX, null, false); - $this->initVar('extrainfo', XOBJ_DTYPE_TXTAREA, null, false); - } -} - -class XoopsBannerclientHandler extends XoopsPersistableObjectHandler -{ - /** - * @param null|XoopsDatabase $db - */ - public function __construct(XoopsDatabase $db = null) - { - parent::__construct($db, 'bannerclient', 'XoopsBannerclient', 'cid', 'name'); - } -} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/banners.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/banners.php 2012-06-19 20:38:24 UTC (rev 9675) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/banners.php 2012-06-19 21:05:06 UTC (rev 9676) @@ -33,8 +33,8 @@ // Get Action type $op = $system->cleanVars($_REQUEST, 'op', 'default', 'string'); // Get banners handler -$banner_Handler = $xoops->getHandlerBanner(); -$client_Handler = $xoops->getHandlerBannerclient(); +$banner_Handler = $xoops->getModuleHandler('banner'); +$client_Handler = $xoops->getModuleHandler('bannerclient'); // Call header $xoops->header('banners_admin_banners.html'); @@ -197,24 +197,26 @@ case 'new': $admin_page->addTips(sprintf(_AM_BANNERS_TIPS_BANNERS_FORM1, implode(', ', $mimetypes)) . sprintf(_AM_BANNERS_TIPS_BANNERS_FORM2, $upload_size / 1000)); - $admin_page->addItemButton(_AM_BANNERS_BANNERS_LIST, 'banners.php', 'list'); + $admin_page->addItemButton(_AM_BANNERS_BANNERS_LIST, 'banners.php', 'application-view-detail'); $admin_page->renderTips(); $admin_page->renderButton(); $obj = $banner_Handler->create(); $form = $xoops->getModuleForm($obj, 'banner'); - $xoops->tpl->assign('form', $form->render()); + $form->render(); + $xoops->tpl->assign('form', true); break; case 'edit': $admin_page->addTips(sprintf(_AM_BANNERS_TIPS_BANNERS_FORM1, implode(', ', $mimetypes)) . sprintf(_AM_BANNERS_TIPS_BANNERS_FORM2, $upload_size / 1000)); - $admin_page->addItemButton(_AM_BANNERS_BANNERS_LIST, 'banners.php', 'list'); + $admin_page->addItemButton(_AM_BANNERS_BANNERS_LIST, 'banners.php', 'application-view-detail'); $admin_page->renderTips(); $admin_page->renderButton(); $bid = $system->cleanVars($_REQUEST, 'bid', 0, 'int'); if ($bid > 0) { $obj = $banner_Handler->get($bid); $form = $xoops->getModuleForm($obj, 'banner'); - $xoops->tpl->assign('form', $form->render()); + $form->render(); + $xoops->tpl->assign('form', true); } else { $xoops->redirect('banners.php', 1, _AM_SYSTEM_DBERROR); } @@ -264,12 +266,13 @@ } $xoops->error($obj->getHtmlErrors()); $form = $xoops->getModuleForm($obj, 'banner'); - $xoops->tpl->assign('form', $form->render()); + $form->render(); + $xoops->tpl->assign('form', true); break; case 'delete': $admin_page->addItemButton(_AM_BANNERS_BANNERS_ADD, 'banners.php?op=new', 'add'); - $admin_page->addItemButton(_AM_BANNERS_BANNERS_LIST, 'banners.php', 'list'); + $admin_page->addItemButton(_AM_BANNERS_BANNERS_LIST, 'banners.php', 'application-view-detail'); $admin_page->renderButton(); $bid = $system->cleanVars($_REQUEST, 'bid', 0, 'int'); if ($bid > 0) { @@ -291,6 +294,8 @@ $xoops->error($obj->getHtmlErrors()); } } else { + // Define Stylesheet + $xoops->theme->addStylesheet('modules/system/css/admin.css'); $img = ''; $imageurl = $obj->getVar("imageurl"); if ($obj->getVar("htmlbanner")) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/clients.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/clients.php 2012-06-19 20:38:24 UTC (rev 9675) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/clients.php 2012-06-19 21:05:06 UTC (rev 9676) @@ -32,8 +32,8 @@ // Get Action type $op = $system->cleanVars($_REQUEST, 'op', 'default', 'string'); // Get banners handler -$banner_Handler = $xoops->getHandlerBanner(); -$client_Handler = $xoops->getHandlerBannerclient(); +$banner_Handler = $xoops->getModuleHandler('banner'); +$client_Handler = $xoops->getModuleHandler('bannerclient'); // Get member handler $member_handler = $xoops->getHandlerMember(); // Call header @@ -109,24 +109,26 @@ case 'new': $admin_page->addTips(_AM_BANNERS_TIPS_CLIENTS_ADDEDIT); - $admin_page->addItemButton(_AM_BANNERS_CLIENTS_LIST, 'clients.php', 'list'); + $admin_page->addItemButton(_AM_BANNERS_CLIENTS_LIST, 'clients.php', 'application-view-detail'); $admin_page->renderTips(); $admin_page->renderButton(); $obj = $client_Handler->create(); $form = $xoops->getModuleForm($obj, 'bannerclient'); - $xoops->tpl->assign('form', $form->render()); + $form->render(); + $xoops->tpl->assign('form', true); break; case 'edit': $admin_page->addTips(_AM_BANNERS_TIPS_CLIENTS_ADDEDIT); - $admin_page->addItemButton(_AM_BANNERS_CLIENTS_LIST, 'clients.php', 'list'); + $admin_page->addItemButton(_AM_BANNERS_CLIENTS_LIST, 'clients.php', 'application-view-detail'); $admin_page->renderTips(); $admin_page->renderButton(); $cid = $system->cleanVars($_REQUEST, 'cid', 0, 'int'); if ($cid > 0) { $obj = $client_Handler->get($cid); $form = $xoops->getModuleForm($obj, 'bannerclient'); - $xoops->tpl->assign('form', $form->render()); + $form->render(); + $xoops->tpl->assign('form', true); } else { $xoops->redirect('clients.php', 1, _AM_SYSTEM_DBERROR); } @@ -154,12 +156,13 @@ } $xoops->error($obj->getHtmlErrors()); $form = $xoops->getModuleForm($obj, 'bannerclient'); - $xoops->tpl->assign('form', $form->render()); + $form->render(); + $xoops->tpl->assign('form', true); break; case 'delete': $admin_page->addItemButton(_AM_BANNERS_CLIENTS_ADD, 'clients.php?op=new', 'add'); - $admin_page->addItemButton(_AM_BANNERS_CLIENTS_LIST, 'clients.php', 'list'); + $admin_page->addItemButton(_AM_BANNERS_CLIENTS_LIST, 'clients.php', 'application-view-detail'); $admin_page->renderButton(); $cid = $system->cleanVars($_REQUEST, 'cid', 0, 'int'); if ($cid > 0) { @@ -190,7 +193,9 @@ $xoops->error($obj->getHtmlErrors()); } } else { - $xoops->confirm(array("ok" => 1, "cid" => $cid, "op" => "delete"), 'clients.php', sprintf(_AM_BANNERS_CLIENTS_SUREDEL, $obj->getVar("name"))); + // Define Stylesheet + $xoops->theme->addStylesheet('modules/system/css/admin.css'); + $xoops->confirm(array("ok" => 1, "cid" => $cid, "op" => "delete"), 'clients.php', sprintf(_AM_BANNERS_CLIENTS_SUREDEL, $obj->getVar("name")) . '<br />'); } } else { $xoops->redirect('clients.php', 1, _AM_SYSTEM_DBERROR); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/index.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/index.php 2012-06-19 20:38:24 UTC (rev 9675) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/admin/index.php 2012-06-19 21:05:06 UTC (rev 9676) @@ -21,21 +21,21 @@ */ include dirname(__FILE__) . '/header.php'; // Get banners handler -$banners_Handler = $xoops->getHandlerBanner(); -$banners_client_Handler = $xoops->getHandlerBannerclient(); +$banner_Handler = $xoops->getModuleHandler('banner'); +$client_Handler = $xoops->getModuleHandler('bannerclient'); // heaser $xoops->header(); // banners $criteria = new CriteriaCompo(); $criteria->add(new Criteria('status', 0, '!=')); -$banners_banner = $banners_Handler->getCount($criteria); +$banners_banner = $banner_Handler->getCount($criteria); // banner clients $criteria = new CriteriaCompo(); -$banners_client = $banners_client_Handler->getCount($criteria); +$banners_client = $client_Handler->getCount($criteria); // banner finish $criteria = new CriteriaCompo(); $criteria->add(new Criteria('status', 0)); -$banners_finish = $banners_Handler->getCount($criteria); +$banners_finish = $banner_Handler->getCount($criteria); // folder path $folder_path = XOOPS_ROOT_PATH . '/uploads/banners'; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/banner.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/banner.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/banner.php 2012-06-19 21:05:06 UTC (rev 9676) @@ -0,0 +1,56 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +/** + * banners module + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package banners + * @since 2.6.0 + * @author Mage Gr\xE9gory (AKA Mage) + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class BannersBanner extends XoopsObject +{ + /** + * Constructor + */ + public function __construct() + { + $this->initVar('bid', XOBJ_DTYPE_INT, null, false, 5); + $this->initVar('cid', XOBJ_DTYPE_INT, null, false, 3); + $this->initVar('imptotal', XOBJ_DTYPE_INT, null, false, 8); + $this->initVar('impmade', XOBJ_DTYPE_INT, null, false, 8); + $this->initVar('clicks', XOBJ_DTYPE_INT, null, false, 8); + $this->initVar('imageurl', XOBJ_DTYPE_TXTBOX, null, false); + $this->initVar('clickurl', XOBJ_DTYPE_TXTBOX, null, false); + $this->initVar('datestart', XOBJ_DTYPE_INT, null, false, 10); + $this->initVar('dateend', XOBJ_DTYPE_INT, null, false, 10); + $this->initVar('htmlbanner', XOBJ_DTYPE_INT, null, false, 1); + $this->initVar('htmlcode', XOBJ_DTYPE_TXTBOX, null, false); + $this->initVar('status', XOBJ_DTYPE_INT, null, false, 1); + } +} + +class BannersBannerHandler extends XoopsPersistableObjectHandler +{ + /** + * @param null|XoopsDatabase $db + */ + public function __construct(XoopsDatabase $db = null) + { + parent::__construct($db, 'banner', 'bannersbanner', 'bid', 'imageurl'); + } +} \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/banner.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/bannerclient.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/bannerclient.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/bannerclient.php 2012-06-19 21:05:06 UTC (rev 9676) @@ -0,0 +1,48 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +/** + * banners module + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package banners + * @since 2.6.0 + * @author Mage Gr\xE9gory (AKA Mage) + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('XOOPS root path not defined'); + +class BannersBannerclient extends XoopsObject +{ + /** + * Constructor + */ + public function __construct() + { + $this->initVar('cid', XOBJ_DTYPE_INT, null, false, 5); + $this->initVar('uid', XOBJ_DTYPE_INT, 0, true); + $this->initVar('name', XOBJ_DTYPE_TXTBOX, null, false); + $this->initVar('extrainfo', XOBJ_DTYPE_TXTAREA, null, false); + } +} + +class BannersBannerclientHandler extends XoopsPersistableObjectHandler +{ + /** + * @param null|XoopsDatabase $db + */ + public function __construct(XoopsDatabase $db = null) + { + parent::__construct($db, 'bannerclient', 'bannersbannerclient', 'cid', 'name'); + } +} \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/bannerclient.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/form/banner.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/form/banner.php 2012-06-19 20:38:24 UTC (rev 9675) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/form/banner.php 2012-06-19 21:05:06 UTC (rev 9676) @@ -27,7 +27,7 @@ /** * @param XoopsBanner|XoopsObject $obj */ - public function __construct(XoopsBanner &$obj) + public function __construct(BannersBanner &$obj) { $xoops = Xoops::getInstance(); @@ -53,7 +53,7 @@ parent::__construct($title, 'form', 'banners.php', 'post', true); $this->setExtra('enctype="multipart/form-data"'); - $client_Handler = $xoops->getHandlerBannerclient(); + $client_Handler = $xoops->getModuleHandler('bannerclient'); $client_select = new XoopsFormSelect( _AM_BANNERS_CLIENTS_NAME, 'cid', $obj->getVar('cid') ); $client_select->addOptionArray($client_Handler->getList()); $this->addElement($client_select, true); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/form/bannerclient.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/form/bannerclient.php 2012-06-19 20:38:24 UTC (rev 9675) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/class/form/bannerclient.php 2012-06-19 21:05:06 UTC (rev 9676) @@ -27,7 +27,7 @@ /** * @param XoopsBannerClient|XoopsObject $obj */ - public function __construct(XoopsBannerClient &$obj) + public function __construct(BannersBannerClient &$obj) { $title = $obj->isNew() ? sprintf( _AM_BANNERS_CLIENTS_ADD ) : sprintf( _AM_BANNERS_CLIENTS_EDIT ); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/include/install.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/include/install.php 2012-06-19 20:38:24 UTC (rev 9675) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/include/install.php 2012-06-19 21:05:06 UTC (rev 9676) @@ -91,6 +91,13 @@ $banner_Handler->insert($obj); } } + // data for table 'banner' + /*$sql = "DELETE FROM " . $xoops->db->prefix("config") . " WHERE `conf_name` = 'banners'";*/ + $dbm = new XoopsDatabaseManager(); + //$xoops->db->queryF($sql); + $dbm->insert("banner", " (bid, cid, imptotal, impmade, clicks, imageurl, clickurl, datestart, dateend, htmlbanner, htmlcode, status) VALUES (1, 1, 0, 1, 0, '" . XOOPS_URL . "/uploads/banners/xoops_flashbanner2.swf', 'http://www.xoops.org/', " . time() . ", 0, 0, '', 1)"); + $dbm->insert("banner", " (bid, cid, imptotal, impmade, clicks, imageurl, clickurl, datestart, dateend, htmlbanner, htmlcode, status) VALUES (2, 1, 0, 1, 0, '" . XOOPS_URL . "/uploads/banners/xoops_banner_2.gif', 'http://www.xoops.org/', " . time() . ", 0, 0, '', 1)"); + $dbm->insert("banner", " (bid, cid, imptotal, impmade, clicks, imageurl, clickurl, datestart, dateend, htmlbanner, htmlcode, status) VALUES (3, 1, 0, 1, 0, '" . XOOPS_URL . "/uploads/banners/banner.swf', 'http://www.xoops.org/', " . time() . ", 0, 0, '', 1)"); return true; } \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/index.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/index.php 2012-06-19 20:38:24 UTC (rev 9675) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/index.php 2012-06-19 21:05:06 UTC (rev 9676) @@ -27,8 +27,8 @@ // Get main instance $system = System::getInstance(); // Get banners handler -$banner_Handler = $xoops->getHandlerBanner(); -$client_Handler = $xoops->getHandlerBannerclient(); +$banner_Handler = $xoops->getModuleHandler('banner'); +$client_Handler = $xoops->getModuleHandler('bannerclient'); // Get member handler $member_handler = $xoops->getHandlerMember(); // Parameters Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/sql ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/sql/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/sql/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/sql/index.html 2012-06-19 21:05:06 UTC (rev 9676) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/sql/mysql.sql =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/sql/mysql.sql (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/sql/mysql.sql 2012-06-19 21:05:06 UTC (rev 9676) @@ -0,0 +1,42 @@ +# +# Table structure for table `banner` +# + +CREATE TABLE banner ( + bid smallint(5) unsigned NOT NULL auto_increment, + cid tinyint(3) unsigned NOT NULL default '0', + imptotal int(10) unsigned NOT NULL default '0', + impmade mediumint(8) unsigned NOT NULL default '0', + clicks mediumint(8) unsigned NOT NULL default '0', + imageurl varchar(255) NOT NULL default '', + clickurl varchar(255) NOT NULL default '', + datestart int(10) NOT NULL default '0', + dateend int(10) NOT NULL default '0', + htmlbanner tinyint(1) NOT NULL default '0', + htmlcode text, + status tinyint(1) NOT NULL default '0', + PRIMARY KEY (bid), + KEY idxbannercid (cid), + KEY idxbannerbidcid (bid,cid) +) ENGINE=MyISAM; +# -------------------------------------------------------- + +# +# Table structure for table `bannerclient` +# + +CREATE TABLE bannerclient ( + cid smallint(5) unsigned NOT NULL auto_increment, + uid mediumint(8) unsigned NOT NULL default '0', + name varchar(60) NOT NULL default '', + extrainfo text, + PRIMARY KEY (cid), + KEY name (name) +) ENGINE=MyISAM; +# -------------------------------------------------------- + +# +# Dumping data for table `bannerclient` +# + +INSERT INTO bannerclient VALUES (1,0, 'XOOPS', 'XOOPS Dev Team'); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/templates/admin/banners_admin_banners.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/templates/admin/banners_admin_banners.html 2012-06-19 20:38:24 UTC (rev 9675) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/templates/admin/banners_admin_banners.html 2012-06-19 21:05:06 UTC (rev 9676) @@ -101,5 +101,5 @@ <{/if}> <!-- Display form (add,edit) --> <{if $form}> -<div class="spacer"><{$form}></div> +<{includeq file="module:system|system_form.html"}> <{/if}> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/templates/admin/banners_admin_clients.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/templates/admin/banners_admin_clients.html 2012-06-19 20:38:24 UTC (rev 9675) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/templates/admin/banners_admin_clients.html 2012-06-19 21:05:06 UTC (rev 9676) @@ -76,5 +76,5 @@ <{/if}> <!-- Display form (add,edit) --> <{if $form}> -<div class="spacer"><{$form}></div> +<{includeq file="module:system|system_form.html"}> <{/if}> Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/xoops_version.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/xoops_version.php 2012-06-19 20:38:24 UTC (rev 9675) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/banners/xoops_version.php 2012-06-19 21:05:06 UTC (rev 9676) @@ -32,6 +32,7 @@ $modversion['help'] = 'page=help'; $modversion['image'] = 'images/logo.png'; $modversion['dirname'] = 'banners'; + //about $modversion['release_date'] = '2011/01/02'; $modversion['module_website_url'] = 'http://www.xoops.org/'; @@ -62,10 +63,13 @@ // Templates $modversion['templates'][] = array( 'file' => 'banners_client.html', 'description' => '' ); -// Admin Templates -$modversion['templates'][] = array('file' => 'banners_admin_banners.html', 'description' => '', 'type' => 'admin'); -$modversion['templates'][] = array('file' => 'banners_admin_clients.html', 'description' => '', 'type' => 'admin'); +// Mysql file +$modversion['sqlfile']['mysql'] = "sql/mysql.sql"; +// Tables created by sql file (without prefix!) +$modversion['tables'][1] = "banner"; +$modversion['tables'][2] = "bannerclient"; + // blocks $i = 0; $modversion['blocks'][$i]['file'] = 'banners_blocks.php'; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/module.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/module.php 2012-06-19 20:38:24 UTC (rev 9675) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/class/module.php 2012-06-19 21:05:06 UTC (rev 9676) @@ -33,9 +33,9 @@ protected $_reservedTables = array( 'avatar', 'avatar_users_link', 'block_module_link', 'xoopscomments', 'config', 'configcategory', 'configoption', 'image', 'imagebody', 'imagecategory', 'imgset', 'imgset_tplset_link', 'imgsetimg', 'groups', - 'groups_users_link', 'group_permission', 'online', 'bannerclient', 'banner', 'bannerfinish', 'priv_msgs', + 'groups_users_link', 'group_permission', 'online', 'priv_msgs', 'ranks', 'session', 'smiles', 'users', 'newblocks', 'modules', 'tplfile', 'tplset', 'tplsource', - 'xoopsnotifications', 'banner', 'bannerclient', 'bannerfinish' + 'xoopsnotifications', ); public function __construct() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |