Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 07 Dec 2016, 15:24
incursio incursio is offline
 
Join Date: Nov 2001
Any API call for updating a social group icon?

I've been digging for a bit, but haven't found anything concrete yet.

Basically, I just need a way to set/update a social group icon image from a separate script. Any ideas? Thanks in advance for any guidance!

Cheers.
Reply With Quote
  #2  
Old 07 Dec 2016, 17:50
noypiscripter's Avatar
noypiscripter noypiscripter is offline
 
Join Date: Aug 2013
Call the /uploader/uploadSGIcon frontend controller. To see what parameters are passed, try inspecting the AJAX call when you go to the group channel page and then clicking Edit Group Icon that appears when you hover the group icon, and then upload an image.

You can see the code for uploadSGIcon in actionUploadSGIcon() function in /includes/vb5/frontend/controller/uploader.php.
__________________
Glenn Vergara, an ex-vB Developer, now a vB Mod Developer

GIPHY for vB5 | AutoLinker | Video Attachments Player | New Registered Users Module | Clear System Cache Cron | DragNDrop Upload | Topic AJAX AutoUpdate | Force Read Topic
Reply With Quote
  #3  
Old 07 Dec 2016, 18:44
incursio incursio is offline
 
Join Date: Nov 2001
Yeah, I was looking at that. Not sure what you mean by "call the controller", though. That file isn't part of the API, right?

EDIT: Oh, you mean call it by CURL or what not ... yeah that would work

--------------- Added 07 Dec 2016 at 19:09 ---------------

Actually, after tinkering a bit, that won't work, at least not as easily, because you run into vBulletin authentication issues with the cURL request

Last edited by incursio; 07 Dec 2016 at 19:11.
Reply With Quote
  #4  
Old 07 Dec 2016, 21:51
Replicant's Avatar
Replicant Replicant is offline
 
Join Date: Sep 2014
Real name: Mel
You have to be logged in with the stay logged in check box clicked so that the cookies are set. Then when you call the function with curl, make sure the cookie info is included on the command line. If you are logged in and the cookie info is included, there are no authentication issues. I do it all the time.
__________________
VB5 mods - RepliClock VB4 mods - Member Online Status
Reply With Quote
  #5  
Old 07 Dec 2016, 23:36
incursio incursio is offline
 
Join Date: Nov 2001
I was building this as a command line tool as it might need to run via cron, but I suppose I can make it browser based instead.

Cheers.
Reply With Quote
  #6  
Old 08 Dec 2016, 01:38
noypiscripter's Avatar
noypiscripter noypiscripter is offline
 
Join Date: Aug 2013
If you look into the actionUploadSGIcon() method in the controller, you would see that it is calling the upload method in the content_attach API to upload the image and then calling the update method in the content_channel API to update the social group channel with the uploaded image.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

You can basically do the same.
__________________
Glenn Vergara, an ex-vB Developer, now a vB Mod Developer

GIPHY for vB5 | AutoLinker | Video Attachments Player | New Registered Users Module | Clear System Cache Cron | DragNDrop Upload | Topic AJAX AutoUpdate | Force Read Topic
Reply With Quote
  #7  
Old 08 Dec 2016, 01:40
incursio incursio is offline
 
Join Date: Nov 2001
Yeah, that's what I ended up doing!

Cheers.
Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Social Group and Album Enhancements Social Group RSS - RSS Feeds for Social Groups nick_ramsay vBulletin 3.8 Add-ons 9 23 Nov 2015 21:48



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 06:48.

Layout Options | Width: Wide Color: