Jump to:

1030 Posts in 805 Topics by 311 members

Forum Module

SilverStripe Forums » Forum Module » AdminFormFeature can be visible for ThreadAuthor & Admin

Discuss the Forum Module.

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

Page: 1
Go to End
Author Topic: 230 Views
  • ihaveqquestion
    Avatar
    Community Member
    12 Posts

    AdminFormFeature can be visible for ThreadAuthor & Admin Link to this post

    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:

    ForumThread.php
    function getFirstPost (){
    return DataObject::get_one('Post', "\"ThreadID\" = '$this->ID'", true, "\"ID\" ASC");
       }

    Forum_show.ss
    <% with FirstPost %>
    <% with Author %>
    <% if $CurrentMember.FirstName = $FirstName %>
    <% if ForumThread.NumPosts > 1 %>             
    <% if AdminFormFeatures %>
    <div class="forum-admin-features">
        <h3>Forum Admin Features</h3>
        $AdminFormFeatures
    </div>
    <% 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.

    230 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.