vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Help calling new threads to a custom page help (https://vborg.vbsupport.ru/showthread.php?t=242183)

Da-Vinci 05-09-2010 10:00 PM

Help calling new threads to a custom page help
 
1 Attachment(s)
On my page, I'm trying to list the top 5 threads in a table.

I'm trying to call the latest thread to position 1 in the table, the second newest thread to position 2 ect, ect, with thread replies not having an effect on how high up or down in the table a thread is placed.

I've created a template and a php file following Lynnes article so I just need to be able to call new threads to display in the table I've created on my page.

Here's an image describing what I'm attempting.

http://www.hostmypics.org/pictures/5...d821c76b92.png

I'm ok with everything except for calling the threads.

Da-Vinci 05-10-2010 07:14 PM

***bump***

Xencored 05-10-2010 07:19 PM

delete sorry i didnt read it all...

Lynne 05-10-2010 07:40 PM

I think you just basically need something along these lines (replace * with the specific fields you want):
PHP Code:

$my_query="SELECT * FROM ".$TABLE_PREFIX."thread as thread
WHERE thread.visible = 1 AND thread.forumid=x
ORDER BY thread.dateline desc limit 5"

$my_result=$db->query($my_query); 

while (
$my_variable=$db->fetch_array($my_result)) {
do 
stuffincluding rending the template


(There are mods around that have these queries and the while loop and all, you just need to go look.)


All times are GMT. The time now is 05:22 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.01694 seconds
  • Memory Usage 1,717KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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