如何调用文章的ID数字号?

模板开发以及发布测试

版主: seita

回复
hellowind
帖子: 47
注册时间: 2010年 11月 8日 04:00
联系:

如何调用文章的ID数字号?

帖子 hellowind »

默认的
<?php $this->theID(); ?>
这样调用的文章ID前面自动加入了post-
例如:
post-18

我只想要后面的ID数字号,不需要前面的。如何调用?

我想在前台文章上面加个编辑按钮,方便编辑。


-------------------------------------------------

还有反馈个小BUG,貌似JustArchives加载方式有点问题。每一篇文章都自动在代码里面载入了代码。
而且会导致页面JS错误。
头像
binjoo
帖子: 824
注册时间: 2009年 9月 11日 11:13
来自: digu.plus
联系:

Re: 如何调用文章的ID数字号?

帖子 binjoo »

获得日志的类型,比如post、page

代码: 全选

<?php $this->type(); ?>

获得日志的ID

代码: 全选

<?php $this->cid(); ?>


多看看源码,结构很清晰,很容易找到需要的东西,而且大部分函数都有注释的。
jkey418
帖子: 8
注册时间: 2010年 10月 16日 02:23
联系:

Re: 如何调用文章的ID数字号?

帖子 jkey418 »

@hellowind
了解,等晚上我修改一下
头像
binjoo
帖子: 824
注册时间: 2009年 9月 11日 11:13
来自: digu.plus
联系:

Re: 如何调用文章的ID数字号?

帖子 binjoo »

@jKey
本来想今天折腾完主题后就把那个插件弄上的,不过还是等你修复这些问题之后再弄吧,呵呵。。
hellowind
帖子: 47
注册时间: 2010年 11月 8日 04:00
联系:

Re: 如何调用文章的ID数字号?

帖子 hellowind »

@binjoo
非常感谢!

等几天放个皮出来。刚扒的
头像
binjoo
帖子: 824
注册时间: 2009年 9月 11日 11:13
来自: digu.plus
联系:

Re: 如何调用文章的ID数字号?

帖子 binjoo »

@hellowind
不客气。。
呵呵,刚刚出炉的。。
qt06
帖子: 93
注册时间: 2010年 3月 5日 12:43
联系:

Re: 如何调用文章的ID数字号?

帖子 qt06 »

<?php if($this->user->hasLogin()): ?>
<a href="<?php $this->options->adminUrl('write-post.php?cid=' . $this->cid); ?>"><?php _e('编辑'); ?></a>
<?php endif ?>
hellowind
帖子: 47
注册时间: 2010年 11月 8日 04:00
联系:

Re: 如何调用文章的ID数字号?

帖子 hellowind »

谢谢!搞定了!
现在在前台添加了个编辑按钮 很方便。
基本上算很强大了。
不知道用什么编辑器好。
都没有非常完美嵌入的。
官方用的功能太少。
qt06
帖子: 93
注册时间: 2010年 3月 5日 12:43
联系:

Re: 如何调用文章的ID数字号?

帖子 qt06 »

直接默认用源码,好处多多。
最大的好处是锻炼自己的html撰写能力。
回复