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 Wed 10. Dec, 2003 10:50

-=ET=- have re-written the header of the how-to, to be more EM ready
New version is 1.1.5., no change in code
(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 Wed 10. Dec, 2003 22:48

I have now uploaded new version, this version support other banner types, e.g. flash or "custom code"
you may also now specify the size of the banner.
ner version is 1.2.0.

to upgrade:
add theise to your DB
Code: Select all
ALTER TABLE `phpbb_banner` ADD `banner_type` MEDIUMINT NOT NULL
ALTER TABLE `phpbb_banner` ADD `banner_width` MEDIUMINT(5) NOT NULL, ADD `banner_height` MEDIUMINT(5) NOT NULL

the banner_name field have also changed from VARCHAR(90) into TEXT type

DL the how-to and upload the included files
(admin_banner.php/lang_banner.php and banner_edit_body.tpl)

then replace the code in page_header.php with the new code in the how-to

all done.
(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 Thu 11. Dec, 2003 22:49

mod version 1.2.1 is uploaded, I had by acident removed one of the language entrys in lang_banner.php
at the same time, I added one more "explain" entry into this file - to clearify the meaning of the fields in ACP.

to upgrade, replace the included files
admin/admin_banner.php
templates/*/banner_edit_body.tpl
language/*/lang_banner.php
(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 12. Dec, 2003 17:48

I have uploaded a new version 1.2.2.
there was a error starting version 1.2.0. , this is now fixed.

witch resulted in this error message, when trying to create a banner:
Code: Select all
SQL Error : 1136 Column count doesn't match value count at row 1


to upgrade, please replace the admin_banner.php with the file in the new zip
(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 Mon 15. Dec, 2003 15:24

I have uploaded new version 1.2.3.
there was a minor typo in the previous release...

to upgrade:
in file page_header.php
Code: Select all
[FIND]
"'width

[REPLACE WITH]
'width
(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 Mon 15. Dec, 2003 23:57

New version is 1.3.0.

I have on request added the option to specify if the banner should hide after a user have clicked on it.
at same time I have made it so you may specify for how long time the banner should be hidden (in sec.) or alternativly how long the "click count" is inactive

if you do not set the banner to hide after click, the timer will still apply, it will be used to prevent "double count" of user witch already have pressed a banner

e.g. if you set this value to 60 sec. and do not hide the banner after click
the users first click will be counted, but the following clicks on the banner will NOT be counted before the 60 sec timeout.

to upgrade:


do this SQL change to your DB
Code: Select all
ALTER TABLE `phpbb_banner` ADD `banner_filter` TINYINT(1) DEFAULT '0' NOT NULL, ADD `banner_filter_time` MEDIUMINT(5) DEFAULT '600' NOT NULL;


Replace the included files:
lang_banner.php
admin_banner.php
banner_edit_body.tpl
redirect.php

in file page_header.php
Code: Select all
[FIND]
$sql = "SELECT DISTINCT banner_id, banner_name, banner_spot, banner_description, banner_forum, banner_type, banner_width, banner_height FROM ".BANNERS_TABLE ."

[REPLACE WITH]
$sql = "SELECT DISTINCT banner_id, banner_name, banner_spot, banner_description, banner_forum, banner_type, banner_width, banner_height, banner_filter FROM ".BANNERS_TABLE ."

[FIND]
while ($banners[$i] = $db->sql_fetchrow($result))
{
   $banner_spot=$banners[$i]['banner_spot'];
   if ($banner_spot<>$last_spot  AND ($banners[$i]['banner_forum']==$forum_id || empty($banners[$i]['banner_forum'])))
   {
      $banner_size = ($banners[$i]['banner_width'] && $banners[$i]['banner_height']) ? 'width="'.$banners[$i]['banner_width'].'" height="'.$banners[$i]['banner_height'].'"' : '';
      switch ($banners[$i]['banner_type'])
      {
         case 6 :
            // swf file
            $template->assign_vars(array('BANNER_'.$banner_spot.'_IMG' => '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,23,0" id=macromedia '.$banner_size.' align="abscenter"><param name=movie value="'.$banners[$i]['banner_name'].'"><param name=quality value=high><embed src="'.$banners[$i]['banner_name'].'" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" autostart="true" /><noembed><a href="'.append_sid('redirect.'.$phpEx.'?banner_id='.$banners[$i]['banner_id']).'" target="_blank">'.$banners[$i]['banner_description'].'</a></noembed></object>'));
            break;
         case 4 :
            // custom code
            $template->assign_var('BANNER_'.$banner_spot.'_IMG', $banners[$i]['banner_name'] );
            break;
         case 2 :
            // Text link
            $banner_example = '<a href="'.append_sid('redirect.'.$phpEx.'?banner_id='.$banners[$i]['banner_id']).'" target="_blank">'.$banners[$i]['banner_name'].'</a>';
            break;
         case 0 :
         default:
            $template->assign_var('BANNER_'.$banner_spot.'_IMG', '<a href="'.append_sid('redirect.'.$phpEx.'?banner_id='.$banners[$i]['banner_id']).'" target="_blank"><img src="'.$banners[$i]['banner_name'].'" '.$banner_size.' border="0" alt="'.$banners[$i]['banner_description'].'" title="'.$banners[$i]['banner_description'].'" /></a>');
      }
      $banner_show_list.= ', '.$banners[$i]['banner_id'];
   }
   $last_spot = ($banners[$i]['banner_forum']==$forum_id || empty($banners[$i]['banner_forum'])) ? $banner_spot : $last_spot;
   $i++;
}



[REPLACE WITH]
while ($banners[$i] = $db->sql_fetchrow($result))
{
   $cookie_name = $board_config['cookie_name'] . '_b_' . $banners[$i]['banner_id'];
   if ( !($HTTP_COOKIE_VARS[$cookie_name] && $banners[$i]['banner_filter']) )
   {
      $banner_spot=$banners[$i]['banner_spot'];
      if ($banner_spot<>$last_spot  AND ($banners[$i]['banner_forum']==$forum_id || empty($banners[$i]['banner_forum'])))
      {
         $banner_size = ($banners[$i]['banner_width'] && $banners[$i]['banner_height']) ? '"width="'.$banners[$i]['banner_width'].'" height="'.$banners[$i]['banner_height'].'"' : '';
         switch ($banners[$i]['banner_type'])
         {
            case 6 :
               // swf file
               $template->assign_vars(array('BANNER_'.$banner_spot.'_IMG' => '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,23,0" id=macromedia '.$banner_size.' align="abscenter"><param name=movie value="'.$banners[$i]['banner_name'].'"><param name=quality value=high><embed src="'.$banners[$i]['banner_name'].'" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" autostart="true" /><noembed><a href="'.append_sid('redirect.'.$phpEx.'?banner_id='.$banners[$i]['banner_id']).'" target="_blank">'.$banners[$i]['banner_description'].'</a></noembed></object>'));
               break;
            case 4 :
               // custom code
               $template->assign_var('BANNER_'.$banner_spot.'_IMG', $banners[$i]['banner_name'] );
               break;
            case 2 :
               // Text link
               $banner_example = '<a href="'.append_sid('redirect.'.$phpEx.'?banner_id='.$banners[$i]['banner_id']).'" target="_blank">'.$banners[$i]['banner_name'].'</a>';
               break;
            case 0 :
            default:
               $template->assign_var('BANNER_'.$banner_spot.'_IMG', '<a href="'.append_sid('redirect.'.$phpEx.'?banner_id='.$banners[$i]['banner_id']).'" target="_blank"><img src="'.$banners[$i]['banner_name'].'" '.$banner_size.' border="0" alt="'.$banners[$i]['banner_description'].'" title="'.$banners[$i]['banner_description'].'" /></a>');
         }
         $banner_show_list.= ', '.$banners[$i]['banner_id'];
      }
      $last_spot = ($banners[$i]['banner_forum']==$forum_id || empty($banners[$i]['banner_forum'])) ? $banner_spot : $last_spot;
   }
   $i++;
}
(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 Tue 16. Dec, 2003 01:40

I have uploaded a new version 1.3.1.
there was a typo in the db_update.php file, witch prevented it from working.
at same time I have included need change into file functions.php


to upgrade:
de the change into file includes/functions.php as described in the 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 Mon 19. Jan, 2004 12:45

I have uploaded new version 1.3.3.

the included redirect.php have been corrected, please replace this file
(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