View Full Version : Styles for Premium Members
amykhar
02-14-2003, 10:00 PM
This Hack allows you to set styles for use only by premium members. (Premium members are people that you decide are premium either because they have paid or because you like them or for whatever reason you determine they are premium)
This hack does not use the usergroup system because it allows premium users to be in any usergroup. This enables me to keep moderators in a mods group, Epinions members in an Epinions group, and everybody else in the registered group and still mark them as a contributor.
Premium members on my board have paid a membership fee. My nonpaid members have the default style that has ad banners and few if any hacks.
My premium members have 5 styles to choose from. None have Ad Banners and there are more hacks and features.
If you want to see a live demo: Join my forum, look at the styles available to you. Then pay to become a premium member :D and look to see the available styles once you have paid.
KNOWN ISSUES:
None.
I will include screenshots in a few minutes.
NOTE: I will support this hack for users who know how to run queries and edit files. I will not explain the basics of hacking. I will support bugs. I will also refine the instructions if they are incorrect.
Custom Avatars Addon: https://vborg.vbsupport.ru/showthread.php?postid=366084#post366084
No PM Quota for Premium Addon:
https://vborg.vbsupport.ru/showthread.php?s=&postid=364882#post364882
amykhar
02-15-2003, 07:54 PM
Screenshot of making the style premium:
amykhar
02-15-2003, 07:56 PM
Here is the screenshot of making the user premium:
SphereX
02-15-2003, 09:47 PM
this looks very nice. I am not sure if I will install it though.
If I ever get a donation thing up and running it will come in very handy
EchoHype.com
02-16-2003, 12:59 AM
This is a very nice hack.
Good job!
amykhar
02-17-2003, 03:16 PM
I got over my lazy spell and updated this hack so that you can change premium member's styles from the admin control panel. The text file has been updated.
If you have already installed it, you simply need to do this in user.php:
Find:
// returns a combo box containing a list of titles in the $tablename table.
// allows specification of selected value in $selvalue
global $DB_site,$bgcounter;
Replace With:
// returns a combo box containing a list of titles in the $tablename table.
// allows specification of selected value in $selvalue
global $DB_site,$bgcounter,$user;
Find:
$result=$DB_site->query("SELECT title,$tableid FROM $tablename WHERE userselect=1 ORDER BY title");
Replace With:
if ($user[premium]){
$result=$DB_site->query("SELECT title,$tableid FROM $tablename WHERE userselect>0 ORDER BY title");
}
else {
$result=$DB_site->query("SELECT title,$tableid FROM $tablename WHERE userselect=1 ORDER BY title");
}
Question: There's a drop down menu for style sets in register.php and member.php. Does this make it so users who are registering cannot select premium styles?
Also, how would I go about making this work with the change style drop-down menu hack, located: here. (https://vborg.vbsupport.ru/showthread.php?s=&threadid=33418)
amykhar
02-17-2003, 07:53 PM
I did not incorporate it into register.php because my members have to register first before they can become premium members. The paypal integration requires that their username already exist. Therefore, people registering can only choose from the non-premium styles.
Regarding the second question, I would simply change This:
$allstyles=$DB_site->query("SELECT style.title, user.styleid, COUNT(*) AS count FROM user LEFT JOIN style USING (styleid) WHERE style.styleid IS NOT NULL AND style.userselect=1 GROUP BY user.styleid");
to this:
if ($bbuserinfo[premium]{
$allstyles=$DB_site->query("SELECT style.title, user.styleid, COUNT(*) AS count FROM user LEFT JOIN style USING (styleid) WHERE style.styleid IS NOT NULL AND style.userselect>0 GROUP BY user.styleid");
}
else {
$allstyles=$DB_site->query("SELECT style.title, user.styleid, COUNT(*) AS count FROM user LEFT JOIN style USING (styleid) WHERE style.styleid IS NOT NULL AND style.userselect=1 GROUP BY user.styleid");
}
amykhar
02-17-2003, 07:56 PM
I don't think I ever mentioned, this code prevents non-premium members from simply setting the styleid in their url and viewing the premium styles that way. The hack treats it just like they tried to use a non-selectable style.
Oops! lol, of course! How can you make a guest a premium member :D! I was having a dumb moment, sorry.
Also, thanks for that code for the drop down change style hack by FireFly, very helpful. Will install this later :).
Dean C
02-18-2003, 09:02 AM
What a good idea Amy :)
- miSt
Chris M
02-18-2003, 04:38 PM
Nice hack:)
Satan
danrak
02-23-2003, 05:13 AM
I must be doing something wrong. I've tried this on my test board but I get the following error message after trying to save the user:
mysql error: Unknown column 'premium' in 'field list'
mysql error number: 1054
I ran the query in the begining of the text. Is there another query I'm missing?
amykhar
02-23-2003, 11:50 PM
danrak, when updating the file, I accidentally posted in the wrong query. This is the correct one:
ALTER TABLE `user` ADD `premium` TINYINT NOT NULL;
Sorry for the confusion.
Amy
danrak
02-24-2003, 04:16 AM
Ok. Sorry about that. Let me try that. Thanks.
Xyphen
03-05-2003, 08:38 PM
Thanks man, installed it on vB2.3.0, don't know if it works fine, but will let u know..
Xyphen
03-09-2003, 09:26 PM
I merged it with Contributing members, works perfect!
amykhar
03-09-2003, 09:36 PM
great. I have been using it for over a year now. It certainly helped cover hosting costs.
amykhar
03-12-2003, 03:29 PM
I have configured my PM system so that Premium members no longer have a PM quota. I combine this with another hack I wrote that deletes PMs older than 2 months old. (date configurable in the code)
So, here is the addon. In private.php, Find:
if ($pmquota>0 and $touserinfo[usergroupid] != 6 and $bbuserinfo[usergroupid] != 6) {
Replace with:
if ($pmquota>0 and $touserinfo[usergroupid] != 6 and $bbuserinfo[usergroupid] != 6 and $touserinfo[premium]!=1) {
That was easy, wasn't it? :D
Amy
corsacrazy
03-13-2003, 06:15 AM
hav u got any more addons, ie an addition for the mini avatars hack so that paid members can use mini icons next to there name on forumhome !
amykhar
03-13-2003, 01:57 PM
Most hacks can be added on very easily to this by only installing them to work on the premium styles. As I am upgrading right now, if I come across any others that I tweak more to work with the premium styles, I will most definitely post them here.
Amy
corsacrazy
03-13-2003, 03:04 PM
thank you :p
corsacrazy
03-14-2003, 01:41 PM
would it be possible to alow premium members to have custom avatars and non premium members use the gallery avatars ?
amykhar
03-14-2003, 01:52 PM
Yes. In fact, I forgot that I had already done something similar. My regular members must have 200 posts to use custom avatars. Premium members can use them no matter how many posts they have. Back in a few with that addon and thanks for the reminder.
Amy
corsacrazy
03-14-2003, 01:58 PM
nice one ! im tryin to make some additions also ! but i cant figure out the variable to select the premium mebers ? is it somthing like
userinfo[premium] ! because i want to add a small icon next to the premium peoples usernames in the whos online bit on forumhome
amykhar
03-14-2003, 02:22 PM
OK. I am back.
I wrote two versions of the hack. The first is tested. The second is not.
The first one makes it so that if you set a post limit for custom avatars, premium members are exempt from that limit. On my board, members need 200 posts to use custom avatars but premium members can use them no matter how many posts they have.
The second one makes it so that if you disable custom avatars entirely for your normal members, premium members can still use them. I have not tested the second one and will rely on some brave soul to do so. I will happily fix any bugs.
Amy
amykhar
03-14-2003, 02:27 PM
Today at 10:58 AM corsacrazy said this in Post #25 (https://vborg.vbsupport.ru/showthread.php?postid=366077#post366077)
nice one ! im tryin to make some additions also ! but i cant figure out the variable to select the premium mebers ? is it somthing like
userinfo[premium] ! because i want to add a small icon next to the premium peoples usernames in the whos online bit on forumhome
It depends on the file you are using. Sometimes it is $bbuserinfo[premium] Sometimes it is $userinfo[premium] . Just check to see what other user variables are in that section of code and it is the same.
To do what you want to do, try this:
In online.php Find:
} else if (($mod["$key"] or $user['usergroupid'] == 5)and $highlightadmin) {
$userinfo["$key"]['username'] = "<b>$user[username]</b>";
Add After:
} else if ($user['premium'])and $highlightadmin) {
$userinfo["$key"]['username'] = "<img src="Put icon here."><b>$user[username]</b>";
Just put your icon url where I have "Put Icon Here"
Amy
corsacrazy
03-14-2003, 07:30 PM
u r a star ! and all this without usergroups thanks ever so much !
corsacrazy
03-14-2003, 07:52 PM
cant get icon to work ! i will not put it in onlin.php but i would like it to go in index so it shows up next to the username in forum home whosonline
amykhar
03-16-2003, 06:26 PM
OK. This one is easy.
In index.php Find: (twice)
eval("\$activeusers = \"".gettemplate('forumhome_loggedinuser')."\";");
Add Above:
if ($loggedin['premium'] == 1 and $highlightadmin) {
$username = "<img src='Icon src here'> " .$username;
}
That should do it. Don't forget to do it in both places in index.php.
corsacrazy
03-16-2003, 06:29 PM
shes back wiv another quality addon ! hoope this wors /me opens smart ftp
corsacrazy
03-16-2003, 06:43 PM
doesnt seem to be working :S :s my index is soooo hacked and jam packed wiv crap that i just cant do it :( if i pm u the file wood u b able to do it , plus i can only find ONE instance of teh stated text :|
amykhar
03-16-2003, 06:51 PM
email me the file. You can go to my website and grab the contact email address and mail it there.
Amy
corsacrazy
03-16-2003, 07:04 PM
thanks alot ps dont get me wrong im not no n00b i just cant figure it out as index is sooo hacked :( thanks ocne again 4 helpin me
corsacrazy
03-24-2003, 08:07 PM
can u pls help me with
premium mebers can set custom titles but normal cant ?
amykhar
03-24-2003, 08:10 PM
I'll look at it for ya tomorrow, ok? Gotta work tonight and I don't want to start ripping code apart if I won't have time to finish it.
Amy
corsacrazy
03-25-2003, 07:26 PM
ok thanks very much !
amykhar
03-28-2003, 02:03 PM
03-24-03 at 05:07 PM corsacrazy said this in Post #35 (https://vborg.vbsupport.ru/showthread.php?postid=372633#post372633)
can u pls help me with
premium mebers can set custom titles but normal cant ?
I THINK this will do it but it's untested. Give it a shot and let me know. It's only changing one line of code.
Amy
corsacrazy
03-29-2003, 06:44 PM
Works like a charm :D
im looking 4 ward to more additions ! cheers amy
corsacrazy
05-15-2003, 05:28 PM
:D im back , how bout forums that only premiums can view so they can chat amongst themselves ?
amykhar
05-15-2003, 07:19 PM
That would be a bit trickier. I can't guarantee that I will look into it anytime soon because I am rather swamped at work.
Amy
corsacrazy
05-15-2003, 07:24 PM
^ no probs :D
Kohhal
06-24-2003, 11:52 AM
Nice hack, using it so I can work on new styles in private :D
corsacrazy
06-24-2003, 12:37 PM
^ same :p
Blood Lust
09-04-2003, 03:19 PM
I am getting a parse error
Parse error: parse error in /home/thelega/public_html/forum/admin/style.php on line 587
I am running 2.3.2
$styleinfo=$DB_site->query_first("SELECT templatesetid,replacementsetid,title FROM style WHERE styleid='$dostyleid'");
line 587= echo "<p>"<b>$styleinfo[title]</b>""
.makelinkcode("edit style properties","style.php?s=$session[sessionhash]&action=edit&editstyleid=$dostyleid")
.makelinkcode("edit replacements","replacement.php?s=$session[sessionhash]&action=modify&expandset=$styleinfo[replacementsetid]")
.makelinkcode("edit templates","template.php?s=$session[sessionhash]&action=modify&expandset=$styleinfo[templatesetid]")
."</p>\n";
Can anyone help me please?
amykhar
09-04-2003, 03:56 PM
You can't use double quotes inside double quotes like that on line 587. If you use "" to designate a string, you should use ' ' inside the string and not ""
Amy
Blood Lust
09-04-2003, 04:36 PM
thank you thank you thank you :D
question: would it be posible to set it so that after a set number of posts the style changes?
SWFans.net
10-26-2003, 08:06 PM
I did not incorporate it into register.php because my members have to register first before they can become premium members. The paypal integration requires that their username already exist. Therefore, people registering can only choose from the non-premium styles.Would you happen to have a releasable version of a paypal integration hack? That would be so sweet to have. :D
amykhar
10-26-2003, 08:34 PM
It was a crude system that I never released for security reasons. I now use vbulletin 3, which has it built in. Sorry. Y'all really should upgrade to 3 if you want the features that 3 has.
SWFans.net
10-26-2003, 08:59 PM
Thanks for the honest answer.
iceman-x
12-17-2003, 01:14 AM
I did not incorporate it into register.php because my members have to register first before they can become premium members. The paypal integration requires that their username already exist. Therefore, people registering can only choose from the non-premium styles.
Regarding the second question, I would simply change This:
$allstyles=$DB_site->query("SELECT style.title, user.styleid, COUNT(*) AS count FROM user LEFT JOIN style USING (styleid) WHERE style.styleid IS NOT NULL AND style.userselect=1 GROUP BY user.styleid");
to this:
if ($bbuserinfo[premium]{
$allstyles=$DB_site->query("SELECT style.title, user.styleid, COUNT(*) AS count FROM user LEFT JOIN style USING (styleid) WHERE style.styleid IS NOT NULL AND style.userselect>0 GROUP BY user.styleid");
}
else {
$allstyles=$DB_site->query("SELECT style.title, user.styleid, COUNT(*) AS count FROM user LEFT JOIN style USING (styleid) WHERE style.styleid IS NOT NULL AND style.userselect=1 GROUP BY user.styleid");
}
Hey, i cant make this work. i get the same error every time i tryed. error at line 67.
this line:
$allstyles=$DB_site->query("SELECT style.title, user.styleid, COUNT(*) AS count FROM user LEFT JOIN style USING (styleid) WHERE style.styleid IS NOT NULL AND style.userselect>0 GROUP BY user.styleid");
Can any one help me. thanks.
Beani
01-13-2004, 08:23 AM
I followed the text file exactly yet whenever i edit the global.php file i get this
Warning: Cannot modify header information - headers already sent by (output started at /home/*****/*****/global.php:391) in /home/*****/*****/admin/functions.php on line 1723
Showing up above the header of a scheme for some users, though it works perfectly for me, anyone know whats wrong?
Alex Carter
04-09-2004, 02:04 PM
Fantastic hack, worked like a charm. Really good for our contributors. :)
Edison Chen
06-10-2004, 11:26 AM
Just a little problem here. I've already followed all the instructions. Only a tiny problem though. Everytime I make someone a premium member, it will not stay that way adn make the person not premium again.
How do I fix that?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.