- Posts: 3
- Thank you received: 0
Kunena 7.0.4 Released
The Kunena team has announce the arrival of Kunena 7.0.4 [K 7.0.4] in stable which is now available for download as a native Joomla extension for J! 5.4.x/6.0.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 and issues discovered during the last development stages of K 7.0
Topics that are moved into this category are generally considered to be closed. Users may want to add additional information but these topics should not be resurrected in order to discuss new problems or unrelated matters.
Question Need info on how to add a new thread programatically
16 years 3 months ago #37943
by statman24
Need info on how to add a new thread programatically was created by statman24
I'm working on an integration project which requires me to programatically (via PHP) add a new thread to a Kunena Forum and populate it with a Subject and Message.
Is there any instruction or code available for this purpose?
Thanks!
Is there any instruction or code available for this purpose?
Thanks!
Please Log in or Create an account to join the conversation.
16 years 3 months ago #37950
by xillibit
I don't provide support by PM, because this can be useful for someone else.
Replied by xillibit on topic Re:Need info on how to add a new thread programatically
Hello,
Adding a new thread by which ways : when your hit or directly in PHP ?
Actually, there isn't API in kunena do this easily.
Adding a new thread by which ways : when your hit or directly in PHP ?
Actually, there isn't API in kunena do this easily.
I don't provide support by PM, because this can be useful for someone else.
Please Log in or Create an account to join the conversation.
16 years 3 months ago - 16 years 3 months ago #37960
by statman24
Replied by statman24 on topic Re:Need info on how to add a new thread programatically
Directly via PHP. Probably will create a component for my needs.
Basically, it's foll out a form with information and $$$ amount, go to paypal to collect, then take the original for data and create a post/thread with that information.
Basically, it's foll out a form with information and $$$ amount, go to paypal to collect, then take the original for data and create a post/thread with that information.
Last edit: 16 years 3 months ago by statman24.
Please Log in or Create an account to join the conversation.
16 years 3 months ago - 16 years 3 months ago #37969
by sozzled
Blue Eagle vs. Crypsis reference guide
Read my blog and
Replied by sozzled on topic Re:Need info on how to add a new thread programatically
Here's a couple of old discussions that may have some ideas or information for you but, like xillibit says, there isn't anything at the moment that's already built (and you've probably already seen these ideas):
Good luck
Blue Eagle vs. Crypsis reference guide
Read my blog and
Last edit: 16 years 3 months ago by sozzled.
Please Log in or Create an account to join the conversation.
16 years 3 months ago - 16 years 3 months ago #37993
by statman24
Replied by statman24 on topic Re:Need info on how to add a new thread programatically
sozzled,
Thanks for the links. I didn't find them initially myself, because I was using different key words.
Anyway, I was able to get it working by slightly modifying/fixing one of the pieces of source code posted on one of those links.
Thanks for the links. I didn't find them initially myself, because I was using different key words.
Anyway, I was able to get it working by slightly modifying/fixing one of the pieces of source code posted on one of those links.
Code:
<?php
defined('_JEXEC') OR defined('_VALID_MOS') OR die( "Direct Access Is Not Allowed" );
/* SETTINGS, PLEASE FILL THESE */
$authorName = $user->username; // OR replace with '$user->name' if you want to use "real name"
$catid = 10; // assign the category number of where you want the thread created
$msgparent = 0; // add parent id if you want to have one thread for all messages
$maxsubject = 35; // Max length of subject
$subject = ''; // Inital subject
/* END OF SETTINGS */
$db = &JFactory::getDBO();
$db->setQuery("SELECT id FROM #__menu WHERE link='index.php?option=com_kunena' AND published='1'");
$kunenaItemid = $db->loadResult();
if ($kunenaItemid < 1) $kunenaItemid = 0;
$kunenaItemid = "&Itemid=" . $kunenaItemid;
$user = &JFactory::getUser();
?>
<form action="<?php echo JRoute::_('index.php?option=com_kunena&func=post' . $kunenaItemid); ?>" method="post" name="postform" enctype="multipart/ form-data">
<input type="hidden" name="parentid" value="<?php echo $msgparent;?>" />
<input type="hidden" name="catid" value="<?php echo $catid;?>" />
<input type="hidden" name="action" value="post" />
<input type="hidden" name="contentURL" value="empty" />
<input type="text" name="subject" size="35" class="inputbox" maxlength="$maxsubject" value="<?php echo $subject;?>" />
<textarea class="inputbox" name="message" rows="6" cols="60" style="height: 100px; width: 100%; overflow:auto;"></textarea>
<input type="submit" name="submit" value="Submit" />
<input type="reset" name="reset" value = "Reset" />
</form>
Last edit: 16 years 3 months ago by statman24.
Please Log in or Create an account to join the conversation.
Time to create page: 0.218 seconds