Time control seems to be broken?

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 !

Time control seems to be broken?

Postby AlleyKat on Fri 08. Oct, 2004 02:30

I couldn't get the time control working at all (using dates), the banners simply didn't show up when assigned a set of dates.

Intense scrutiny of the code made me try the following.

in includes/page_header.php:
Code: Select all
      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,banner_weigth*SUBSTRING(RAND(),6,2) DESC";
changed into
Code: Select all
      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,banner_weigth*SUBSTRING(RAND(),6,2) DESC";
This seems to be working - I'd like to have this code change confirmed. :)
Image
AlleyKat
Poster
Poster
 
Posts: 23
Joined: Wed 09. Jul, 2003 17:45
Location: Fyn, Denmark

Postby AlleyKat on Fri 15. Oct, 2004 17:32

*small bump* (I'd just like to make sure - thx)
Image
AlleyKat
Poster
Poster
 
Posts: 23
Joined: Wed 09. Jul, 2003 17:45
Location: Fyn, Denmark

Postby Priit Tamboom on Fri 05. Nov, 2004 12:16

Good morning!

I think it is the correct way and don't see better way.

Thanks for your fix.

Priit
Priit Tamboom
Poster
Poster
 
Posts: 4
Joined: Fri 05. Nov, 2004 12:10

Postby Niels on Tue 07. Dec, 2004 15:42

I asume you did a litle more that that, removing 3 ))) will also require to remove 3 ((( in the SQL - otherwise the SQL is not a valid command to the DB.

the 3 ending ))) you have removed is ending the 3 ((( initiated by the IF(IF(IF( a litle higher in the SQL command.
if you for some compability reassons have removed these IF() then you should also remove the 3 ending )))

hope this helps
(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 Priit Tamboom on Tue 07. Dec, 2004 16:20

Heip!

Sure, didn't see mistakes here, i just got the idea and did it myself.

Priit
Priit Tamboom
Poster
Poster
 
Posts: 4
Joined: Fri 05. Nov, 2004 12:10

Postby stardotstar on Mon 10. Jan, 2005 23:56

I am experiencing this time/date activation problem myself and have upgraded to the latest version 1.3.6em - I also am getting the update new banner twice for the forum it is placed in to hold.

When I activate a banner by a date range it never shows up.

Has the reason that the structure of the above SQL ( ie the 3((( thing) been resolved or further investigated.

I cannot parse the SQL at that level and wonder why one might have to do it "for compatibility" since my board is pretty standard - mysql and phpBB2.06

Thanks in advance for any assistance or pointers on this matter.

Will.*
stardotstar
Poster
Poster
 
Posts: 11
Joined: Tue 14. Dec, 2004 14:14

Postby Niels on Wed 12. Jan, 2005 00:27

it just stroke me, that if you are using the date filter, you MUST also apply a time interval...

e.g. if you would like the baner to show every wensday, you must select
"day of week" AND select date begin = "wensday" AND select date end = "wensday" AND select time begin = 00:00 AND select time end = 23:59

hope this clearify - and the included file should be alright, no need to change it (at least if using mysql)
(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 stardotstar on Wed 12. Jan, 2005 02:09

Thanks very much for clarifying the way these fields work, this, in fact does seem to work.

I was only selecting the date fields - ie a banner to run from Jan 12 to Feb 12. I have since input Jan 12 Wed 00:10 -> Feb 12 Sat 23:00 and it is appearing.

One final question - does this necessitate the day entry if I only want the date - ie can I just put in any week day to make it work - if I don't know what day Feb 12 is will it work if I put say Monday in - even if it is actually a Sat? Or can I leave the day fields blank and only do the date and time?

Will.
stardotstar
Poster
Poster
 
Posts: 11
Joined: Tue 14. Dec, 2004 14:14

Next

Return to Complete banner [2.0.6/EM]

Who is online

Users browsing this forum: No registered users and 2 guests

cron