Ok 3 days ago i was looking for a Php code that u can put in a page and u can post things and it come out in a page so u can edit news.. this was for Phpbb now i need 1 for Invision power boards can ne1 give me it??
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.
Something like this ^^ yo MarcinAJ if u see this post plz give it to me..<!-- m --><a class="postlink" href="http://www.htmlforums.com/showthread.php?s=&postid=234365#post234365">http://www.htmlforums.com/showthread.ph ... post234365</a><!-- m -->
he already gave it to you. just change what you need to get it to work with the new forum. scoutt, Invision uses different database structure, so you would need to redo the query. Easier to do a query for Invision than for phpBB but still a bit much for some one whos not got alot of experiance.
<?php
$URL = "http://www.your-site.com/forum/"; //URL to location of forum
$prefix = "GP_"; //Forum's table prefix in database
$forumID = 1; //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: <br>".mysql_error($link));
mysql_select_db("$dbname", $link) or die("Database Selection Error");
$sql = "SELECT post, topic_id, ".$prefix."posts.forum_id, new_topic, tid, title, posts,
starter_id, start_date, starter_name, views
FROM ".$prefix."posts, ".$prefix."topics
WHERE ".$prefix."posts.forum_id = '$forumID'
AND topic_id=tid
AND new_topic = 1
ORDER BY tid 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[start_date]);
$curretNews .= "<b>$news[title]</b> by <a href=http://www.htmlforums.com/archive/index.php/\"".$URL."index.php?showuser=$news[starter_id]\">$news[starter_name]</a> at $date<br>";
$curretNews .= "$news[post]<br>";
$curretNews .= "<a href=http://www.htmlforums.com/archive/index.php/\"".$URL."index.php?showtopic=$news[topic_id]\"> <b>View Comments ($news[posts])</b></a> : $news[views] Views";
$curretNews .= "<hr style=\"margin-bottom: 2em; border-bottom: 1px solid #9AA7B6;\">";
}
print $curretNews;
?>
13lood > next time just add a reply in the currently running thread since its pretty much in the same topic area.Originally posted by scoutt
just change what you need to get it to work with the new forum.
that is why I said that
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.
Something like this ^^ yo MarcinAJ if u see this post plz give it to me..<!-- m --><a class="postlink" href="http://www.htmlforums.com/showthread.php?s=&postid=234365#post234365">http://www.htmlforums.com/showthread.ph ... post234365</a><!-- m -->
he already gave it to you. just change what you need to get it to work with the new forum. scoutt, Invision uses different database structure, so you would need to redo the query. Easier to do a query for Invision than for phpBB but still a bit much for some one whos not got alot of experiance.
<?php
$URL = "http://www.your-site.com/forum/"; //URL to location of forum
$prefix = "GP_"; //Forum's table prefix in database
$forumID = 1; //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: <br>".mysql_error($link));
mysql_select_db("$dbname", $link) or die("Database Selection Error");
$sql = "SELECT post, topic_id, ".$prefix."posts.forum_id, new_topic, tid, title, posts,
starter_id, start_date, starter_name, views
FROM ".$prefix."posts, ".$prefix."topics
WHERE ".$prefix."posts.forum_id = '$forumID'
AND topic_id=tid
AND new_topic = 1
ORDER BY tid 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[start_date]);
$curretNews .= "<b>$news[title]</b> by <a href=http://www.htmlforums.com/archive/index.php/\"".$URL."index.php?showuser=$news[starter_id]\">$news[starter_name]</a> at $date<br>";
$curretNews .= "$news[post]<br>";
$curretNews .= "<a href=http://www.htmlforums.com/archive/index.php/\"".$URL."index.php?showtopic=$news[topic_id]\"> <b>View Comments ($news[posts])</b></a> : $news[views] Views";
$curretNews .= "<hr style=\"margin-bottom: 2em; border-bottom: 1px solid #9AA7B6;\">";
}
print $curretNews;
?>
13lood > next time just add a reply in the currently running thread since its pretty much in the same topic area.Originally posted by scoutt
just change what you need to get it to work with the new forum.
that is why I said that