Re: Subscription Status If/Then
Now you have to dig deeper and know some MySQL and a little about querying the database. (Sorry - I don't know enough about subscriptions to answer you directly - maybe someone else knows the exact query you need.)
I was just pointing you to where the variable that you are using is getting read from the database. The query is what you see in the $query variable. You can study it and the table in the db it is using to see how they match the login with the user information in the database. (You'll need to know some MySQL). You can see that they are not trying to figure out how many subscriptions, or anything else except if the login matched. So - your query will be more complex. You have to write a query (not necessarily here) that pulls the subscription information (types of subscriptions) that you are after after it matches the login. This is where you will need to know how this information is organized in the db. And - you will have to decide how you want to handle the complication of a user having more than one subscription. You may have to add another query unless you know that modifying this one won't mess something else up.
More hints (hopefully helpful?):
When I'm dissecting their code to figure things out - I try things out - making extensive use of print_r and echo in the php, and print out smarty variables in the tpl to see the results of my experiments. (and use the smarty debug console)
I might try to add another function based on the is_user_subscribed, but call it something else like user_subscribed_to - then modify the query to get the other subscription information you want.
If you know exactly what tables all the data you need is stored, but need help with the query, and do not get a response here - I might try posting that to the MySQL forum. I've seen people answer questions there who are really good with the queries. You could make it easy for someone by knowing exactly what tables in the db your info lives. I don't think there are all that many that are associated with subscriptions. It may get complicated if you have to start extracting information from the orders table.
This is where the function is called that sets the variable that you are using:
./postauth.php:171: $smarty->assign("user_subscription", is_user_subscribed($login));
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
|