vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   need a code to do this: (https://vborg.vbsupport.ru/showthread.php?t=46142)

scsa20 11-27-2002 01:31 AM

need a code to do this:
 
can someone tell me what the code would be to show, lets say, news... There's a forum called News where I make threads which becomes news... what code is it to show about 5 of those thread news on the front page (which is going to be something I'm going to be working on soon)... thanks for any help, and I could give you more info if needed.

JulianD 11-27-2002 01:41 AM

There are plenty of hacks here in vb.org that can do what you need.

scsa20 11-27-2002 01:49 AM

yeah, but I want to completely coustom make mine so that I have the good feeling of doing something...

Velocd 11-27-2002 09:34 PM

As JulianD stated, there are hacks such as vBHome lite that will give you this in a very query-efficient manner. If you are fairly new to PHP coding, I wouldn't create it on your own as the news process itself can develop a huge amount of queries if configured improperly (Teck would probably know).

Also, if you insist on it being original, why are you asking for the code to do it in this thread? ;)

scsa20 11-28-2002 12:44 AM

I just need to know the code that calls to pull the database string for the slected forum ID and limited it to 5 (I know it's a database string but I just don't know what it is -_-')

NTLDR 11-28-2002 12:48 AM

Look at one of the many news hacks and take the queries used there and the modicications to the DB that are required.

scsa20 11-28-2002 01:22 AM

well... I did found that you could use this querie to get the info needed:

[sql]
$sql = 'SELECT threadid, title, forumid, replycount, postusername, postuserid, lastposter, dateline, iconid FROM thread WHERE forumid =2 ORDER BY threadid DESC LIMIT 5';
[/sql]

but what did I need to put as require to connect to the database without much work and the code to show it as HTML.

NTLDR 11-28-2002 09:11 AM

You know that query will only get the titles for the news? Not sure if thats all you want. Like I said before if you look at the hacks they show you how do the queries and how to use templates to output the results.

If you art't integrating with vB then look up the mysql_connect() PHP function.


All times are GMT. The time now is 10:55 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.02242 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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