vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   How can I change an image based on newposts and activity? (https://vborg.vbsupport.ru/showthread.php?t=289077)

Marzas 10-15-2012 06:06 AM

How can I change an image based on newposts and activity?
 
Hi there,

I'm not a programmer but require some simple assistance. Based on vBulletin 4 obviously.

Can anyone provide me with a small piece of PHP to allow me to change an 'IMAGE.jpg' based on the amount of 'new posts' for that day? Ie. if new posts > 300 to Image1.jpg, if new posts > 1000 image2.jpg etc.

And similarly, using this to change Picture1 to Picture2 or Picture3 based on the amount of users that have visited the forum today. if > 100, >200, >300 etc.

Thank you for any assistance in advance.

kh99 10-17-2012 10:59 AM

It's easy enough to have a series of "ifs" to set a file name, the bigger problem is having the number of posts or visits available. You'd have to query to get them, then you'd probably want to cache the value so you're not doing those queries every time someone visits the page.


All times are GMT. The time now is 07:21 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.01019 seconds
  • Memory Usage 1,700KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete