Webmastersite.net
Register Log In

Cat avail to only certain members

Comments on Cat avail to only certain members

babrees
Expert

Usergroup: Customer
Joined: Aug 19, 2005
Location: England

Total Topics: 391
Total Comments: 1303
babrees
Posted Oct 08, 2007 - 1:57 AM:

I have a category only viewable to specific usergroup. Within that I have a sub-cat (CATID=8) that I want only viewable to those who have checked YES to {MEMBERSNEWSLETTER}

Is there an easy way to do this?


Paul
developer

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

Total Topics: 61
Total Comments: 7868
Paul
Posted Oct 09, 2007 - 10:59 AM:

First half is easy, edit the category to set permission. For the subcategory, not easy. Maybe in the show links in category template's subcategory list <IF {MEMBERNEWSLETTER} is YES></IF> around it.
babrees
Expert

Usergroup: Customer
Joined: Aug 19, 2005
Location: England

Total Topics: 391
Total Comments: 1303
babrees
Posted Nov 02, 2007 - 7:42 AM:

Trying to get this to work and can't. I have tried several different things, finally ending up with making a new link type - newsletter - and having the following in the displaylinks.tpl...

<IF {SHOWNEWSLETTER} >
<IF {MEMBERNEWSLETTER} is no>
Sorry, you have not signed up to receive the newsletter online.
<OTHERWISE>
<table {STANDARDTABLE}>
<!-- BEGIN NEWSLETTER LINKS -->
[INSERTFILE=linkbitregular]
<!-- END NEWSLETTER LINKS -->
</table>
</IF>
</IF>

I would've thought this would work but it doesn't sad It shows the wording "sorry..." correctly, but still shows the links.

You can see it at http://www.123club.co.uk/papclub/8/ To log in use Guest with password of temp - that has permission to view parent cat, but not newsletters.
Paul
developer

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

Total Topics: 61
Total Comments: 7868
Paul
Posted Nov 02, 2007 - 5:12 PM:

I can't begin to guess what a link type could possibly have to do with what you said in post #1. What you've typed, though, tells it to show "Sorry,..." when there's at least one link of the link type 'newletter' somebody unspecified (is this supposed to be the viewer of the page? if so, that's {THISMEMBER) has the newsletter profile field set to no. It will then show the actual links of type neweletter when the unspecified person has some value other than no for the newsletter field.

You probably have other template code showing links of a non-newsletter link type. You've told it to make newsletter links to look exactly the same as regular links.

Guest/temp is not a valid login.
babrees
Expert

Usergroup: Customer
Joined: Aug 19, 2005
Location: England

Total Topics: 391
Total Comments: 1303
babrees
Posted Nov 02, 2007 - 10:43 PM:

Paul wrote:
I can't begin to guess what a link type could possibly have to do with what you said in post #1.


Well it's quite simple really when you apply a bit of blonde logic wink In cat #8 there will only be newsletters posted. I only want certain members to view those newsletters. I couldn't work out how to restrict viewing the cat so thought I would simply make a new link type for the newsletters.

Paul wrote:
What you've typed, though, tells it to show "Sorry,..." when there's at least one link of the link type 'newletter' somebody unspecified (is this supposed to be the viewer of the page? if so, that's {THISMEMBER) has the newsletter profile field set to no. It will then show the actual links of type neweletter when the unspecified person has some value other than no for the newsletter field.


Yes, that's what I want. But I still don't think I've got it right as it still shows the links. I now have...

<IF {SHOWNEWSLETTER} >
<IF {THISMEMBER} newsletter is no>
Sorry, you have not signed up to receive the newsletter online.
<OTHERWISE>
<table {STANDARDTABLE}>
<!-- BEGIN NEWSLETTER LINKS -->
[INSERTFILE=linkbitregular]
<!-- END NEWSLETTER LINKS -->
</table>
</IF>
</IF>


Paul wrote:
Guest/temp is not a valid login.


Sorry, was working on the members within phpmyadmin and forgot to reinstate guest. It's there and working now. It is set so that you should NOT be able to see the link types newsletter.
Paul
developer

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

Total Topics: 61
Total Comments: 7868
Paul
Posted Nov 03, 2007 - 5:53 PM:

<IF {THISMEMBERNEWSLETTER} is no> is the conditional you want.
babrees
Expert

Usergroup: Customer
Joined: Aug 19, 2005
Location: England

Total Topics: 391
Total Comments: 1303
babrees
Posted Nov 05, 2007 - 5:19 AM:

Paul wrote:
<IF {THISMEMBERNEWSLETTER} is no> is the conditional you want.


Sorry Paul, but I still cannot get this to work. The "sorry..." message now displays in ALL categories and the newsletters still show when they shouldn't.


Paul
developer

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

Total Topics: 61
Total Comments: 7868
Paul
Posted Nov 06, 2007 - 5:02 PM:

Well presumably {THISMEMBERNEWSLETTER} is blank unless you've edited your profile. Comparing to a blank value might be problematic. Does <?php if ("{THISMEMBERNEWSSLETTER}" == "no") { ?> work? Have you checked the actual value of {THISMEMBERNEWSSLETTER}?
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.