• OzzModz is no longer taking registrations. All registrations are being redirected to Snog's Site
    All addons and support is available there now.

April Fools Fun (vB4)

Ozzy47

Administrator
This is something someone asked for on vB.org, so I thought I would post it here to. Cute little way to flip some of your forums upside down for April Fools.

Create a plugin, ACP --> Plugins & Products --> Add New Plugin

Product: vBulletin
Hook Location: parse_templates
Execution Order: 5
Plugin PHP Code: Add the following;
Code:
if (date('F j') == 'April 1' AND THIS_SCRIPT == 'forumdisplay' AND in_array($foruminfo['forumid'], array([B][COLOR=Red]X,X,X[/COLOR][/B])))
{
    $invert = '<style type="text/css">
    body {
          -webkit-transform: rotate(180deg);
          -moz-transform: rotate(180deg);
          -ms-transform: rotate(180deg);
          -o-transform: rotate(180deg);
          transform: rotate(180deg);
    }
    </style>
    
     <script>
       window.onload=toBottom;
    
       function toBottom() {
          window.scrollTo(0, document.body.scrollHeight);
       }
    </script> ';
$template_hook[headinclude_bottom_css] .= $invert;
}

Just change X,X,X to the forums you want this to happen on.

Also note, I wrote this to only happen on April 1, so if you want to test it, change the date.
 
I installed it on my 3.8... adjusted it to do only a 10 degree tilt.... It's mestup, great little plugin.
 
Followed the instructions, added the forum id's instead of the x's, changed date to March 31

Not working
Dunno if the template hook is required for v4 like it is for 3.... But it is $invert and it goes at the very bottom of the forumhome template in v3.
 
The hook is not needed in vB4, as it should be auto inserting it. I have a site to look at also that it is not working, maybe I can find something out there.
 
Ok I got it going on the users site, change the first line of the code:
Code:
if (date('F j') == 'April 1' AND THIS_SCRIPT == 'forumdisplay' AND in_array($foruminfo['forumid'], array([B][COLOR=Red]X,X,X[/COLOR][/B])))

To this:
Code:
if (date('F j') == 'April 1' AND THIS_SCRIPT == 'forumdisplay' AND in_array($GLOBALS['forumid'], array([B][COLOR=Red]X,X,X[/COLOR][/B])))
 
Back
Top