本篇文章给大家谈谈zblog发布文章写代码,以及zblog文章模板对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。
可以在发布文章的时候可以把文章类型设置成私人文章,这样只有在登录状态下才能查看文章的。更多的内容可以去zblog仿站乐园看下。。
一般统计代码在后台版权里面添加就可以了,需要注意的必须文件重建才能在分类页面和文章页面显示的,你试着文件重建下试下了。
不用写什么代码吧
建个子目录,把zblog的程序放到里面,然后将域名绑定,服务器端设置绑定到子目录就可以了
1、新建广告文件
在模板文件夹内建一个文件作为放广告代码的文件(这里暂且命名为:post-ad.php)
2、修改模板文件
找到 \zb_users\theme\default\template\index.php (default根据你自己的模板为准)这个文件找到下面这段代码:
PHP
{foreach $articles as $article}
{if $article.IsTop}
{template:post-istop}
{else}
{template:post-multi}
{/if}
{/foreach}
如果你只想在置顶列表里加入广告那么将上面的代码替换为:
PHP
{php}$j=1;{/php}
{foreach $articles as $article}
{if $article.IsTop}
{template:post-istop}
{if $j==3}
{template:post-ad} (这里也可以不调用,直接放广告代码)
{/if}
{php}$j++;{/php}
{else}
{template:post-multi}
{/if}
{/foreach}
(数字3为广告出现的位置,post-ad 为第一步建的文件名,下同)
如果你想在除置顶列表外加入广告那么将上面的代码替换为:
PHP
{php}$i=1;{/php}
{foreach $articles as $article}
{if $article.IsTop}
{template:post-istop}
{else}
{template:post-multi}
{if $i==3}
{template:post-ad}
{/if}
{php}$i++;{/php}
{/if}
{/foreach}
上面两个位置同时出现的代码为:
PHP
{php}$i=1;$j=1;{/php}
{foreach $articles as $article}
{if $article.IsTop}
{template:post-istop}
{if $j==3}
{template:post-ad}
{/if}
{php}$j++;{/php}
{else}
{template:post-multi}
{if $i==3}
{template:post-ad}
{/if}
{php}$i++;{/php}
{/if}
{/foreach}
不但可以向本文一样显示代码,并且高亮显示。
一、在FCKeditor的配置文件(一般为fckconfig.js或custom.config.js)中,配置 FCKConfig.ToolbarSets设置部分 添加一个按钮值 'InsertCode',步骤如下:
1、在配置文件中找到下面的代码:
JavaScript代码
XML/HTML代码
FCKConfig.ToolbarSets[Default]=[
['Source','FontName','FontSize'],
['TextColor','BGColor'],
['Image','Media','Flash','Table','Smiley','SpecialChar'],
['ShowBlocks','Preview','FitWindow'],
'/',
['PasteText','Templates','Find','RemoveFormat'],
['Undo','Redo'],
['-','Bold','Italic','Underline','StrikeThrough'],
['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote'],
['JustifyLeft','JustifyCenter','JustifyRight'],
['Link','Unlink','Rule'],
['Subscript','Superscript','-','InsertCode']//Nocommaforthelastrow.];看到了么?最后一句的区别。
2、查找:FCKConfig.PluginsPath = FCKConfig.BasePath + 'plugins/';
在下面加上:
FCKConfig.Plugins.Add('insertcodeRun');
二、打开fckeditor\editor\lang文件夹里的zh-cn.js,在结尾的 };之前 加入以下代码
InsertCodeBtn : 插入代码
注意:加入上面代码时,原来的最未句代码后面要加个逗号.
zblog发布文章写代码的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于zblog文章模板、zblog发布文章写代码的信息别忘了在本站进行查找喔。
本文由admin于2022-12-19发表在靑年PHP官网,如有疑问,请联系我们。
本文链接:http://qnphp.com/post/122241.html