• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

I need thread tools to show

Matthew Hawley

Well-known member
#1
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?
 

truonglv

Formerly Nobita.Kun
#6
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
#7
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
#9
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);
        }
 
#10
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
#11
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: