MOD download & history

a complete banner management system, any number of banners can be added
Forum rules
The content in this forum is dated Dec. 21 2005 and can be used as Archive only. This Forum is LOCKED and READ ONLY !

Postby Niels on Sat 17. May, 2003 01:11

there was a error in the included admin_banner.php file, witch I did upload yesteday, this is now corrected please update this file
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Niels on Sun 08. Jun, 2003 17:41

I have today included a new feature to this mod, it is now posible to specify inside witch forum the banner should show, this will make it posible to make different banners depending on the topic the user is watching
this can still be combined with any of the existing rules, so you may let banners rotate.

new version is 1.0.2.
to upgrade you need to do alter the banner table in the database, so it have the new field.
SQL: (remember to substitude the prefix)
Code: Select all
ALTER TABLE prefix_banner ADD banner_forum MEDIUMINT(8) UNSIGNED NOT NULL


also do the 2 newly included files in the how-to (topicview_body.tpl and forumview_body.tpl)

then update the lang_banner.php, admin/admin_banner.php and subsilver/admin/banner_edit_body.tpl file, witch is included

finally you need to change the code in page_header.php, so it look like the code in the how-to

after this, you may specify if any of your banners should only be viible inside a special forum, here on mods.db9.dk, I have set up sutch test banner inside the "pre-loaded pack forum" if you go view a topic inside this forum, you will see a test banner
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Niels on Thu 19. Jun, 2003 21:54

version 1.0.2. did miss the changes need in page_tail.php, new version is now 1.0.3

to upgrade: do the page_tail.php as described in the how-to
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Niels on Fri 15. Aug, 2003 21:28

a bug in the included file admin_banner have coused your banners might have got wrong ID's, this is corected in the newest version of the admin_banner.php - please update this file

since the ID is already stored in your DB (if you have defined any banners) you need ot have this corrected - this file will fix your banner table automatically, please run this mulitiply times, until it reports that 0 banners have been updated - do this by upload this file
Code: Select all
<?php
#########################################################
## SQL commands to phpBB2
## Author: Niels Chr. Rød
## Nickname: Niels Chr. Denmark
## Email: ncr@db9.dk
##
## Ver 1.0.18
##
## phpBB2 database update script for complete banner mod
##
#########################################################

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/functions_selects.'.$phpEx);
define('BANNERS_TABLE', $table_prefix.'banner');


$update=0;
$sql ="SELECT COUNT(banner_id) as total, banner_description, banner_name, banner_spot, banner_click, banner_view, banner_comment from ".BANNERS_TABLE." group by banner_id having total>1";
if(!$result = $db->sql_query($sql))
{
   message_die(GENERAL_ERROR, "Couldn't obtain banner data", "", __LINE__, __FILE__, $sql);
}

while ($double_banner = $db->sql_fetchrow($result))
{
         $sql = "SELECT MAX(banner_id)+1 as banner_id FROM " . BANNERS_TABLE;
         if(!$result2 = $db->sql_query($sql))
         {
            message_die(GENERAL_ERROR, "Couldn't obtain banner id data", "", __LINE__, __FILE__, $sql);
         }
         $banner_nr = $db->sql_fetchrow($result2);
         $sql = "UPDATE " . BANNERS_TABLE . "
            SET    banner_id='".$banner_nr['banner_id']."' WHERE banner_name = '". $double_banner['banner_name']."' AND
               banner_description = '". $double_banner['banner_description']."' AND
               banner_spot = '". $double_banner['banner_spot']."' AND
               banner_click = '". $double_banner['banner_click']."' AND
               banner_view = '". $double_banner['banner_view']."' AND
               banner_comment = '". $double_banner['banner_comment']."'";
         if( !$result2 = $db->sql_query($sql) )
         {
            message_die(GENERAL_ERROR, "Couldn't update into banners table", "", __LINE__, __FILE__, $sql);
         }
         $update++;
}
message_die(GENERAL_MESSAGE, "banners updated, in total '$update' banners are updated");

?>

after this you may delete this file again
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Niels on Sat 23. Aug, 2003 01:30

this mod is now EM ready
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Niels on Wed 27. Aug, 2003 22:57

I have updated this mod to version 1.1.2, the new version wil start record the clicks, not only the number of clicks are now stored, but detailed information about who and when is now also stored.

I do plan to make a statistics page, witch only admin and moderators have access to, this page will be able to show these informations.

to update, replace the redirect.php, run the db_update.php (again) and
in file constants.php
Code: Select all
[FIND]
define('BANNERS_TABLE', $table_prefix.'banner');

[AFTER, ADD]
define('BANNER_STATS_TABLE', $table_prefix.'banner_stats');
(if a how-to is EM ready, it will mostly be bullet prof, since a machine is more picky than a human. :D)
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Niels on Fri 24. Oct, 2003 23:13

I have added code to allow backup/restore from ACP, new version is 1.1.3.

to upgrade:
please do the admin_db_utils.php as described in the new how-to
(if a how-to is EM ready, it will mostly be bullet prof, since a machine is more picky than a human. :D)
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Niels on Sat 25. Oct, 2003 00:24

new version is 1.1.4.

to upgrade, please do this:

update lang_banner.php ($lang['Left_via_banner'] added)
update the inlcuded file redirect.php
do change into viewonline.php
do the change into constant.php


after this version, the info showen in "view who is online" will show if the users last click on the site was a banner, if the "topic in who is online MOD" is also installed, the list will inlcude information about witch bannaer the user did left via.
(if a how-to is EM ready, it will mostly be bullet prof, since a machine is more picky than a human. :D)
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

PreviousNext

Return to Complete banner [2.0.6/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron