Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-15-2008, 05:03 PM
katwomanofsteel katwomanofsteel is offline
 
Join Date: Dec 2007
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default paid subscription info

What's the paid subscription variable?
Reply With Quote
  #2  
Old 08-16-2008, 10:12 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What do you mean with "the paid subscription variable"?
Reply With Quote
  #3  
Old 08-16-2008, 02:28 PM
katwomanofsteel katwomanofsteel is offline
 
Join Date: Dec 2007
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Marco,

We have 4 different paid subscriptions: platinum, silver, gold, bronze and none are associated with any specific forums/usergroups/permissions as it is only used as a donation system.

Since we have upgraded from vb 3.5.1 to 3.5.8, the current variable we were using to pull in the subscription description (an img) per user in the posts $post[sub_id] (associated level of paid subscription) and $post[active_sub] (which checked to see if the paid subscription was active) have stopped working...

This is what the postbit looks like now (hint- the blank space on the right above the flag of the user's country):


And this is what it's supposed to look like (with gold subscription icon on the right above the flag):


I've been looking all over the vB db for how the paid subscriptions are associated with the user - can't find it anywhere...

Thanks for your help!
Attached Images
File Type: jpg yorkygold.jpg (121.6 KB, 0 views)
File Type: jpg yorkygold2.jpg (88.5 KB, 0 views)
Reply With Quote
  #4  
Old 08-17-2008, 09:43 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't think $post[sub_id] and $post[active_sub] are default vB variables, they where most likely added by a modification you had on your 3.5.1 installation.
Reply With Quote
  #5  
Old 08-17-2008, 02:12 PM
katwomanofsteel katwomanofsteel is offline
 
Join Date: Dec 2007
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmmm well is there a variable or something I could use to pull the paid subscription info in the template then? I can't find it in the db - but it has to exist somewhere since I see it in the admin cp

There were many modifications to the 3.5.1 install, and mostly undocumented... trying to find them and document them as I go...

--------------- Added [DATE]1219017788[/DATE] at [TIME]1219017788[/TIME] ---------------

Ok, found it in the db - it's the subscriptionlog table - status field = 1 if user has a paid subscription, and subscriptionid is the type of paid subscription...

now how to pull that in. I have a conditional statement in the postbit template:
Code:
<if condition="$subscription['status'] == 1">
$vbphrase[paidsubscriptiontype]
<else />
Free
</if>
But that isn't working. It's still showing Free for users whose status = 1, so not sure what I need to use to grab this field...

--------------- Added [DATE]1219020711[/DATE] at [TIME]1219020711[/TIME] ---------------

getting closer... found the hack in the old code. Previous developer did not document an added $posts query joining the subscriptionlog table info...
Reply With Quote
  #6  
Old 08-18-2008, 04:34 PM
katwomanofsteel katwomanofsteel is offline
 
Join Date: Dec 2007
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Strange - my replies were being merged with my post from the other day...

I found it in the db - it's the subscriptionlog table - subscriptionid is the type of paid subscription... anyone know how to grab this? It isn't $subscription[subscriptionid]...
Reply With Quote
  #7  
Old 08-19-2008, 08:57 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If the subscribed user will be put into a usergroup specific to the subscription, you can just check their usergroup (X is the subscription usergroup):
Code:
<if condition="is_member_of($post, X)">
$vbphrase[paidsubscriptiontype]
<else />
Free
</if>
Reply With Quote
  #8  
Old 08-19-2008, 05:37 PM
katwomanofsteel katwomanofsteel is offline
 
Join Date: Dec 2007
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yeah there is no specific usergroup and/or permissions for the paid members... guess I could create that with no permissions though...

Thanks will try it out!
Reply With Quote
  #9  
Old 08-20-2008, 06:18 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by katwomanofsteel View Post
yeah there is no specific usergroup and/or permissions for the paid members... guess I could create that with no permissions though...
Yea, you could just create a holder usergroup, just set all permissions to "No" or "0". A "yes" will always override a "no".
Reply With Quote
  #10  
Old 08-20-2008, 05:21 PM
katwomanofsteel katwomanofsteel is offline
 
Join Date: Dec 2007
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

But how would the holder usergroup be able to tell if it's a gold, silver, bronze or platinum?

I tried doing this in the postbit template:

Code:
<if condition="is_member_of($post, 28)">
<img src="http://www.wetcanvas.com/forums/images/sub/icon_bronze.gif" alt="Bronze Membership">
<else />
    <if condition="is_member_of($post, 27)">
    <img src="http://www.wetcanvas.com/forums/images/sub/icon_silver.gif" alt="Silver Membership">
    <else />
       <if condition="is_member_of($post, 26)">
       <img src="http://www.wetcanvas.com/forums/images/sub/icon_gold.gif" alt="Gold Membership">
       <else />&nbsp;</if>
     </if>
</if>
but that didn't work...

I did put this hack back into showthread.php:
Code:
$posts = $db->query_read("SELECT sublog.status AS active_sub,sub.subscriptionid as sub_id, post.*, post.username...
and then this additionally:
Code:
... LEFT JOIN subscriptionlog AS sublog ON sublog.userid = user.userid AND sublog.status = 1LEFT JOIN subscription as sub ON sub.subscriptionid = sublog.subscriptionid
And I can pull now active_sub (which just checks to see if they have an active paid subscription) but can't seem to pull sub_id (which shows what type)...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:51 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.06277 seconds
  • Memory Usage 2,282KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (5)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete