Author |
Topic |
|
RokDev
Starting Member
19 Posts |
Posted - 10 April 2008 : 03:58:54
|
Hi all,
I was wondering if anyone knows how best to automate the locking and unlocking of a forum. Currently this a manual process where you have to click the icon.
Once a month we unlock a forum for 3 days, post some questions, and then lock it. It would be great if a list of dates would be stored in say a database, the system checks against these and say unlocks the forum if the current date matches.
Any ideas?
Thanks
<moved from="Help: General / Current Version (v3.4.xx)" by="Shaggy" />< |
Edited by - Shaggy on 10 April 2008 04:35:56 |
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 10 April 2008 : 06:13:58
|
well, firstly, it is not very practical to do anything automatically on a website based on time since it will only ever work if someone actually accesses the website during the correct time period, so if nobody accesses the site on the day in question, it will not get opened, or not get closed, so be careful how you code it.
Now down to practical bits, all you need to do is issue a query that sets the status of the particular forum, take a look in pop_lock.asp for the relevant code required.< |
|
|
RokDev
Starting Member
19 Posts |
Posted - 10 April 2008 : 11:12:17
|
Thanks for pointed me in a right direction.
I have gleaned the following:
--Lock Forum UPDATE FORUM_FORUM SET F_STATUS = 0 WHERE FORUM_ID = 1
--Unlock Forum UPDATE FORUM_FORUM SET F_STATUS = 1 WHERE FORUM_ID = 1
If I can get these queries to run in SQL scheduled task (at their various dates) then this should work.
NB. This is run over an Intranet when it is common knowledge when a specific forum opens and closes, so there's no problem with this been automated.
Thanks for your help.< |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 10 April 2008 : 11:23:12
|
quote: If I can get these queries to run in SQL scheduled task
if you can do that, it would be the best solution
alternatively you could use isql (i think that is what it is called) and use the windows scheduler to execute a batch file to do it< |
|
|
|
Topic |
|