<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[PunBB Forums — Wordpress plugin to post to PunBB]]></title>
		<link>https://punbb.informer.com/forums/topic/8373/wordpress-plugin-to-post-to-punbb/</link>
		<atom:link href="https://punbb.informer.com/forums/feed/rss/topic/8373/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Wordpress plugin to post to PunBB.]]></description>
		<lastBuildDate>Fri, 17 Oct 2008 03:49:56 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Wordpress plugin to post to PunBB]]></title>
			<link>https://punbb.informer.com/forums/post/118393/#p118393</link>
			<description><![CDATA[<p>ok that was a silly goofy on my part.. i had to go to the settings and configure the plugin. but now when i use it... it does the job but the post.php is a blank screen...</p><p>errrr</p><p>Q</p>]]></description>
			<author><![CDATA[null@example.com (quaker)]]></author>
			<pubDate>Fri, 17 Oct 2008 03:49:56 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/118393/#p118393</guid>
		</item>
		<item>
			<title><![CDATA[Re: Wordpress plugin to post to PunBB]]></title>
			<link>https://punbb.informer.com/forums/post/118392/#p118392</link>
			<description><![CDATA[<p>this is the error im getting..<br /></p><div class="codebox"><pre><code>Warning: require(config.php) [function.require]: failed to open stream: No such file or directory in /home/quaker/public_html/wp-content/plugins/ih_wp2punbb.php on line 23

Warning: require(config.php) [function.require]: failed to open stream: No such file or directory in /home/quaker/public_html/wp-content/plugins/ih_wp2punbb.php on line 23</code></pre></div><p>how do i set the punbb root ?????????</p><p>Q</p>]]></description>
			<author><![CDATA[null@example.com (quaker)]]></author>
			<pubDate>Fri, 17 Oct 2008 03:29:56 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/118392/#p118392</guid>
		</item>
		<item>
			<title><![CDATA[Re: Wordpress plugin to post to PunBB]]></title>
			<link>https://punbb.informer.com/forums/post/103432/#p103432</link>
			<description><![CDATA[<p>I install the plugin without error under Wordpress. <img src="https://punbb.informer.com/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /><br />But I&#039;ve got a error on Punbb. <img src="https://punbb.informer.com/forums/img/smilies/sad.png" width="15" height="15" alt="sad" /><br /></p><div class="codebox"><pre><code>An error was encountered
Error: Unable to create topic.

Fatal error: Call to a member function close() on a non-object in C:\wamp\www\wordpress\forum\include\functions.php on line 1122</code></pre></div><p>Where I made a mistake. <img src="https://punbb.informer.com/forums/img/smilies/hmm.png" width="15" height="15" alt="hmm" /></p>]]></description>
			<author><![CDATA[null@example.com (Bloody)]]></author>
			<pubDate>Fri, 09 Nov 2007 19:28:42 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/103432/#p103432</guid>
		</item>
		<item>
			<title><![CDATA[Re: Wordpress plugin to post to PunBB]]></title>
			<link>https://punbb.informer.com/forums/post/98671/#p98671</link>
			<description><![CDATA[<p>Ive tried this but im not getting anything.&nbsp; Nothing gets posted to my forum from wordpress.&nbsp; Is there a way to set this when you want it to be posted to that specific forum or every time you post its going to go in that forum??</p>]]></description>
			<author><![CDATA[null@example.com (MaryJane197)]]></author>
			<pubDate>Sat, 28 Jul 2007 01:34:38 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/98671/#p98671</guid>
		</item>
		<item>
			<title><![CDATA[Re: Wordpress plugin to post to PunBB]]></title>
			<link>https://punbb.informer.com/forums/post/94050/#p94050</link>
			<description><![CDATA[<p>Looks interesting guys, doesn&#039;t work for me, and I don&#039;t think my php skills are so great as to be of help.</p>]]></description>
			<author><![CDATA[null@example.com (tommy2toes)]]></author>
			<pubDate>Fri, 11 May 2007 01:33:49 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/94050/#p94050</guid>
		</item>
		<item>
			<title><![CDATA[Re: Wordpress plugin to post to PunBB]]></title>
			<link>https://punbb.informer.com/forums/post/92088/#p92088</link>
			<description><![CDATA[<div class="codebox"><pre><code>&lt;?php ih_add_comment($post-&gt;ID); ?&gt;</code></pre></div><p>Isn&#039;t working for me. But there isn&#039;t any meta field in my posts also. So I guess it has something to do with that?!?</p><p>Maybe it has something tot do with the Wordpress update to 2.1?! Or has anyone it working with 2.1?!</p>]]></description>
			<author><![CDATA[null@example.com (r0nh)]]></author>
			<pubDate>Wed, 18 Apr 2007 07:36:27 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/92088/#p92088</guid>
		</item>
		<item>
			<title><![CDATA[Re: Wordpress plugin to post to PunBB]]></title>
			<link>https://punbb.informer.com/forums/post/91959/#p91959</link>
			<description><![CDATA[<p>They&#039;re not that long. They seem to be getting truncated around 200-300 characters.</p>]]></description>
			<author><![CDATA[null@example.com (theCurtis)]]></author>
			<pubDate>Mon, 16 Apr 2007 04:26:31 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/91959/#p91959</guid>
		</item>
		<item>
			<title><![CDATA[Re: Wordpress plugin to post to PunBB]]></title>
			<link>https://punbb.informer.com/forums/post/91952/#p91952</link>
			<description><![CDATA[<div class="quotebox"><cite>theCurtis wrote:</cite><blockquote><p>I&#039;ve integrated the code but the message gets truncated in the forum post for some reason. Is that a limitation set somewhere? If so, I can&#039;t seem to find it.</p></blockquote></div><p>If your posts are really long (long enough to overflow a TEXT field, which is 65535 charcaters), you might have to change the column to a MEDIUMTEXT</p>]]></description>
			<author><![CDATA[null@example.com (Smartys)]]></author>
			<pubDate>Mon, 16 Apr 2007 01:38:59 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/91952/#p91952</guid>
		</item>
		<item>
			<title><![CDATA[Re: Wordpress plugin to post to PunBB]]></title>
			<link>https://punbb.informer.com/forums/post/91951/#p91951</link>
			<description><![CDATA[<p>I&#039;ve integrated the code but the message gets truncated in the forum post for some reason. Is that a limitation set somewhere? If so, I can&#039;t seem to find it.</p>]]></description>
			<author><![CDATA[null@example.com (theCurtis)]]></author>
			<pubDate>Mon, 16 Apr 2007 01:15:39 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/91951/#p91951</guid>
		</item>
		<item>
			<title><![CDATA[Re: Wordpress plugin to post to PunBB]]></title>
			<link>https://punbb.informer.com/forums/post/91754/#p91754</link>
			<description><![CDATA[<p>Added to your code.</p><p>The following code:<br />Doesn&#039;t post if the same one already exists.<br />Changes the title of the forum thread upon edit.<br />Upon insertion places a post inside the thread that links back to the original word press post.</p><p>Placing: &lt;?php ih_add_comment($post-&gt;ID); ?&gt;</p><p>in sinple_post.php and index.php allows you to directly link to the forum post from the word press article.</p><br /><p>you can get the code here:</p><p><a href="http://www.randallpotter.com/code/ih_wp2punbb2.phps">click here</a></p>]]></description>
			<author><![CDATA[null@example.com (Rantheman)]]></author>
			<pubDate>Fri, 13 Apr 2007 21:44:50 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/91754/#p91754</guid>
		</item>
		<item>
			<title><![CDATA[Re: Wordpress plugin to post to PunBB]]></title>
			<link>https://punbb.informer.com/forums/post/91723/#p91723</link>
			<description><![CDATA[<p>It&#039;s great to see that someone is working on this. I&#039;ll try your changes as soon as I have a test installation running.</p><p>My code for preventing new forum posts every time the wordpress post is updated looks like this: </p><div class="codebox"><pre><code>// Create nothing if the post already has topicid
$tid = get_post_meta($post_id, &#039;topicid&#039;, TRUE);
if($tid) {
    return $post_id;
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Dataclown)]]></author>
			<pubDate>Fri, 13 Apr 2007 17:25:16 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/91723/#p91723</guid>
		</item>
		<item>
			<title><![CDATA[Re: Wordpress plugin to post to PunBB]]></title>
			<link>https://punbb.informer.com/forums/post/91720/#p91720</link>
			<description><![CDATA[<p>This is an old post but I&#039;ve got updated code.<br />The code below will create the thread in your punbb installation but it will also update the last post status on the forum index right off the bat and update the post counts for that forum right off the bat.</p><p>Things to do today:<br />1.&nbsp; Make it to where when you edit a post in the blog it updates the thread in the forums.<br />2.&nbsp; When you delete a post in the blog it deletes the thread in the forum (maybe - have to think of usability - blog thread might have started a great discussion that you want to keep)<br />3.&nbsp; When you add a comment to the blog it adds it to the forum thread as a reply.</p><p>Things for consideration:<br />1.&nbsp; If user deletes their comment out of the forum does it delete it out of the blog?&nbsp; This would require a reverse method as it integrates punbb into WP not WP into punbb.<br />2.&nbsp; If user edits their comment in the forum does it edit in the blog?</p><p>After considering those two options and other usability items - it might be beneficial to disable manual replies and editing for that forum in punbb and make it to where all that takes place in WP.&nbsp; This keeps the comments in one place.&nbsp; (It also makes my work load lighter today haha)<br />Might get around to those considerations when I have time.</p><p>Any rate here&#039;s my contribution:<br />&lt;?php<br />/*<br />Plugin Name: Ian&#039;s WordPress2PunBB plugin<br />Plugin URI: <a href="http://punbb.org/forums/viewtopic.php?id=8373">http://punbb.org/forums/viewtopic.php?id=8373</a><br />Description: Sends a new post to a comment forum in punbb<br />Version: 0.2<br />Revision Author: Randall Potter<br />Revision Author URL: services.randallpotter.com&nbsp; <br />Original Author: Ian Huston<br />Original Author URI: <a href="http://www.ianhuston.net">http://www.ianhuston.net</a><br />*/</p><p>/*Main Wordpress post processing function*/<br />function ih_wp2punbb( $post_id )<br />{<br />//get wordpress options and define variables<br />$punbb_info = get_option(&quot;wp2punbb_info&quot;);<br />$username = $punbb_info[0];<br />$pun_user[&#039;id&#039;] = $punbb_info[2];<br />$userid = $punbb_info[2];</p><p>$fid = $punbb_info[1];<br />define(&#039;PUN_ROOT&#039;, $punbb_info[3]);</p><p>global $wpdb;<br />//include punbb functions needed<br />require PUN_ROOT.&#039;config.php&#039;;<br />require PUN_ROOT.&#039;/include/functions.php&#039;;<br />require PUN_ROOT.&#039;/include/dblayer/common_db.php&#039;;</p><p>// Start a transaction<br />$db-&gt;start_transaction();</p><br /><p>//fetch and process wp data<br />$postdata = get_postdata($post_id);<br />$message = $postdata[&#039;Content&#039;];<br />$message = ih_cleanArticle($message);<br />$subject = $postdata[&#039;Title&#039;];<br />$now = time();</p><br /><p>// Create the topic<br />$db-&gt;query(&#039;INSERT INTO &#039;.$db-&gt;prefix.&#039;topics (poster, subject, posted, last_post, last_poster, forum_id) VALUES(\&#039;&#039;.$db-&gt;escape($username).&#039;\&#039;, \&#039;&#039;.$db-&gt;escape($subject).&#039;\&#039;, &#039;.$now.&#039;, &#039;.$now.&#039;, \&#039;&#039;.$db-&gt;escape($username).&#039;\&#039;, &#039;.$fid.&#039;)&#039;) or error(&#039;Unable to create topic&#039;, __FILE__, __LINE__, $db-&gt;error());<br />$new_tid = $db-&gt;insert_id();</p><p>// Create the post (&quot;topic post&quot;)<br />$db-&gt;query(&#039;INSERT INTO &#039;.$db-&gt;prefix.&#039;posts (poster, poster_id, poster_ip, message, hide_smilies, posted, topic_id) VALUES(\&#039;&#039;.$db-&gt;escape($username).&#039;\&#039;, &#039;.$pun_user[&#039;id&#039;].&#039;, \&#039;&#039;.$_SERVER[&#039;REMOTE_ADDR&#039;].&#039;\&#039;, \&#039;&#039;.$db-&gt;escape($message).&#039;\&#039;, \&#039;&#039;.$hide_smilies.&#039;\&#039;, &#039;.$now.&#039;, &#039;.$new_tid.&#039;)&#039;) or error(&#039;Unable to create post&#039;, __FILE__, __LINE__, $db-&gt;error());</p><p>$new_pid = $db-&gt;insert_id();</p><p>// Update the topic with last_post_id<br />$db-&gt;query(&#039;UPDATE &#039;.$db-&gt;prefix.&#039;topics SET last_post_id=&#039;.$new_pid.&#039; WHERE id=&#039;.$new_tid) or error(&#039;Unable to update topic&#039;, __FILE__, __LINE__, $db-&gt;error());</p><p>/*not implemented yet due to function conflicts<br />update_search_index(&#039;post&#039;, $new_pid, $message, $subject);</p><p>update_forum($fid);*/</p><p>$low_prio = ($db_type == &#039;mysql&#039;) ? &#039;LOW_PRIORITY &#039; : &#039;&#039;;<br />$db-&gt;query(&#039;UPDATE &#039;.$low_prio.$db-&gt;prefix.&#039;users SET num_posts=num_posts+1, last_post=&#039;.$now.&#039; WHERE id=&#039;.$pun_user[&#039;id&#039;]) or error(&#039;Unable to update user&#039;, __FILE__, __LINE__, $db-&gt;error());<br />//$querystring = &quot; &quot;;<br />$db-&gt;query(&#039;UPDATE &#039;.$low_prio.$db-&gt;prefix.&#039;forums SET num_topics=num_topics+1, last_post=&#039;.$now.&#039;, last_post_id=\&#039;&#039;.$pun_user[&#039;id&#039;].&#039;\&#039;, last_poster=\&#039;&#039;.$db-&gt;escape($username).&#039;\&#039; WHERE id=19&#039;) or error(&#039;Unable to update forum&#039;, __FILE__, __LINE__, $db-&gt;error());</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </p><p>//add custom field to wordpress post<br />$qry = &quot;INSERT INTO {$wpdb-&gt;postmeta} (Post_ID, meta_key, meta_value) VALUES ({$post_id}, &#039;topicid&#039;,&#039;{$new_tid}&#039;);&quot;;</p><p>$wpdb-&gt;query($qry);</p><p>return $post_id;<br />}</p><br /><p>/* Cleans WordPress HTML and adds BBCode. <br />&nbsp; &nbsp; This is from NP_PunBB at <a href="http://nupusi.com">http://nupusi.com</a>, by Radek HULAN, Bert Garcia and Rickard Andersson. I just removed some Nucleus specific stuff*/<br />function ih_cleanArticle($article)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; global $CONF;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; // Make sure all linebreaks are \n<br />&nbsp; &nbsp; &nbsp; &nbsp; $article = str_replace(&quot;\r&quot;, &quot;&quot;, $article);<br />&nbsp; &nbsp; &nbsp; &nbsp; // convert links into bbCode<br />&nbsp; &nbsp; &nbsp; &nbsp; $article = preg_replace(&#039;/&lt;a(.*?)href=[\&#039;|\&quot;](.*?)[\&#039;|\&quot;]&gt;(.*?)&lt;\/a&gt;/&#039;, &#039;<a href="http://$2">$3</a>&#039;, $article); </p><p>&nbsp; &nbsp; &nbsp; &nbsp; $article = preg_replace(&#039;/&lt;img(.*?)src=[\&#039;|\&quot;](.*?)[\&#039;|\&quot;]&gt;/&#039;, &#039;[img]$2[/img]&#039;, $article); <br />&nbsp; &nbsp; &nbsp; &nbsp; $article = preg_replace(&#039;/&lt;%(.*?)%&gt;/&#039;, &#039;&#039;, $article);<br />&nbsp; &nbsp; &nbsp; &nbsp; // do bold, italic and underline<br />&nbsp; &nbsp; &nbsp; &nbsp; $article = str_replace(array(&#039;&lt;b&gt;&#039;, &#039;&lt;/b&gt;&#039;, &#039;&lt;i&gt;&#039;, &#039;&lt;/i&gt;&#039;, &#039;&lt;u&gt;&#039;, &#039;&lt;/u&gt;&#039;), array(&#039;<strong>&#039;, &#039;</strong>&#039;, &#039;<em>&#039;, &#039;</em>&#039;, &#039;<span class="bbu">&#039;, &#039;</span>&#039;), $article);<br />&nbsp; &nbsp; &nbsp; &nbsp; // pre/code into bbCode<br />&nbsp; &nbsp; &nbsp; &nbsp; $article = str_replace(&#039;&lt;pre&gt;&#039;, &quot;</p><div class="codebox"><pre><code>&quot;, $article);
        $article = str_replace(&#039;&lt;/pre&gt;&#039;, &quot;</code></pre></div><p>&quot;, $article);<br />&nbsp; &nbsp; &nbsp; &nbsp; $article = str_replace(&#039;&lt;code&gt;&#039;, &quot;</p><div class="codebox"><pre><code>&quot;, $article);
        $article = str_replace(&#039;&lt;/code&gt;&#039;, &quot;</code></pre></div><p>&quot;, $article);<br />&nbsp; &nbsp; &nbsp; &nbsp; // blockquote into bbCode<br />&nbsp; &nbsp; &nbsp; &nbsp; $article=str_replace(&#039;&lt;blockquote&gt;&#039;,&quot;</p><div class="quotebox"><blockquote><p>&quot;,$article);<br />&nbsp; &nbsp; &nbsp; &nbsp; $article=str_replace(&#039;&lt;/blockquote&gt;&#039;,&quot;</p></blockquote></div><p>&quot;,$article);<br />&nbsp; &nbsp; &nbsp; &nbsp; // ending tags into line breaks<br />&nbsp; &nbsp; &nbsp; &nbsp; $article = str_replace(&#039;&lt;/p&gt;&#039;, &quot;\n\n&quot;, $article);<br />&nbsp; &nbsp; &nbsp; &nbsp; $article = str_replace(&quot;&lt;br /&gt;\n&quot;, &quot;\n&quot;, $article);<br />&nbsp; &nbsp; &nbsp; &nbsp; $article = str_replace(&#039;&lt;br /&gt;&#039;, &quot;\n&quot;, $article);<br />&nbsp; &nbsp; &nbsp; &nbsp; $article = str_replace(&quot;&lt;br&gt;\n&quot;, &quot;\n&quot;, $article);<br />&nbsp; &nbsp; &nbsp; &nbsp; $article = str_replace(&#039;&lt;br&gt;&#039;, &quot;\n&quot;, $article);<br />&nbsp; &nbsp; &nbsp; &nbsp; $article = str_replace(&#039;&lt;/li&gt;&#039;, &quot;\n&quot;, $article); <br />&nbsp; &nbsp; &nbsp; &nbsp; // lists<br />&nbsp; &nbsp; &nbsp; &nbsp; $article = str_replace(&#039;&lt;li&gt;&#039;, &quot;* &quot;, $article); <br />&nbsp; &nbsp; &nbsp; &nbsp; // headlines in bold<br />&nbsp; &nbsp; &nbsp; &nbsp; $article = preg_replace(&#039;/&lt;h(.*?)&gt;(.*?)&lt;\/h(.*?)&gt;/&#039;, &quot;<strong>$2</strong>\n&quot;, $article); <br />&nbsp; &nbsp; &nbsp; &nbsp; // strip all other tags<br />&nbsp; &nbsp; &nbsp; &nbsp; $article = trim(strip_tags($article));<br />&nbsp; &nbsp; &nbsp; &nbsp; // convert &lt; and &gt; if entered to display code<br />&nbsp; &nbsp; &nbsp; &nbsp; $article = str_replace(array(&#039;&lt;&#039;, &#039;&gt;&#039;), array(&#039;&lt;&#039;, &#039;&gt;&#039;), $article);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; return $article;<br />&nbsp; &nbsp; }</p><p>//Adds a link to the relevant forum topic<br />function ih_add_comment($post_id)<br />{<br />&nbsp; &nbsp; $punbb_info = get_option(&quot;wp2punbb_info&quot;);<br />&nbsp; &nbsp; $forumurl = $punbb_info[4];<br />&nbsp; &nbsp; $commentlink = $punbb_info[5];<br />&nbsp; &nbsp; $tid = get_post_meta($post_id, &#039;topicid&#039;, TRUE);<br />&nbsp; &nbsp; if($tid){<br />&nbsp; &nbsp; //echo &#039;| asdf&lt;a href=&quot;&#039;.$forumurl.&#039;viewtopic.php?id=&#039;.$tid.&#039;&quot;&gt;&#039;.$commentlink.&#039;&lt;/a&gt;asdf&#039;;<br />&nbsp; &nbsp; echo (&#039;&lt;a href=&quot;&#039;.$forumurl.&#039;viewtopic.php?id=&#039;.$tid.&#039;&quot;&gt;Discuss in Forum&lt;/a&gt; | &#039;);<br />&nbsp; &nbsp; }<br />}</p><p>//Wordpress options handler<br />function ih_add_pages()<br />{<br />add_options_page(&#039;WP2PunBB&#039;, &#039;WP2PunBB&#039;, 8, __FILE__, &#039;ih_options_page&#039;);<br />}<br />//Wordpress Options page interface<br />function ih_options_page()<br />{<br /> if (isset($_POST[&#039;info_update&#039;])) {<br />&nbsp; &nbsp; $punbb_info[0]=$_POST[&#039;username&#039;];<br />&nbsp; &nbsp; $punbb_info[1]=$_POST[&#039;forumid&#039;];<br />&nbsp; &nbsp; $punbb_info[2]=$_POST[&#039;userid&#039;];<br />&nbsp; &nbsp; $punbb_info[3]=$_POST[&#039;forumdir&#039;];<br />&nbsp; &nbsp; $punbb_info[4]=$_POST[&#039;forumurl&#039;];<br />&nbsp; &nbsp; $punbb_info[5]=$_POST[&#039;commentlink&#039;];</p><p>&nbsp; &nbsp; update_option(&quot;wp2punbb_info&quot;, $punbb_info);<br />?&gt;&lt;div class=&quot;updated&quot;&gt;&lt;p&gt;&lt;strong&gt;Options updated&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;&lt;?php<br />&nbsp; &nbsp; } <br />$punbb_info = get_option(&quot;wp2punbb_info&quot;);</p><p>?&gt;<br />&lt;div class=wrap&gt;<br />&nbsp; &lt;form method=&quot;post&quot;&gt;<br />&nbsp; &nbsp; &lt;h2&gt;Ians WP2PunBB Plugin&lt;/h2&gt;<br />&nbsp; &nbsp; &nbsp;&lt;fieldset name=&quot;set1&quot;&gt;<br />&nbsp; &nbsp; &lt;legend&gt;PunBB forum options&lt;/legend&gt;<br />&nbsp; &nbsp; &lt;h3&gt;PunBB username:&lt;input type=text name=&quot;username&quot; value=&quot;&lt;?php echo $punbb_info[0];?&gt;&quot; /&gt;&lt;/h3&gt;<br />&nbsp; &nbsp; &lt;h3&gt;PunBB user ID:&lt;input type=text name=&quot;userid&quot; value=&quot;&lt;?php echo $punbb_info[2];?&gt;&quot; /&gt;&lt;/h3&gt;<br />&nbsp; &nbsp; &lt;h3&gt;PunBB comment forum ID:&lt;input type=text name=&quot;forumid&quot; value=&quot;&lt;?php echo $punbb_info[1];?&gt;&quot; /&gt;&lt;/h3&gt;<br />&nbsp; &nbsp; &lt;h3&gt;Comment link text:&lt;input type=text name=&quot;commentlink&quot; value=&quot;&lt;?php echo $punbb_info[5];?&gt;&quot; /&gt;&lt;/h3&gt;<br />&nbsp; &nbsp; &lt;h3&gt;URL to punbb:&lt;input type=text name=&quot;forumurl&quot; value=&quot;&lt;?php echo $punbb_info[4];?&gt;&quot; /&gt;&lt;/h3&gt;<br />&nbsp; &nbsp; &lt;em&gt;Include final slash e.g. <a href="http://www.example.com/forum/">http://www.example.com/forum/</a>&lt;/em&gt;<br />&nbsp; &nbsp; &lt;h3&gt;Absolute path to punbb:&lt;input type=text name=&quot;forumdir&quot; value=&quot;&lt;?php echo $punbb_info[3];?&gt;&quot; /&gt;&lt;/h3&gt;<br />&nbsp; &nbsp; &lt;em&gt;Include final slash e.g. /var/www/httpdocs/forum/&lt;/em&gt;<br />&nbsp; &nbsp; &nbsp;&lt;/fieldset&gt;<br />&lt;div class=&quot;submit&quot;&gt;<br />&nbsp; &lt;input type=&quot;submit&quot; name=&quot;info_update&quot; value=&quot;&lt;?php<br />&nbsp; &nbsp; _e(&#039;Update options&#039;, &#039;Localization name&#039;)<br />&nbsp; &nbsp; ?&gt;&quot; /&gt;&lt;/div&gt;<br />&nbsp; &lt;/form&gt;<br /> &lt;/div&gt; <br />&lt;?php<br />}</p><p>//Add wordpress plugin hooks<br />add_action(&#039;save_post&#039;, &#039;ih_wp2punbb&#039;, 8);<br />add_action(&#039;admin_menu&#039;, &#039;ih_add_pages&#039;);<br />//</p><br /><p>forums messed with the code a little:</p><p>this is the main change:</p><p>update_forum($fid);*/</p><p>$low_prio = ($db_type == &#039;mysql&#039;) ? &#039;LOW_PRIORITY &#039; : &#039;&#039;;<br />$db-&gt;query(&#039;UPDATE &#039;.$low_prio.$db-&gt;prefix.&#039;users SET num_posts=num_posts+1, last_post=&#039;.$now.&#039; WHERE id=&#039;.$pun_user[&#039;id&#039;]) or error(&#039;Unable to update user&#039;, __FILE__, __LINE__, $db-&gt;error());<br />//$querystring = &quot; &quot;;<br />$db-&gt;query(&#039;UPDATE &#039;.$low_prio.$db-&gt;prefix.&#039;forums SET num_topics=num_topics+1, last_post=&#039;.$now.&#039;, last_post_id=\&#039;&#039;.$pun_user[&#039;id&#039;].&#039;\&#039;, last_poster=\&#039;&#039;.$db-&gt;escape($username).&#039;\&#039; WHERE id=19&#039;) or error(&#039;Unable to update forum&#039;, __FILE__, __LINE__, $db-&gt;error());</p>]]></description>
			<author><![CDATA[null@example.com (Rantheman)]]></author>
			<pubDate>Fri, 13 Apr 2007 15:43:59 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/91720/#p91720</guid>
		</item>
		<item>
			<title><![CDATA[Re: Wordpress plugin to post to PunBB]]></title>
			<link>https://punbb.informer.com/forums/post/83377/#p83377</link>
			<description><![CDATA[<p>Ok, my bad. The problem was that I had the wrong path put in...</p><p>Now I get this error:</p><div class="quotebox"><blockquote><p>Fatal error: Cannot redeclare unregister_globals() (previously declared in /home/jowikine/public_html/protestantpub/wordpress/wp-settings.php:4) in /home/jowikine/public_html/protestantpub/punbb/include/functions.php on line 1037</p></blockquote></div><p>Which I do believe has been solved above...</p>]]></description>
			<author><![CDATA[null@example.com (sofyst)]]></author>
			<pubDate>Thu, 21 Dec 2006 14:56:02 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/83377/#p83377</guid>
		</item>
		<item>
			<title><![CDATA[Re: Wordpress plugin to post to PunBB]]></title>
			<link>https://punbb.informer.com/forums/post/83376/#p83376</link>
			<description><![CDATA[<p>Hi. I installed the plugin. This is my first time using punbb, so forgive me for being a newb on this all. First, I could not find out the user ID or the forum ID (so I just put 1, thinking that would be the obvious).</p><p>After configuring all of the options in the wordpress area, when I tried to make a test post, I got this error after clicking &#039;publish&#039;:</p><div class="quotebox"><blockquote><p>Warning: ih_wp2punbb(/www/protestantpub/punbb/config.php) [function.ih-wp2punbb]: failed to open stream: No such file or directory in /home/jowikine/public_html/protestantpub/wordpress/wp-content/plugins/ih_wp2punbb.php on line 23</p><p>Warning: ih_wp2punbb(/www/protestantpub/punbb/config.php) [function.ih-wp2punbb]: failed to open stream: No such file or directory in /home/jowikine/public_html/protestantpub/wordpress/wp-content/plugins/ih_wp2punbb.php on line 23</p><p>Fatal error: ih_wp2punbb() [function.require]: Failed opening required &#039;/www/protestantpub/punbb/config.php&#039; (include_path=&#039;.:/usr/lib/php:/usr/local/lib/php&#039;) in /home/jowikine/public_html/protestantpub/wordpress/wp-content/plugins/ih_wp2punbb.php on line 23</p></blockquote></div><p>Any help?</p>]]></description>
			<author><![CDATA[null@example.com (sofyst)]]></author>
			<pubDate>Thu, 21 Dec 2006 14:20:49 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/83376/#p83376</guid>
		</item>
		<item>
			<title><![CDATA[Re: Wordpress plugin to post to PunBB]]></title>
			<link>https://punbb.informer.com/forums/post/83029/#p83029</link>
			<description><![CDATA[<p>I also have the problem that a new topic is created everytime that a post is saved in wordpress even if it was only edited. The best fix for this would probably be to find the wordpress action hook that is only executed when the a new post is created for the first time but I have not been able to find it. </p><p>My idea is to look in the punBB database for the subject of the post. If it already exists in the forum for the comments then no new topic should be created. I put the following lines in my ih_wp2punbb.php between $now = time(); and // Create the topic .&nbsp; </p><div class="codebox"><pre><code>// Create nothing if there is a topic with the same subject
$qry = &quot;SELECT id FROM &quot; . $db-&gt;prefix . &quot;topics WHERE subject = \&quot;$subject\&quot; AND forum_id = $fid&quot;;
$rslt = $db-&gt;query($qry);

if ( $db-&gt;num_rows($rslt) )
{
    return $post_id;    
}</code></pre></div><p>It would be even better to change the post in punBB so that it matches the post in wordpress since this probably was the reason to edit in the first place.</p>]]></description>
			<author><![CDATA[null@example.com (Dataclown)]]></author>
			<pubDate>Thu, 14 Dec 2006 00:31:54 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/83029/#p83029</guid>
		</item>
	</channel>
</rss>
