somehow some little improvments: redirect.tpl???

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 Holger on Mon 24. Feb, 2003 17:29

Hehehe, well, yes, I am behind a companys firevall/proxy, so I am not able/allowed to disable something! :lol:

/H
~~~~~~~~~~~~~~~~~~~~~~~~~
www.manual-forum.de
Holger
Poster
Poster
 
Posts: 56
Joined: Wed 17. Jul, 2002 13:13

Postby Niels on Mon 24. Feb, 2003 17:43

you can do this in your personal brwoser, go to "settings" -> "connection" -> "disable "automatic proxy"

if you are using M$ explore, if this does not work, I'll email it to you
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Holger on Mon 24. Feb, 2003 17:53

Thank you! I just got the file from a friend I asked to download it. Actually he is in England. I am in Germany. Isn't it a great world we live in?!?! :D I LOVE the internet!
Now it works great!
(if I disable automatic proxy then I have no connection any more, only to the intranet ...)

Hm, how about the problem with the view-counting in the ACP? Will that be solved in the final version? Or can you give an update here?

Thank you for this great MOD!

/Holger
~~~~~~~~~~~~~~~~~~~~~~~~~
www.manual-forum.de
Holger
Poster
Poster
 
Posts: 56
Joined: Wed 17. Jul, 2002 13:13

Postby Niels on Mon 24. Feb, 2003 18:00

view should be counted, (they do here on mods.db9.dk)
this is done in the page_heeader.php, have you placed the code correctly ?
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Holger on Mon 24. Feb, 2003 18:09

Hm, I added
Code: Select all
$time_now=time();
$hour_now=create_date('Hi',$time_now,$board_config['board_timezone']);
$date_now=create_date('Ymd',$time_now,$board_config['board_timezone']);
$week_now=create_date('w',$time_now,$board_config['board_timezone']);
$sql = "SELECT banner_id, banner_name, banner_spot, banner_description FROM ".BANNERS_TABLE ."
      WHERE banner_active and (banner_timetype='0'
      OR (( $hour_now BETWEEN time_begin AND time_end) AND ((banner_timetype='2'
      OR (( $week_now BETWEEN date_begin AND date_end) AND banner_timetype='4')
      OR (( $date_now BETWEEN date_begin AND date_end) AND banner_timetype='6')
      )))) ORDER BY banner_spot,SUBSTRING(RAND(),4,2)*banner_weigth";
if ( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, "Couldn't get banners data", "", __LINE__, __FILE__, $sql);
}
while ($banner = $db->sql_fetchrow($result))
{
   $banner_spot=$banner['banner_spot'];   
   if ($banner_spot<>$last_spot)
   {
      $template->assign_vars(array('BANNER_'.$banner_spot.'_IMG' => '<a href="'.append_sid('redirect.'.$phpEx.'?banner_id='.$banner['banner_id']).'" target="_blank"><img src="'.$banner['banner_name'].'" border="0" alt="'.$banner['banner_description'].'" title="'.$banner['banner_description'].'"></a>'));
      $banner_show_list.= ', '.$banner['banner_id'];
   }
   $last_spot=$banner_spot;
}
if ($banner)
{
$banner_show_list['0'] = ($banner_show_list) ? ' ':'';
// only apply the next lines, if view count are to be enabled
$sql = "UPDATE ".BANNERS_TABLE." SET banner_view=banner_view+1 where banner_id IN ($banner_show_list)";
if ( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, "Couldn't get banners data", "", __LINE__, __FILE__, $sql);
}
}


before

Code: Select all
//
// The following assigns all _common_ variables that may be used at any point


so I think it is ok ...

Maybe interference with oder MODs?

/H
~~~~~~~~~~~~~~~~~~~~~~~~~
www.manual-forum.de
Holger
Poster
Poster
 
Posts: 56
Joined: Wed 17. Jul, 2002 13:13

Postby Niels on Mon 24. Feb, 2003 19:19

Holger wrote:Hm, I added

so I think it is ok ...

Maybe interference with oder MODs?

/H


sorry, my mistake once again - it is a fairly new mod, therefore it happens that the how-to is incomplete/not up to date.

if ($banner)
{

$banner_show_list['0'] = ($banner_show_list) ? ' ':'';
// only apply the next lines, if view count are to be enabled
$sql = "UPDATE ".BANNERS_TABLE." SET banner_view=banner_view+1 where banner_id IN ($banner_show_list)";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Couldn't get banners data", "", __LINE__, __FILE__, $sql);
}
}


remove the red code, and it should be up runing, with count also
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Niels on Mon 24. Feb, 2003 19:22

I will though post a more "correct", upgrade, since some similar code are needed, but for now, you may remove this (make shure to define banners first)
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Niels on Mon 24. Feb, 2003 19:42

ok, here is how the last part will finaly look, I'll post this here, since you have truble with proxy servers

snap from ver 0.9.3


Code: Select all
.
.
.
.
   $last_spot=$banner_spot;
}
$banner_show_list['0'] = ($banner_show_list) ? ' ':'';
if ($last_spot)
{
$sql = "UPDATE ".BANNERS_TABLE." SET banner_view=banner_view+1 where banner_id IN ($banner_show_list)";
if ( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, "Couldn't get banners data", "", __LINE__, __FILE__, $sql);
}
}
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 2 guests

cron