vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   April Fools Joke (https://vborg.vbsupport.ru/showthread.php?t=260714)

SVTCobraLTD 03-21-2011 02:41 AM

April Fools Joke
 
Would this coding still work in vb 3.8.x?

Code:

just add something like $newavatar = mt_rand(1, 10); in postbit_display_start hook, (if you have 10 random avatars to display)

and the in the postbit, change the avatar to <img src="avatarlocation/image_$newavatar.gif">

I want to have avatars randomly change.

JacquiiDesigns 03-21-2011 03:50 AM

This would be kinda kewl. Subscribing...

Paul M 03-22-2011 10:23 AM

Quote:

Originally Posted by SVTCobraLTD (Post 2175666)
Would this coding still work in vb 3.8.x?

Should do.

valdet 03-30-2011 10:02 AM

That's what I did last year.

In a hugely replublican/conservative forum, I replaced user avatars, with democrat/liberal politicians and celebrities, with some funny messages as user ranks.

It proved to be a great prank.

Lynne 03-30-2011 01:58 PM

No need to do any template edits. Just do it all in a plugin:
PHP Code:

$newavatar rand(1,20);
$this->post['avatarurl'] = "avatarlocation/image_$newavatar.gif"

You may want to set the width/height also ( $this->post['avwidth'] = 'width="100"'; etc... )

kylek 03-31-2011 09:23 AM

Would this work with 4.1.2?

Ellendway 03-31-2011 01:10 PM

Quote:

Originally Posted by Lynne (Post 2179107)
No need to do any template edits. Just do it all in a plugin:
PHP Code:

$newavatar rand(1,20);
$this->post['avatarurl'] = "avatarlocation/image_$newavatar.gif"

You may want to set the width/height also ( $this->post['avwidth'] = 'width="100"'; etc... )

Hey,

it's a plugin, right? What Hook Location I must select?

//edit: Nevermind, is something like this for vb 4???

Lynne 03-31-2011 02:40 PM

Just use postbit_display_complete.

It's just php, so it works with 3.x and 4.x

Ellendway 03-31-2011 04:27 PM

Thanks <3

SVTCobraLTD 03-31-2011 11:59 PM

How do you make a plugin?


All times are GMT. The time now is 04:10 PM.

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.01259 seconds
  • Memory Usage 1,738KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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