DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • October 22, 2017, 03:40:27 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: global function  (Read 2613 times)
0 Members and 1 Guest are viewing this topic.
Dhampir
Guest
« on: September 24, 2005, 10:57:57 AM »

I haven't been able to find this through searching..

Is there a way, or rather function out there, to make what ever you say in a script, happen to everyone online?

For example, of the newday.php:

Code:
if ($session['user']['loggedin']){
                $session=$revertsession;
                $session['user']['restorepage']=$REQUEST_URI;
                $session['allowednavs']=array();
                redirect("newday.php");
               
        }

How would I tell the script, to run this check for everyone?

P.S.
I left out a lot of code, I just put it there as an example.
« Last Edit: September 24, 2005, 11:01:11 AM by Dhampir » Logged
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #1 on: September 24, 2005, 11:01:51 AM »

You could just write up an SQL line. Or, a script that runs at everyhit, everyfooter or everyheader and make that same exact check.
Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Dhampir
Guest
« Reply #2 on: September 24, 2005, 11:10:05 AM »

Again, my ignorance prevailed me. heh

I figured it was something simple like that.


Thanks.
« Last Edit: September 24, 2005, 11:10:17 AM by Dhampir » Logged
Dhampir
Guest
« Reply #3 on: September 24, 2005, 12:00:49 PM »

So I just attempted that, now, the problem with me testing stuff from the newday is, that, when I do it, it still only effects me.

Code:
case "everyhit":      
globalnewday_run();
break;
// the $op pop, is just what I used, as a target for my nav to trigger this

function globalnewday_run(){
global $session;
$op = httpget('op');
       
if($op=="pop"){
require_once("newday.php");
function newday() {
global $session,$revertsession,$REQUEST_URI;
if ($session['user']['loggedin']){
$session=$revertsession;
$session['user']['restorepage']=$REQUEST_URI;
$session['allowednavs']=array();
redirect("newday.php");
               
}   
}
}
}
Logged
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #4 on: September 24, 2005, 12:16:09 PM »

It will only effect those that hit the script. Tongue It is more safe than an SQL query, that is why I suggested it.
Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Dannic
Guest
« Reply #5 on: October 04, 2005, 07:31:14 PM »

If you want to affect everyone then set a flag for each one in the user preferences.  at new day check for the flag, and if not set then set it after doing what you want done.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Play LoGD on Dragonprime

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
27 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search