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 :).


All times are GMT. The time now is 12:15 AM.

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.01077 seconds
  • Memory Usage 1,746KB
  • 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
  • (6)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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