hey i need a Php code that u can make a thred in a forum and then put it in the website and lokk the thread so only staffcan log in and edit the news.. can ne1 give me this..Plzeh? are you looking for forum software, or...? you could try phpBB (<!-- m --><a class="postlink" href="http://www.phpbb.com">http://www.phpbb.com</a><!-- m -->).I think you might be talking bout a Content Management System (CMS). I would tryphpNuke (<!-- m --><a class="postlink" href="http://phpnuke.com">http://phpnuke.com</a><!-- m -->) I think what he wants is a script to export news from a forum on which only certain member groups on a board have posting permisions.
What Forum are you using? If its InvisionBoard, I already have made such a script I could give you.If it's invision board then there is one already built into the system.Yes there is, tho, I like to make my own custom script thats seperate from the forum, gives me a bit more control over stuff.Is in Phpbb... I have one for phpBB too. (I dont like phpBB myself, but one of the site I help at uses it.)
<?php
$URL = "http://www.your-site.com/forum/"; //URL to location of forum
$prefix = "ccphpbb_"; //Forum's table prefix in database
$forumID = 9; //Numeric ID of forum to get posts from
$show = 8; //Number of posts to show
$dbhostname = "localhost";
$dbname = ""; //Database Name
$dbuser = ""; //Database Username
$dbpassword = ""; //Database User Password
$link = mysql_connect( "$dbhostname", "$dbuser", "$dbpassword" ) or die("mySQL connection error.");
mysql_select_db("$dbname", $link) or die("Database Selection Error");
$sql = "SELECT topic_id, forum_id, topic_title, topic_poster, topic_time, topic_first_post_id, topic_replies, post_id, post_subject, post_text, user_id, username
FROM ".$prefix."topics, ".$prefix."posts_text, ".$prefix."users
WHERE forum_id='".$forumID."'
AND post_id=".$prefix."topics.topic_first_post_id
AND ".$prefix."posts_text.post_id=".$prefix."topics.topic_first_post_id
AND ".$prefix."topics.topic_poster=".$prefix."users.user_id
ORDER BY topic_id DESC LIMIT 0, $show";
$query = mysql_query($sql, $link) or die("mySQL Query Error:<br>".mysql_error($link));
while( $news = mysql_fetch_array($query) ) {
$date = gmdate ( "H:i - l, F d, Y", $news['topic_time']);
$curretNews .= "<b>".$news['post_subject']."</b> by <a href=http://www.htmlforums.com/archive/index.php/\"".$URL."profile.php?mode=viewprofile&u=".$news['user_id']."\">".$news['username']."</a> at ".$date."<br>";
$curretNews .= $news['post_text']."<br>";
$curretNews .= "<a href=http://www.htmlforums.com/archive/index.php/\"".$URL."viewtopic.php?t=".$news['topic_id']."\">View Comments (".$news['topic_replies'].")</a> | <a href=http://www.htmlforums.com/archive/index.php/\"".$URL."posting.php?mode=reply&t=".$news['topic_id']."\">Post Comments</a>";
$curretNews .= "<br>";
$curretNews .= "<br>";
}
print $curretNews;
?>Originally posted by MarcinAJ
Yes there is, tho, I like to make my own custom script thats seperate from the forum, gives me a bit more control over stuff.
Good point Tanx for The code So i juss edit all the stuff up to password.. Only the top..Originally posted by 13lood
So i juss edit all the stuff up to password.. Only the top..
yep.Ok good looking out
What Forum are you using? If its InvisionBoard, I already have made such a script I could give you.If it's invision board then there is one already built into the system.Yes there is, tho, I like to make my own custom script thats seperate from the forum, gives me a bit more control over stuff.Is in Phpbb... I have one for phpBB too. (I dont like phpBB myself, but one of the site I help at uses it.)
<?php
$URL = "http://www.your-site.com/forum/"; //URL to location of forum
$prefix = "ccphpbb_"; //Forum's table prefix in database
$forumID = 9; //Numeric ID of forum to get posts from
$show = 8; //Number of posts to show
$dbhostname = "localhost";
$dbname = ""; //Database Name
$dbuser = ""; //Database Username
$dbpassword = ""; //Database User Password
$link = mysql_connect( "$dbhostname", "$dbuser", "$dbpassword" ) or die("mySQL connection error.");
mysql_select_db("$dbname", $link) or die("Database Selection Error");
$sql = "SELECT topic_id, forum_id, topic_title, topic_poster, topic_time, topic_first_post_id, topic_replies, post_id, post_subject, post_text, user_id, username
FROM ".$prefix."topics, ".$prefix."posts_text, ".$prefix."users
WHERE forum_id='".$forumID."'
AND post_id=".$prefix."topics.topic_first_post_id
AND ".$prefix."posts_text.post_id=".$prefix."topics.topic_first_post_id
AND ".$prefix."topics.topic_poster=".$prefix."users.user_id
ORDER BY topic_id DESC LIMIT 0, $show";
$query = mysql_query($sql, $link) or die("mySQL Query Error:<br>".mysql_error($link));
while( $news = mysql_fetch_array($query) ) {
$date = gmdate ( "H:i - l, F d, Y", $news['topic_time']);
$curretNews .= "<b>".$news['post_subject']."</b> by <a href=http://www.htmlforums.com/archive/index.php/\"".$URL."profile.php?mode=viewprofile&u=".$news['user_id']."\">".$news['username']."</a> at ".$date."<br>";
$curretNews .= $news['post_text']."<br>";
$curretNews .= "<a href=http://www.htmlforums.com/archive/index.php/\"".$URL."viewtopic.php?t=".$news['topic_id']."\">View Comments (".$news['topic_replies'].")</a> | <a href=http://www.htmlforums.com/archive/index.php/\"".$URL."posting.php?mode=reply&t=".$news['topic_id']."\">Post Comments</a>";
$curretNews .= "<br>";
$curretNews .= "<br>";
}
print $curretNews;
?>Originally posted by MarcinAJ
Yes there is, tho, I like to make my own custom script thats seperate from the forum, gives me a bit more control over stuff.
Good point Tanx for The code So i juss edit all the stuff up to password.. Only the top..Originally posted by 13lood
So i juss edit all the stuff up to password.. Only the top..
yep.Ok good looking out