thankyou
Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!
Most of the plugins here are made by B3 users and the authors may not visit frequently. If you need support for plugins or if questions remain unanswered, you will have to contact the author directly. Read the full Support Disclaimer here

NOTE: Do not attach plugins to your forumtopics! Attachements are periodically removed by maintenance tasks. Upload your plugins to our Downloads section instead!

Author Topic: ForumLink  (Read 36786 times)

Offline MordyT

  • Support Hero
  • Hero Member
  • *
  • Posts: 3644
  • Over $300 Donated to B3!
    • MordyT
Re: ForumLink
« Reply #45 on: September 01, 2011, 05:54:16 PM »
I've wrote a bit of code to doing something like this but it changes players B3 group based on there forum group.(This has been coded for the PHPBB forum Only!)

add this "self.changelvl(event.client)"
below "t.start()" in foumlink.py

add this to forumlink.py
Code: [Select]
    def changelvl(self, client):
      forumid = client.var(self,'forumid',0).value
      self.dbconnect()
      cursor = self.query("""SELECT `group_id` FROM `phpbb_users` WHERE `user_id` = '%s'""" % (forumid))
      if cursor.rowcount > 0:
         r = cursor.fetchone()

         id = r[0]
         
         if id == IDHERE:
            group = clients.Group(keyword='superadmin')
            group = self.console.storage.getGroup(group)

            if client.inGroup(group):
                self.debug(self._adminPlugin.getMessage('groups_already_in', client.exactName, group.name))
            else:
                client.setGroup(group)
                client.save()
                self.console.say('%s has been added to the Administrator group' % client.exactName)
            return False
         elif id == IDHERE:
            group = clients.Group(keyword='serveradmin')
            group = self.console.storage.getGroup(group)

            if client.inGroup(group):
                self.debug(self._adminPlugin.getMessage('groups_already_in', client.exactName, group.name))
            else:
                client.setGroup(group)
                client.save()
                self.console.say('%s has been added to the Server Administrator group' % client.exactName)
            return False
         elif id == IDHERE:
            group = clients.Group(keyword='smod')
            group = self.console.storage.getGroup(group)

            if client.inGroup(group):
                self.debug(self._adminPlugin.getMessage('groups_already_in', client.exactName, group.name))
            else:
                client.setGroup(group)
                client.save()
                self.console.say('%s has been added to the Senior Moderator group' % client.exactName)
            return False
         elif id == IDHERE:
            group = clients.Group(keyword='mod')
            group = self.console.storage.getGroup(group)

            if client.inGroup(group):
                self.debug(self._adminPlugin.getMessage('groups_already_in', client.exactName, group.name))
            else:
                client.setGroup(group)
                client.save()
                self.console.say('%s has been added to the Moderator group' % client.exactName)
            return False
         elif id == IDHERE:
            group = clients.Group(keyword='ehd')
            group = self.console.storage.getGroup(group)

            if client.inGroup(group):
                self.debug(self._adminPlugin.getMessage('groups_already_in', client.exactName, group.name))
            else:
                client.setGroup(group)
                client.save()
                self.console.say('%s has been added to the EHD Members group' % client.exactName)
            return False
         elif id == IDHERE:
            group = clients.Group(keyword='vip')
            group = self.console.storage.getGroup(group)

            if client.inGroup(group):
                self.debug(self._adminPlugin.getMessage('groups_already_in', client.exactName, group.name))
            else:
                client.setGroup(group)
                client.save()
                self.console.say('%s has been added to the VIP group' % client.exactName)
            return False
         elif id == IDHERE:
            if client.maxLevel >= 2:
               group = clients.Group(keyword='user')
               group = self.console.storage.getGroup(group)

               if client.inGroup(group):
                   self.debug(self._adminPlugin.getMessage('groups_already_in', client.exactName, group.name))
               else:
                   client.setGroup(group)
                   client.save()
                   client.message('You have been reset to User')
               return False
            else:
               return False
         else:
            return False

You will have to edit the ids and group keywords to work with your B3 and forum.

Could you adapt this to SMF2 spoon? All I want to be able to do is change their server level based on forum group. I don't need to get PMs or anything.
Thanks!
Help will be given to those with a b3.log

If drop off the map it is due to RL becoming busy :)

System: Python 2.7.3 - Deb 7 - B3 Source Code - 128MB RAM box (rented at $5 a year) - remote MySQL - Remote Web Services

Offline Spoon

  • Sr. Member
  • ****
  • Posts: 255
    • EHD Gaming
Re: ForumLink
« Reply #46 on: September 02, 2011, 01:46:11 PM »
i would need to know the name of the group id and the name of the table it is in.

Offline MordyT

  • Support Hero
  • Hero Member
  • *
  • Posts: 3644
  • Over $300 Donated to B3!
    • MordyT
Re: ForumLink
« Reply #47 on: September 07, 2011, 07:27:34 PM »
i would need to know the name of the group id and the name of the table it is in.

The table name is smf_members.
Then under the row with the user (in my case 1) there is a column called id_group If the value is set to 17, it should make the user a admin (40). OFC, I would love for it to be able to go even further, but we will see...
Help will be given to those with a b3.log

If drop off the map it is due to RL becoming busy :)

System: Python 2.7.3 - Deb 7 - B3 Source Code - 128MB RAM box (rented at $5 a year) - remote MySQL - Remote Web Services

Offline Jman2213

  • Full Member
  • ***
  • Posts: 52
Re: ForumLink
« Reply #48 on: October 05, 2011, 04:57:41 PM »
Hey guys, has anyone made a version of this for IPB? Because i realllly realllly want to have this on my servers but our organization is running IPB and we do not plan to move. So is it possible to do it on IPB or not?

If someone has the time to do this it would be awesome!

Offline Spoon

  • Sr. Member
  • ****
  • Posts: 255
    • EHD Gaming
Re: ForumLink
« Reply #49 on: October 06, 2011, 01:36:14 AM »
The table name is smf_members.
Then under the row with the user (in my case 1) there is a column called id_group If the value is set to 17, it should make the user a admin (40). OFC, I would love for it to be able to go even further, but we will see...

Really all you would have to do it change
cursor = self.query("""SELECT `group_id` FROM `phpbb_users` WHERE `user_id` = '%s'""" % (forumid)
to
cursor = self.query("""SELECT `id_group` FROM `smf_members` WHERE `user_id` = '%s'""" % (forumid)
then change if id == IDHERE: to what ever your id's are.

Offline Jman2213

  • Full Member
  • ***
  • Posts: 52
Re: ForumLink
« Reply #50 on: October 06, 2011, 06:03:39 AM »
Does anyone know how hard this would be? Spoon how difficult would this be? Do i just need to change the name of the tables? Or would all of the code be completely different?

Thanks for your time, Jman/Aurora

Offline Spoon

  • Sr. Member
  • ****
  • Posts: 255
    • EHD Gaming
Re: ForumLink
« Reply #51 on: October 07, 2011, 09:06:44 PM »
it would probs need alot of code changed

Offline Jman2213

  • Full Member
  • ***
  • Posts: 52
Re: ForumLink
« Reply #52 on: October 09, 2011, 06:40:59 PM »
it would probs need alot of code changed


Hmmm okay. Would you be interested in doing this? Im not sure how hard it would be but im sure it wouldnt be that bad. All it does is see what their group ID is and put them in that group on the bot right? To say as a noob anyways. If that is all it does all you would need to do is change the name of the tables. Right?

Offline Spoon

  • Sr. Member
  • ****
  • Posts: 255
    • EHD Gaming
Re: ForumLink
« Reply #53 on: October 12, 2011, 01:42:25 AM »
this plugin does not support IPB forum

Offline LouK

  • Full Member
  • ***
  • Posts: 119
    • The Sni:{Per}:Jum Clan
Re: ForumLink
« Reply #54 on: March 02, 2013, 02:55:29 AM »
Hi, just a quick question: I use a very smart forum called nabble http://www.nabble.com/ , vvill you consider to vvork(sorry, my double v doesn't ork xd) yo also link this plugin ith that system?(I could help, I'm in the support group of nabble)

Thanks

Offline pedjas

  • Jr. Member
  • **
  • Posts: 24
Re: ForumLink
« Reply #55 on: May 30, 2013, 01:14:37 PM »
Is there any way I could download this? The download link is not working ( https://github.com/Bakes/b3-forumlink/zipball/master ) and all downloads point to that link.

Mussic

  • Guest
Re: ForumLink
« Reply #56 on: May 10, 2015, 07:24:02 PM »
does anyone have this plugin anymore cuz his github page is deleted

 


Rate this page +1 at Google Search

anything