Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-30-2014, 05:39 PM
woodmj woodmj is offline
 
Join Date: Sep 2013
Posts: 66
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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 :-)
Reply With Quote
  #2  
Old 03-30-2014, 06:31 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 03-30-2014, 06:53 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tbworld View Post
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.
Reply With Quote
Благодарность от:
tbworld
  #4  
Old 03-31-2014, 08:54 AM
woodmj woodmj is offline
 
Join Date: Sep 2013
Posts: 66
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Attached Images
File Type: jpg Screenshot 2014-03-31 10.49.50.jpg (93.3 KB, 0 views)
Reply With Quote
  #5  
Old 03-31-2014, 09:55 AM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 03-31-2014, 11:13 AM
woodmj woodmj is offline
 
Join Date: Sep 2013
Posts: 66
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks very much, will PM you now.

Quote:
Originally Posted by ozzy47 View Post
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.
Reply With Quote
  #7  
Old 03-31-2014, 08:42 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)))
Reply With Quote
  #8  
Old 03-31-2014, 11:59 PM
Stefan118 Stefan118 is offline
 
Join Date: Dec 2010
Location: Vaassen (Netherlands)
Posts: 299
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Me like this very much!
Reply With Quote
Благодарность от:
ozzy47
  #9  
Old 04-01-2014, 12:03 AM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

LOL no problem, it happens quite often when people try to like my posts.
Reply With Quote
  #10  
Old 04-01-2014, 10:39 AM
blind-eddie's Avatar
blind-eddie blind-eddie is offline
 
Join Date: Apr 2006
Location: Michigan
Posts: 2,310
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:49 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05652 seconds
  • Memory Usage 2,277KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (2)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete