PDA

View Full Version : Small problem I cant seem to resolve


JmZ
03-04-2008, 03:40 PM
hey there,

I am currently coding a script which will post information automatically from specific "feeds".

The whole script is finished which means now, I have to integrate it into vBulletin.
Now this is generally easy, until I get the the "post insertion". The problem here is that my posts will contain HTML, so I need to figure out one of the following:

- How to set a specific user's posts to be directly posted, not filtered through anything which may change the content of the given post.

OR

- How to convert ALL HTML from a given post into friendly BBCode

Either of these means that my script will be complete, so any help is appreciated.

Thanks
JmZ

shovel
03-04-2008, 06:04 PM
Try...

require_once(DIR . '/includes/functions_wysiwyg.php');
$your_text = convert_wysiwyg_html_to_bbcode($your_text, false);

JmZ
03-04-2008, 06:11 PM
ah great
ill give that a go, thanks shovel

shovel
03-04-2008, 06:19 PM
Make sure that your point that require_once() method to the appropriate directory, that was a bit taken right out of the vBulletin source.

JmZ
03-04-2008, 06:22 PM
ok here's what I get now:
Fatal error: Call to a member function clean_gpc() on a non-object

im guessing I need to include another file aswell as the current one?

shovel
03-04-2008, 06:38 PM
Remember to go ahead and bring in your back-end if you haven't..

require_once('./global.php');
require_once(DIR . '/includes/functions_newpost.php');
require_once(DIR . '/includes/functions_editor.php');
require_once(DIR . '/includes/functions_bigthree.php');

JmZ
03-04-2008, 06:53 PM
oh perfect
it works great, hopefully it keeps working consistently without any errors

thanks a lot for the replies shovel

shovel
03-04-2008, 07:01 PM
No problem. :)