Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP
Author Message
amkma
New Member
New Member



Joined: Oct 08, 2004
Posts: 8

PostPosted: Fri Oct 08, 2004 4:23 am Reply with quote

Hi everybody,
I wonder If someone can help me in getting to have a timed website.

I want to create a webpage which is available to members fro lets say 09 am till 5 pm, Monday to Friday only.

Is there any possiblities???
 
View user's profile Send private message
beetraham
Regular
Regular



Joined: Dec 13, 2003
Posts: 94
Location: Finland (EU)

PostPosted: Fri Oct 08, 2004 11:25 am Reply with quote

amkma wrote:
Hi everybody,
I wonder If someone can help me in getting to have a timed website.

I want to create a webpage which is available to members fro lets say 09 am till 5 pm, Monday to Friday only.

Is there any possiblities???


Hi amkma,

As they say "everything is possible, but nothing is real" Wink Smile - so, considering this as head a start, let's try to figure out something as a solution to this.

So, please let me first ask you a couple of questions - you apparently are running with the Nuke, aren't you? If, so then we're in for some more specific questions;

* should it be placed on the PHP-Nuke frontpage? If, so, then we'll need to pull out a timed control, which would change the *active content* to something other than that (preferably to *nothing*) when outside the timeframe - sounds acceptable?

* or should it be an accessible link with timed control? Then probably I'd suggest to create a timed link interface - is it this that you looking for?

* or did you think of something totally different than those two options above?

Please let me know you thoughts upon this, let's figure it out.

Thanks!

-beetraham
 
View user's profile Send private message
ecvej
Hangin' Around



Joined: Oct 10, 2004
Posts: 45
Location: Northampton, UK

PostPosted: Sun Oct 10, 2004 4:13 pm Reply with quote

Have you considered cron jobs? One to turn the site on set to run mondays and one to turn it off set to run fridays.

Include some code at the top of your pages to query the database table "siteactive" for example. If it returns a value of 0, die site is not active outside the hours of x-y. Else php of your site runs as usual. Simple heh!

Obviously the cron jobs that run automatically will change the value in the siteactive table from 1 to 0 when required. You could even set up an admin option (if you are using nuke) to toggle the siteactive variable as beetraham alluded
 
View user's profile Send private message
oprime2001
Worker
Worker



Joined: Jun 04, 2004
Posts: 119
Location: Chicago IL USA

PostPosted: Sun Oct 10, 2004 9:18 pm Reply with quote

Have you given the tips in http://www.ravenphpscripts.com/article-566--0-0.html a try?
 
View user's profile Send private message
amkma







PostPosted: Mon Oct 11, 2004 2:05 am Reply with quote

hi everybody,
Thanks for suggestions. Firstly I will answer to beetraham....
Quote:

So, please let me first ask you a couple of questions - you apparently are running with the Nuke, aren't you? If, so then we're in for some more specific questions;

* should it be placed on the PHP-Nuke frontpage? If, so, then we'll need to pull out a timed control, which would change the *active content* to something other than that (preferably to *nothing*) when outside the timeframe - sounds acceptable?

* or should it be an accessible link with timed control? Then probably I'd suggest to create a timed link interface - is it this that you looking for?

* or did you think of something totally different than those two options above?


Firstly I am using Nuke as well other scripts side by side. Can you be kind to explain me the easiest one and also at the same time the secure one.

I want my website to be working 24/7, but only the members area with login from monday to friday, 9-5.

I have heard about cronjobs, but never tried. I have to get detailed commands syntax for that. You can say I have no knowledge of using it.

i think I will go for this:
Quote:

* or should it be an accessible link with timed control? Then probably I'd suggest to create a timed link interface - is it this that you looking for?


it seems to be more reliable. As I understood that, the link will apear on the website during the particular time as it will be set. and the rest of time it will be inactive.


THanks again to all.
 
beetraham







PostPosted: Mon Oct 11, 2004 4:42 am Reply with quote

amkma wrote:

Firstly I am using Nuke as well other scripts side by side. Can you be kind to explain me the easiest one and also at the same time the secure one.


OK, so in that case, in my opinion, this would require *all* the earlier presented options taken under scope - why's that? Because, we now have a reason to believe that we need both the...

1) timed link IF (enabling direct access)

and the...

2) method for blocking indirect accesses outside the *allowed timeframe*.

So, should it be an absolute m-u-s-t that USERS may not access the sections under any circumstances, then we necessarily need to figure a way to *block it* outside the *allowed timeframes.

