News:

Wondering if this will always be free?  See why free is better.

Main Menu

Display Additional Membergroups

Started by margarett, March 03, 2014, 11:02:35 AM

Previous topic - Next topic

margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

iiiXen

Sent this in a PM but may aswell post here too, we're running into a problem after installing this plugin where the additional membergroups appear unchecked when you go back onto someones profile.
For example, this is before confirming the settings.


And this is what happens whne they're confirmed.

margarett

I've seen your PM, I'll check as soon as I get to the computer ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

iiiXen

Quote from: margarett on January 24, 2016, 03:14:10 PM
I've seen your PM, I'll check as soon as I get to the computer ;)
Awesome, just thought I'd post just incase someone else had the issue :D

Much appreciated :)

Steve

Just a tip iiiXen ... you should always post first and then pm if someone on the support team says it's okay. Most team members ignore support requests if they haven't been posted. :)
DO NOT pm me for support!

margarett

I can't reproduce this issue. Are you sure you didn't failed any installation step?
Do you have any errors in your error log which might relate to this?

Maybe try with default theme?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

iiiXen

Quote from: margarett on January 24, 2016, 07:20:27 PM
I can't reproduce this issue. Are you sure you didn't failed any installation step?
Do you have any errors in your error log which might relate to this?

Maybe try with default theme?
Tried it with the default theme and still the same thing, but yeah I did get an error while installing while replacing something within load.php.


Find:
mem.time_format, mem.secret_question, mem.is_activated, mem.is_activated, mem.additional_groups AS additional_groups_ori,
mem.smiley_set, mem.show_online, mem.total_time_logged_in, mem.id_post_group, mem.notify_announcements, mem.notify_regularity, mem.notify_send_body,
mem.notify_types, lo.url, mem.ignore_boards, mem.warning, mem.password_salt, mem.pm_prefs';
$select_tables = '
LEFT JOIN {db_prefix}log_online AS lo ON (lo.id_member = mem.id_member)
LEFT JOIN {db_prefix}attachments AS a ON (a.id_member = mem.id_member)';


Replace:

mem.time_format, mem.secret_question, mem.is_activated, mem.additional_groups, mem.smiley_set, mem.show_online,
mem.total_time_logged_in, mem.id_post_group, mem.notify_announcements, mem.notify_regularity, mem.notify_send_body,
mem.notify_types, lo.url, mg.online_color AS member_group_color, IFNULL(mg.group_name, {string:blank_string}) AS member_group,
pg.online_color AS post_group_color, IFNULL(pg.group_name, {string:blank_string}) AS post_group, mem.ignore_boards, mem.warning,
CASE WHEN mem.id_group = 0 OR mg.stars = {string:blank_string} THEN pg.stars ELSE mg.stars END AS stars, mem.password_salt, mem.pm_prefs';
$select_tables = '
LEFT JOIN {db_prefix}log_online AS lo ON (lo.id_member = mem.id_member)
LEFT JOIN {db_prefix}attachments AS a ON (a.id_member = mem.id_member)
LEFT JOIN {db_prefix}membergroups AS pg ON (pg.id_group = mem.id_post_group)
LEFT JOIN {db_prefix}membergroups AS mg ON (mg.id_group = mem.id_group)';


Also nothing jumps out at me with the error logs.

margarett

For future reference, *never* install a MOD with errors. Ask first ;)
If you failed that edit, the MOD will not work at all, really.

Please attach your Load.php, I'll try to fix it for you.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

iiiXen

Quote from: margarett on January 24, 2016, 08:29:23 PM
For future reference, *never* install a MOD with errors. Ask first ;)
If you failed that edit, the MOD will not work at all, really.

Please attach your Load.php, I'll try to fix it for you.
Ooopsies :P

Here you go, thank you by the way.

margarett

Sorry for the huge delay, been terribly busy...
Try the attached file. That change conflicts with a "thanks" MOD you have also installed. I manually fixed the missing query entries.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

iiiXen

Quote from: margarett on February 03, 2016, 07:59:49 PM
Sorry for the huge delay, been terribly busy...
Try the attached file. That change conflicts with a "thanks" MOD you have also installed. I manually fixed the missing query entries.
Thank you, we thought it would of been that mod. We've had trouble with it ever since we installed it. Managed to get rid of it completely now.

lntit

margarett, this is a great mod and I love it!

We have upgraded our forum from 1.1.x to 2.0.x and your mod replaced the previous banner mod. There was one minor thing that I have changed:
Code (original) Select
foreach($context['member']['additional_groups_full'] as $temp) {
echo '
<dt>', $txt['additional_membergroups'], ':</dt>
<dd>', $temp['group'], '</dd>';
}

to:
Code (changed) Select
foreach($context['member']['additional_groups_full'] as $temp) {
if (!empty($temp['stars_img']))
echo '
<dt>', $temp['group'], ':</dt>
<dd>', $temp['stars_img'], '</dd>';
}

This little change let display only membergroups in the member's profile that have a star or badge or any kind of image plus the corresponding membergroup name (instead "Additional Membergroup" it shows the the membergroup name).
This worked for me since september without any error messages. :D :) Maybe this could be useful for other users. :)

margarett

Thank you for sharing, it's a neat modification ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

lntit

I have a question:
When I approve a requestable membergroup, it used to be set as primary membergroup, but which code I have to change to let it set as additional membergroup?

margarett

I understand your question but that doesn't relate to this mod. You should ask that in SMF Coding board ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

lntit


T-Bone225

margarett, sorry in advance, feeling a bit nooby  :D, but which lines do I need to swap to make the additional groups (just the additional) to display under the avatar instead?  :-[

JerzyLS

Is possible to show additional membergroups only in profile?
And how about showing "Additional ..." only once with all membergroups list?

-Rock Lee-

@margarett Very good modification I've used more than once with some alterations O:) so here I leave the translation to the Latin Spanish I hope you serve!

Modifications.spanish_latin.php
$txt['show_additional_groups'] = '¿Mostrar grupo(s) de miembro(s) adicional(es) en la visualizaci&oacute;n de temas y en el resumen del perfil?';
$txt['show_additional_groups_name'] = '¿Mostrar el nombre de los grupos de miembro(s) adicional(es)? Si no se selecciona, s&oacute;lo se mostrar&aacute;n las estrellas.<br /> Esto s&oacute;lo se activa si se selecciona la opci&oacute;n anterior';


and Modifications.spanish_latin-utf8.php
$txt['show_additional_groups'] = '¿Mostrar grupo(s) de miembro(s) adicional(es) en la visualización de temas y en el resumen del perfil?';
$txt['show_additional_groups_name'] = '¿Mostrar el nombre de los grupos de miembro(s) adicional(es)? Si no se selecciona, sólo se mostrarán las estrellas.<br /> Esto sólo se activa si se selecciona la opción anterior';



Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

margarett

Quote from: T-Bone225 on April 10, 2016, 05:39:10 AM
margarett, sorry in advance, feeling a bit nooby  :D, but which lines do I need to swap to make the additional groups (just the additional) to display under the avatar instead?  :-[
You find this in Display.template.php
//Show additional groups, if the user has some attributed
if (!empty($message['member']['additional_groups_full'])) {
foreach($message['member']['additional_groups_full'] as $temp) {
if (!empty($modSettings['show_additional_groups_name']))
echo '
<li class="membergroup">', $temp['group'], '</li>';
echo '
<li class="membergroup">', $temp['stars_img'], '</li>';
}
}

Move it ABOVE this
// Show how many posts they have made.
Do note that this will prevent the MOD from being automatically uninstalled, should you choose to do so...



Quote from: JerzyLS on April 10, 2016, 08:43:46 AM
Is possible to show additional membergroups only in profile?
Without major changes, find this in Display.template.php
//Show additional groups, if the user has some attributed
if (!empty($message['member']['additional_groups_full'])) {

Change to:
//Show additional groups, if the user has some attributed
if (false && !empty($message['member']['additional_groups_full'])) {

This will prevent the information to be shown in topic view, yet keep all other functionality intact.
Do note that this will prevent the MOD from being automatically uninstalled, should you choose to do so...

Quote from: JerzyLS on April 10, 2016, 08:43:46 AM
And how about showing "Additional ..." only once with all membergroups list?
It's possible but tricky. I haven't tested this (so it might break, be sure to back up your files :P ) in Profile.template.php find:
//Show additional groups, if the user has some attributed
if (!empty($modSettings['show_additional_groups']) && !empty($context['member']['additional_groups_full'])) {
echo '<dl>';
foreach($context['member']['additional_groups_full'] as $temp) {
echo '
<dt>', $txt['additional_membergroups'], ':</dt>
<dd>', $temp['group'], '</dd>';
}
echo '</dl>';
}

Replace with this
//Show additional groups, if the user has some attributed
$check = false;
if (!empty($modSettings['show_additional_groups']) && !empty($context['member']['additional_groups_full'])) {
echo '<dl>';
foreach($context['member']['additional_groups_full'] as $temp) {
echo '
<dt>', (empty($check) ? $txt['additional_membergroups'] : '&nbsp;'), ':</dt>
<dd>', $temp['group'], '</dd>';
}
$check = true;
echo '</dl>';
}

Again, this prevents the MOD from being automatically uninstalled.



@Rock Lee [BC], thank you. I will add your translation to a next version (if/when it comes out ;) )
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Advertisement: