PDA

View Full Version : Customized Forum Closed Screen


Michael Morris
12-24-2004, 10:00 PM
By default the vbulletin closed screen is a simple message with the standard header and footer for the boards. You can change this to a different page entirely with this hack.

This hack requires you to create a new template entirely and install a slight modification in your global.php file.

The file modification is as follows:

Search for this code.
// ################################################## ###########################
// check that board is active - if not admin, then display error
if (!$vboptions['bbactive'] AND THIS_SCRIPT != 'login')
{
if (!($permissions['adminpermissions'] & CANCONTROLPANEL))
{
eval('standard_error("' . str_replace("\'", "'", addslashes($vboptions['bbclosedreason'])) . '");');
unset($shutdownqueries['lastvisit']);

Comment out the eval('standard_error.... line and place this below the unset($shutdownque.... line.
eval('print_output("' . fetch_template('boards_closed') . '");');

The finished code, assuming you have no other hacks in this section of the code, will look like this:

// ################################################## ###########################
// check that board is active - if not admin, then display error
if (!$vboptions['bbactive'] AND THIS_SCRIPT != 'login')
{
if (!($permissions['adminpermissions'] & CANCONTROLPANEL))
{
//eval('standard_error("' . str_replace("\'", "'", addslashes($vboptions['bbclosedreason'])) . '");');
unset($shutdownqueries['lastvisit']);
eval('print_output("' . fetch_template('boards_closed') . '");');


Now create a new template called boards_closed. This can be any html document you want and you can of course call some of the variables from vbulletin.

If you want the boards closed reason to appear in the page you'll need to include $vboptions[bbclosedreason] somewhere in the file.

Below is a very simple template that will include the reason on a blank page.


<html>
<body>
$vboptions[bbclosedreason]
</body>
</html>


From this model you can build up a page. Attached is a screenshot of ENWorld's closing screen using this modification.

MrNase
12-25-2004, 09:26 AM
Thank you for sharing it with us :)

error_22
12-25-2004, 11:10 AM
cool, thanks for sharing *clicks install*

moley
12-25-2004, 01:48 PM
thanks a lot the vb default is so boring will be fun to make a new one.

Boofo
12-25-2004, 04:14 PM
Why didn't you include this in your code replacement? unset($shutdownqueries['lastvisit']);

Red Blaze
12-25-2004, 06:46 PM
Very cool, I'll definatly have this in my to-do list. :)

Michael Morris
12-25-2004, 07:32 PM
Why didn't you include this in your code replacement? unset($shutdownqueries['lastvisit']);

The print_output function doesn't check this variable and that function terminates the script. Hence the line isn't necessary (as far as I'm aware) - though there is no harm in it's inclusion.

The Ghost
01-01-2005, 05:55 PM
Hi,

I get only a white Page?

Greetz

Michael Morris
01-01-2005, 06:35 PM
You have to create a new template for your custom forum closed screen named boards_closed. This can be any XML document you like - but it has to be loaded into the template boards_closed

Dan
01-01-2005, 06:44 PM
I like this mod :D Thanks for sharing it with us

The Ghost
01-01-2005, 08:43 PM
Hi,

I know, I've created some HTML Tag an inserted in the Template, but only white Page.....

Michael Morris
01-01-2005, 10:39 PM
Check the source code. Is it matching your html? If so, the problem is your html. If not then you misnamed the template. the template must be named:

boards_closed

exactly, or it won't find the template.

Silverdawn222
01-27-2005, 12:26 PM
For those who have the same problem - make sure that the 'boards_closed' template is present in each style selectable by your users. :)

Natch
01-27-2005, 04:16 PM
The print_output function doesn't check this variable and that function terminates the script. Hence the line isn't necessary (as far as I'm aware) - though there is no harm in it's inclusion.
The reason you would want to keep this would be to retain the previous visit's timestamp for members who get the board_closed message: that way, and messages posted by Admin's during board downtime would be "new posts" when the board is restored.

yoyoyoyo
01-31-2005, 03:25 PM
works great, but I kept theunset($shutdownqueries['lastvisit']); ***CLICKS INSTALL***

Michael Morris
02-08-2005, 08:24 PM
So do I now that I understand what it's for. Changed the instructions slightly, but the hack isn't functionally changed.

noj75
07-27-2006, 05:57 PM
Thanks Michael

Been trying to suss this out myself all day. Then I found this :-)

Great stuff !!!!