We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Forum | Forum

Michel
Michel Feb 2 '14
ye i got it like this now

{foreach from=$postList item=post name=postList}
{capture assign='tpl'}

<!-- added -->
{if $isModerator}
<img src="http://www.tibiaevents.com/teamlogo.png" border="0" alt="" />
{/if}
<!-- end add -->

    {capture name='info_string'}
        <a href="{$avatars[$post.userId].url}">{$avatars[$post.userId].title}</a>
        <span class="ow_tiny ow_ipc_date ow_remark">{$post.createStamp}</span>
{/capture}
dave Leader
dave Feb 2 '14
look at my code again   you have this part in the wrong place {capture name='info_string'} move it up like mine


{foreach from=$postList item=post name=postList}

{capture assign='tpl'}{capture name='info_string'}


<!-- added -->

{if $isModerator}

<img src="http://www.tibiaevents.com/teamlogo.png" border="0" alt="" /> 

{/if}

<!-- end add -->


<a href="{$avatars[$post.userId].url}">{$avatars[$post.userId].title}</a> 

<span class="ow_tiny ow_ipc_date ow_remark">{$post.createStamp}</span>

{/capture}

Michel
Michel Feb 2 '14
ah ye done that

http://www.tibiaevents.com/forum/topic/251?page=1#post-2630

now it looks like that
dave Leader
dave Feb 2 '14
i dont see it... is it working only for your moderators now
Michel
Michel Feb 2 '14
nope its with my users aswell now
dave Leader
dave Feb 2 '14
and you cleared your cache


Michel
Michel Feb 2 '14
ye i did that :P
dave Leader
dave Feb 2 '14
$isModerator try this without the $ so we make it a constant instead so like this 


{if isModerator}


its referenced both ways so try that. 




Michel
Michel Feb 2 '14
doesnt work :P
dave Leader
dave Feb 2 '14
ok dang,  $isModerator is already called in that file so that should work... mmm 


well one more thing then we will have to make a php file addition 
try this way 

<!-- added -->

{ if  OW::getUser()->isAuthorized('base') }

<img src="http://www.tibiaevents.com/teamlogo.png" border="0" alt="" /> 

{/if}

<!-- end add -->

Michel
Michel Feb 2 '14
i get the internal server error if i do that
dave Leader
dave Feb 2 '14
ok i was afraid of that.. ok remove that and put the $isModerator back.. actually change $isModerator to $isMod  and i will tell you what to change in the php file 
Michel
Michel Feb 2 '14
okii done its now like this

{foreach from=$postList item=post name=postList}

{capture assign='tpl'}{capture name='info_string'}

<!-- added -->

{if $isMod}

<img src="http://www.tibiaevents.com/teamlogo.png" border="0" alt="" />

{/if}

<!-- end add -->

<a href="{$avatars[$post.userId].url}">{$avatars[$post.userId].title}</a>

<span class="ow_tiny ow_ipc_date ow_remark">{$post.createStamp}</span>

{/capture}
dave Leader
dave Feb 2 '14
 ok thats good... 


ok open  ow_plugins/forum/controllers/topic.php


and the second function down about 50 lines down will say 


public function index


it looks like this, let me know when you found that



/**     

 * Controller's default action     

 *    

 * @param array $params     

 */    


public function index( array $params )    {




The Forum post is edited by dave Feb 2 '14
dave Leader
dave Feb 2 '14
about 15 lines down from that you will see this section here 


        $isHidden = $forumSection->isHidden;
        $userId = OW::getUser()->getId();

        $isOwner = ( $topicDto->userId == $userId ) ? true : false;


The Forum post is edited by dave Feb 2 '14
dave Leader
dave Feb 2 '14
Directly AFTER that section add this 


// logo for moderator only    

//initialize var   


$isMod = 0;
          if(OW::getUser()->isAuthorized('base'))          

          {          

            $isMod = 1;  

            }
         $this->assign('isMod', $isMod);
//end logo for moderator only


The Forum post is edited by dave Feb 2 '14
dave Leader
dave Feb 2 '14
make sure you copy and paste this code to notepad first and then copy it again and paste to your file 
The Forum post is edited by dave Feb 2 '14
dave Leader
dave Feb 2 '14
notepad will get rid of all the special format chars that you cant see so its clean
dave Leader
dave Feb 2 '14
so when you get done that section should look exactly like this 



        $userId = OW::getUser()->getId();        

       $isOwner = ( $topicDto->userId == $userId ) ? true : false;


// logo for moderator only    

//initialize var

    $isMod = 0;


          if(OW::getUser()->isAuthorized('base'))

          {           

          $isMod = 1;               

           }

   

      $this->assign('isMod', $isMod);


//end logo for moderator only



        $postReplyPermissionErrorText = null;


The Forum post is edited by dave Feb 2 '14
dave Leader
dave Feb 2 '14
then clear your cache just to clear your  temp change you made and give it a try, it should work
Pages: « 1 2 3 4 5 6 »