Simple Machines Community Forum

Customizing SMF => Bridges and Integrations => Topic started by: nuva on December 21, 2009, 01:37:42 PM

Title: create topic
Post by: nuva on December 21, 2009, 01:37:42 PM
hello,

At the moment I am making a website with a homepage that has smf integrated. I included ssi.php.
Now i was wondering if it is possible to create a forum topic from the main site?

Thank you,
Nuva ;)
Title: Re: create topic
Post by: H on December 21, 2009, 01:59:06 PM
You can use createpost() (http://support.simplemachines.org/function_db/index.php?action=view_function;id=323) to create topics or replies :)
Title: Re: create topic
Post by: nuva on December 21, 2009, 02:33:19 PM
Works great after some time of trying :P :D

Thanks!
Title: Re: create topic
Post by: H on December 21, 2009, 02:57:43 PM
Glad that did what you wanted :)
Title: Re: create topic
Post by: nuva on December 22, 2009, 04:14:24 AM
Is there a function to send a pm as well?
Title: Re: create topic
Post by: H on December 22, 2009, 06:45:18 AM
sendpm() (http://support.simplemachines.org/function_db/index.php?action=view_function;id=315) :). Be sure to checkout all the other functions on the main Function DB (http://support.simplemachines.org/function_db) page :)
Title: Re: create topic
Post by: nuva on December 22, 2009, 07:25:37 AM
Quote from: H on December 22, 2009, 06:45:18 AM
Be sure to checkout all the other functions on the main Function DB (http://support.simplemachines.org/function_db) page :)
Sorry, it has been a long time since i visited this forum O:)


edit:
I used the following code:

<?php
include_once("forum/SSI.php");
require_once(
$sourcedir '/Post.php');
require_once(
$sourcedir '/Subs-Post.php');

$msgOptions = array(
'bbc' => array(),
'to' => array('nuva'),
);

$subject "test";
$message "test";
$outbox_store false;

$from = array(
'id' => 1,
'name' => 'nuva',
'username' => 'nuva',
);

$result sendpm(array $recipientsstring $subjectstring $messagebool $outbox_store[, array $from])

?>



And i get the following error, though I don't seem to find why...

Parse error: parse error, expecting `'('' in C:\wamp\www\nuva\pmtest.php on line 21

Line 21 is the line where the sendpm function is called.
Title: Re: create topic
Post by: nuva on December 22, 2009, 07:41:53 AM
sorry, my bad.
I found out.

Thanks, works great ;D


edit:
Just one more question ::)

Can i make a link redirect to the pm page with $to, $subject and $message already filled in?
Title: Re: create topic
Post by: Kill Em All on March 07, 2010, 09:53:52 PM
Sorry for the delayed response. As far as one specific link, I don't think so.
Title: Re: create topic
Post by: MultiformeIngegno on March 10, 2010, 02:47:55 AM
nuva I'm interested on this too! Can you post the right code for the one 3 posts ago? Thanks!!