Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Forum Module /

Discuss the Forum Module.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

AdminFormFeature can be visible for ThreadAuthor & Admin

Go to End



Community Member, 12 Posts

4 March 2014 at 2:08pm

Edited: 04/03/2014 2:14pm

Hey there,

I have been working on Forum module for a month. So far I really like it. Also it's fun to develop it.

Currently, there is a bit problem with AdminFormFeature. What we try to achieve is that, only thread author or admin can see the 3 checkbox (IsGlobalSticky, IsReadOnly etc.)

The code is as below:

function getFirstPost (){
return DataObject::get_one('Post', "\"ThreadID\" = '$this->ID'", true, "\"ID\" ASC");
<% with FirstPost %>
<% with Author %>
<% if $CurrentMember.FirstName = $FirstName %>
<% if ForumThread.NumPosts > 1 %>
<% if AdminFormFeatures %>
<div class="forum-admin-features">
<h3>Forum Admin Features</h3>
<% end_if %>
<% end_if %>
<% end_if %>
<% end_with %>
<% end_with %>

However, after change, now no one can see the Admin Feature, even author or admin. It's gone.

Could someone give me a hand with this? Thanks so much in advance.