vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Styles for Premium Members (https://vborg.vbsupport.ru/showthread.php?t=48953)

amykhar 02-14-2003 10:00 PM

Styles for Premium Members
 
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/showthrea...084#post366084


No PM Quota for Premium Addon:
https://vborg.vbsupport.ru/showthrea...882#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:
Code:

// 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:
Code:


// 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:
Code:


$result=$DB_site->query("SELECT title,$tableid FROM $tablename WHERE userselect=1 ORDER BY title");

Replace With:
Code:


  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");
  }


N9ne 02-17-2003 06:30 PM

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.

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:

Code:

$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:

Code:

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.

N9ne 02-17-2003 08:07 PM

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:
Quote:

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:

Code:

if ($pmquota>0 and $touserinfo[usergroupid] != 6 and $bbuserinfo[usergroupid] != 6) {
Replace with:

Code:

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

Quote:

Today at 10:58 AM corsacrazy said this in Post #25
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:

Code:

} else if (($mod["$key"] or $user['usergroupid'] == 5)and $highlightadmin) {
          $userinfo["$key"]['username'] = "<b>$user[username]</b>";

Add After:

Code:

} 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)
Code:

  eval("\$activeusers = \"".gettemplate('forumhome_loggedinuser')."\";");
Add Above:

Code:

  if ($loggedin['premium'] == 1 and $highlightadmin) {

  $username = "<img src='Icon src here'>&nbsp;" .$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

Quote:

03-24-03 at 05:07 PM corsacrazy said this in Post #35
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 ?


All times are GMT. The time now is 12:50 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01836 seconds
  • Memory Usage 1,819KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (12)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete