News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Create new topic using SSI function

Started by princesodhi, September 17, 2012, 12:58:51 PM

Previous topic - Next topic

princesodhi

Hello All,

how can we create new topic using SSI???

is there anyway?

emanuele

Hello princesodhi and welcome to sm.org.

This is not exactly a feature request, so I'll move it to SMF Coding Discussion later.

Yes, you can use SSI.php to create posts, there is a bit of code involved though.
You should first include Subs-Post.php and then use createPost, for example:
<?php
require_once(dirname(__FILE__) . '/SSI.php');
global
$sourcedir;
require_once(
$sourcedir . '/Subs-Post.php');


after that you have to collect the informations to create the post (you can see an example in Post.php line 1861 in a clean SMF) and finally call createPost passing the proper values.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Ecru

For how to use createPost, have a look at the documentation for the function. It's rather simple to setup.


Advertisement: