vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   General Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=189)
-   -   How-To Enable Random News Posts on vBAdvanced (https://vborg.vbsupport.ru/showthread.php?t=105642)

01-17-2006 10:00 PM

How-To Enable Random News Posts on vBAdvanced
 
I searched and didn't see this here, apologies if it's in the wrong spot. With so many of us running vBA, I believe it's appropriate.

This is for vBA 2.x running on 3.5.3, untested otherwise.

To enable random news posts from your news forum:

Edit: news.php

Find:

Code:

ORDER BY " . iif($mod_options['portal_news_sticky'], 'sticky DESC,') . iif($mod_options['portal_news_orderby'] == 'postdateline', 'dateline', $mod_options['portal_news_orderby']) . " $mod_options[portal_news_direction]
Replace With:
Code:

ORDER BY RAND()
Save and you're done. Demo if you must, simply visit my website in my sig and refresh the page a few times.

Lea Verou 01-30-2006 04:46 AM

I have 3 blocks of news and I would like that in only one of them. However they all use the same news.php. Can you think of a way to accomplish this? :)

Lizard King 01-30-2006 08:37 AM

Quote:

Originally Posted by Michelle
I have 3 blocks of news and I would like that in only one of them. However they all use the same news.php. Can you think of a way to accomplish this? :)

Rename the news.php to randomnews.php upload it to your modules direntory and add a new module using randomnews.php that may solve your problem ;)

Lea Verou 01-30-2006 08:40 AM

Oh yes, correct... Thanks...

G_Man 06-22-2006 01:10 AM

Works a trick, but I have a question.

It doesn't actually select a random post for me, but rather the first post of a random thread.

Have I done something wrong, or is there a way to change it further so it selects an actual random post???


Thanks for this, BTW - It is very helpful.


All times are GMT. The time now is 05:54 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.00976 seconds
  • Memory Usage 1,719KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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