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 11-26-2011, 10:53 PM
Mikhailtech Mikhailtech is offline
 
Join Date: Aug 2002
Location: USA
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to randomly cycle content displayed on front page (section manager)?

Is there a way to randomly display content in a section each time the front page is loaded? I don't see it as an option in the "display order" dropdown.

I was told at the vb forums it would have to be some sort of modification. Has anyone tried this?
Reply With Quote
  #2  
Old 11-29-2011, 02:51 AM
Mikhailtech Mikhailtech is offline
 
Join Date: Aug 2002
Location: USA
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bump ... anyone?
Reply With Quote
  #3  
Old 11-30-2011, 03:14 AM
Dead Eddie's Avatar
Dead Eddie Dead Eddie is offline
 
Join Date: Apr 2004
Location: at Home...
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm a little confused. Are you looking to display content from a random section each time the home page loads? Or display content in a random order?
Reply With Quote
  #4  
Old 12-12-2011, 03:26 AM
Mikhailtech Mikhailtech is offline
 
Join Date: Aug 2002
Location: USA
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Display content in a random order within a section (regardless of category). There's no option to display in random order right now.
Reply With Quote
  #5  
Old 12-12-2011, 12:41 PM
Dead Eddie's Avatar
Dead Eddie Dead Eddie is offline
 
Join Date: Apr 2004
Location: at Home...
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Create a new plugin that hooks into vbcms_collection_section_querydata and add the following code:

PHP Code:
//comma separated list of nodeids to apply this to
$sections = array(1,5);

if(
self::QUERY_BASIC == $required_query && in_array($this->filter_node_exact$sections))
{
$this->sortby ' ORDER BY RAND()';

Edit the section(s) you want to apply it to at the top, and you're good to go.
Reply With Quote
  #6  
Old 12-15-2011, 05:14 AM
summytinc summytinc is offline
 
Join Date: Nov 2008
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wow, that works great. Any ideas how to get it to work on the home content or in sections which include sub-section content? Thanks.
Reply With Quote
Благодарность от:
TTayfun
  #7  
Old 12-16-2011, 12:27 PM
Dead Eddie's Avatar
Dead Eddie Dead Eddie is offline
 
Join Date: Apr 2004
Location: at Home...
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by summytinc View Post
Wow, that works great. Any ideas how to get it to work on the home content or in sections which include sub-section content? Thanks.
By default, your "home content" is at node 1. If you've changed that, you'll have to set it for the node you've designated as your home page.

This does work on sections that includes sub sections.
Reply With Quote
  #8  
Old 12-26-2011, 01:44 AM
Mikhailtech Mikhailtech is offline
 
Join Date: Aug 2002
Location: USA
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I can't get this to work. Did as you said, I'm guessing you have to select the section in the array(x,x) part? I tried putting in different numbers and it's not working.

I have Home > Articles (section) > (categories) of articles > actual content.

See attachment.

What am I doing wrong? And how do I figure out what "node" my home content is in (if it's not 1 because that doesn't seem to work)?
Attached Images
File Type: jpg plugin.jpg (60.9 KB, 0 views)
Reply With Quote
  #9  
Old 12-26-2011, 12:43 PM
Dead Eddie's Avatar
Dead Eddie Dead Eddie is offline
 
Join Date: Apr 2004
Location: at Home...
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mikhailtech View Post
I can't get this to work. Did as you said, I'm guessing you have to select the section in the array(x,x) part? I tried putting in different numbers and it's not working.

I have Home > Articles (section) > (categories) of articles > actual content.

See attachment.

What am I doing wrong? And how do I figure out what "node" my home content is in (if it's not 1 because that doesn't seem to work)?
1. Yes, you need to put the actual nodeids of the sections you want to randomize there. Those are the numbers in the url (1-Index).

2. If you want to see what node controls your homepage, go to admincp -> Settings -> Options -> Content Management -> Default Page

3. What do you mean when you say it's "not working"? It's not randomizing the content? It's giving you a blank page? It's doing something else unexpected?

4. What version of vBulletin?
Reply With Quote
  #10  
Old 02-09-2012, 01:27 PM
summytinc summytinc is offline
 
Join Date: Nov 2008
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for your help on this. Can this be set up with a cache so that it doesn't run a new query when paginating through articles in that section?
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 03: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.04917 seconds
  • Memory Usage 2,284KB
  • 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
  • (1)bbcode_php
  • (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
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)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