|
Joined: Jul 2001
Posts: 442
Enthusiast
|
Enthusiast
Joined: Jul 2001
Posts: 442 |
Not sure if this is the right place, but here goes: In order to try and get a handle on bandwidth as well as convert users to Members I need a few hacks like this:
1. Currently I would like to see a hack that would allow the image tag to be used by group, not the current, on or off for everyone. This would allow only my Member group to show pics in their posts not everyone.
2. I would also like to see a hack that would only allow a certain group to display avitars, not the current, on or off for everyone. This would allow only my Member group to have an avitar in their posts not everyone.
Basicly, anywhere I can limit pics/bandwidth by group I'm all for, can anyone create hacks like this, I'm sure others could use these?
|
|
|
|
Joined: Jul 2001
Posts: 442
Enthusiast
|
Enthusiast
Joined: Jul 2001
Posts: 442 |
Anyone? 
|
|
|
|
Joined: May 1999
Posts: 1,715
Addict
|
Addict
Joined: May 1999
Posts: 1,715 |
1. This is an easy fix. Find the following lines in ubbt.inc.php: <br /> // ----------------------------<br /> // Convert email markup -> html<br /> $Body = preg_replace("/\[{$ubbt_lang['TEXT_EMAIL']}\]([^\[]*)\[\/{$ubbt_lang['TEXT_EMAIL']}\]/i","<a href=\"mailto:\\1\">\\1</a>",$Body);<br /><br /> // ---------------------<br /> // Convert image markup <br /> if ($config['allowimages']) {<br /> And replace them with this: <br /> // ----------------------------<br /> // Convert email markup -> html<br /> $Body = preg_replace("/\[{$ubbt_lang['TEXT_EMAIL']}\]([^\[]*)\[\/{$ubbt_lang['TEXT_EMAIL']}\]/i","<a href=\"mailto:\\1\">\\1</a>",$Body);<br /><br /> // ---------------------<br /> // Convert image markup <br /> Global $user;<br /> if ($config['allowimages'] && stristr($user['U_Groups'], "-{$config['imagegroup']}-")) {<br /> Then add this line to your config file (and change 5 to the number of the group you want to allow images for): $config['imagegroup'] = "5"; 2. This is almost as easy. Open up your editbasic.php file and do the following: Find these lines: <br />// -----------------<br />// Get the user info<br /> $userob = new user;<br /> $user = $userob -> authenticate(); <br /> Replace them with this: <br />// -----------------<br />// Get the user info<br /> $userob = new user;<br /> $user = $userob -> authenticate("U_Groups"); <br /> Now find these lines: <br /> if ($theme['PictureView']) {<br /> if ( ($config['avatars']) && (ini_get('file_uploads')) ){<br /> And replace them with this: <br /> if ($theme['PictureView'] && stristr($user['U_Groups'], "-{$config['avatargroup']}-")) {<br /> if ( ($config['avatars']) && (ini_get('file_uploads')) ){<br /> That's it. Now you need to add a new configuration option to your config file, so open that up and insert this at the end: $config['avatargroup'] = "5";
|
|
|
|
Joined: Jul 2001
Posts: 442
Enthusiast
|
Enthusiast
Joined: Jul 2001
Posts: 442 |
|
|
|
|
Joined: Aug 2002
Posts: 100
Journeyman
|
Journeyman
Joined: Aug 2002
Posts: 100 |
Wondering how you can do this for many groups? How would you add in multiple groups, so that more than the one group can add an avatar?
Deej
|
|
|
|
Joined: Aug 2002
Posts: 100
Journeyman
|
Journeyman
Joined: Aug 2002
Posts: 100 |
This can be done easily it looks like, by adding the groups to this variable?
$config['avatargroup'] = "5";
How would I add groups 6,7,8 etc?
Deejay
|
|
|
|
Joined: May 1999
Posts: 1,715
Addict
|
Addict
Joined: May 1999
Posts: 1,715 |
Wouldn't it be easier to just create a special avatar group for this purpose and add all relevant users to it?
But I'll see what I can whip up.
|
|
|
|
Joined: May 1999
Posts: 1,715
Addict
|
Addict
Joined: May 1999
Posts: 1,715 |
Here are complete instructions for letting several groups use avatars. All steps are the same as before except the last one. I've also changed the name of the config option to make it plural. Open up your editbasic.php file and do the following: Find these lines: <br />// -----------------<br />// Get the user info<br /> $userob = new user;<br /> $user = $userob -> authenticate(); <br /> Replace them with this: <br />// -----------------<br />// Get the user info<br /> $userob = new user;<br /> $user = $userob -> authenticate("U_Groups"); <br /> Now find these lines: <br /> if ($theme['PictureView']) {<br /> if ( ($config['avatars']) && (ini_get('file_uploads')) ){<br /> And replace them with this: <br /> $grpfound = false;<br /> $avgroups = split(",", $config['avatargroups']); <br /> foreach ( $avgroups as $grp ) {<br /> if ( stristr($user['U_Groups'], "-{$grp}-") ) {<br /> $grpfound = true;<br /> }<br /> }<br /> if ($theme['PictureView'] && $grpfound ) {<br /> if ( ($config['avatars']) && (ini_get('file_uploads')) ){<br /> That's it. Now you need to add a new configuration option to your config file, so open that up and insert this at the end: $config['avatargroups'] = "5,6,7"; This has been tested to work on 6.2.3.
|
|
|
|
Joined: Aug 2002
Posts: 100
Journeyman
|
Journeyman
Joined: Aug 2002
Posts: 100 |
Thanks  Since i already had the hack installed before all i had to change was the last snip of code and then the avatargroups 5,6,7 etc... Awesome! thanks! (I cant say enough about the awesome help here.. thanks guys!) Deej
|
|
|
|
Joined: May 1999
Posts: 1,715
Addict
|
Addict
Joined: May 1999
Posts: 1,715 |
You're welcome. I'm stuck with a problem of my own at the moment and needed some distractions so I might be able to look at the problem with a fresh mind...
|
|
|
|
Joined: Jan 2002
Posts: 674
Junior Member
|
Junior Member
Joined: Jan 2002
Posts: 674 |
Anybody update this for 6.4?
|
|
|
|
Joined: Apr 2001
Posts: 3,266
Member
|
Member
Joined: Apr 2001
Posts: 3,266 |
Nearest I can tell from comparing the instructions to the code involved in 6.4 it is the same. You should be able to apply the changes from Gardener's text.
|
|
|
|
Joined: May 2003
Posts: 1,068
Junior Member
|
Junior Member
Joined: May 2003
Posts: 1,068 |
Okay, I have this working in 6.4 but the problem is with this line, by default in 6.4 it reads <br />$userob = new user;<br />$user = $userob -> authenticate("U_CoppaUser"); The only way I can get it to work is to replace "U_CoppaUser" with "U_Groups" I tried this <br />$userob = new user;<br />$user = $userob -> authenticate("U_CoppaUser","U_Groups"); and it didn't work.
|
|
|
|
Joined: Apr 2001
Posts: 3,266
Member
|
Member
Joined: Apr 2001
Posts: 3,266 |
That is because it is suppose to be this
$userob = new user; $user = $userob -> authenticate("U_CoppaUser, U_Groups");
not this you have
$userob = new user; $user = $userob -> authenticate("U_CoppaUser","U_Groups");
|
|
|
|
Joined: May 2003
Posts: 1,068
Junior Member
|
Junior Member
Joined: May 2003
Posts: 1,068 |
Ahh.. thanks 
|
|
|
|
Joined: Apr 2001
Posts: 3,266
Member
|
Member
Joined: Apr 2001
Posts: 3,266 |
Don't meantion it 
|
|
|
|
Joined: Feb 2002
Posts: 2,286
Veteran
|
Veteran
Joined: Feb 2002
Posts: 2,286 |
I don't think you need to add U_Groups for 6.4 as it is authenticated within ubbt.inc.php
Fans Focus - Focusing on Fans of Sport (Okay - mainly football (the British variety at the moment - but expanding all the time....)
|
|
|
|
Joined: Apr 2001
Posts: 3,266
Member
|
Member
Joined: Apr 2001
Posts: 3,266 |
U_Groups was authenticated in ubbt-inc.php I beleive in 6.2 as well Ian. no worries though using it here.
|
|
|
|
Joined: Mar 2005
Posts: 1
Lurker
|
Lurker
Joined: Mar 2005
Posts: 1 |
Has anybody got this to work for 6.5?
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 1,157
Joined: July 2001
|
|
Forums63
Topics37,575
Posts293,931
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|