1

Topic: How to do an if statement for paid vs. non paid members?

I have a "Donate" button and I only want regular members to see if. If someone is a paid member I dont want them to see it.

How can I program it so that only regular members see that button, but no one else can?
I dont know the syntax of how to program that.

thanks smile

2

Re: How to do an if statement for paid vs. non paid members?

<!-- IF session.group_id == "5" -->
Donate Button
<!-- ENDIF -->

Not sure what the group ID is for regular members, but should be able to find in CP.

3

Re: How to do an if statement for paid vs. non paid members?

THanks a lot, but this didnt work for me.
The group ID is 2

<!-- IF app_license == "commercial" -->
                                        <!-- IF system_enable_upgrades == "1" -->
                                            <!-- IF loggedin_can_upgrade_account == "1" -->
                                                <!-- IF session.group_id == "2" -->
                                                <li>{anchor:url1="account/upgrade/",url2="index.php?m=account_upgrade",name="Donate"}</li>
<!-- ENDIF -->
                                            <!-- ENDIF -->
                                        <!-- ENDIF -->
                                    <!-- ENDIF -->

it didnt crash, but it didnt display the link for regular membeers.

any idea what IM doing wrong?

4

Re: How to do an if statement for paid vs. non paid members?

Since you're using a version older than 2.5, you need to use "loggedin_" instead of "session.", so it'll look like "loggedin_group_id"

5

Re: How to do an if statement for paid vs. non paid members?

vlad wrote

Since you're using a version older than 2.5, you need to use "loggedin_" instead of "session.", so it'll look like "loggedin_group_id"

thanks that worked!

1 question, are all these nested IF statements going to slow my site down? its in the header so its in every page load.

I dont know about programming so I dont know if php if sttements are fast, olr if so many will cause a load on the server.
thanks

6

Re: How to do an if statement for paid vs. non paid members?

Nope, IF's won't slow it down.

7

Re: How to do an if statement for paid vs. non paid members?

No

Most of the time what slows a server down are media like graphics, videos, etc.  If I had 10,000 members with images, good chance I would have to upgrade my server. Of course, how many members are using your resources at one time could also be a factor. If I have a thousand members on my site at the same time, things are going to run slower than if I had 100. Again, if I was getting that many members at one time, I would upgrade my server.

Case in point right now is digital point forum. One of the top adsense earners (they are in the top 10), yet there are times when I'm trying to get on the site it blanks out from too many users using it as the same time. Digitial Point needs to upgrade.

VldPersonals coding is as good as it gets. Even the big boys like wordpress and phpbb3 have coding that is not as good as vldPersonals. An if statement (unless it is buggy) is not going to slow down your server. Like I said, what will slow it down is 1000 users at the same time using that if statement, but if that is the case that is a good problem. Having too many users using my site at one time is a problem I hope to have one day smile

Last edited by db3204 (2009-03-11 11:11:11)

8

Re: How to do an if statement for paid vs. non paid members?

I would like to add this mod to my site. I added the code above to header.tpl but can't see anything on the page. Does it need to be in a particular place?

9

Re: How to do an if statement for paid vs. non paid members?

I put this in the header.tpl:

"<!-- IF app_license == "commercial" -->
                                        <!-- IF system_enable_upgrades == "1" -->
                                            <!-- IF loggedin_can_upgrade_account == "1" -->
                                                <!-- IF session.group_id == "2" -->
                                                <li>{anchor:url1="account/upgrade/",url2="index.php?m=account_upgrade",name="Donate"}</li>
<!-- ENDIF -->
                                            <!-- ENDIF -->
                                        <!-- ENDIF -->
                                    <!-- ENDIF -->"

(somebody please show me how to show code)
I am guessing that the <li></li> tages mean this would go into a list somewhere, so I'm not sure how to implement it. What I want to do is ask Regular members to upgrade to remove the ads and get better services. Thanks.