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]);
$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";
OK, this little request is going to throw a major complication into the works, I know, but I just have to ask.
Instead of limiting the number of news items that show up to a fixed number (with $newsitems), could there be a way to show news items during the past certain amount of time? For example, show all from the past two days, or something like that (the time limit would be a admin-set variable, just like $newsitems).
Im not actually sure if this works, im at work at the moment, and i dont have access to my database to test it.
Basically i just added the last line to $newsquery.
Watch out for v1.5 soon!
Itll have more features! (who knows what at the moment )
I plan on adding multiple forum support, which ive done in my version, but its only basic, and you need to know the forumid(any forumid works atm, gotta fix that)
Maybe news headlines, just like PluhNews, i like that feature.
Im also working on OPColumns, which will do similar features to here.
If you can sugest any more features you would like, ill try work on them
$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";
NOT sure... my SQL is a bit rusty
Your ALMOST right. just you need to add a SPACE before the start of limit, just my coding style