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?
 
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.
 
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>
 
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);
        }
 
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);
        }
 
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.
 
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:
 
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 Bottom