Welcome, Guest. Please login or register.
March 21, 2010, 06:03:49 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem Website Baker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite .
110567 Posts in 15967 Topics by 9310 Members
Latest Member: stevenris10
* Home Help Search Login Register
+  WebsiteBaker Community Forum
|-+  English
| |-+  Help & Support (Moderators: Argos, BerndJM)
| | |-+  start and end-date for publishing sections
Pages: [1] Go Down Print
Author Topic: start and end-date for publishing sections  (Read 5911 times)
thorn

Offline Offline

Posts: 861


WWW
« on: October 03, 2007, 11:16:42 PM »

Hello,

i wonder if it would be possible to have start end end-dates for publishing content on section-basis.

For a first test, i made a few changes in pages/admin/section.php and section_save.php
and framework/frontend_functions.php (and adding 2 table-columns) -- and it seems to work very well.

In "Modify Page" -> "Manage Sections"
you can enter a start and stop-date/time for every section on the corresponding page.
For now, there are only simple text-fields. I'm not familiar with forms - so i need someone who is able to put a nice calendar-field or similar into it.

start_date -- stop_date : display section between these dates
      0    -- stop_date : dispaly section up to this date
start_date --     0     : display section beginning with start_date, forever
      0    --     0     : display section without start or stop-date.


To test this, you have to alter the database:
Code:
ALTER TABLE `wb_sections` ADD `publ_start` INT NOT NULL DEFAULT '0', ADD `publ_end` INT NOT NULL DEFAULT '0';
and overwrite some files in your wb-installation with the files from the zip-file.


