<IF {CATCANSUBMITLINKS} or {SWITCH_DENIALPAGE}><img src="{IMAGESURL}/bullet.gif" alt="" class="bullet" /> <a href="suggest.php?action=addlink&catid={CATID}" title="Submit a New Business Listing">Add a Business</a> </IF><br />
<IF {CATCANSUBMITSUBS}><img src="{IMAGESURL}/bullet.gif" alt="" class="bullet" /> <a href="suggest.php?action=addcat&parent={CATID}" title="Submit a New Sub Category for Consideration">Submit Subcategory</a> </IF>
<ELSE>
<IF {CATCANSUBMITLINKS} or {SWITCH_DENIALPAGE}><img src="{IMAGESURL}/bullet.gif" alt="" class="bullet" /> <a href="suggest.php?action=addlink&catid=0" title="Submit a New Business Listing">Add a Business</a> </IF><br />
<IF {CATCANSUBMITSUBS}><img src="{IMAGESURL}/bullet.gif" alt="" class="bullet" /> <a href="suggest.php?action=addcat&parent=0" title="Submit a New Category for Consideration">Submit Category </a></IF> </IF>
When a member is logged in, the Submit links look like:
If category variables aren't applicable to a page, you're just testing plain text which always true. So, that's always true. You need to test for an appropriate page. If you're looking to test for the "display links in category" page, use <IF {CURRENTURL} contains action=displaycat>
It used to give 0 in that situation, but I believe I changed it because that was causing problems with something and it's more logical to not have any category variables when not in a category. To test for being inside a category, see the conditional in post #2.
I was thinking that unless you were in a category or subcategory, you would be in cat 0, the root of the directory.
But you usually aren't in the root, you can be on hundreds of other different pages like the help screen, member profile and so on.
0/5
1
2
3
4
5
Sorry, you don't have permission to post posts. Log in, or register if you haven't yet.
Comments on IF CATID not working?
Experienced
Usergroup: Customer
Joined: Jun 18, 2008
Total Topics: 22
Total Comments: 85
I've got this in my wrapper.
When a member is logged in, the Submit links look like:
I would think that the IF would be non positive and use the ELSE, resulting in CATID=0
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
If category variables aren't applicable to a page, you're just testing plain text which always true. So, that's always true. You need to test for an appropriate page. If you're looking to test for the "display links in category" page, use <IF {CURRENTURL} contains action=displaycat>
Experienced
Usergroup: Customer
Joined: Jun 18, 2008
Total Topics: 22
Total Comments: 85
I was thinking that unless you were in a category or subcategory, you would be in cat 0, the root of the directory.
The code would use the current cat/subcat if it existed, or force cat=0 if not.
I really just need to test for the user being inside a category/subcategory or not.
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
It used to give 0 in that situation, but I believe I changed it because that was causing problems with something and it's more logical to not have any category variables when not in a category. To test for being inside a category, see the conditional in post #2.
I was thinking that unless you were in a category or subcategory, you would be in cat 0, the root of the directory.
But you usually aren't in the root, you can be on hundreds of other different pages like the help screen, member profile and so on.