日志标签 ‘插件’

Warning: Use of undefined constant archives - assumed 'archives' (this will throw an Error in a future version of PHP) in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: Use of undefined constant page - assumed 'page' (this will throw an Error in a future version of PHP) in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32
class="post-1402 post type-post status-publish format-standard hentry category-grass-roots-webmaster tag-alimama tag-google-adsense tag-430 tag-55 tag-164 tag-906">

WordPress广告随机显示的方法

2011年3月11日

因为每天都看到同样的广告,感到很厌烦,同时,由于申请了Google Adsense、百度联盟、凡客诚品联盟、阿里妈妈等一系列的广告联盟,可是博客里面只有一两个广告位,那怎么办呢?

据说是有wordpress的广告插件,可以实现广告随机显示,但是如果插件太多的话,很容易导致WP速度变慢,于是博主们一般都希望能不用插件即可实现广告的随机显示。

Google了一下,发现不用插件实现广告随机显示的方法有好多,自己测试了一下,发现有两种方法是比较不错的。

方法一:来自求索阁:wordpress中不同广告联盟随机显示

<?php if ( rand(0, 1) == 0) { ?>
广告代码1
<?php } else { ?>
广告代码2
<?php } ?>

很简单,将“广告代码1”、“广告代码2”替换为您的Google Adsense或者百度联盟广告代码就OK了。

不过,有个缺点就是貌似只能两个广告代码交替出现,如果有两个以上的广告想同时出现的话,貌似就不是很容易实现了。

方法二:来自壹品集让你的WordPress 显示随机广告

<?php
    $ad = array(
        ‘广告代码_1’,
        ‘广告代码_2’,
        ‘广告代码_3’,
    );
    $rand = array_rand($ad);
    echo $ad[$rand];
?>

相对于第一种方法,这个可以实现多个广告代码交替出现。

不过,在实际使用中却出现了问题:如果使用了百度联盟的广告代码的话,则WordPress会报错。不知道为什么会出现这种情况。由于不懂代码,于是最佳的解决办法是,在这个代码中,不加百度联盟广告……

Warning: Use of undefined constant archives - assumed 'archives' (this will throw an Error in a future version of PHP) in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: Use of undefined constant page - assumed 'page' (this will throw an Error in a future version of PHP) in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32
class="post-1401 post type-post status-publish format-standard hentry category-grass-roots-webmaster tag-mail-to-commenter tag-wordpress tag-191 tag-164">

求助:Cordobo Green Park 2主题如何添加Mail to Commenter的自定义按钮的代码

2011年3月11日

前几天博客装了Cordobo Green Park 2 主题,这个主题确实不错,很清爽,但是却发现这个主题的代码好像跟以前用过的有些不同。

由于不太懂后台代码,很多想修改的地方都找不到该在什么地方修改。
之前一直用
Mail to commenter插件,但是在这个主题里,我竟然找不到Mail to Commenter的自定义按钮的代码应该添加的位置。

Mail to commenter插件的设置界面的说明是:

自定义按钮显示:

这部分用来设定mailtocommenter_button()函数的输出内容和格式。请在模板文件中插入<?php if(function_exists(‘mailtocommenter_button’)) mailtocommenter_button();?>代码用于生成按钮。

 

之前用的主题也曾经被我找到了合适的位置,可是,为什么现在用的这个Cordobo Green Park 2 主题就是找不到了,把代码放在了好多地方测试,都无功而返……

哪位达人帮忙给看看,这个代码应该加在哪个文件的什么地方?

话说,刚装上主题的时候,想插入备案信息,结果在footer.php里面找了好久都没有找到插入备案信息的地方,最后竟然是在functions.php(主题支持函数)中找到了页脚的版权信息,sigh!

主题地址:http://wordpress.org/extend/themes/cordobo-green-park-2

Warning: Use of undefined constant archives - assumed 'archives' (this will throw an Error in a future version of PHP) in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: Use of undefined constant page - assumed 'page' (this will throw an Error in a future version of PHP) in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32
class="post-1400 post type-post status-publish format-standard hentry category-grass-roots-webmaster tag-php tag-wordpress tag-191 tag-164 tag-302">

春天新主题:Cordobo Green Park

2011年3月8日

WordPress的主题早就想换了,但是苦于一直都没找到个称心如意的主题,于是一拖再拖,昨天总算是下定了决心,要改头换面一下,于是Google了一下,找了好多的主题来试验。

网上的WP主题确实是不少,当然,WP后台也可以直接搜索主题,直接安装。但是发现好多的主题放在我博客上并不是很适用,挑选了好久,总算找到了这一款叫做Cordobo Green Park的主题,很清新,也很爽快。绿色的横条让人感觉到春天的气息……

Wopus上对它的介绍同样简洁:

