Donkerrood Posted July 15, 2011 Share Posted July 15, 2011 File Name: Topic View Sidebar File Submitter: Donkerrood File Submitted: 14 Jul 2011 File Category: Other style options This hook shows a sidebar in the topic view, similar to the sidebar on the board index. As with the sidebar on the board index, you can add content blocks to the sidebar by installing hooks at the hook point pre.if.scrollToPost. Further instructions are in the readme.txt. The download contains two example hooks that you could install to show the sidebar adcode (as shown on the board index) and to show the 10 latest replies. here to download this file Link to comment Share on other sites More sharing options...
broni Posted July 15, 2011 Share Posted July 15, 2011 You're not saying what it does. No screenshot. Link to comment Share on other sites More sharing options...
Adriano Faria Posted July 16, 2011 Share Posted July 16, 2011 Screenshot ? Link to comment Share on other sites More sharing options...
Donkerrood Posted July 16, 2011 Author Share Posted July 16, 2011 I will add a screenshot tonight. Like the title says, the hook creates a sidebar in the topic view. After installing this hook, you can add any content to the sidebar by installing another hook (e.g. the recent topics hook or the ads hook). In this way the hook creates maximum flexibility, because you use IPB's drag and drop hook system to arrange the content blocks. Link to comment Share on other sites More sharing options...
joelle Posted July 16, 2011 Share Posted July 16, 2011 I am not exactly sure about the adding content to the sidebar process works. Do we have to manually edit the topicviewtemplate? Link to comment Share on other sites More sharing options...
Donkerrood Posted July 17, 2011 Author Share Posted July 17, 2011 I added a screenshot and two example hooks in the updated version. This hook does not require any file edits. Any content can be added by installing an extra hook that returns the content you want. I think this will be clear once you have installed my example hooks from the updated zip file. Link to comment Share on other sites More sharing options...
Enigm@ Posted July 18, 2011 Share Posted July 18, 2011 Nice mod, unfortunately is for 3.2 version, too many people still use 3.1. Link to comment Share on other sites More sharing options...
hammerstringz Posted September 2, 2011 Share Posted September 2, 2011 I'm getting errors like this using 3.2.1:Fatal error: Call to undefined method templateTopicView::recentPosts() in/home/totaltop/public_html/hooks/topicViewRecentPosts_409db0031433eddc2859dfa15b87447d.php on line 79but i guess that's because I put all 3 hooks in. Link to comment Share on other sites More sharing options...
Chinna444 Posted October 8, 2011 Share Posted October 8, 2011 is this working for 3.2.2 Link to comment Share on other sites More sharing options...
Gaffney Posted November 10, 2011 Share Posted November 10, 2011 How can I show a hook on the main sidebar and inside the topic? Link to comment Share on other sites More sharing options...
fvaldez Posted February 7, 2012 Share Posted February 7, 2012 I get this error: Fatal error: Call to undefined method skin_topic_5::recentPosts() in /home/allfreel/public_html/hooks/topicViewRecentPosts_be4751e04f432a7dfd59abb023cb16b0.php on line 79 What happens when I disable topicviewsidebarrecentpost - the sidebar appears as blank. When I have both recent posts and sidebar ad code enabled, i get this error message listed above. Links for images below. (sorry, but the images doesn't appear as they should) http://www.box.com/s/zq3bjah29r8q718i8bje http://www.box.com/s/uc7lk9hpik2be3rq7zuo Link to comment Share on other sites More sharing options...
Donkerrood Posted February 16, 2012 Author Share Posted February 16, 2012 I think that the recentPosts template is not present as a template in the skinTopic group. I will post later on what you should include there. Link to comment Share on other sites More sharing options...
Donkerrood Posted February 16, 2012 Author Share Posted February 16, 2012 Add a new template to the skin_topic group with the name recentPosts, variables are: $topics, $title And the template code is as follows. <if test="recenttopics:|:is_array( $topics ) && count( $topics )"> <div class='ipsSideBlock clearfix'> <h3> <if test="hastitle:|:$title"> {$title} <else /> <a href="{parse url="app=core&module=search&do=viewNewContent&search_app=forums" base="public"}">{$this->lang->words['recently_added_replies']}</a> </if> </h3> <div class='_sbcollapsable'> <ul class='ipsList_withminiphoto'> <foreach loop="topics_hook:$topics as $r"> <li class='clearfix'> <a href='{parse url="showuser={$r['member_id']}" seotitle="{$r['members_seo_name']}" template="showuser" base="public"}' title='{$this->lang->words['view_profile']}' class='ipsUserPhotoLink left'> <img src='{$r['pp_mini_photo']}' alt="{$r['members_display_name']}{$this->lang->words['users_photo']}" class='ipsUserPhoto ipsUserPhoto_mini' /> </a> <div class='list_content'> <a href='{parse url="showtopic={$r['tid']}&view=getnewpost" base="public" template="showtopic" seotitle="{$r['title_seo']}"}' class='ipsType_small' title='{$this->lang->words['view_topic']} {$r['topic_title']}'>{$r['title_display']}</a> <p class='desc ipsType_smaller'> <if test="hideuser:|:$r['hideUserName'] == 1"><else />{parse template="userHoverCard" group="global" params="$r"} -</if> {parse date="$r['start_date']" format="short"} </p> </div> </li> </foreach> </ul> </div> </div> </if> Link to comment Share on other sites More sharing options...
Heineken Posted April 6, 2013 Share Posted April 6, 2013 This is a great addon I have also installed (e32) Custom Sidebar Blocks in order to have custom sidebars in the topic view but I cannot figure out how to get the blocks to show up It seems the Topic View Sidebar is using different name for the blocks? Anyone have a solution for how to get Topic View Sidebar to load the (e32) Custom Sidebar Blocks? Link to comment Share on other sites More sharing options...
Heineken Posted April 6, 2013 Share Posted April 6, 2013 Here is code for hook which will import 20 recent topics, it uses IPB member settings so it respect all forum rules. Also you do not need to create any additional templates or create any skin template like mentioned previously in this thread. If you want to change the number of topics shown just edit the number hooks_recentTopics(20) <?xml version="1.0" encoding="utf-8"?> <hookexport> <hookdata> <config> <hook_name>Recent Forum Topics</hook_name> <hook_desc>Adds a list of recent threads topic view</hook_desc> <hook_author/> <hook_email/> <hook_website/> <hook_update_check/> <hook_requirements><![CDATA[a:3:{s:21:"required_applications";a:0:{}s:20:"hook_php_version_min";s:0:"";s:20:"hook_php_version_max";s:0:"";}]]></hook_requirements> <hook_version_human>1.0.0</hook_version_human> <hook_version_long>1000</hook_version_long> <hook_extra_data><![CDATA[a:1:{s:7:"display";N;}]]></hook_extra_data> <hook_key>viewTopicRecentThreads</hook_key> <hook_global_caches/> </config> </hookdata> <hookfiles> <file> <hook_file_real>boardIndexRecentTopics.php</hook_file_real> <hook_type>templateHooks</hook_type> <hook_classname>viewTopicRecentThreads</hook_classname> <hook_data><![CDATA[a:8:{s:12:"dataLocation";s:0:"";s:14:"libApplication";s:0:"";s:15:"classToOverload";s:0:"";s:9:"skinGroup";s:10:"skin_topic";s:12:"skinFunction";s:17:"topicViewTemplate";s:4:"type";s:2:"if";s:2:"id";s:12:"scrollToPost";s:8:"position";s:11:"pre.startif";}]]></hook_data> <hooks_source><![CDATA[<?php class viewTopicRecentThreads { public $registry; public function __construct() { $this->registry = ipsRegistry::instance(); } public function getOutput() { $output = $this->registry->getClass('class_forums')->hooks_recentTopics(20); return $output; } }]]></hooks_source> </file> </hookfiles> <hookextras_settings/> <hookextras_language/> <hookextras_modules/> <hookextras_help/> <hookextras_templates/> <hookextras_css/> <hookextras_replacements/> <hookextras_tasks/> <hookextras_database_create/> <hookextras_database_alter/> <hookextras_database_update/> <hookextras_database_insert/> </hookexport> Using this method you can create any of the sidebar blocks for IP suite. I have one for recent blog posts too Link to comment Share on other sites More sharing options...
Sidi Posted May 28, 2013 Share Posted May 28, 2013 Here is code for hook which will import 20 recent topics, it uses IPB member settings so it respect all forum rules. Also you do not need to create any additional templates or create any skin template like mentioned previously in this thread. If you want to change the number of topics shown just edit the number hooks_recentTopics(20) <?xml version="1.0" encoding="utf-8"?> <hookexport> ... </hookexport> Using this method you can create any of the sidebar blocks for IP suite. I have one for recent blog posts too So save this as an xml file and upload and install on the ACP? But how will the sidebar be created or show up on the board index? Do we deactivate the current recent topics sidebar? Link to comment Share on other sites More sharing options...
fadedturbulence Posted May 28, 2013 Share Posted May 28, 2013 1. So save this as an xml file and upload and install on the ACP? 2. But how will the sidebar be created or show up on the board index? 3. Do we deactivate the current recent topics sidebar? 1. Redownloading the package contains the hook that is in this post you quoted. Import it through ACP and make SURE its BELOW this hook, so it should be like this: Topic View Sidebar v1.0.0 Shows sidebar in topic view Topic View Sidebar - Recent Replies v1.0.0 Shows recent replies in Topic View Sidebar 2. It will automatically show up once blocks are added. And it is a TOPIC sidebar, it is not for your board index. Only Global SIdebars can allow you to alter the index sidebar. 3. 2 should answer this question (there is nothing there from start, this is a topic sidebar, you start with no blocks). Although for me, I still had to add the template bit manually, it doesnt add it in any of these hooks. ( post #13, http://community.invisionpower.com/topic/341477-download-topic-view-sidebar/#entry2231884 ) Also, got the 'cannot modify header info' too: Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxxx/forums/cache/skin_cache/cacheid_4/skin_topic.php: 972) in /home/xxxxx/forums/admin/sources/classes/output/formats/html/htmlOutput.php on line 141 After recaching template too. I only have that new posts hook installed. Works great otherwise, thanks! Link to comment Share on other sites More sharing options...
BomAleold Posted June 12, 2013 Share Posted June 12, 2013 suggestion: my post into this topic (filter)? Link to comment Share on other sites More sharing options...
Daniel Ocio Posted July 23, 2014 Share Posted July 23, 2014 Hi, works in last version? Link to comment Share on other sites More sharing options...
Nam Nam Posted September 6, 2014 Share Posted September 6, 2014 I have mistake : "Error: Could not load template 'recentPosts' from group 'topic'" How can I fix it ? Link to comment Share on other sites More sharing options...
Donkerrood Posted September 9, 2014 Author Share Posted September 9, 2014 have you tried adding the recentPosts template manually to the skin group Topic? Another message regarding this hook; Since IPS4 will support a sidebar on any place in the software you want, this hook will be discontinued. Many thanks to those of you that helped out others on fixing the issues with this hook. Link to comment Share on other sites More sharing options...
newbie LAC Posted September 9, 2014 Share Posted September 9, 2014 I have mistake : "Error: Could not load template 'recentPosts' from group 'topic'" How can I fix it ? ACP - Look and Feel - Template Tools - Rebuild Master Skin Data. Select all the check boxes and click Rebuild - Recache Skin Sets Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.