Elxis CMS Forum

Extensions => Bots and plugins => Topic started by: wbread on January 08, 2011, 16:32:57

Title: eForum Discussion bot button
Post by: wbread on January 08, 2011, 16:32:57
Based on eForum Discussion bot and Easy gallery button
after activating the bot page does not load, white sheet, what did I do wrong? ???
eforumdiscussion.btn.xml
Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<mosinstall type="mambot" group="editors-xtd" version="2009.1">
<name>eforumdiscussion.btn</name>
<author>wbread</author>
<creationDate>2011-01-08 14:14:30</creationDate>
<copyright>(C) 2005-2011 wbdesign. All rights reserved</copyright>
<license>Creative Commons 3.0 SA</license>
<authorEmail>wbread@runsite.ru</authorEmail>
<authorUrl>www.runsite.ru</authorUrl>
<version>1.0</version>
<description>
<![CDATA[
<p>Display on Elxis content items a redirect link which bot will connect this with the corresponding eForum topic you like.  (Button for the editor)</p>
<p>You can find the topic id for eForum component on administrator area on eForum Component.<br/>
    Other choices that we can find the id of the topic is the url link. The number absolutely before the <b>.html</b>
    like : http://www.domain-name.com/eforum/announcements/<b>472</b>.html?msg=473</p>
]]></description>
<files>
<filename mambot="eforumdiscussion.btn">eforumdiscussion.btn.php</filename>
<filename>eforumdiscussion.png</filename>
</files>
</mosinstall>
eforumdiscussion.btn.php
Code: [Select]
<?php 
/**
* @version 1.0
* @package: eForum Discussion button
* @author: wbread 
* @email: wbread@runsite.ru
* @link: http://www.runsite.ru
* @license: Creative Commons 3.0 Share Alike
* @copyright: (C) 2005-2011 wbdesign. All rights reserved.
* @description: Display on Elxis content items a redirect link which bot will connect this with the corresponding eForum topic you like.  (Button for the editor)
*/

defined( &#39;_VALID_MOS&#39; ) or die( &#39;Direct Access to this location is not allowed.&#39; );


$_MAMBOTS->registerFunction(&#39;onCustomEditorButton&#39;, &#39;boteforumdiscussion.btn&#39;);

function boteforumdiscussion.btn() {
    
$tip = &#39;Provides button to insert {eforum}forum_id{/eforum} into content edit box<br>&#39;;
    
$tip .= &#39;<b>Examples:</b><br />&#39;;
    
$tip .= &#39;{eforum}45{/eforum}<br />&#39;;

return array(&#39;eforumdiscussion.png&#39;, &#39;{eforum}forum_id{/eforum}&#39;, $tip);
}

?>
Title: Re: eForum Discussion bot button
Post by: speck on January 08, 2011, 20:47:52
Replace

$_MAMBOTS->registerFunction('onCustomEditorButton', 'boteforumdiscussion.btn');
with
$_MAMBOTS->registerFunction('onCustomEditorButton', 'botEforumDiscussion');

Replace
function boteforumdiscussion.btn() {
with
function botEforumDiscussion() {
Title: Re: eForum Discussion bot button
Post by: wbread on January 08, 2011, 23:20:51
 :D thanks all work
Title: Re: eForum Discussion bot button
Post by: datahell on January 09, 2011, 10:54:16
The bot is wrong.
A function name in PHP can not contain a dot "."
Title: Re: eForum Discussion bot button
Post by: wbread on January 22, 2011, 16:03:28
I can publish it on the official site?
Title: Re: eForum Discussion bot button
Post by: speck on January 22, 2011, 16:46:53
I can publish it on the official site?
YES  :)
Title: Re: eForum Discussion bot button
Post by: wbread on January 22, 2011, 17:39:47
somehow