vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Help with frontpage, query needed (https://vborg.vbsupport.ru/showthread.php?t=64325)

MrNase 04-24-2004 10:17 AM

Help with frontpage, query needed
 
Hey :)

I need a query/code to get the following out of the database:

- the last 11 threads ordered by threadcreationtime

- the latest thread should have preview (only smilies should get parsed) and the first attached image should show up as a kind of teaser image.

- the other 10 threads should only have their headlines and a link to the thread.


I can do the first on my own. :)
The only problems are: how can i get a preview for the latest thread and only display the headlines for the other 10 threads? Another major problem would be to get the attachment working correct...

As you may see this should be for a news page. The most recent news should have an image and that image should be that image which is attached to the certain thread.

The other 10 threads should just give an overview about that the news. Just the title of the thread.

Here's what i would use for the first task:
PHP Code:

 SELECT thread.*
     
FROM ".TABLE_PREFIX."thread AS thread
     WHERE open 
'1'
     
AND forumid IN (1,3,6)
     AND 
thread.visible '1'
     
ORDER BY threadcreationtime
     DESC LIMIT 11 


MrNase 04-25-2004 08:30 AM

Alright, i got it working :)

Now the attached image is automatically shown on the frontpage. Great isn't it ;)


All times are GMT. The time now is 03:05 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.00981 seconds
  • Memory Usage 1,710KB
  • 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
  • (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