一款清爽的绿色主题
完全兼容WordPress的2.7.1和2.8
支持WordPress的小工具
此版本对CSS进行了优化,载入迅速,对SQL数据库的查询降到最低限度的
支持Twitter插件

大家可点击下方链接下载:

下载

用了一个晚上的时间,为主题添加了广告、加上了一些常用的插件……可是有一个问题一直没有解决:

Mail to Commenter的自定义按钮的代码没有找到放的地方。

或者干脆是:没有找到可以编辑“评论列表”的地方……sigh

偶不懂html、php、asp在内的所有代码,哪位代码达人帮忙给看一下下?

立此存照(点击图片查看大图):

新主题首页:

Cordobo Green Park 2

新主题日志页:

Cordobo Green Park 2

原博客主页:

Warning: Use of undefined constant archives - assumed 'archives' (this will throw an Error in a future version of PHP) in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: Use of undefined constant page - assumed 'page' (this will throw an Error in a future version of PHP) in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32
class="post-1329 post type-post status-publish format-standard hentry category-grass-roots-webmaster tag-wordpress tag-3 tag-164">

测试几个插件

2011年3月1日

本篇博客用作测试Wp2Sinablog、Wp2HiBaidu、Wp2Sohublog三个worderpress插件,请众博友忽略~

经测试:Wp2Sinablog、Wp2Sohublog完美的完成了自己的任务,但是百度空间上并没有看到文章同步过去。

这个系列的插件还是很不错的,博友们可以直接在后台添加,搜索着几个插件安装激活。

安装的说明,可以到这里来看。

Warning: Use of undefined constant archives - assumed 'archives' (this will throw an Error in a future version of PHP) in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: Use of undefined constant page - assumed 'page' (this will throw an Error in a future version of PHP) in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32
class="post-1320 post type-post status-publish format-standard hentry category-dbview tag-chrome tag-theword tag-wordpress tag-164 tag-352">

我所使用的chrome扩展

2011年2月19日

Google扩展程序

用Firefox的童鞋肯定都知道扩展程序的好,有了扩展程序之后,世界美好了许多……

在浏览器的选择上,chrome出来之前,我宁愿用IE内核的Theworld或者是遨游,也很少用firefox,因为Firefox的启动太慢了……不过有了chrome之后,我就深深的爱上了它,启动速度快,浏览速度快,界面简洁。现在用了周鸿祎童鞋的360极速浏览器(chrome内核,但是还有IE兼容模式,可以顺利访问支付宝、网上银行等)之后,更加的热爱上了chrome……

最初chrome开始推出扩展程序的时候,曾经关注过,但是最初的时候扩展真的很少,这几天忽然发现chrome的扩展程序已经很多很多了,多得用不完……而且,很多真的是非常非常有用的,顿时感慨:生活真美好~!

用了一段时间,试用了一些,也淘汰了一些,最后留下了一些常用的扩展程序。

1、FaWave(发微)

现在是一个微博的时代,似乎没有微博就像要被社会淘汰一样……发微(FaWave),Chrome上的微博插件,支持多微博,真正的实时同步发送微博,多微博发送不再烦。目前支持的微博有腾讯微博(qq)、新浪微博(sina)、Twitter、搜狐微博(sohu)、饭否、做啥、嘀咕(digu)、人间网、雷猴、豆瓣、Google Buzz、网易微博(163)。 功能全面、强大,还可以批量发送图片。FaWave的理念不是简单的多微博同步,而是多微博管理,可以让你在同一个入口很方便的管理你的微博,让你所有的微博对于你、还有你的粉丝都是真正有价值的。

2、ScribeFire

虽然现在是微博的时代,但是依然无法掩盖博客的风光。ScribeFire貌似原来是Firefox上的一个博客插件,现在被迁移到chrome平台上,ScribeFire是一个全功能的博客编辑器插件,目前支持WordPress, Blogger, TypePad, Windows Live Spaces, Tumblr, Posterous, Xanga, LiveJournal, 以及其他支持 MetaWeblog 或 MovableType APIs的博客程序。

如今的这篇日志便是我利用chrome ScribeFire插件编辑的,与wordpress后台插件貌似很相近,但是感觉速度比较快、用起来没有任何的障碍。

3、网页截图

截取网页为图片,支持窗口截图,区域截图和整个网页截图三种方式。支持水平和垂直翻页截取超大网页,截图后,可以利用图片编辑工具编辑图片,然后将编辑后的图片保存下来即可。

4、PageRank Status

看名字,不用解释了吧?做网站或者独立博客的人应该没有不知道PR是干什么的……不光显示PageRank,还会可以显示实时的Aleax的排名。

5、Douban Pulse

豆瓣的插件,其实一般的功能在FaWave中已经实现了,但是Douban Pulse可以听豆瓣电台,边写博客边听歌,也是很惬意的……

6、Micro Clock

微型的时钟,直接显示在图标栏上

7、谷歌地图 + 生活通 

在地图上查找地点,浏览周围的好去处,不过说实在话,除了不用输入Google maps的网址之外,我还真没看出这个插件有多好的地方……


Warning: Use of undefined constant archives - assumed 'archives' (this will throw an Error in a future version of PHP) in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: Use of undefined constant page - assumed 'page' (this will throw an Error in a future version of PHP) in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32
class="post-1282 post type-post status-publish format-standard hentry category-grass-roots-webmaster tag-mail-to-commenter tag-wordpress tag-164 tag-302">

Mail To Commenter插件使用中的两个问题

2010年8月31日

Mail To Commenter插件在人在岱北博客已经用了好久好久了,但是由于SunQ本身就是一个圡人,并不懂后台,所以之前用的主题都是集成了Mail To Commenter插件的主题,我也就没有做过什么设置的工作,但是最近换了个主题,却发现主题并没有集成Mail To Commenter插件,最直接的问题是,没有回复按钮,让回复评论变得很累。

前一段时间一直都懒,也就没在意这件事情,昨天ryan同学在评论我的博文《可怜之人必有可恨之处》时,建议我加上回复评论按钮,这时我才想起来,这个按钮已经空缺了好久了……

如何加入回复评论的按钮

在Mail To commenter插件的设置界面,有这么一句说明:

自定义按钮显示:
这部分用来设定mailtocommenter_button()函数的输出内容和格式。请在模板文件中插入<?php if(function_exists(‘mailtocommenter_button’)) mailtocommenter_button();?>代码用于生成按钮。

也就是说,只要在想要的地方插入想要出现的地方,就可以在那个地方显示你所设置的回复按钮……

可是,应该在哪里插入这段代码呢?

研究了半天我现在所使用的这个GenkiTheme主题,感觉要么是在single.php中修改,要么是在comments.php中修改。虽然不懂php,英语也是弱智级别,但是简单的词语还是懂一些的。

眼对眼研究了好久,觉得还是应该在comments.php中添加这个代码……

在comments.php中发现了这么一段代码:

<?php foreach ($comments as $comment) : ?>

        <li class="<?php echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>">
            <?php if (function_exists(‘avatar_display_comments’)){ avatar_display_comments(get_comment_author_email(),’48’,”); } ?>&nbsp;&nbsp;<strong><?php comment_author_link() ?></strong> | <a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date(‘F jS, Y’) ?> <?php _e(‘at’);?> <?php comment_time() ?></a> <?php edit_comment_link(‘e’,”,”); ?>

我想,这应该是评论的上方所出现的评论者信息栏吧,因为我看到了ID、date、time这样的字眼,而且重要的是,如果我用管理员登录后,会在这些信息的后面显示“e”,以用于编辑评论,而最后面那句“<?php edit_comment_link(‘e’,”,”); ?>”不正是编辑评论链接的表述嘛……

这正是我想放上回复评论按钮的地方,于是把那句代码粘贴在这段代码之后,更新文件。到前台刷新了一下,果然,评论按钮出现了!

解决邮件无发件人的现象

由于真的不懂代码,为了让自己的修改更保险一下,用Google搜了一下,虽然没有找到准确的答案,但是却找到了之前发现的一个问题的解决办法。

一年多以前了,2009年6月,自从wordpress升级到2.8以后,Mail To Commenter插件所发送的邮件就出现了问题:发送的邮件没有发件人,虽然基本功能还是能实现的,但是却真的有碍观瞻,说不定还会被人当作成垃圾邮件了……

在一个叫做Derek’s Blog的wordpress上,我找到了问题的解决办法:(以下内容转自:Mail To Commenter的未知发件人问题

修改Mail To Commenter插件目录下的文件mailtocommenter_functions.php,路径为****/wp-content/plugins/mailtocommenter,找到function mailtocommenter_send_email此行,照着修改(我是CP的),然后测试成功,收工。

function mailtocommenter_send_email($to,$subject,$message){
	$hostname = get_option('home');
	preg_match("/^(http:\/\/)?([^\/]+)/i",$hostname, $matches);
	$blogname = get_option('blogname');
	$blognameO = $blogname;
	$blogname .= " <no-reply@";
	$blogname .= $matches[2];
	$blogname .= ">";

	$charset = get_option('blog_charset');
	$headers  = "From: $blognameO <no-reply@$matches[2]> \n" ;
	$headers .= "MIME-Version: 1.0\n";
	$headers .= "Content-Type: text/html;charset=\"$charset\"\n";
	$to = strtolower($to);
	return @wp_mail($to, $subject, $message, $headers);
}
果然,按照Derek的方法修改之后,现在回复的邮件已经显示发件人了……
“困扰”了一年多的问题在偶然中找到了解决办法,正所谓“无心插柳柳成荫”呀……

启示

对网站做一些简单的修改,并不一定非要懂后台,懂代码,仔细分析一下代码内容,必要时借助一下Google,小问题也是可以轻松解决的!

Warning: Use of undefined constant archives - assumed 'archives' (this will throw an Error in a future version of PHP) in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: Use of undefined constant page - assumed 'page' (this will throw an Error in a future version of PHP) in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32
class="post-1064 post type-post status-publish format-standard hentry category-grass-roots-webmaster tag-mail-to-commenter tag-wordpress tag-164">

Mail To Commenter 插件出现问题

2009年6月20日

自从前几天WordPress升级到2.8之后,发现Mail To Commenter插件出现了一个小问题:

原来显示为“人在岱北 静心聆泉 wordpress@sun-q.cn”的发件人处,竟然是空白!

(原来的收件人显示正确)

原因可能出现在哪里?有没有人跟我遇到同样的情况呢?

Warning: Use of undefined constant archives - assumed 'archives' (this will throw an Error in a future version of PHP) in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: Use of undefined constant page - assumed 'page' (this will throw an Error in a future version of PHP) in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32
class="post-1021 post type-post status-publish format-standard hentry category-memory tag-vpn tag-164">

谁懂VPN?

2009年5月10日

谁能帮我看看,这个是怎么了?

我在第一次安装这个Cisco的VPN插件的时候,就一直出现这个问题,导致安装不上,之后重做了操作系统之后,安装成功了。

前几天还正常使用的,今天想再连一下,结果在Checking for updates…时,又出现了这个问题,郁闷呀!

谁能帮我看看问题会出在哪里呢?

Warning: Use of undefined constant archives - assumed 'archives' (this will throw an Error in a future version of PHP) in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: Use of undefined constant page - assumed 'page' (this will throw an Error in a future version of PHP) in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32
class="post-787 post type-post status-publish format-standard hentry category-grass-roots-webmaster tag-php tag-wordpress tag-303 tag-164">

搞定Hot Friends插件的链接云

2008年11月8日

花果山寨的推荐下,用了Think Again的Hot Friends插件,但是使用之后,只有Widgets的Hot Friends可以使用,在页面调用链接云的函数老是无法成功。以前也写过文章问关于Hot Friends插件的使用问题,Think Again也亲自给指导了一下,但是问题一直都没有解决……

今天早上,一个叫做小肚生鱼汤的网友来到了我的博客,提到了他在使用Hot Friends插件中时存在的问题,但是不到九点,小肚生鱼汤就解决了这个问题,并且特意过来告诉我:原来是应为缺少文章调用php代码的功能,小肚给推荐了Exec-PHP插件

Exec-PHP插件可以帮助WP实现在页面和Widgets中调用php代码的功能,直接到WP官方站上下载插件,然后在后台启动就OK了,这样我们就可以在正文或Widgets中调用php函数了。

现在友情链接页面已经是链接云的效果了。

Warning: Use of undefined constant archives - assumed 'archives' (this will throw an Error in a future version of PHP) in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: Use of undefined constant page - assumed 'page' (this will throw an Error in a future version of PHP) in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /www/wwwroot/daibei.info/wp-content/themes/cordobo-green-park-2/archive.php on line 32
class="post-679 post type-post status-publish format-standard hentry category-memory category-grass-roots-webmaster tag-479 tag-303 tag-164">

WordPress Hot Friends插件使用问题

2008年9月14日

    博友花果山寨向大家推荐了Think Again的Hot Friends插件,Hot Friends插件可以根据指定期间(周、月或者全部)评论数对友情链接进行排序,生成制定数目的首页友情链接,还支持生成类似标签云的友情链接云,另外对于评论次数达到特定要求的评论者自动添加到友情链接中。

    对于如此让人心动的插件,怎可不试一下呢?

    禁用了之前使用的AutoBlogroll插件(AutoBlogroll的频繁更新,每次更新都需要重新安装一遍确实让人心烦),将Hot Friends插件激活,同时分别增加了一个文本的widgets,内容为<?php hot_friends();?>,同时新建了一个“友情链接”的页面,html代码中加入<?php hot_friends_cloud();?>。

    但是在实际效果中,不管是widgets还是友情链接页面,都没有显示链接,但是在后台可以查询博友的评论数,怀疑是函数调用的时候出了点问题……但是实在不知道函数调用错误出在哪里,郁闷!

    有没有哪位牛人帮忙解决一下呀?

×××××××××××××××××××××

    新生的军训又开始了,忽然翻出了6年前自己参加军训时候的照片,翻拍出来给大家看看:

 

    军训时期,宿舍的合影,想想现在已经毕业两年多了,还是好怀念那段时光……

 

    军训期间拉练,在打靶场的照片,那时候真年轻,体型也好……现在都成了肉丸子了!