• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.

Forum integration

imagonos

Chevereto Member
Hello,

I was wondering if there was a way to integrate chevereto's API as an option for my vBulletin forum (4.2.2) so my users could automatically upload images to my chevereto webpage to post them on their threads.

Not quite sure if this is the correct area to ask this for though so, if I'm mistaken please accept my apologies.

Thanks in advance,
imagonos
 
Hello,

I was wondering if there was a way to integrate chevereto's API as an option for my vBulletin forum (4.2.2) so my users could automatically upload images to my chevereto webpage to post them on their threads.

Not quite sure if this is the correct area to ask this for though so, if I'm mistaken please accept my apologies.

Thanks in advance,
imagonos
I found a script someone made for IP.B used to upload to other sites. I simply changed the API used in it to use my site. It shows up on any new create a post... Once they upload it simply prints out the direct link for them to use. Overly simple. You may be able to edit any existing upload, or simply create an upload form and imbed it into your site. Integration is not possible with the API to be applied to usernames as the current system is VERY dumb and used only for guest uploads.
 
Hello,

Well, I might be able to check and maybe even edit that script with my knowledge of php. So far I tried with this code:
Code:
function curl_multi($images)
{
   global $vbulletin;
   $curls = $result= array();

   $ch = curl_multi_init();
   foreach ($images AS $id => $imageurl)
   {
     if (strpos($imageurl, $vbulletin->options['bburl']) === false AND strpos($imageurl, 'rcupload.com') === false)
     {
       $curls[$id] = curl_init();
       curl_setopt($curls[$id], CURLOPT_URL,'http://echimagen.com/api/1/upload/?key=0afea9195c8b1cf944d66714baa0742d&source=$imageurl');
       curl_setopt($curls[$id], CURLOPT_RETURNTRANSFER, true);
       curl_setopt($curls[$id], CURLOPT_USERAGENT, 'vBulletin via cURL/PHP');
       curl_multi_add_handle($ch, $curls[$id]);
     }
   }

   $active = null;

   do
   {
     curl_multi_exec($ch, $active);
   } while($active > 0);

   foreach($curls AS $id => $content)
   {
     $result[$id] = curl_multi_getcontent($content);
     curl_multi_remove_handle($ch, $content);
   }

   curl_multi_close($ch);

   return $result;
}

But I get an
{"status_code":400,"error":{"message":"Uploadin g source base64 must be done using POST method.","code":130,"context":"Exception"},"status _txt":"Bad Request"}
error.

Not quite sure what to do to make it work. If you have the script you are using maybe I could use it or something. I don't know I'm quite lost.
 
I used the following in an iframe then put it inside of the theme using a plugin. Works without any major problems. Some files are a bit wonky to upload it. Problem is I know little about curl... http://superuser.com/questions/149329/what-is-the-curl-command-line-syntax-to-do-a-post-request

HTML:
<body>
<form enctype="multipart/form-data" action="http://YOUR SITE HERE/api/1/upload/?" method="POST">
<input type="hidden" name="key" value="API HERE" />
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
<input type="hidden" name="format" value="txt" />
Choose a file to upload: <input name="source" type="file" value="" /><br />
<input type="submit" name="source" value="Submit" />
</form>
</body>
 
I wrote a private (unreleased) plugin for PHPBB which works with forum posts, hooking one of the submission pre-events. It detects image uploads in the forum post data and automatically submits the image(s) to the chevereto API, then takes the resulting URL to inject it into the post data for the embedded image. The plugin has much more than this functionality, such as a full featured "wordpress" type of frontpage, so it may be too heavy for a simple API transaction controller.

Clearly, you said vBulletin... If however, other are interested in this PHPBB plugin, speak up here, and I may revisit it, producing a release candidate.
 
If there was a forum login script to IPB or XenForo I would be all over that! Thanks for your guys' experiments!
 
Back
Top