vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Latest Posts Adjustment (https://vborg.vbsupport.ru/showthread.php?t=294584)

chrisbr 01-30-2013 08:27 PM

Latest Posts Adjustment
 
Hi All,

Wondering if anyone tehhnical can help, I have the following php script below to call the latest posts from my forum to my php based homepage.

However, as the eagle eyed upon you will notice, this script will exclue certain forums, nothing wrong with this BUT, i need to change the script so it will old check one forum ID

Can anyone point me in the right direction?

Thanks

cellarius 01-31-2013 07:11 AM

PHP Code:

$exclude = array('15','22'); 

That's the part that defines the forumids of the excluded forums. Add or remove ids there, it's a comma seperated list as you can see.

Amaury 01-31-2013 07:22 AM

An easier way to get latest posts is to just use a forum block.

No work needs to be done and no scripts are needed. Just add it.

Admin CP -> Forums & Moderates -> Forum Blocks Manager -> Add Block
  • Select Block Type: New Forum Posts

Configure the options to your liking and click Save.

cellarius 01-31-2013 09:15 AM

You can't use a forumblock on a non vB-Site, obviously. And that's what he's doing.

chrisbr 01-31-2013 05:21 PM

Thanks for the reply all, Cellarius is right in saying that I want to be able to put the latest posts on a non VB page, however whilst I realise that
PHP Code:

$exclude = array('15','22'); 

is where I need to setup the forum excludes, I would have to enter ALL my forum ID's and remember to keep this updated whenever I see fit to add a new forum.

This is why I need to be able to change the code so that I can just select a single Forum ID as I only want the posts from a particular forum to be displayed.

I did wonder if I needed to change
PHP Code:

 WHERE forumid NOT IN (" . $exclude_list . "

but I am not a mysql/php expert so I have no idea where to start!


I have managed to solve this, Please can a moderator close!


All times are GMT. The time now is 01:47 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.00919 seconds
  • Memory Usage 1,715KB
  • 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
  • (3)bbcode_php_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