97久久国产亚洲精品超碰热,成人又色又爽的免费网站,色偷偷女人的天堂a,男女高潮喷水在线观看,国内精品一线二线三线区别在哪里
Discuz! 官方交流社區(qū)
標(biāo)題:
關(guān)于前端鉤子 按鈕顯示的問題 大佬們幫我看看 哪個(gè)地方有有問題
[打印本頁(yè)]
作者:
bug八阿哥
時(shí)間:
2024-9-8 00:35
標(biāo)題:
關(guān)于前端鉤子 按鈕顯示的問題 大佬們幫我看看 哪個(gè)地方有有問題
關(guān)于前端鉤子 按鈕顯示的問題 大佬們幫我看看 哪個(gè)地方有問題
最終想顯示的是
發(fā)帖框頂部 發(fā)帖框中部 發(fā)帖框底部 還有 帖子和列表頁(yè)的 快速回復(fù)區(qū)域顯示
xml文件里面的代碼
<item id="hooks">
<item id="post_top">
<item id="qier_thread_top"><![CDATA[qier_thread_post_top]]></item>
</item>
<item id="post_middle">
<item id="qier_thread_middle"><![CDATA[qier_thread_post_middle]]></item>
</item>
<item id="post_bottom">
<item id="qier_thread_button"><![CDATA[qier_thread_post_button]]></item>
</item>
<item id="viewthread_fastpost_content">
<item id="qier_thread_viewthread_fastpost_content"><![CDATA[qier_thread_viewthread_fastpost_content]]></item>
</item>
<item id="forumdisplay_postbutton_bottom">
<item id="qier_thread_forumdisplay_postbutton_bottom"><![CDATA[qier_thread_forumdisplay_postbutton_bottom]]></item>
</item>
</item>
復(fù)制代碼
class.php里面的代碼
<?php
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
class plugin_qier_thread {
public function post_top() {
if (!$this->is_plugin_enabled()) return '';
return $this->qier_thread_button('post_top');
}
public function post_middle() {
if (!$this->is_plugin_enabled()) return '';
return $this->qier_thread_button('post_middle');
}
public function post_bottom() {
if (!$this->is_plugin_enabled()) return '';
return $this->qier_thread_button('post_bottom');
}
public function viewthread_fastpost_content() {
if (!$this->is_plugin_enabled()) return '';
global $_G;
if($_G['cache']['plugin']['qier_thread']['show_in_fastpost']) {
return $this->_get_button_html();
}
return '';
}
public function global_header() {
if (!$this->is_plugin_enabled()) return;
global $_G;
$button_position = $this->get_button_position();
$button_text = $_G['cache']['plugin']['qier_thread']['custom_button_text'] ?: lang('plugin/qier_thread', 'qier_thread_generate_article');
// 只在發(fā)帖頁(yè)面顯示按鈕
if(CURSCRIPT == 'forum' && (CURMODULE == 'post' || CURMODULE == 'viewthread')) {
include template('qier_thread:qier_thread_post');
}
}
public function forumdisplay_postbutton_bottom() {
if (!$this->is_plugin_enabled()) return '';
global $_G;
if($_G['cache']['plugin']['qier_thread']['show_in_fastpost']) {
return $this->_get_button_html();
}
return '';
}
private function qier_thread_button($position) {
global $_G;
$enable = $_G['cache']['plugin']['qier_thread']['enable'];
$button_position = $_G['cache']['plugin']['qier_thread']['button_position'];
if (!$enable) {
return '';
}
$position_map = [
'post_top' => '1',
'post_middle' => '2',
'post_bottom' => '3'
];
if ($button_position !== $position_map[$position]) {
return '';
}
return $this->get_button_html();
}
private function _get_button_html() {
global $_G;
$button_text = $_G['cache']['plugin']['qier_thread']['custom_button_text'] ?: '這是個(gè)按鈕';
include template('qier_thread:button');
return $return;
}
private function get_button_html() {
$css_url = 'source/plugin/qier_thread/static/css/style.css';
$js_url = 'source/plugin/qier_thread/static/js/qier_thread.js';
$output = '<link rel="stylesheet" type="text/css" href="' . $css_url . '" />';
$output .= '<script type="text/javascript" src="' . $js_url . '"></script>';
$button = '<button type="button" id="qier_thread_button" class="qier-thread-button">';
$button .= '<span class="qier-thread-icon"></span>';
$button .= '<span class="qier-thread-text">' . $button_text . '</span>';
$button .= '</button>';
return $output . $button;
}
private function get_position_for_hook($hook) {
switch ($hook) {
case 'post_top': return 1;
case 'post_middle': return 2;
case 'post_bottom': return 3;
default: return 0;
}
}
public function get_button_position() {
global $_G;
return $_G['cache']['plugin']['qier_thread']['button_position'];
}
private function is_plugin_enabled() {
global $_G;
return !empty($_G['cache']['plugin']['qier_thread']['enable']);
}
}
復(fù)制代碼
試過好多方案 就是不能正常的顯示出按鈕 查看網(wǎng)頁(yè)源代碼 也沒用相關(guān)插件的js或者css文件路徑
也就是說沒啟動(dòng)插件
不知道什么原因【上面的代碼是改了好幾種方案的其中一種了 都不顯示】
日志全開 日志頁(yè)抓不到。
作者:
myboss
時(shí)間:
2024-9-15 08:40
綜合法務(wù)服務(wù),這個(gè)網(wǎng)站,我看看唄
歡迎光臨 Discuz! 官方交流社區(qū) (http://r615.cn/)
Powered by Discuz! X5.0