News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Display Additional Membergroups on Profile

Started by live627, January 09, 2007, 10:16:18 PM

Previous topic - Next topic

flutter

when I used it everyone in my forum was in all the membergroups.  They were all administrators according to the mod.  Also when it applies the member groups to posts, it tkaes the custom title into account and displays that as a membergroup.

live627

Ach, you're right about the all groups displayed for everyone!

live627


flutter

I think this was messing with ultimate profile too, is it compatible?

live627

Most likely not since there is nothing to ensure compatibility

flutter

#65
The updated version blew up my profiles.  Nobody could view their profiles at all.

Here's the error message

An error occured; Wrong value type sent to the database. Array of integers expected. (groups)'

Jade Elizabeth

Hey Live,

The error above is for members without a group at all. In the log it shows as this:

index.php?action=profile;u=191
Wrong value type sent to the database. Array of integers expected. (groups)
Function: cache_getMembergroupListForProfile
File: /Sources/Subs-Membergroups.php
Line: 787


I've tested it on several members all with the same result: Those with groups have no issue and those without have no access lol.

Thanks for the mod though, it was awesome when it worked :D.
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

petesky

#67
Installing on RC4 causes an error:

Wrong value type sent to the database. Array of integers expected. (groups)
Function: cache_getMembergroupListForProfile


EDIT: Changes does not work as expected - will post a new solution soon.

flutter

#68
on my site the person who noticed this error first was someone with a reasonably high up group, she's in three groups and I also got the error and I'm in about 4 groups.

This has nothing to do with ungrouped membes or unactivated accounts, it was across the board for us

I'm installing on rc3

I'd love this to work

petesky

All right - changed as follow:

while ($row = $smcFunc['db_fetch_assoc']($request))
{
$new_loaded_ids[] = $row['id_member'];
$loaded_ids[] = $row['id_member'];
$loaded_idg[] = $row['id_group'];
$row['options'] = array();
$user_profile[$row['id_member']] = $row;
}
$smcFunc['db_free_result']($request);
}

if (!empty($new_loaded_ids) && $set === 'profile' && $loaded_idg[0] > 0)

flutter

I'm stupid, so I have no idea what bit you've changed, can you enlighten me petesky?

petesky

In while loop add:

$loaded_idg[] = $row['id_group'];

...and after:

if (!empty($new_loaded_ids) && $set === 'profile' && $loaded_idg[0] > 0)

petesky

Ok - this is my final patch (when package is already installed):

In /sources/load.php search and replace to the following:

// Get any additional membergroups to show on their profile.
if (!empty($new_loaded_ids[0]) && !empty($user_profile[$new_loaded_ids[0]]['additional_groups']) && $set == 'profile')


Should be working now in every case because it checks for $user_profile[$new_loaded_ids[0]]['additional_groups'] which must be set and the cache_getMembergroupListForProfile database call can handle correct.

flutter

Ok,  I have to say that I have no clue what is going on here, the last one says search and replace with the following, search what? 

There are 4 posts now on this with code and I have no way of knowing what to do with them.

Shouldn't the author change the parse instructions for us, that way we see what to replace and where.

petesky

@Flutter: Just change the one line after you installed the product from author on RC4. Thats all.

flutter

I don't have Rc4 I have Rc3.  I've uninstalled it.  Form what I can see there are 4 posts of instructions and I can't make head or tail of any of them.  Just change one line isn't really instructions to someone like me who doesn't code for SMF.  I could stare at the lines for days and not know which to change.


What about all the other things you've put up?  Don't I have to do that too?  Would that even be compatible with my version of SMF?

I have a headache with this, it's just not important enough to have a headache over, it's a little mod

petesky

#76
I don't have RC3 because i recently updated to RC4.
I assume, that my single line change now also works on RC3 as expected now.
Just install the orginal mod from the author and replace in /sources/load.php :

// Get any additional membergroups to show on their profile.
if (!empty($new_loaded_ids) && $set === 'profile'


with

// Get any additional membergroups to show on their profile.
if (!empty($new_loaded_ids[0]) && !empty($user_profile[$new_loaded_ids[0]]['additional_groups']) && $set === 'profile')


In respect to the author rights, here is the modified package for you and btw. i find this little mod very useful because it will help searching for a specific usergroup by one klick via profile.

And btw. to avoid undefined index entries in your error log you should add in load.php around line 940 also:

// Loads an array of users' data by ID or member_name.
function loadMemberData($users, $is_name = false, $set = 'normal')
{
global $user_profile, $modSettings, $board_info, $smcFunc, $list_additional_groups;

flutter

Thanks Petesky

Just one mroe thing please, what do you use to edit your files?  I use dreamweaver and the lines are never where they should be.  The other problem is, with a few mods installed things move about and lines are added..  I'll have a look and see if I can work it out

petesky

Just use an good text editor with syntax highlighting

flutter

I don't think you know what I meant, when you say line ## it could be anything as the lines change as you add mods.  I'll find it, thanks for the help

Advertisement: