Add-Ons

Details

Wiki Forum Talk 1.0 first_party

Author:
Derek Jones
Published:
Jun 03, 2008
Last Updated:
Jun 26, 2008
License:
First Party License
Categories:
Extensions  Wiki  
Allows the use of the Discussion Forum module for Wiki article discussions

Requirements

ExpressionEngine 1.6.3+ (Personal or Commercial) and Discussion Forum 2.1+

Notes

Installation Instructions:

  • Copy ext.wiki_forum_talk.php to /system/extensions/
  • Copy lang.wiki_forum_talk.php to /system/language/english/
  • In the Extension Manager, enable the Wiki Forum Talk extension
  • Click "Settings" to set the extension preferences for your wiki(s)
  • Modify the wiki theme of your choice to add a "Discussion" link. For example, in the Azure theme in the wiki_page() template, you could add it to the navigation menu, changing:
    <div id="actMenu">
    <
    ul>
    {if special_page}
    <li><a href="{path:view_article}">Special Page</a></li>
    {if:elseif file_page}
    <li><a href="{path:view_article}">File Page</a></li>
    {if:else}
    <li><a href="{path:view_article}">View</a></li>
    {if can_edit}
    <li><a href="{path:edit_article}{if revision}revision/{revision_id}/{/if}">Edit</a></li>
    <
    li><a href="{path:article_history}">History</a></li>
    {/if}
    {
    /if}
    </ul>
    </
    div

    to

    <div id="actMenu">
    <
    ul>
    {if special_page}
    <li><a href="{path:view_article}">Special Page</a></li>
    {if:elseif file_page}
    <li><a href="{path:view_article}">File Page</a></li>
    {if:else}
    <li><a href="{path:view_article}">View</a></li>
    {if article == TRUE && wiki_forum_talk == TRUE && new_article == FALSE && article_history == FALSE && revision == FALSE}
    <li>
        <
    form id="wiki_forum_talk_form" action="{discussion_link}" method="post" style="display:none;"><input type="hidden" name="wiki_page_info" value="{wiki_page_info}" /></form>
        <
    a href="javascript:void(0);" onclick="document.getElementById('wiki_forum_talk_form').submit();return false;">
        
    {if thread_total 0}
            Discuss Article 
    ({thread_total} comment{thread_plural})
        
    {if:else}
            Start a discussion about this article
    !
        
    {/if}
        
    </a>
    </
    li>
    {/if}
    {if can_edit}
    <li><a href="{path:edit_article}{if revision}revision/{revision_id}/{/if}">Edit</a></li>
    <
    li><a href="{path:article_history}">History</a></li>
    {/if}
    {
    /if}
    </ul>
    </
    div

    This can be placed anywhere in the wiki theme that you like using markup of your choosing, the key portions are the conditional and the form and link:

    {if article == TRUE && wiki_forum_talk == TRUE && new_article == FALSE && article_history == FALSE && revision == FALSE}
    <li>
        <
    form id="wiki_forum_talk_form" action="{discussion_link}" method="post" style="display:none;"><input type="hidden" name="wiki_page_info" value="{wiki_page_info}" /></form>
        <
    a href="javascript:void(0);" onclick="document.getElementById('wiki_forum_talk_form').submit();return false;">
        
    {if thread_total 0}
            Discuss Article 
    ({thread_total} comment{thread_plural})
        
    {if:else}
            Start a discussion about this article
    !
        
    {/if}
        
    </a>
    </
    li>
    {/if} 
  • Next change your forum Threads template (threads() in theme_threads.php if you are editing the file) to include a wiki link. Just below the closing javascript tag, before the first table tag, add:
    {if wiki_article_link}{lang:wiki_article_link}{/if} 

    You can of course style it to your preference, including using a class or id and styling the markup with your stylesheets. The key components are the conditional and the language variable.

Note: Due to the context of the established relationships, it is recommended that for forums you utilize for wiki article discussions that you disallow the Merge action for moderators of those forums.