developpez.com
03-03-2011, 04:48 PM
Hello everybody,
I am currently working on a php webservice that creates topics in my vbulletin forum.
The webservice is running as
$threaddm = new vB_DataManager_Thread_FirstPost($vbulletin, ERRTYPE_STANDARD);
$threaddm->do_set('forumid', $forumid);
$threaddm->do_set('userid', $user);
$threaddm->do_set('username', $username);
$threaddm->do_set('pagetext', $message);
$threaddm->do_set('title', $subject);
$threaddm->do_set('allowsmilie', $allowsmilie);
$threaddm->do_set('visible', $visible);
$showsignature = true;
$threaddm->do_set("showsignature", $showsignature);
$tid = $threaddm->save();
This works fine, the bbcode inside $message is correctly rendered when I display the created topic.
But ... I'm using the AME plugin (2.5) to display videos in the post messages. A basic youtube url inserted in the message has to be replaced with a youtube block, and it works fine when the message is entered manually in the forum.
If I provide a youtube url in the $message variable in my webservice, it is not converted in a youtube block when displayed. It seems that some vbulletin hooks are not triggered, and something about AME is missing in my code.
I have tried to call directly some AME functions to parse myself the whole bbcode and to write it into the postparsed table but the html rendered is not that well rendered and this idea may be dangerous (I think)
Do I need to trigger a vbulletin hook (even if my code is absolutely not inside a classic vbulletin stream) ? Do I need to add some more code about AME plugin ?
Anyone knows what I did wrong ?
Thanks for your help
I am currently working on a php webservice that creates topics in my vbulletin forum.
The webservice is running as
$threaddm = new vB_DataManager_Thread_FirstPost($vbulletin, ERRTYPE_STANDARD);
$threaddm->do_set('forumid', $forumid);
$threaddm->do_set('userid', $user);
$threaddm->do_set('username', $username);
$threaddm->do_set('pagetext', $message);
$threaddm->do_set('title', $subject);
$threaddm->do_set('allowsmilie', $allowsmilie);
$threaddm->do_set('visible', $visible);
$showsignature = true;
$threaddm->do_set("showsignature", $showsignature);
$tid = $threaddm->save();
This works fine, the bbcode inside $message is correctly rendered when I display the created topic.
But ... I'm using the AME plugin (2.5) to display videos in the post messages. A basic youtube url inserted in the message has to be replaced with a youtube block, and it works fine when the message is entered manually in the forum.
If I provide a youtube url in the $message variable in my webservice, it is not converted in a youtube block when displayed. It seems that some vbulletin hooks are not triggered, and something about AME is missing in my code.
I have tried to call directly some AME functions to parse myself the whole bbcode and to write it into the postparsed table but the html rendered is not that well rendered and this idea may be dangerous (I think)
Do I need to trigger a vbulletin hook (even if my code is absolutely not inside a classic vbulletin stream) ? Do I need to add some more code about AME plugin ?
Anyone knows what I did wrong ?
Thanks for your help