Previous Thread
Next Thread
Print Thread
Rate Thread
#238092 02/25/2003 12:13 PM
Joined: Jul 2001
Posts: 442
C
Enthusiast
OP Offline
Enthusiast
C
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?

Sponsored Links
Joined: Jul 2001
Posts: 442
C
Enthusiast
OP Offline
Enthusiast
C
Joined: Jul 2001
Posts: 442
Anyone?

Joined: May 1999
Posts: 1,715
Addict
Offline
Addict
Joined: May 1999
Posts: 1,715
1. This is an easy fix. Find the following lines in ubbt.inc.php:
Code
<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:
Code
<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:
Code
<br />// -----------------<br />// Get the user info<br />   $userob = new user;<br />   $user = $userob -> authenticate();                         <br />


Replace them with this:
Code
<br />// -----------------<br />// Get the user info<br />   $userob = new user;<br />   $user = $userob -> authenticate("U_Groups");                         <br />


Now find these lines:
Code
<br />   if ($theme['PictureView']) {<br />      if ( ($config['avatars']) && (ini_get('file_uploads')) ){<br />


And replace them with this:
Code
<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
C
Enthusiast
OP Offline
Enthusiast
C
Joined: Jul 2001
Posts: 442

I will get this going this weekend and let you know how it went, you da man.

Joined: Aug 2002
Posts: 100
D
Journeyman
Offline
Journeyman
D
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

Sponsored Links
Joined: Aug 2002
Posts: 100
D
Journeyman
Offline
Journeyman
D
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
Offline
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
Offline
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:
Code
<br />// -----------------<br />// Get the user info<br />   $userob = new user;<br />   $user = $userob -> authenticate();                         <br />


Replace them with this:
Code
<br />// -----------------<br />// Get the user info<br />   $userob = new user;<br />   $user = $userob -> authenticate("U_Groups");                         <br />


Now find these lines:
Code
<br />   if ($theme['PictureView']) {<br />      if ( ($config['avatars']) && (ini_get('file_uploads')) ){<br />


And replace them with this:
Code
<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
D
Journeyman
Offline
Journeyman
D
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
Offline
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...

Sponsored Links
Joined: Jan 2002
Posts: 674
S
Junior Member
Offline
Junior Member
S
Joined: Jan 2002
Posts: 674
Anybody update this for 6.4?

Joined: Apr 2001
Posts: 3,266
O
Member
Offline
Member
O
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
E
Junior Member
Offline
Junior Member
E
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
Code
    <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
Code
    <br />$userob = new user;<br />$user = $userob -> authenticate("U_CoppaUser","U_Groups"); 


and it didn't work.

Joined: Apr 2001
Posts: 3,266
O
Member
Offline
Member
O
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
E
Junior Member
Offline
Junior Member
E
Joined: May 2003
Posts: 1,068
Ahh.. thanks

Joined: Apr 2001
Posts: 3,266
O
Member
Offline
Member
O
Joined: Apr 2001
Posts: 3,266
Don't meantion it

Joined: Feb 2002
Posts: 2,286
Veteran
Offline
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 wink at the moment - but expanding all the time....)
Joined: Apr 2001
Posts: 3,266
O
Member
Offline
Member
O
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
I
Lurker
Offline
Lurker
I
Joined: Mar 2005
Posts: 1
Has anybody got this to work for 6.5?


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Posts: 70
Joined: January 2007
Forum Statistics
Forums63
Topics37,569
Posts293,914
Members13,847
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,829
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 81
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2022 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Snapshot build 20220917)