The 2nd part becomes necessary to implement as there are always *nosies* around trying to access the sections with their indirect links (saved from the earlier sessions) - this is just an assumption, but I bet it is like that.

So, how to accomplish this goal? In my opinion the answer is twofold - the first (1), the one that was referred earlier to be lately presented by Raven, in form of *.htaccess* file enhanced Timed control and the second fully covered *Google Tapping* (I'm more familiar with *GT-NExtGEn*) to cover all the possible convetional links being mod-rewritten by Apache to *htm(l) format (as an example).

Why an Earth would we need to use Google Tapping (or better *GT-NExtGEn*) for that? Simply because it would appear to be a suitable way for forming the time-dependent *floating abstract link layer* - in reality it does not exist, until it is assigned with the time dependent content.

QUESTION: Would it be possible to receive more details on the relative size of that planned (existing) Members Section? How huge is it anyways - are there many internal links within that section? Perhaps it is a MODULE that has already been GT'ed?

BTW, should anybody strongly disagree with this *approach* - please let me know, I'd be more than happy to hear about more an efficient/reliable way of getting it done.

So, here comes enclosed an example of the "raw PHP code" dedicated for these purposes" - controlling the Timed Link IF's active link generation...
I'll make an PHP-Nuke block out of it and post it soon here...

Quote:

<?php
/************************************************************************/
/* PHP-NUKE: Advanced Content Management System */
/* ============================================ */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* [ Only registered users can see links on this board! Get registered or login! ] */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/* */
/************************************************************************/
/* block-Timed_Control_Link_IF.php *** [ Only registered users can see links on this board! Get registered or login! ] */
/* by beetraham aka ZenoCide - (c) 2004 */
/************************************************************************/

if (eregi("block-Timed_Control_Link-IF.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
$content ="";
//
// In order to create a *Timed Control Link-IF*, we need to evaluate both
// the *day* and *hours* to decide whether or not to provide the *active link*
//
$today = date("w");
//
//////////////////////////////////////////////////////////////////////////////////
// "opendays" array corresponds to Days {Sunday, Monday, Tuesday,...,Saturday} //
////////////////////////////////////////////////////////////////////////////////
//
// creating an array stating the open days - from Sunday to Saturday (but open only from Monday to Friday, =='1')
$opendays = array('0', '1', '1', '1', '1', '1', '0');
$openhours = array('09', '10', '11', '12', '13', '14', '15', '16', 'break');
//
$hours_pre = date("H"); // we're using 24h format due to practical reasons herein
$hours = trim($hours_pre); // removing white space
//
//resolving status - whether or not it is time to open the link to *Members Area*
//
// in case that both the day and hours are *open* (=='1'), we'll generate the link. Otherwise we'll offer some substitute content
//
if ($opendays[$today] == "1") {
// not interested in this branch
//if ("$hours" == '09' || '10'|| '11'|| '12'|| '13'|| '14'|| '15'|| '16') {
while(list(, $val) = each($openhours)) {
if ($val == 'break') {
// if there's a match with the *day* but not with the *hours*, we'll perform the script exit from here at same time issuing that *CLOSED* status
// comments only
//echo "Member Section Closed"; // debugging only
// echo $opendays[$today]; // debugging only
// echo '-'; // debugging only
// echo $hours; // debugging only
$content .="<center><b>Members Area - Closed</b></center>";
break;
}
// passing through the values in *openhours* array, if there's a match both with the *days* and *hours*, we'll issue the *OPEN* status
if ($val == $hours) {
//echo "Member Section Open"; // debugging only
//echo $opendays[$today]; // debugging only
//echo '-'; // debugging only
//echo $hours; // debugging only
$content .="<center><b><a href=\"forums.html\">Members Area - Open</a></b></center>";
break;
}
}
} else {
// if there's neither match with the *day* nor with the *hours*, we'll issue the *CLOSED* status // comments only
//echo "Member Section Closed"; // debugging only
// echo $opendays[$today]; // debugging only
// echo '-'; // debugging only
// echo $hours; // debugging only
$content .="<center><b>Members Area - Closed</b></center>";
}
?>


I'll provide the *armed and ready* PHP-Nuke Block soon - need take off to City for some hours...

[continued]

OK, so here is the actual PHP-Nuke outlook of that block - case dependent;

Members Area Open:

Image
and...

Members Area Closed:

Image

Sorry to have you kept waiting - I had a relatively busy day back in downtown.

So, clearly, now that the reduced Link IF is OK, we should perhaps take a look at that MODULE of yours - still interested? Smile

Thanks,

BR,

-beetraham


Last edited by beetraham on Tue Oct 12, 2004 5:21 am; edited 13 times in total 
amkma







PostPosted: Mon Oct 11, 2004 4:54 am Reply with quote

Many thanks beetraham,
I will work with this and will let you know how it helped me. Also I will be waiting for PHP-Nuke Block.
Smile


Thanks alot .
 
amkma







PostPosted: Mon Oct 11, 2004 5:23 am Reply with quote

Hi beetraham,
Just want to ask you one more thing. I have tried the code, it works well with days, but not with hours. Can you please check this for me

Many thanks
 
beetraham







PostPosted: Mon Oct 11, 2004 10:39 am Reply with quote

amkma wrote:
Hi beetraham,
Just want to ask you one more thing. I have tried the code, it works well with days, but not with hours. Can you please check this for me

Many thanks


Thanks amkma,

You were absolutely correct on the state of that scratch - I now shoveled it into a Nuke block (in place of the previous scratch) - as it is a relatively easy struct (the arrays may first bother slightly, but once realized, it's a walk in a park). In case that more comments should be added, let's add those.

OK, so the next issue would be then the size of your *Target*, Member Area (MODULE?) and the complexity of the internal links present - i.e. in order to perform the *.htaccess* *indirect link access blocking* via Google Tapped struct combined with Raven's reference on using the timed control features as 2-state "multiplexers" - on/off....

Let me know if you have interest to go any further - to secure the area natural backdoor links' point of view.

Thanks,

-beetraham
 
amkma







PostPosted: Mon Oct 11, 2004 10:59 am Reply with quote

Thanks,
It really got interested. Sure i have quite good interest in going further.
THanks for your help
 
beetraham







PostPosted: Mon Oct 11, 2004 11:52 am Reply with quote

amkma wrote:
Thanks,
It really got interested. Sure i have quite good interest in going further.
THanks for your help


OK, great - so, maybe in that case you could shortly summarize the amount components related to that Members Area *Entity* - if, a Module - then how many components are there associated with it? Furthermore, is the Module publically available as a GPL/GNU based entity? If, so, then it could be possible that someone would have already GT'ed the piece... Smile

--> So this is what interests the most at this point - the Line-up and complexity (internal browser accesible linkages) of those components?
/modules/index.php
/modules/someother.php
...
-->

I'll get back to the Forums tomorrow somewhere near around these hours.

Thanks!

-beetraham


[Oct-12th-2004]

Please see the *Timed Link-IF Block* "being updated once more time" - this was clearly due to too many made assumptions and inadequately performed testing. Embarassed Embarassed

Sorry about the caused inconvieniences.


-beetraham
 
amkma







PostPosted: Tue Oct 12, 2004 2:59 am Reply with quote

Hi beetraham,
Thanks for your work. I really liked that.
But I am having problem in using it for hours. Even I alter the time still says the session is opened. I tried a couple of things but not making it work.
I will kindly ask your help again

thanks
 
beetraham







PostPosted: Tue Oct 12, 2004 3:14 am Reply with quote

amkma wrote:
Hi beetraham,
Thanks for your work. I really liked that.
But I am having problem in using it for hours. Even I alter the time still says the session is opened. I tried a couple of things but not making it work.
I will kindly ask your help again

thanks


Please see the previous post Smile - I made the exactly same notice myself some hours ago and I re-updated/tested the block that can found updated in the *block presentation section*

Thanks a lot!

-beetraham
 
amkma







PostPosted: Tue Oct 12, 2004 3:26 am Reply with quote

Smile
But this time it got opposite, Now when I change the time, still it keeps on saying session open...
Can't get it
 
beetraham







PostPosted: Tue Oct 12, 2004 4:52 am Reply with quote

amkma wrote:
Smile
But this time it got opposite, Now when I change the time, still it keeps on saying session open...
Can't get it


I can not manage to figure any other explanation than having eaten something seriously fatal during yesterday - now, gradually beginning to see the light.

I performed the *corner case* tests, which would clearly show the snippet functioning as it should.

Both thumbs up that it works at your end!

BR,

-beetraham


Last edited by beetraham on Wed Oct 13, 2004 1:26 pm; edited 1 time in total 
amkma







PostPosted: Tue Oct 12, 2004 5:47 am Reply with quote

valooo!

Now its quite well. and perfectly working. Thank you very much beetraham.

Really it was nice to work with you.

thanks again for such a nice effort.

Very Happy
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©