Hey,
Im trying to build a new product where you can set default prefixes to threads. Im a abit puzzled how to set the prefixid when a user posts. So far I have this:
PHP Code:
<installcode><![CDATA[$db->hide_errors();
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "forum ADD default_forum_thread_prefix VARCHAR(300) NOT NULL");
$db->show_errors();]]></installcode>
This adds my new field in the forum table.I already have the whole frame but I still need the basic function.
PHP Code:
<plugin active="1">
<title>Default Forum Thread Prefix</title>
<hookname>forumadmin_edit_form</hookname>
<phpcode>
<![CDATA[print_table_header($vbphrase['default_forum_thread_prefix']);
print_input_row($vbphrase['default_forum_thread_prefix_desc'], 'forum[default_forum_thread_prefix]', $forum['default_forum_thread_prefix']);]]>
</phpcode>
</plugin>
The admin area seems to work fine also.
PHP Code:
<plugin active="1">
<title>Default Forum Thread Prefix</title>
<hookname>newthread_post_start</hookname>
<phpcode>
<![CDATA[
$vbulletin->GPC['prefixid'] = $forum['default_forum_thread_prefix'];
$newpost['prefixid'] =& $vbulletin->GPC['prefixid'];
]]>
</phpcode>
</plugin>
Now this is the part where Im puzzled and I originally wanted to do an query each time but then I thought it might be easier to retrieve the info.
I must say that Im fairly new to php and vbulletin. I only wrote programs with C# and C++ yet so Im still learning the syntax and whatnot.
Thanks for the help ahead.