phpBB forum and site integration

I will no longer provide phpBB2 support due to phpBB2's EOL announcement. If you need help with phpBB2 you can try phpBB2 Refugees.
Locked
WK_tmp
Posts: 12
Joined: Fri Jan 19, 2007 2:50 am

phpBB forum and site integration

Post by WK_tmp »

Hi David,

I am not sure with solution for more complicated problem.

I want add following feature for my site pages (I use Perl+mySql for page generation):
There will be the button "Discuss this article" at the end of each article.

This button keeps simply link if topic exist (/viewtopic.php?t=topic_ID).

The main problem is to create new topic and transfer there the article title and id.

1. The 1-st way is to insert rows into phpBB tables from my perl routines, namely into:
topics (insert article title);
posts and posts_text (insert "The discussion of article Article_Title");
and others tables.

But there is a lot of problem on this way:
Identification of user_id and session_id, user permissions, etc.

So to escape phpBB simulation at perl I hope on the 2-nd way.

2. I should to transfer to posting.php module article title and article id.
And posting.php has to fill in fields subject and message with predefined values.

So solution could be consist of following posting.php modifications:
a) to expand input params list to accept these two values
or b) get these values through temporal mySql table
c) initialize values obtained for subject and message fields
d) set relation of my article with new topic (in mysite_Article_Table or phpBB_topic nomatter) when user had succesfully sent new topic. It needs for future article views with link assigned to existing topic.

I hope on your help.
Are there analogous mods?
What way is more preferrable on your sight?
Are changes a-d) concerned above restricted by posting.php module only? Or changes will be more wide?

Thanx.
DavidIQ
Site Admin
Posts: 619
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

Post by DavidIQ »

So you basically want to have a discuss button that creates a topic when clicked on? Or that it will take the user to an already created topic? Not sure which of the two you're trying to accomplish here. If there is to be a list of discussion topics then I suppose just adding a column to the topics table, call it discussion, and have it set to 1 or 0 and then do a SELECT * FROM phpbb_topics WHERE discussion = 1 would give you a list of the topics for discussion.
WK_tmp
Posts: 12
Joined: Fri Jan 19, 2007 2:50 am

Post by WK_tmp »

DavidIQ wrote:So you basically want to have a discuss button that creates a topic when clicked on? Or that it will take the user to an already created topic? Not sure which of the two you're trying to accomplish here...
There are near 150 articles (product descriptions) and near 50 articles with technology notes and solutions. So I wouldn't like to create in advance 200 empty topics (1 empty topic per article). The forum will be as dustbin.

So the button will be act depending on "Does exist there relation between article and topic?"

Code: Select all

if (Link_exist) 
{
$button_prompt = "View the discussion of the topic";
$forum_link = $myboard.'/viewtopic.php?t='.$topic_id;
}
else
{
$button_prompt = "Start discussion of the topic";
$forum_link = $myboard."/posting.php?mode=newtopic&f='$forum_id'".
   "&title='$topic_title'".     # e.g. 'Ethernet in the First Mile'
   "&message='$standart_invitation'". # 'You can see article here by link'
   "&link='$article_link'";   # e.g. '?do=showtech&id=37'
}
Locked