Unfortunately i can't change the original search-function from wb to respect these dates.
(The original search-function use only page_id, instead of section_id).
So you have to set the search off. (Or use the extended search-function from http://nettest.thekk.de/ cool which could be changed easily to respect these dates).

thorn.

PS: these text-fields are really cool. You can enter strings like "now", "tomorrow", "next week", "1 month 2 weeks" or "Jan 2 2007", "10/9" ... as date. If you enter "next monday" as start-date and "1 week" as end-date, the end-date will be calculated as one week after next monday. Really cool.
[This is strtotime()-magic cool]
But nevertheless a cute calendar-field would be easier to handle ... 

PPS: oh, blocks must be enabled - this have to be fixed ...


EDIT:
Latest Version

will be found here
http://forum.websitebaker.org/index.php/topic,7469.msg45929.html#msg45929

thorn.
« Last Edit: January 07, 2008, 01:48:54 AM by thorn » Logged

¡ɹǝpun-uʍop ɥɔɐu ǝssǝnɹƃ
doc

Offline Offline

Posts: 3581


« Reply #1 on: October 04, 2007, 06:08:21 AM »

Hello thorn,

that is a cool idea. Will check it out in more detail tonight and give you some feedback.
Thanks for this nice contribution.

Regards Christian
Logged
pcwacht
Guest
« Reply #2 on: October 04, 2007, 12:56:19 PM »

Cool idea!

Quote
But nevertheless a cute calendar-field would be easier to handle ...

Look at the news-xtd snippet, it has a working calendar thingy for the dates etc.

John
Logged
sparkdigital

Offline Offline

Posts: 254


Once a baker, always a baker!


WWW
« Reply #3 on: October 04, 2007, 02:45:41 PM »

How cool - I was just asking about this earlier this week!

http://forum.websitebaker.org/index.php/topic,7427.0.html

I'll try this and see how I get on. Thanks!

Konrad
Logged
sparkdigital

Offline Offline

Posts: 254


Once a baker, always a baker!


WWW
« Reply #4 on: October 04, 2007, 03:03:55 PM »

Have just installed it and no problems there. And when enabling 'section blocks' in the prefernces the 'save' button appears.

However, it doesn't seem to agree with my dates / times. When I enter today's date (2007/10/04) and a time in the future (15:00) and click on save, it is being saved as 2007/10/03 and 23:59. Any idea what I'm doing wrong?

Also, would it be possible to have a tick box after the end date which will trigger a notification email when a section is about to expire (e.g. day before)?

Thanks!

Konrad
Logged
DGEC

Offline Offline

Posts: 382


WWW
« Reply #5 on: October 04, 2007, 04:48:17 PM »

Thanks for this work!

Look at the calendar popup Jscript in mod_evcal -- http://forum.websitebaker.org/index.php/topic,2852.0.html
Logged
thorn

Offline Offline

Posts: 861


WWW
« Reply #6 on: October 04, 2007, 05:57:42 PM »

However, it doesn't seem to agree with my dates / times. When I enter today's date (2007/10/04) and a time in the future (15:00) and click on save, it is being saved as 2007/10/03 and 23:59.

Oh, i see. It's strtotime()'s timezone-feature. I have to do more research in this... (and maybe remove strtotime() and use an own input-routine).

BTW: what timezone did you set in website baker?

thorn.
Logged

¡ɹǝpun-uʍop ɥɔɐu ǝssǝnɹƃ
sparkdigital

Offline Offline

Posts: 254


Once a baker, always a baker!


WWW
« Reply #7 on: October 04, 2007, 10:09:04 PM »

Hi Thorn,

Timezone is GMT.

Thanks for your work!

Konrad
Logged
thorn

Offline Offline

Posts: 861


WWW
« Reply #8 on: October 04, 2007, 11:07:50 PM »

Hello,

added a cute calendar-gadget (i put it into wb/include, so it could be reused).

Some fine-tuning have to be done (calendar-language, Manage Sections-Page, ...).
I keep the strtotime()-magic, but this need some intensive tests.

thorn.

Edit:
@sparkdigital: could you test this one, too? Now the times should be correct...
Oh, the zip growth in size from 10KB to 400KB huh  -- The calendar uses 1MB unpacked undecided
« Last Edit: January 07, 2008, 01:37:47 AM by thorn » Logged

¡ɹǝpun-uʍop ɥɔɐu ǝssǝnɹƃ
BerndJM
Moderator
******
Offline Offline

Posts: 1677



WWW
« Reply #9 on: October 04, 2007, 11:38:30 PM »

Hi thorn,

just want to give you the tip to use "jscalendar"  grin
Seems you're faster then me ...

Quote
Oh, the zip growth in size from 10KB to 400KB   -- The calendar uses 1MB unpacked
There are many files, not realy needed for the live use: reference as pdf and html - the sample files the _stripped files ...

Regards Bernd
Logged

Recommended site of the day: Help-Projekt | no support via email or pm !!!
sparkdigital

Offline Offline

Posts: 254


Once a baker, always a baker!


WWW
« Reply #10 on: October 05, 2007, 08:46:23 AM »

Works a treat, thanks!

Any chance you had a think about the reminder email?

Thanks,

Konrad
Logged
thorn

Offline Offline

Posts: 861


WWW
« Reply #11 on: October 05, 2007, 03:22:29 PM »

Hello,

Any chance you had a think about the reminder email?

Website Baker is executed only if someone request a page (or by an admin using the backend).
There is no guarantee that the code for this email-notification will be executed on a regular basis. If for any reason no one looks at your site for several days, there's no way to send emails automatically from within Website Baker.
So it would be better to use a cron-job with perl-script to do the job! If you can't use cron, you're in trouble...

E.g. eGroupware has a mechanism to do such jobs without a cronjob (as fallback). They check for _every_ invocation if something is to be done. This will slowdown (by the count of sections/pages to check) _every_ page. I'm not sure if one would notice this delay, but it will be there!

Any comments / suggestions? Anyone else who wants this feature?

thorn.
Logged

¡ɹǝpun-uʍop ɥɔɐu ǝssǝnɹƃ
thorn

Offline Offline

Posts: 861


WWW
« Reply #12 on: October 05, 2007, 10:39:13 PM »

Hello,

it seems to be finished.

- the calendar uses the same language as the backend
- first-day-of-week is either sunday (LANGUAGE==EN) or monday (everything else)
- dates are shown as dd.mm.yyyy or mm/dd/yyyy (depends on DATE_FORMAT)
- cleaned up the jscalendar-directory and added a setup-script
- it's possible to enter a date through the calendar-gadget or by direct-input into the text-field (a date, or a string like "today", "next week", "next monday", "6 weeks", "next monday +1 week", ... [english text only]).

thorn.

PS: just for the records: You have to alter the sections-table:
Code:
ALTER TABLE `wb_sections` ADD `publ_start` INT NOT NULL DEFAULT '0', ADD `publ_end` INT NOT NULL DEFAULT '0';
« Last Edit: January 01, 2008, 08:42:26 PM by thorn » Logged

¡ɹǝpun-uʍop ɥɔɐu ǝssǝnɹƃ
Webjourneyman

Offline Offline

Posts: 3


« Reply #13 on: October 10, 2007, 09:17:15 AM »

Thanks for this feature, it is exactly what I'm lookin for. I'm just getting started with WB so I can't give any feedback right away but I'm sure I'll be back with plenty questions  grin
Logged
doc

Offline Offline

Posts: 3581


« Reply #14 on: October 10, 2007, 10:26:54 AM »

Hello thorn,

this feature is working great  smiley
Would require the adaption of the show_menu call to check if the page should be displayed and as already mentioned the search routine. Will ask Ryan, if we could add this feature to one of the next releases of WB.

Thanks again for a great contribution to WB.

Regards Christian
Logged
thorn

Offline Offline

Posts: 861


WWW
« Reply #15 on: October 10, 2007, 07:09:58 PM »

Hello,

Would require the adaption of the show_menu call to check if the page should be displayed
Oh, i missed that.
I would use show_page() for this purpose, and add a show_page()-call  to show_menu() (to page_menu(), too?). This is what show_page() is made for.
EDIT: It seems that show_page was made for s single special purpose only, so i will have to use a different method.

Edit: After i have checked out show_menu() i see one problem:
If we hide a main-page (on menu's root-level) because it's out of publ.-date, ALL sub-pages will be disappear, too! [It's the same as setting a root-level-page to hidden - all sub-pages disappear]
Do we really want this behavior?


I will spend some time on this next weekend.

Quote
and as already mentioned the search routine
It's impossible to achieve that! (with th original search-routine)
There's no way to find out in which section the match appeared.

thorn.
« Last Edit: October 11, 2007, 08:39:41 PM by thorn » Logged

¡ɹǝpun-uʍop ɥɔɐu ǝssǝnɹƃ
thorn

Offline Offline

Posts: 861


WWW
« Reply #16 on: October 13, 2007, 08:07:26 PM »

Hello,

made two changes:
- pages with no active sections (all are out of date) don't appear in the menu. In this case, the submenus will disappear, too. It's the same behavior as setting a root-page to 'hidden'.
- i tried to adapt the search, but all i can do is to hide the page from search if there's no active section at all. If there is at least one active section, the search proceed all sections. - I can't fix that.

thorn.
Logged

¡ɹǝpun-uʍop ɥɔɐu ǝssǝnɹƃ
thorn

Offline Offline

Posts: 861


WWW
« Reply #17 on: October 23, 2007, 10:10:59 PM »

Hello,

i did some more investigations in php's timezone-support, and find that one would need PHP >= 5.1 to have full support for different timezones (if server and user has different timezones).

For now, the server and the admin have to use the same timezone - times will differ in several hours if e.g. a de-user (GMT+1 or +2) uses an us-server (GMT-5 ... -9).

thorn.
Logged

¡ɹǝpun-uʍop ɥɔɐu ǝssǝnɹƃ
WLehmann

Offline Offline

Posts: 6


« Reply #18 on: November 15, 2007, 03:13:08 PM »

Hi,
I must confess, that I haven't searched intensively for it, but:
could the start-end date configuration also include a simple 'disable/hide' function for each section,
basically: 'not publish until infinity' ?

I haven't found any other high-level way to do so !?

cheers,
Wolfgang
Logged
armin2302

Offline Offline

Posts: 8


« Reply #19 on: November 16, 2007, 11:23:11 AM »

Hi Wink

just downloaded the tool, exactly what I was missing in WB Wink but now a newbie qestion....
How do I install it? It does not work trough the Admin Section (Import). Do I have to upload and replace the files manually on the server?

A intall.txt in the Zipfile would be cool Wink

Thanks again for the cool app
Logged
thorn

Offline Offline

Posts: 861


WWW
« Reply #20 on: November 16, 2007, 03:55:40 PM »

Hello,

could the start-end date configuration also include a simple 'disable/hide' function for each section,
basically: 'not publish until infinity' ?

you could set the 'stop-date' to some date in the past. There is no other way, yet.

thorn.
Logged

¡ɹǝpun-uʍop ɥɔɐu ǝssǝnɹƃ
thorn

Offline Offline

Posts: 861


WWW
« Reply #21 on: November 16, 2007, 04:07:19 PM »

Hello,

How do I install it? It does not work trough the Admin Section (Import). Do I have to upload and replace the files manually on the server?

yes. And you have to alter the database, too.


thorn.
« Last Edit: January 01, 2008, 08:45:50 PM by thorn » Logged

¡ɹǝpun-uʍop ɥɔɐu ǝssǝnɹƃ
enni
Documentation Team
******
Offline Offline

Posts: 57



« Reply #22 on: April 10, 2008, 04:11:19 PM »

Öhm, wo ist denn der Download?!  undecided
Logged
thorn

Offline Offline

Posts: 861


WWW
« Reply #23 on: April 10, 2008, 06:47:36 PM »

Hello,

Öhm, wo ist denn der Download?!  undecided

download is here http://www.websitebaker2.org/forum/index.php/topic,7469.msg45929.html#msg45929

But it's considered outdated. There will be no support for use with wb2.6.7 anymore. And there was a lot of changes for integration into wb 2.7.

Best to wait for wb2.7 (mid/end april 2008).

thorn.

(BTW: upgrading from wb2.6.7 with this patch to wb2.7 should be possible without harm)
Logged

¡ɹǝpun-uʍop ɥɔɐu ǝssǝnɹƃ
doc

Offline Offline

Posts: 3581


« Reply #24 on: April 10, 2008, 07:37:49 PM »

Hello,

closed this thread as this patch is no longer supported for WB 2.6.x or lower. The module is part of the WB 2.7 core files, so thorn thanks for this nice contribution.

Regards Christian
Logged
Pages: [1] Go Up Print 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!