BeBot - An Anarchy Online and Age Of Conan chat automaton

Development => Module Requests => Topic started by: ilon on January 06, 2007, 01:57:43 pm

Title: module to list org members
Post by: ilon on January 06, 2007, 01:57:43 pm
So, the thing i really miss to be able to maintain the org (kick inactive members, remove shops for players who left etc is a command (!members?) that shows all the members that are in the org.

A really nice additional function would be a sort function (per default) for it to group alts togheter, like:

amain
 amains-alt1
 amains-alt2
cmain
 cmain-alt1

etc, sort them alphabetical and just throw in the alts under the main-char.

would help alot for me, and i bet other ppl could use it too. :)

would be really happy if someone who know more about coding than me could help me out here and maybe do suck a module. i dont know much about php, but i assume it wouldnt be much code, like fetch memberslist, fetch alt list, sort method, sort the list, show it, or something >_>
Title: Re: module to list org members
Post by: pusikas on January 06, 2007, 03:02:25 pm
I am still not good at coding php, but the info you are looking for is in the database already. Would prolly be possible to make a SELECT statement that gives you just what you need. Stil haven't had my morning coffee, so the following is all I could come up with in 2 minutes, sounds useful, will see if I can come up with something better. Lists all members with their alts (only those in org), ordered by name of the main, then name of the alt. Note that this may be the wrong way to do it in mysql, I usually use postgresql and oracle. And even in those databases, it would be considered ugly. ^^
Code: [Select]
SELECT mains.main, alt
  FROM (SELECT nickname main
          FROM members
         WHERE nickname NOT IN (SELECT alt FROM alts)) mains
  LEFT JOIN (SELECT alts.main, alts.alt
               FROM alts, members
              WHERE alts.alt = members.nickname) altsinorg
       ON (mains.main = altsinorg.main)
 ORDER BY main, alt;
Title: Re: module to list org members
Post by: ilon on January 07, 2007, 02:06:43 am
anyone feels like making this into a working module? i simply dosnt have the knowledge in SQL / PHP for it :<
Title: Re: module to list org members
Post by: jjones666 on January 07, 2007, 02:14:25 am
http://www.jjones.co.uk/files/memberlist2.php

that was something wolfbiter wrote and i changed slightly for our org.  should fit roughly what you need.

-jj-
Title: Re: module to list org members
Post by: ilon on January 07, 2007, 02:56:46 am
ok, tyvm :))

will try it out tomorrow when i wake up, need some sleep badly now :P

gnite
SimplePortal 2.3.7 © 2008-2025, SimplePortal