Version: , by merk
Developer Last Online: Mar 2012
Version: Unknown
Rating:
Released: 08-26-2001
Last Update: Never
Installs: 0
No support by the author.
Well, after finding 'PluhNews', i thought to myself, why not create something that uses templates, and the $DB_site class?
Well, after a bit of twiddling, i reduced the querys to just one, and Got it working, took a while tho D:
First off, youll need to create 2 templates.
newsbit:
Code:
Posted By <a href="$forumspath/member.php?s=&action=getinfo&userid=$newsarray[postuserid]"><b>$newsarray[postusername]</b></a> at <i>$dateposted</i>
</center>
<blockquote></a>$cookedthread</blockquote><center><a href="$forumspath/showthread.php?s=&threadid=$newsarray[threadid]"><b>$newsarray[replycount]</b> $commenttext</a> Last comment was by <b>$newsarray[lastposter]</b></a></center>
<hr noshade height="1" width="60%">
This is just example code, basically the same as PluhNews' Code, i dont have time to make it a bit mroe spicey, but im sure you can work it out.
shownews:
Code:
Your Header Code Here
$newsbits
Your Footercode here.
And finally, create news.php in the forum root directory, and put this in it:
//Configuration Options
//What is the ID of your News forum?
$newsforums = 107;
//How many news items should be displayed?
$newsitems = 10;
//Path to your forums directory (leave out trailing slash)
$forumspath = "/forum";
require('./global.php');
$newsquery = "SELECT thread.*, post.*";
$newsquery .= " FROM thread,post";
$newsquery .= " WHERE post.threadid=thread.threadid";
$newsquery .= " AND thread.forumid=$newsforums";
$newsquery .= " GROUP BY thread.threadid";
$newsquery .= " ORDER BY thread.dateline DESC";
$news=$DB_site->query($newsquery);
while ($newsarray=$DB_site->fetch_array($news)) {
$dateposted = vbdate("jS F Y, H:i",$newsarray[dateline]);
Hey just wondering about one thing, i added the threads title to the newspage, but i'm wondering if its possible to make the title capital letters only, like some kind of line of code that replaces all letters in the title to capitals.
Originally posted by JJR512 OK, how can I make it so the newest thread is at the top, rather than the bottom?
I get this already-
However, i think i forgot to add a touch of code.
To change it, you need to modify the code block:
Code:
$newsquery = "SELECT thread.*, post.*";
$newsquery .= " FROM thread,post";
$newsquery .= " WHERE post.threadid=thread.threadid";
$newsquery .= " AND thread.forumid=107";
$newsquery .= " GROUP BY thread.threadid";
to
Code:
$newsquery = "SELECT thread.*, post.*";
$newsquery .= " FROM thread,post";
$newsquery .= " WHERE post.threadid=thread.threadid";
$newsquery .= " AND thread.forumid=107";
$newsquery .= " GROUP BY thread.threadid";
$newsquery .= " ORDER BY thread.dateline DESC";
Originally posted by DjSao Hey just wondering about one thing, i added the threads title to the newspage, but i'm wondering if its possible to make the title capital letters only, like some kind of line of code that replaces all letters in the title to capitals.