分类:'wordpress' 的所有文章

测试转载,转贴,zz,zt

这是个测试贴:

只要标题中出现了“转贴, 转载, zz, zt”中的一个,就不会出现作者以及链接声明了

顺便测试修改过的编辑器
<br /> <b> this is a test for coolcode button in the editor</b><br />

Update:考虑到del.iciu.us自动发帖,加入了”links for”过滤

Tags:[tag]test, 转贴, 转载, zt, zz, 声明, 编辑器[/tag]

文章前加入作者名和本文链接

考虑到文章会被转载,在原创文章前面加入了作者和本文链接声明:

在代码(index.php):

<?php the_content(__('Read more'));?>

前面加入了

<?php $thetitle=the_title('', '', false) ?>
 
<?php if (strpos($thetitle, '转贴') === false) { ?>
    
<?php if (strpos($thetitle, '转载') === false) { ?>
      
<?php if (strpos($thetitle, 'zz') === false) { ?>
        
<?php if (strpos($thetitle, 'zt') === false) { ?>
          
<font color=#cccccc>
              作者:兔毛猫(2maomao.com)  链接:
<?php the_permalink() ?>
          
</font>
        
<?php } ?>
      
<?php } ?>
    
<?php } ?>
 
<?php } ?>

其中的条件判断提供了在转贴别人的文章时,不加入作者和本文链接声明的方法:
发表文章时在标题中加入’转贴’,”转载”,’zz’或者’zt都会自动去除该声明。

目前存在的问题:
1. 不会RSS中显示
这个做起来不难,修改rss.php应该就可以实现,但是还是算了,因为订阅RSS的用户,转载的时候都应该知道加原始链接吧。
而且订阅RSS本身就是为了方便,何必加个链接污染视野呢。

2. 有可能不是在标题开头出现转载,并且是原创帖
懒得改了,可以改成前两个字加冒号等等等等,这都不严重,而且很少见

Tags:[tag]转载, 转贴, zz, zt, 声明[/tag]

再次测试tags

[tag]test, tags, tag, again, wordpress, plugin[/tag]

测试Ultimate Tag Warrior

Ultimate Tag Warrior 3 / A Wordpress plugin for Tagging and Folksonomy Madness
Written by Christine Davis / christine@neato.co.nz / http://www.neato.co.nz

What’s here, in this archive?

+- plugins
|+- UltimateTagWarrior
|| These are the main plugin files. Place the whole folder into the wordpress
|| plugins folder (i.e. so you end up with /wp-content/plugins/UltimateTagWarrior/xxx.php
|| and so on).
||+- ultimate-tag-warrior-help.html contains the instructions for installing
| the plugin, and how to use it. It links to help files that cover customisations.
|
+- themes
|+- example-bits
||+- header.php includes the php you need to include the name of the tags in
|| the title bar, if you’re looking at a tag page
||+- tag.php is an example of a tag page - the page that is displayed when you
|| select a tag.
||+- searchtags.php is an AJAX driven tag based search. To use this, add it
|| to your theme folder; then create a new page, and select the “Search Tags”
|| template. If your wordpress isn’t installed at the top level, you’ll
|| need to tweak the ajax file path. You might also need to shuffle headers,
|| footers and sidebars about to match your theme.
||+- tags.php is an example of a page template that displays a tag cloud. As
with the tag search, to use it, you need to create a new page, and select
the “Tag Archive” template.

Tags:[tag]ajax, tag, test, ultimate, warrior[/tag]

更改了翻页链接的显示方式

只贴一下修改后的代码:

next_posts_link("点击查看下一页", $max_page);
echo ",共($max_page)页: <b>";
if ($paged >= 4) {
    
echo '<a href="'.get_pagenum_link().'">&laquo; First</a> ... ';
}
previous_posts_link($prelabel);
for($i = $paged - 2 ; $i  <= $paged +2; $i++) {
    
if ($i >= 1 && $i <= $max_page) {
        
if($i == $paged) {
            
echo "[$i]";
        
} else {
            
echo ' <a href="'.get_pagenum_link($i).'">'.$i.'</a> ';
        
}
    
}
}
next_posts_link($nxtlabel, $max_page);
if (($paged+2) < ($max_page)) {
    
echo ' ... <a href="'.get_pagenum_link($max_page).'">Last &raquo;</a>';
}
echo "$after</b>";
echo '&nbsp;&nbsp;&nbsp;也可以<a href="http://www.2maomao.com/blog/wp-archives.php">查看归档内容</a>';

Tags:[tag]Navigate, modify, wordpress[/tag]

« 上一页下一页 »