Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Manually inserted template tags are ignoring permission sets, not showing topic headlines to guests (who are allowed to see them)
Avatar
Robert Lawrence
Member
Free Members
sp_UserOfflineSmall Offline
Mar 3, 2013 - 5:49 pm

I am using a template tag to pull in a list of recent forum posts into a page and was having some issues before, (in another thread) which is solved.

https://simple-press.com/suppo.....2/#p123105

This is a separate and unique issue so I thought it best to start another thread in case anyone else is having this new issue.

The issue I am having now is that the template tag now only shows up to users who are logged into the site.  For guests, the template tag doesn't pull in any topic headlines at all. 

I checked the permission sets and guests "Can view a list of forums and list of topics only" but can't do anything else and are hit with the page redirect (just like how you have it here on this Simple-Press help forum).  This worked fine when I was using the recent posts widget, but it seems that the recent posts template tags don't follow theses same permissions.  It just doesn't show the output of the template tag at all.  It's blank.

To test this, I changed the permission set for guests to allow everything and the template tag worked and pulled in the topic headlines like it is supposed to be doing. (But the forum and everything is now open, which I don't want it to be). 

I switched the permissions on guests back to "Can view a list of forums and list of topics only"  and the recent posts tag did it again and everything disappeared.   It's not showing the topic headlines at all, even though I am allowing guests to view these.

(I cleared the cache in both the browser and the host each time and tested it in several browsers and had the same result.)

The template tags should follow the user permissions granted and show what is allowed to be shown to each user group.  The recent posts widget does this fine, but for some reason the template tags on their own don't follow the permission sets. 

How do I fix this so I can show a list of topic headlines to guests (and when they click on a link get redirected to a page)?

 

 

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Mar 3, 2013 - 6:40 pm

so what template tag are you using?  the recent posts template tag and the recent posts widget all share the same code...

Avatar
Robert Lawrence
Member
Free Members
sp_UserOfflineSmall Offline
Mar 3, 2013 - 7:10 pm

Yes, it's the recent posts template tag.  I re-tested the recent posts widget and it works fine.  But the recent posts template tag doesn't follow the permissions set or show up for guests (even though they are allowed to view the forum and list of topics).  But when I changed the permissions to guests to "full access", the template tag worked fine and the topic list and everything shows up (and they can view the contents of all posts in the forum, which is NOT what I want them to do). 

When I switch the guests back to just being able to view just the forum and topics list, then the recent posts template tag doesn't work and nothing is displayed.  It doesn't pull in anything.

Also, I cleared the cache in both the browser and at the host each time.   The only thing I switched was the permission set for guests (in order to test it).  So I know that the recent posts template tag isn't accepting the permission "Can view a list of forums and list of topics only".  It's ignoring it. 

I also tried it switching it on and off several times (to make sure that the permission would stick and stay green) and the template tag just ignores it and displays nothing.  But, the recent posts widget works fine and follows all permission changes each time I make the switch (on or off).

My site is http://membershipexpert.com

You can see on the left hand side (scroll down) the recent posts widget (says "recent forum posts), which I have there for testing purposes. 

The recent post template tags are in the middle of the page (main area) and under the title "Hot Topics In The Members Discussion Forum". This is where I want to show recent activity happening in the forum.

The recent posts widget works fine.  The template tag just doesn't show up (unless I change the permissions for guests to full access to be able to view everything). 

Somehow, the recent posts template tag is not taking the permission: "Can view a list of forums and list of topics only", but the recent posts widget does.

 

 

Avatar
Brandon
U.S.
SP Wrangler
Free Members
sp_UserOfflineSmall Offline
Mar 3, 2013 - 7:53 pm

Robert Lawrence said
Somehow, the recent posts template tag is not taking the permission: "Can view a list of forums and list of topics only", but the recent posts widget does.
 

You mean the Hottest Topics template tag is not displaying anything for view/read only guest permissions but the Recent Posts ones does. Right?

I did a quick test and I cannot duplicate the issue. Do you have Guests and their Permission Read only added to all the groups and forums?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Mar 3, 2013 - 8:08 pm

yes, this was noticed a few days ago... Is this still the case in the template tags release pushed out last night?

Avatar
Robert Lawrence
Member
Free Members
sp_UserOfflineSmall Offline
Mar 3, 2013 - 8:58 pm

Mr Papa said
yes, this was noticed a few days ago... Is this still the case in the template tags release pushed out last night?

 

I just installed the plugin update for template tags and tested everything again as described above and the problem is still there.  It doesn't appear fixed.  I also uninstalled the plugin and reinstalled it fresh and it's still happening. I cleared all cache, etc.

The recent forum posts template tag is not adhering to the permissions set for guests ("Can view a list of forums and list of topics only".)  It's ignoring it and displaying nothing.   The recent forum posts widget works fine and adheres to the permissions.  When I change the guest permissions to be able to view everything, then it works fine (but I don't want to give guests full access)

I also set up a separate test page to make sure there was no other code or anything on the home page which was messing things up.  The test page is here: http://membershipexpert.com/test-page/  The same issue persists.  It made no difference.

The issue appears to be with the recent forum posts template tag.

 

Avatar
Robert Lawrence
Member
Free Members
sp_UserOfflineSmall Offline
Mar 3, 2013 - 9:10 pm

Brandon C said

Robert Lawrence said
Somehow, the recent posts template tag is not taking the permission: "Can view a list of forums and list of topics only", but the recent posts widget does.
 

You mean the Hottest Topics template tag is not displaying anything for view/read only guest permissions but the Recent Posts ones does. Right?

I did a quick test and I cannot duplicate the issue. Do you have Guests and their Permission Read only added to all the groups and forums?

 

No, I'm not using the hottest topics template tag.  Just the recent posts template tag (which does not work). The recent posts widget works find and respects the permissions set.  I also checked both the group and forum permissions and they are both set the same, guests get read only access and can only view a list of forums and topics.  The issue seems to be with the recent posts template tag itself.

 

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Mar 3, 2013 - 11:16 pm

well, you  missed my point earlier... did you not say the widget worked?  the widget actually calls the recent posts template tag...

so lets clear that up...  are you still saying the widget works but the template tag does not?? or did I misunderstand?

Avatar
Robert Lawrence
Member
Free Members
sp_UserOfflineSmall Offline
Mar 3, 2013 - 11:52 pm

Yes, the recent posts widget works fine. The recent posts template tag (by itself) does not work.  That's the whole issue. 

I only put the widget on the page, so I could test it against the template tag because you said that they are both using the same code and should react the same way (when forum permission changes are made). They don't.

It's the template tag for recent forum posts that is having the issue.  It does not adhere to permissions set for guests.  But the recent posts widget does.  It makes no sense.  Something is wrong.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Mar 4, 2013 - 12:48 am

agreed.. makes no sense... we will need to do some more testing... but here is what I am saying... this is the widget code that displays the data:

function widget($args, $instance) { extract($args); $title = empty($instance['title']) ? __("Recent Forum Posts", 'sp-ttags') : $instance['title']; $forumIds = empty($instance['forumIds']) ? 0 : $instance['forumIds']; $limit = empty($instance['limit']) ? 5 : $instance['limit']; $itemOrder = empty($instance['itemOrder']) ? 'FTUD' : $instance['itemOrder']; $linkScope = empty($instance['linkScope']) ? 'forum' : $instance['linkScope']; $beforeForum = empty($instance['beforeForum']) ? __('Forum: ', 'sp-ttags') : $instance['beforeForum']; $afterForum = empty($instance['afterForum']) ? '
' : $instance['afterForum']; $beforeTopic = empty($instance['beforeTopic']) ? __('Topic: ', 'sp-ttags') : $instance['beforeTopic']; $afterTopic = empty($instance['afterTopic']) ? '
' : $instance['afterTopic']; $beforeUser = empty($instance['beforeUser']) ? __('By: ', 'sp-ttags') : $instance['beforeUser']; $afterUser = empty($instance['afterUser']) ? '' : $instance['afterUser']; $beforeDate = empty($instance['beforeDate']) ? ' -' : $instance['beforeDate']; $afterDate = empty($instance['afterDate']) ? '' : $instance['afterDate']; $avatarSize = empty($instance['avatarSize']) ? 25 : $instance['avatarSize']; $niceDate = empty($instance['niceDate']) ? 1 : $instance['niceDate']; $postTip = empty($instance['postTip']) ? 1 : $instance['postTip'];

# generate output echo $before_widget.$before_title.$title.$after_title; sp_RecentPostsTag($instance); echo $after_widget; }

note the call to sp_RecentPostsTag() which is what you say does not work...

so quite mystified...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17363
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625