I need thread tools to show

Matthew Hawley

Well-known member
So the addon I'm developing has a link in the thread tools menu, and the thread tools menu doesn't display to regular members. How do I get this to display?
 

Matthew Hawley

Well-known member
I dont have permissions for the addon. I just want the thread tools drop down to show for regular members with the link i put in it.
 

truonglv

Formerly Nobita.Kun
So what is your code to do? *Its mean code html
I was read your resources.
If you used:
Code:
<xen:if is="{$canWatchThread}">
<a href="{xen:link 'threads/watch-confirm', $thread}" class="OverlayTrigger" data-cacheOverlay="false">{xen:if $thread.thread_is_watched, '{xen:phrase unwatch_thread}', '{xen:phrase watch_thread}'}</a>
<label><a href="{xen:link search/search, '', 'type=post', 'thread_id={$thread.thread_id}', 'users={$visitor.username}'}">Your Posts</a></label>
</xen:if>
Change to:
Code:
<xen:if is="{$canWatchThread}">
<a href="{xen:link 'threads/watch-confirm', $thread}" class="OverlayTrigger" data-cacheOverlay="false">{xen:if $thread.thread_is_watched, '{xen:phrase unwatch_thread}', '{xen:phrase watch_thread}'}</a>

</xen:if>
<a href="{xen:link search/search, '', 'type=post', 'thread_id={$thread.thread_id}', 'users={$visitor.username}'}">Your Posts</a>
 

truonglv

Formerly Nobita.Kun
Try to
PHP:
if ($hookName == 'thread_view_tools_links')
        {
            $contents .= $template->create('find_posts_in_thread_view', $template->getParams());
        }
Code:
if ($hookName == 'thread_view_tools_links')
        {
            $params = $template->getParams();
$params += $hookParams;
$contents .= $template->create('find_posts_in_thread_view', $params);
        }
 

truonglv

Formerly Nobita.Kun
No I changed that into an addon.

http://xenforo.com/community/resources/find-your-posts-in-a-thread-alpha.1960/

you can download it and look at the code.
I downloaded and try to:
Try to
PHP:
if ($hookName == 'thread_view_tools_links')
        {
            $contents .= $template->create('find_posts_in_thread_view', $template->getParams());
        }
Code:
if ($hookName == 'thread_view_tools_links')
        {
            $params = $template->getParams();
$params += $hookParams;
$contents .= $template->create('find_posts_in_thread_view', $params);
        }
 

Matthew Hawley

Well-known member
I downloaded and try to:
try to what? What does that tell you?

This is code in the template. I used a template hook to insert it into the thread tools menu.

Code:
<xen:foreach loop="$posts" value="$post">
      <xen:if is="{$post.user_id} == {$visitor.user_id}">
            <xen:set var="$hasPosted">1</xen:set>
      </xen:if>
</xen:foreach>
<xen:if is="{$hasPosted}">
      <li><a href="{xen:link search/search, '', 'type=post', 'thread_id={$thread.thread_id}', 'users={$visitor.username}'}">Your Posts</a></li>
</xen:if>
But i dont think this is a problem with my addon. I think its the fact that the thread tools menu is not visible to members.
 

truonglv

Formerly Nobita.Kun
try to what? What does that tell you?

This is code in the template. I used a template hook to insert it into the thread tools menu.

Code:
<xen:foreach loop="$posts" value="$post">
      <xen:if is="{$post.user_id} == {$visitor.user_id}">
            <xen:set var="$hasPosted">1</xen:set>
      </xen:if>
</xen:foreach>
<xen:if is="{$hasPosted}">
      <li><a href="{xen:link search/search, '', 'type=post', 'thread_id={$thread.thread_id}', 'users={$visitor.username}'}">Your Posts</a></li>
</xen:if>
But i dont think this is a problem with my addon. I think its the fact that the thread tools menu is not visible to members.
In your Listener.php
Code:
if ($hookName == 'thread_view_tools_links')
        {
            $contents .= $template->create('find_posts_in_thread_view', $template->getParams());
        }
Change to:
Code:
if ($hookName == 'thread_view_tools_links')
        {
            $params = $template->getParams();
$params += $hookParams;
$contents .= $template->create('find_posts_in_thread_view', $params);
        }
Sorry my english not good :oops:
 

Matthew Hawley

Well-known member
Lol nvm. I didn't post in the thread as the demo user I was logged in as. its not supposed to show if the user has not posted in thread. LOL Silly me.
 
Top