vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Flip Screen (https://vborg.vbsupport.ru/showthread.php?t=310053)

woodmj 03-30-2014 05:39 PM

Flip Screen
 
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 :-)

ozzy47 03-30-2014 06:31 PM

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;
}

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.

ozzy47 03-30-2014 06:53 PM

Quote:

Originally Posted by tbworld (Post 2490507)
You would essentially have to re-render the HTML output using JavaScript using 'htmlcanvas' in HTML5. It would require quite a bit of work to implement this.

I have used this library for some fun projects I implemented, which might help you.
http://html2canvas.hertzen.com/

I did like the idea, though. :)

I posted the solution above your post. :p

woodmj 03-31-2014 08:54 AM

1 Attachment(s)
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.

ozzy47 03-31-2014 09:55 AM

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.

woodmj 03-31-2014 11:13 AM

Thanks very much, will PM you now.

Quote:

Originally Posted by ozzy47 (Post 2490585)
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.


ozzy47 03-31-2014 08:42 PM

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)))
To this:
Code:

if (date('F j') == 'April 1' AND THIS_SCRIPT == 'forumdisplay' AND in_array($GLOBALS['forumid'], array(X,X,X)))

Stefan118 03-31-2014 11:59 PM

I can not like your post before liking anyone else his post, so i tell it this way:

Me like this very much!

ozzy47 04-01-2014 12:03 AM

LOL no problem, it happens quite often when people try to like my posts. :)

blind-eddie 04-01-2014 10:39 AM

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.


All times are GMT. The time now is 03:37 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02074 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete