Previous Thread
Next Thread
Print Thread
Hop To
Joined: Jan 2008
Posts: 514
addict
addict
Joined: Jan 2008
Posts: 514
I have a subscription based group. This group has a specific title (Iskirra Donator). I would like to make it easy for my admins and I to be able to recognize their contribution easier than going into group management and doing each person manually. Is there a way that when they get moved to the Iskirra Donation group that their title would be given automatically or even a once every couple days query I could run to ensure they are properly recognized?

Dunny

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
yep, i do this myself with a small tweak to the stock code ( paypal_ipn.inc.php )

i set a custom user color and change their title right after it sets their group

kinda like:
PHP Code
$q = "
update {$config['TABLE_PREFIX']}USER_PROFILE
set USER_CUSTOM_TITLE='n00b Sponsor!', USER_NAME_COLOR='#0af'
where USER_ID=$user_id";

$dbh->do_query($q); 

so you could either modify the code like that ( probably different title ) or you could appropriate the SQL and save that as a query in Database tools.

3rd option is to make a custom island ( not displayable ) that runs every so often and does that query, but on a group basis to swoop in and ensure everyone is setup properly

I use 'housekeeping' custom islands all the time for this kinda work.

2c


Joined: Dec 2003
Posts: 6,563
Likes: 78
Joined: Dec 2003
Posts: 6,563
Likes: 78
Quote
I use 'housekeeping' custom islands all the time for this kinda work.

Nice tip, SD!
Never thought of that.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Jan 2008
Posts: 514
addict
addict
Joined: Jan 2008
Posts: 514
Sweet thank you so much SD. I will need more guidance but I can "see" how that works as it is.

I may want to play with custom islands a bit in the future for the newer admins so I can do a quick show for them.

Thank you I will try this out.

Dunny

Joined: Jan 2008
Posts: 514
addict
addict
Joined: Jan 2008
Posts: 514
If I were to update the paypal code where would I put that code?

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
from your PM:

sql for a general update to all members of group xxx

SQL Query
update ubbt_USER_PROFILE up, ubbt_USER_GROUPS ug
set up.USER_CUSTOM_TITLE="whatever title"
where up.USER_ID=ug.USER_ID
and ug.GROUP_ID=xxx

change 'whatever title' to whatever you want
change xxx to group number

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
if you want to change the code instead..

just add the following code after:

PHP Code
} else {																		   
	// Add user to this group														
	$query = "																	   
		replace into {$config['TABLE_PREFIX']}USER_GROUPS							  
		(USER_ID,GROUP_ID)															 
		values																		 
		( ? , ? )																	  
	";																			   
	$dbh->do_placeholder_query($query,array($user_id,$group_id),__LINE__,__FILE__); 

add:
PHP Code
// SD Mod -- Update their name color / title
if ($group_id == xx) {
$query = "
	update {$config['TABLE_PREFIX']}USER_PROFILE
	set USER_CUSTOM_TITLE='n00b Sponsor!', USER_NAME_COLOR='#0af'
	where USER_ID=$user_id
";
$dbh->do_query($query);
} 

in scripts/paypal_ipn.inc.php

where xx is the group number
note: you can drop the name color change, if not needed

Joined: Jan 2008
Posts: 514
addict
addict
Joined: Jan 2008
Posts: 514
YOU ROCK SD!!!

Dunny

Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
Yeah, he does, doesn't he?

He also 'ROLLS' quite well.....

heh heh laugh

RAAAWWWWWWK -> SD wink

Joined: Jan 2008
Posts: 514
addict
addict
Joined: Jan 2008
Posts: 514
Having an issue with the WHERE command it doesn't recognize ug.USER_ID

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
i updated the query to use GROUP_ID which should be correct

Joined: Jan 2008
Posts: 514
addict
addict
Joined: Jan 2008
Posts: 514
Yes SD that one worked THANKS!

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
no probs.. good luck

Joined: Jan 2008
Posts: 514
addict
addict
Joined: Jan 2008
Posts: 514
Heheh now I am going to add in changing the color LOL I figured if I didn't break it the first time....... wink

I still have to figure out why my search column didn't cross when I saved my last DB.

Dunny


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Version 7.7.5 Images suddenly not displaying
by Stovebolt - 05/04/2024 11:19 AM
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Who's Online Now
0 members (), 736 guests, and 155 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240505)