SimplePortal

Customization => Custom Coding => Topic started by: smithc6 on January 08, 2011, 02:23:26 PM

Title: code for profile group
Post by: smithc6 on January 08, 2011, 02:23:26 PM
Hi i use SMF 2.0 RC4

i have added a description on some members profile for a prayer group
they are already members of dif groups so that was the only way i could do it as they can't be members of 2 dif groups for some reason SMF won't allow that

what i'm after is an info box on SP that shows these members
i presume i would have to do it via custom html or php not sure

what code would i add please does anyone know?
Title: Re: code for profile group
Post by: smithc6 on January 08, 2011, 02:34:17 PM
sorry i have now managed to create an additional group

so i'm actually after some code which will list people in this additional group called 'Prayer Team'

sorry for confusion

Thanks
Title: Re: code for profile group
Post by: Ares on January 10, 2011, 05:18:33 PM
what is it you are wanting?
A page to show the ppl in the secondary group
or show the badge on post of secondary group
bc both of those options can be achieved with 2 mods

first mod stars and badges for 2.0rc4
awesome mod love it
this mod will display the persons secondary group image in posts
Download Here (http://www.simplemachines.org/community/index.php?action=dlattach;topic=225743.0;attach=146571)

second mod
Team Page
display any groups in a page
woks great for gaming clans
Download Here (http://custom.simplemachines.org/mods/index.php?mod=2167)
Title: Re: code for profile group
Post by: smithc6 on January 11, 2011, 02:02:46 AM
neither of those things
i want the code to add the group into a box on SP

like the staff list for example lists everyone on the staff

but i want it for the 'prayer team'
Title: Re: code for profile group
Post by: Ares on January 11, 2011, 07:38:07 AM
what is the group #
you will find it in the url like
go to
admin panel
member groups
click prayer team
then look at the url
http://yoursite.com/index.php?action=admin;area=membergroups;sa=members;group=1
Title: Re: code for profile group
Post by: smithc6 on January 11, 2011, 09:14:28 AM
http://www.christianstogether.co.uk/forum/index.php?action=admin;area=membergroups;sa=members;group=12

:)
Title: Re: code for profile group
Post by: smithc6 on January 13, 2011, 10:52:13 AM
can anyone help me with this please????????
Title: Re: code for profile group
Post by: AngelinaBelle on January 13, 2011, 11:31:28 AM
I'm stuck on your first post. SMF does allow members to belong to 2 different groups.
 
They can have one primary group, and any number of other groups. If you are having problems assigning users to groups, please ask for support at simplemachines.org.  Support helpers and specialists there are probably familiar with your problem.
Title: Re: code for profile group
Post by: smithc6 on January 13, 2011, 12:02:51 PM
yes i figured out how to do additional groups
what i'm after is a box on SP that shows these member f the additional group

'Prayer team'

thanks
Title: Re: code for profile group
Post by: AngelinaBelle on January 13, 2011, 12:29:34 PM
SSI.php has a function to do exactly what you want.
It will even print it out for you.
Call it from your custom php block.
Title: Re: code for profile group
Post by: smithc6 on January 13, 2011, 12:36:59 PM
sorry you've lost me completely
Title: Re: code for profile group
Post by: AngelinaBelle on January 13, 2011, 12:40:09 PM
Make a custom php block.
In the custom php block, call the ssi function that does what you want.
 
Look through ssi.php to find the name of the function you want -- one to get all members from a group.
You only have to tell the function the group_id. It does the rest.
Title: Re: code for profile group
Post by: smithc6 on January 14, 2011, 01:58:25 AM
i know where the custom.php block is
but you are loosing me with this ssi.php
i think that you forget sometimes that not everyone is an expert coder or good with programmes etc

i'm still really new i'm learning as i go along slowly

can you explain in detail pls what you meant thank you :)
Title: Re: code for profile group
Post by: AngelinaBelle on January 14, 2011, 08:45:40 AM
Welcome to custom coding! This is a good way to learn.
 
All SMF files are found on your server.
You can copy them to your desktop using ftp, or else extract a fresh copy from the SMF archive available from SMF's downloads page.
 
Get a copy of ssi.php to your desktop, so you can have a look at it.
You will want to open it in notepad.
 
You might want something better than notepad, like notepad++ or one of the other programmer's text editors.
Title: Re: code for profile group
Post by: smithc6 on January 14, 2011, 09:56:02 AM
i've had a look through this and can't actually find anything in there about my group called
'prayer team'

mind you even if i could find it i still wouldn't have a clue what to do  :0
Title: Re: code for profile group
Post by: AngelinaBelle on January 17, 2011, 11:15:24 AM
That code doesn't know anything about the data on your forum.
But -- one step at a time.
 
First step: find a function (you'll recognize where a function definition begins, because it begins with the word function at the beginning of a line) that has to do with getting membergroup information.
Title: Re: code for profile group
Post by: smithc6 on January 20, 2011, 05:38:41 PM
sorry Angelina but i am totally lost here
as in baffled beyond belief

all i want is a box to show this membergroup :(
please help me
Title: Re: code for profile group
Post by: AngelinaBelle on January 21, 2011, 10:02:08 AM
Yes. You are learning a little about custom coding now.
 
Please look in the file ssi.php.
Search this file until you find a function to Get all members of a group
 
This is the function you will wish to use.
Title: Re: code for profile group
Post by: Ares on March 01, 2011, 07:17:38 PM
AngelinaBelle I know you are trying to help but most of your post you tell ppl about the ssi but we don't know how to code or call the functions so if somone is asking for help instead of telling the person about the ssi and a bunch of stuff that they don't even understand how about you help with coming up with the code that they are wanting

sorry if it sound mean but not everyone knows php
Title: Re: code for profile group
Post by: AngelinaBelle on March 01, 2011, 09:44:19 PM
I know what you are saying. I am not very quick at writing code.
I'm sorry.  I'm a support specialist and a doc writer, not a customizer.
Any piece of code I come up with, I also struggle to learn what I need to know.
 
So I know that if I can use the ctrl-F key while editing a file, so can the next guy. And, if they follow my instructions, they will succeed.
Title: Re: code for profile group
Post by: [SiNaN] on March 02, 2011, 04:21:59 AM
Ares, that's not really true. For instance, I could have given such a code:

Code: [Select]
$members = ssi_queryMembers('FIND_IN_SET({int:id_group}, additional_groups)', array('id_group' => 12), '', 'real_name', 'array');

$member_list = array();
foreach ($members as $member)
    $member_list[] = $member['link'];

if (empty($member_list))
    echo 'There are no members.';
else
    echo implode(', ', $member_list);

But you wouldn't learn anything from that. The next time you need to make a little modification to that, you'll need to ask for help again.

I admire the way AngelinaBelle helps. (she is a brilliant support specialist, by the way) I just didn't have the time to do same. So I guess I'm one to blame for making people expect to get what they need without much effort.

If I actually used the time I spent on customizing people's portal for developing SimplePortal, we would have long released SimplePortal 3.0 and I'm pretty sure it would have had all those features built-in.

By the way, that above code will list members who has the group with the id of 12 as their additional group.
SimplePortal 2.3.8 © 2008-2024, SimplePortal