Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
[hack]Turn Your forum On and Off
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2009-03-27 14:28:59
From time to time, you may want to turn your forum off to the public while you perform maintenance, update versions, etc. When you turn your forum off, visitors will receive a message that states that the forum is temporarily unavailable. Administrators will still be able to see the forum.

to add in backend/config.php

$closeforums  = false; // false = forum on, true = forum off.

$message = '<b><font color="red">We are currently performing updates, please check back soon!</font></b>'; // Message to show your users why the forum is off...
to add in backend/function.php before ?>


function forum_closed() {

global $closeforums, $message;

if ($closeforums && $GLOBALS["CURUSER"]["control_panel"] != "yes")

show_error_msg("Sorry","$message", 1);

}





open forums.php and add after: loggedinonly();



forum_closed();



post updated thank you TorrentialStorm
Unknown User
2009-03-27 14:38:40
function forum_closed() {

global $closeforums,$adminip,$message;

if ($closeforums){

$userip = getip();

if ($userip != $adminip){

show_error_msg("Sorry","$message", 1);

}

}

}


i would make the admin ip jus get it from the userstable rather than jus right it in because if people dont have static ips then their fuked!
Unknown User
2009-03-27 14:47:45
There is a concern it is that it one can connect oneself more once put the code in function
Unknown User
2009-03-27 14:53:30
function forum_closed() {

global $closeforums, $message;

if ($closeforums && $GLOBALS["CURUSER"]["control_panel"] != "yes")

show_error_msg("Sorry","$message", 1);

}
Unknown User
2009-03-27 14:56:44
im not having a go mate but i think this would be more convienient

to backend/config.php add

$site_config['FORUM_ONLINE'] = true;									

$site_config['FORUM_MESSAGE'] = 'The Forums Are Temporarily Closed!';





add to backend/functions.php





function forum_closed()

{

global $site_config;



if (!$site_config["FORUM_ONLINE"]){

if ($CURUSER["level"]!=="Administrator") {

echo '<BR><BR><BR><CENTER>'. stripslashes($site_config["FORUM_MESSAGE"]) .'</CENTER><BR><BR>';

die;

}else{

echo '<BR><BR><BR><CENTER><B><FONT COLOR=RED>FORUM OFFLINE, ADMIN ONLY VIEWING! DO NOT LOGOUT</FONT></B><BR>If you logout please edit backend/config.php and set FORUM_ONLINE to true </CENTER><BR><BR>';

}

}



}





To forums.php add





forum_closed();
Unknown User
2009-03-27 14:59:13
Thank you TorrentialStorm

post 1 updated
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728