Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

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 //-->

  • Replies 59
  • Created
  • Last Reply

Top Posters In This Topic

Posted

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 //-->

Posted

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 //-->

Posted

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.

  • 7 months later...
Posted

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

  • 4 weeks later...
Posted

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.

  • 5 months later...
Posted

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

Posted

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 :)

Posted
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.

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.

  • 11 months later...
Posted

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...