QmQ Posted July 10, 2006 Posted July 10, 2006 Thanks for enigma1's excellent work!! from your idea, I've revised the codes so that it links to the topic content directly. forum_id was changed to post_id-1 <?php/* $Id: information.php,v 1.6 2003/02/10 22:31:00 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright ? 2003 osCommerce Released under the GNU General Public License */ tep_db_close(); tep_db_connect2() or die('Unable to connect to database server!'); $phpbb_post_query = tep_db_query2("select pt.post_subject, pt.post_text, p.post_id from phpbb_posts p left join phpbb_posts_text pt on p.post_id=pt.post_id order by pt.post_id desc limit " . MAX_DISPLAY_PHPBB_BOX_POSTS); ?> <!-- information //--> <tr> <td> <?php $forum_url = "http://www.YOURFORUM.com/viewtopic.php"; $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_FORUM); new infoBoxHeading($info_box_contents, true, false, 'http://www.YOURFORUM.com/viewtopic.php', 'NONSSL'); //if you wanna show your inbox at right column, please change the code above to //new infoBoxHeading($info_box_contents, false, true, 'http://www.YOURFORUM.com/viewtopic.php', //'NONSSL'); $forum_text = ''; while( $phpbb_post = tep_db_fetch_array($phpbb_post_query) ) { // Remove HTML tags $post_content = strip_tags($phpbb_post['post_text']); // Process PHPBB tags $post_content = phpbb_tags_to_html($post_content); $phpbb_post['post_id'] = $phpbb_post['post_id']-1; $forum_text .= '<center><b><a href="' . $forum_url . '?t=' . $phpbb_post['post_id'] . '">' . $phpbb_post['post_subject'] . '</a> </b></center>' . "\n"; //$forum_text .= "<center><br />\n---------\n</center><br />" . "\n"; $forum_text .= "<center>---------------------\n</center>"; } $forum_text = '<MARQUEE behavior= "scroll" align= "center" direction= "up" height="160" scrollamount= "2" scrolldelay= "20" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'>'.$forum_text.'</MARQUEE>' . "\n"; $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => $forum_text); new infoBox($info_box_contents); // close the connection tep_db_close2(); tep_db_connect() or die('Unable to connect to database server!'); ?> </td> </tr> <!-- information_eof //--> Quote
QmQ Posted July 11, 2006 Posted July 11, 2006 Sorry ,All I've made a mistake in my codes Here comes the correct. It shows the recent post in your phpBB forum. I kept my comments in the code, so that you can see what's the difference between the original one and my version. The code is for external database. <?php/* $Id: information.php,v 1.6 2003/02/10 22:31:00 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright ? 2003 osCommerce Released under the GNU General Public License */ tep_db_close(); tep_db_connect2() or die('Unable to connect to database server!'); $phpbb_post_query = tep_db_query2("select pt.post_subject, pt.post_text, p.post_id from phpbb_posts p left join phpbb_posts_text pt on p.post_id=pt.post_id order by pt.post_id desc limit " . MAX_DISPLAY_PHPBB_BOX_POSTS); ?> <!-- information //--> <tr> <td> <?php $forum_url = "http://www.znsunimage.com/forum/viewtopic.php"; $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_FORUM); new infoBoxHeading($info_box_contents, true, false, 'http://www.znsunimage.com/forum/index.php', 'NONSSL'); $forum_text = ''; while( $phpbb_post = tep_db_fetch_array($phpbb_post_query) ) { // Remove HTML tags $post_content = strip_tags($phpbb_post['post_text']); // Process PHPBB tags $post_content = phpbb_tags_to_html($post_content); //$phpbb_post['post_id'] = $phpbb_post['post_id']-1; //modified to remove the content SUN Zhenning $forum_text .= '<center><b><a href="' . $forum_url . '?op=modload&name=phpbb2&f=' . $phpbb_post['forum_id'] . '">' . $phpbb_post['post_subject'] . '</a></b></center><br>' . $post_content . "\n"; $forum_text .= '<center><b><a href="' . $forum_url . '?p=' . $phpbb_post['post_id'] . '">' . $phpbb_post['post_subject'] . '</a> </b></center>' . "\n"; //$forum_text .= "<center><br />\n---------\n</center><br />" . "\n"; $forum_text .= "<center>---------------------------\n</center>"; } $forum_text = '<MARQUEE behavior= "scroll" align= "center" direction= "up" height="160" scrollamount= "2" scrolldelay= "20" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'>'.$forum_text.'</MARQUEE>' . "\n"; $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => $forum_text); new infoBox($info_box_contents); // close the connection tep_db_close2(); tep_db_connect() or die('Unable to connect to database server!'); ?> </td> </tr> <!-- information_eof //--> Quote
QmQ Posted July 11, 2006 Posted July 11, 2006 New Version for show the lastest topic in the forum <?php/* $Id: information.php,v 1.6 2003/02/10 22:31:00 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright ? 2003 osCommerce Released under the GNU General Public License */ tep_db_close(); tep_db_connect2() or die('Unable to connect to database server!'); $phpbb_post_query = tep_db_query2("select pt.topic_title, p.topic_id from phpbb_topics p left join phpbb_topics pt on p.topic_id=pt.topic_id order by pt.topic_id desc limit " . MAX_DISPLAY_PHPBB_BOX_POSTS); ?> <!-- information //--> <tr> <td> <?php $forum_url = "http://www.znsunimage.com/forum/viewtopic.php"; $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_FORUM); new infoBoxHeading($info_box_contents, false, false, 'http://www.znsunimage.com/forum/index.php', 'NONSSL'); //if you put the infobox on the left top, please change codes to "...contents, true, false..." $forum_text = ''; while( $phpbb_post = tep_db_fetch_array($phpbb_post_query) ) { // Remove HTML tags $post_content = strip_tags($phpbb_post['post_text']); // Process PHPBB tags $post_content = phpbb_tags_to_html($post_content); //$phpbb_post['post_id'] = $phpbb_post['post_id']-1; $forum_text .= '<center><b><a href="' . $forum_url . '?t=' . $phpbb_post['topic_id'] . '">' . $phpbb_post['topic_title'] . '</a> </b></center>' . "\n"; //$forum_text .= "<center><br />\n---------\n</center><br />" . "\n"; $forum_text .= "<center>----------------------\n</center>"; } $forum_text = '<MARQUEE behavior= "scroll" align= "center" direction= "up" height="160" scrollamount= "2" scrolldelay= "20" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'>'.$forum_text.'</MARQUEE>' . "\n"; $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => $forum_text); new infoBox($info_box_contents); // close the connection tep_db_close2(); tep_db_connect() or die('Unable to connect to database server!'); ?> </td> </tr> <!-- information_eof //--> Quote
Guest Posted July 11, 2006 Posted July 11, 2006 If you do a contribution/update do not post the php code like this (that includes your store's urls in the http placeholders). It will create problems and confuse users. Quote
CThomas Posted February 18, 2007 Posted February 18, 2007 Hello enigma1 & Everyone Else, Was wondering if you, or anyone else, might help me with trying to keep non approved posts from showing in the phpbb scrolling box. I have everything working fine between the shopping cart and the forum, and the phpbb scrolling box. I've installed a phpbb add on called Approval, which makes posts not viewable until they've been approved, and it works fine as well. This add on adds a post_approve column to the phpbb_posts TABLE, and inserts a '1', for unapproved posts, and a '0' when/if the post is approved. I don't know much about php or MySql, but I have installed a large number of contributions, so I am not completely unfamiliar with them either. I have been trying for awhile now to make the phpbb scrolling box exclude unapproved posts using variations of: if ($post_approve == '0') { and adding: p.post_approve to the phpbb_post_query in the phpbb scrolling box file. I have had no success, and just cannot figure out how it should all go. I am thinking that it would be rather simple, if I knew what I was doing. At this point I have reached the limits of what I can do. A little help would be much appreciated. Thanks for the contribution, and thanks in advance for any input you, or anyone else might have. Regards, CT Quote
Guest Posted March 14, 2007 Posted March 14, 2007 yes change the query for your new column in the phpbb_forum.php box file: from this: $phpbb_post_query = tep_db_query("select pt.post_subject, pt.post_text, p.forum_id from phpbb_posts p left join phpbb_posts_text pt on p.post_id=pt.post_id order by pt.post_id desc limit " . MAX_DISPLAY_PHPBB_BOX_POSTS); to this: $phpbb_post_query = tep_db_query("select pt.post_subject, pt.post_text, p.forum_id from phpbb_posts p left join phpbb_posts_text pt on p.post_id=pt.post_id where post_approve='0' order by pt.post_id desc limit " . MAX_DISPLAY_PHPBB_BOX_POSTS); this should do for the column you added. Quote
vibe107fm Posted September 1, 2007 Posted September 1, 2007 hey People. i am thinking of having a PHpbb forum on my website.... is there a way i can intergrate it into my shop? kinda so it uses the shops header and footer? Hope someone knows what i mean! Cheers, Andy Quote
Chubz Posted September 1, 2007 Posted September 1, 2007 Has anyone looked at integrating with CH version of phpBB? It was developed as a phpBB mod to give sub-forum & sub-catogory capability but it almost its own system now and is far more secure, much faster, and lighter on SQL than standard phpBB. Pretty much what phpBB have been trying to achieve with phpBB3 and it has been stable for over 2 years! http://www.ptifo.clanmckeen.com/index.php I swear by it & if someone could find a way to integrate, we would all benefit :) Quote
Silverado05 Posted September 2, 2007 Posted September 2, 2007 hey People. i am thinking of having a PHpbb forum on my website.... is there a way i can intergrate it into my shop? kinda so it uses the shops header and footer? Hope someone knows what i mean! Cheers, Andy Search the contributions for phpBB it will bring up an integration for it. Quote Search the forum and contributions before posting. If that doesn't work, keep looking, then post. The forum is for seeking help and advice NOT for someone to do your work for you. Try to do something on your on, if you are going to run a shop then learn how it works.
leveera Posted August 12, 2008 Posted August 12, 2008 Hello, Just installed v1.02 for internal forum Please advice how to make a links in boxes/phpbb_forum.php to work? I have all links broken because this code reffers to FILENAME_BBMODULES what is not a part of OSC or phpBB instalations and not included in the contribution. new infoBoxHeading($info_box_contents, true, true, tep_href_link(FILENAME_BBMODULES, 'op=modload&name=phpbb2&file=index.php', 'NONSSL')); Thanks Sergei Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.