PDA

View Full Version : need a code to do this:


scsa20
11-27-2002, 01:31 AM
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 = 'SELECT threadid, title, forumid, replycount, postusername, postuserid, lastposter, dateline, iconid FROM thread WHERE forumid =2 ORDER BY threadid DESC LIMIT 5';


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.