Webmastersite.net
Register Log In

IF CATID not working?

Comments on IF CATID not working?

fusionx
Experienced

Usergroup: Customer
Joined: Jun 18, 2008

Total Topics: 22
Total Comments: 85
fusionx
Posted Dec 20, 2008 - 9:31 AM:

I've got this in my wrapper.


<IF {CATID}>

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


www.inpanamacity.com/sugges...=addlink&catid={CATID}


I would think that the IF would be non positive and use the ELSE, resulting in CATID=0
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Dec 23, 2008 - 6:49 PM:

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>
fusionx
Experienced

Usergroup: Customer
Joined: Jun 18, 2008

Total Topics: 22
Total Comments: 85
fusionx
Posted Dec 24, 2008 - 5:47 AM:

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.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Dec 25, 2008 - 11:45 PM:

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.
Search thread for
Download thread as
  • 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.