Giter Site home page Giter Site logo

Comments (6)

jzwalk avatar jzwalk commented on July 21, 2024 1

$comments变量默认只在评论模版里声明,所以你在首页用新版代码无效了。可以用旧版代码<?php Smilies_Plugin::output(); ?>也是兼容的。js无效有两种可能,一个是你用的主题没有在footer.php里按标准写上插件节点<?php $this->footer(); ?>,二就是其他js代码和表情插入js冲突了。

from smilies.

jzwalk avatar jzwalk commented on July 21, 2024

你这个需求比较特殊……考虑到首页一版没有评论框,插件并没有往首页输出js。你可以手动修改Plugin.php的第629行改成
if ($widget->is('single') || $widget->is('index')) {即可。

from smilies.

chinobing avatar chinobing commented on July 21, 2024

按照你的方法改了,但是完全没有显示出来?
如果用旧的版本,<div id="smiliesbox" style="display:block;">。。。。</div>是可以正常显示,但是js无效。但现在用了新的版本,连

的代码都没有出现,我怀疑是调用问题

from smilies.

chinobing avatar chinobing commented on July 21, 2024

513行:

	public static function insertjs($widget)
	{
		$options = Helper::options();
		$settings = $options->plugin('Smilies');
		$textareaid = $settings->textareaid;
		$textareaid = $textareaid ? $textareaid : _t('一般无需填写');

		$idset = ($widget->is('single') || $widget->is('index')) ? $textareaid : 'text';
		$txtid = $settings->jqmode ? '#'.$idset : $idset;
		$txtdom = 'domId("'.$txtid.'")';
		if ($widget->is('single') || $widget->is('index') && $idset==_t('一般无需填写')) {
			$txtid = 'textarea';
			$txtdom = 'domTag("'.$txtid.'")';
		}

629行:

		if ($widget->is('single') || $widget->is('index')) {

因为只改动629的代码并没有效果,而且div并没有调用,所以我改了513行的代码,但同样没有效果。

from smilies.

chinobing avatar chinobing commented on July 21, 2024

果然优秀!!!而且解释得很清楚!

from smilies.

jzwalk avatar jzwalk commented on July 21, 2024

能用上就行:P

from smilies.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.