View Full Version : Show Usergroup Description on Show Groups
Link14716
07-14-2005, 10:00 PM
This plugin shows the description of the usergroup on showgroups.php.
Enjoy. :)
Chris M
07-15-2005, 01:56 AM
I noticed that the hook showgroups_start is initialised just before the query you modify in your Code Modification version...
Couldn't you do something like the following?
$locationfieldselect = array_merge($locationfieldselect, array(' usergroup.description,'));
Not entirely sure but wouldn't this work? ;)
Satan
Link14716
07-15-2005, 02:58 AM
$locationfieldselect isn't an array. I didn't notice it, though. I guess I can make a plugin without a query. :p
(Whoops...)
Chris M
07-15-2005, 02:59 AM
$locationfieldselect isn't an array. I didn't notice it, though. I guess I can make a plugin without a query. :p
(Whoops...)
Yeh I know it's not an array, but I was just being lazy and quoting something to give you the general idea :p
Satan
Link14716
07-15-2005, 03:02 AM
Actually, I don't think I can. The same variable is used on a query that doesn't involve usergroups (moderators), so I end up with a MySQL error. I can probably find some way around it, though.
Chris M
07-15-2005, 03:06 AM
Actually, I don't think I can. The same variable is used on a query that doesn't involve usergroups (moderators), so I end up with a MySQL error. I can probably find some way around it, though.
Hrm yes I see that :ermm:
Isn't there a way that you can clear the alteration to $locationfieldselect after you display the description?
Like "unset($locationfieldselect);"
Then you could reset it before it goes on to the moderators query?
Just theorising :p
Satan
Link14716
07-15-2005, 03:08 AM
That would make it not select the location field silly. :p
I did something similar, setting what was $locationfieldselect to a temp variable and then changing it back when it gets to the usergroup loop. I just need to download the .xml file, attach it, and report my code mod version for deletion. :D
Chris M
07-15-2005, 03:10 AM
That would make it not select the location field silly. :p
I did something similar, setting what was $locationfieldselect to a temp variable and then changing it back when it gets to the usergroup loop. I just need to download the .xml file, attach it, and report my code mod version for deletion. :D
Well I was just theorising :p
Glad to see my confusion brought a query-free plugin out of this :p
Satan
Link14716
07-15-2005, 03:14 AM
Thanks for spotting that variable, Satan. I was looking for one before I did the code mod, but I was looking for it at the end of the fields.
Chris M
07-15-2005, 03:17 AM
Heh - You are going to hate me:p
Database error in vBulletin 3.5.0 Beta 4:
Invalid SQL:
SELECT userfield.field2, usergroup.description, user.*,moderator.*
FROM moderator AS moderator
INNER JOIN user AS user USING(userid)
INNER JOIN userfield AS userfield USING(userid)
#ORDER BY user.username;
MySQL Error : Unknown table 'usergroup' in field list
Error Number : 1109
Date : Thursday, July 14th 2005 @ 11:17:06 PM
Script : http://forums.hellsatan.co.uk/showgroups.php
Referrer : http://forums.hellsatan.co.uk/index.php?
IP Address :
Username : hellsatan
Classname : vb_database
:D
Satan
Chris M
07-15-2005, 03:24 AM
Ah I've figured out why;)
For some reason the plugin I downloaded had:
<plugins>
<plugin active="1" devkey="show_description_on_showg" product="vbulletin">
<title>Show Description On Showgroups - Usergroup Loop</title>
<hookname>showgroups_user</hookname>
<phpcode>if (isset($locationfieldselect2)) {
$locationfieldselect = $locationfieldselect2;
}
unset($locationfieldselect2);</phpcode>
</plugin>
That should be:
<plugins>
<plugin active="1" devkey="show_description_on_showg" product="vbulletin">
<title>Show Description On Showgroups - Usergroup Loop</title>
<hookname>showgroups_user</hookname>
<phpcode><![CDATA[if (isset($locationfieldselect2)) {
$locationfieldselect = $locationfieldselect2;
}
unset($locationfieldselect2);]]></phpcode>
</plugin>
:)
Satan
Link14716
07-15-2005, 03:25 AM
It looks like the xml file has some issues. It cut the devkey down, and since the differences are at the end, one of the plugins overwrote the other one. That hurts.
Delete the single plugin it added and I'll fix it.
Link14716
07-15-2005, 03:27 AM
Redownload it and the plugin file should work.
Chris M
07-15-2005, 03:28 AM
It looks like the xml file has some issues. It cut the devkey down, and since the differences are at the end, one of the plugins overwrote the other one. That hurts.
Delete the single plugin it added and I'll fix it.
Hehe - I fixed it by myself manually but I though I'd let you know it was corrupted ;)
Satan
Wayne Luke
07-15-2005, 04:23 AM
Did you see my post on vBulletin.com about this? I deleted it when I figured out it needed to be done in the code.
Anyways, thanks. Will be installing this on my site once I go live with 3.5.0.
Link14716
07-15-2005, 04:48 AM
Did you see my post on vBulletin.com about this? I deleted it when I figured out it needed to be done in the code.
Anyways, thanks. Will be installing this on my site once I go live with 3.5.0.
Yep. I was going to post a link to the code mod version I did right after I saw it, but the thread disappeared on me. ;)
Oblivion Knight
10-17-2005, 07:00 PM
I'm quite surprised that this isn't a default feature, even if usergroup descriptions generally aren't used..
Installed, thanks Matt. :)
Oblivion Knight
10-31-2005, 05:45 AM
This doesn't work for Moderators that are assigned to a forum (using $moderatorbits).
Is there any way to get around that? :)
robertpro2a
08-21-2008, 08:34 PM
Why is it not showing anything? I've followed your directions to the 'T'. And I have descriptions on them set.
Added the code and everything:
<if condition="$user['description']"><br /><span class="smallfont">$user[description]</span></if>
I even replaced it with "TEST" and that text shows up, but it's as if $user[description] is a NULL value.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.