Version: , by merk
Developer Last Online: Mar 2012
Version: Unknown
Rating:
Released: 08-28-2001
Last Update: Never
Installs: 1
No support by the author.
Well, after very little effort on my behalf, i have released version 1.2.
Not much new, however-
I have added a headlines system, which is basically it
Anyway, it works exactly the same way as the original, just setup a news forum(you can set its display order to 0, if you wish for noone to actually see it. i also recomend only allowing normal members to reply, not post
Just create a template, headlinebit and add the following
Code:
<smallfont>-></smallfont> <normalfont><a href="$forumspath/showthread.php?s=&threadid=$newsarray[threadid]">$newsarray[title]</a> by <a href=\"$forumspath/member.php?s=&action=getinfo&userid=$newsarray[postuserid]\">$newsarray[postusername]</a></normalfont><smallfont> ($dateposted)</smallfont><br>
You can customise it, and you have access to all field names in the thread table. (check out the ERD in the members area, Keir )
As easy as it is, to access the headlines(or include them) add
Not much else i can rant about, im a bit lonely tonight
Anyway, heres the script:
(attached)
PS. like most scripts, just place this into your /forum/ directory, where its with its buddies(like index.php and global.php)
I just thought of another feature to add, which will come later tonight hopefully!(most commented news items, of course which would expire after a certain date offset of the current date)
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Originally posted by IanMFT
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";
$newsquery .= " LIMIT $newsitems";
$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";
$newsquery .= " LIMIT $newsitems";
^^ Hrm, thats the one i use, and it works fine.
ok, something is REALLY screwey, i changed the 0 back to a 1(actually, i re copied the script) and its still displating the last comment instead of the news...this is quite odd. Any ideas?
Originally posted by IanMFT ok, something is REALLY screwey, i changed the 0 back to a 1(actually, i re copied the script) and its still displating the last comment instead of the news...this is quite odd. Any ideas?
while ($newsarray=$DB_site->fetch_array($passthruquery)) {
//Get date in their timezone
$dateposted = vbdate("jS F Y, H:i",$newsarray[dateline]);
//If they select anything but 'headlines' as their action, assume they want news.
if ($action != "headlines") {
//You may remove this, and replace any reference to $commenttext in the templates to Coments, or use replacment variables
//Make it plural if there is more than one comment
if ($newsarray[replycount]==1) {
$commenttext = "Comment";
}
else {
$commenttext = "Comments";
}
//Process the thread, and make it parse vBcode, and stuff
$cookedthread=bbcodeparse2($newsarray[pagetext],"1","1","1","1");
//Call the template 'newsbit' for each news entry it finds in the database
eval("\$newsbits .= \"".gettemplate("newsbit")."\";");
}
//They want headlines, so they get headlines
if ($action == "headlines") {
eval("\$newsbits .= \"".gettemplate("headlinebit")."\";");
}
}