The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
Hi, Would anyone know how I could temporarily turn the screen upside down when someone goes into one of my forums? Just a little something for April 1st I was thinking :-)
|
|
#2
|
||||
|
||||
|
Sure, you would need to 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(X,X,X)))
{
$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;
}
Also note, I wrote this to only happen on April 1, so if you want to test it, change the date. |
|
#3
|
||||
|
||||
|
Quote:
|
| Благодарность от: | ||
| tbworld | ||
|
#4
|
|||
|
|||
|
Thanks so much for your help Ozzy.
Unfortuately the plugin doesn't seem to be working on my forum. Maybe I did something wrong? Please see attached view of the plugin from my ACP. Many thanks. |
|
#5
|
||||
|
||||
|
Not sure, it should be working, as I have seen it work on 4 sites now. If you want PM me a admin account and I will check it out when I get home from work.
|
|
#6
|
|||
|
|||
|
Thanks very much, will PM you now.
|
|
#7
|
||||
|
||||
|
If anyone else has trouble getting this to work do the following.
Change the first line of the code: Code:
if (date('F j') == 'April 1' AND THIS_SCRIPT == 'forumdisplay' AND in_array($foruminfo['forumid'], array(X,X,X)))
Code:
if (date('F j') == 'April 1' AND THIS_SCRIPT == 'forumdisplay' AND in_array($GLOBALS['forumid'], array(X,X,X)))
|
|
#9
|
||||
|
||||
|
LOL no problem, it happens quite often when people try to like my posts.
|
|
#10
|
||||
|
||||
|
I like the ideas, but original code nor edited code would work for me on 3.8.
I did not try it on 4.2 But, thank you for the share ozzy. |
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|