Bookmark

Bookmark 1.9

No permission to download
@AndyB in the template modification for post the regular expression you are matching is as follows:
Code:
<xen:if is="{$post.canReport}">
                    <a href="{xen:link posts/report, $post}" class="OverlayTrigger item control report" data-cacheOverlay="false"><span></span>{xen:phrase report}</a>
                </xen:if>

Doing this will also check against tab characters. Which means that in theme, such as mine, where I've tabbed in an extra time to keep a clean template, your add-on won't work. The only alternative that I can think of is to match it against just the one line <xen:if> and add the code before that. But I've edited my themes to work with this. Thanks @AndreaMarucci it'll be ready for the next release! :)
 
Last edited:
@AndyB if you switch from str_replace to the following regular expression replacement type, This will append your bits to the hook, in a way that is compatible with other addons and other themes.

Find:
Code:
#(<xen:hook name="post_public_controls".*?)(\s*</xen:hook>)#s
Replace:
Code:
$1
<xen:if is="{$visitor.permissions.bookmarkGroupID.bookmarkID}">

<xen:if is="!{$post.bookmark}">
<a href="{xen:link 'posts/bookmark', $post}" class="item control OverlayTrigger">{xen:phrase bookmark_bookmark}</a>
</xen:if>

<xen:if is="{$post.bookmark}">
<a href="{xen:link 'posts/bookmark-unbookmark', $post}" class="item control OverlayTrigger">{xen:phrase bookmark_unbookmark}</a>
</xen:if>

</xen:if>
$2
 
AndyB updated
Thanks Andy, now it works halfway since the bookmark link under the message is displayed and working but the link in the user menu (this one)
pic003-jpg.95409

is not displayed at all. I'll tag also @Mike Creuzer so he knows about that...
 
Andy, it seems that the string "Post succesfully bookmarked" is not phrased since I'm not able to find it in phrase search.

Edit: Found sorry
 
Last edited:
anyone getting any errors?

ErrorException: Fatal Error: syntax error, unexpected ''op' (T_ENCAPSED_AND_WHITESPACE) - library/Andy/SimilarThreads/Model.php:149
Generated By: Unknown Account, 35 minutes ago
Stack Trace
#0 [internal function]: XenForo_Application::handleFatalError()
#1 {main}
Request State
array(3) {
["url"] => string(94) "http://www.xyz.com/threads/thread/page-23"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
 
Top Bottom