Home >Backend Development >PHP Tutorial >discuz post_image_btn_extra and post_image_tab_extra are invalid?

discuz post_image_btn_extra and post_image_tab_extra are invalid?

WBOY
WBOYOriginal
2016-08-04 09:21:101197browse

I want to make a discuz plug-in. I followed the tutorial and did the test:

<code class="php">    if(!defined('IN_DISCUZ')) {
        exit('Access Denied');
    }
    class plugin_tutu{
        function post_image_btn_extra(){
            return "aaa";
        }
        function post_image_tab_extra(){
            return "sss";
        }
    }</code>

But there was no response.
Then I replaced post_image_btn_extra with global_usernav_extra1, but it was successfully output at the corresponding location!

Reply content:

I want to make a discuz plug-in. I followed the tutorial and did the test:

<code class="php">    if(!defined('IN_DISCUZ')) {
        exit('Access Denied');
    }
    class plugin_tutu{
        function post_image_btn_extra(){
            return "aaa";
        }
        function post_image_tab_extra(){
            return "sss";
        }
    }</code>

But there was no response.
Then I replaced post_image_btn_extra with global_usernav_extra1, but it was successfully output at the corresponding location!

In the end no one answered my question...Finally I found the solution myself...

<code>if(!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
class plugin_tutu{
    
}
class plugin_tutu_forum extends plugin_tutu{
        function  post_image_btn_extra(){
        return "aaa";
    }
    function post_image_tab_extra(){
        return 'sss';
    }
}</code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn