日志分类:博客赚钱

114啦网址导航建站模板bug修复方法

时间:2011年07月14日作者:么吉查看次数:111 views评论次数:0

  最近在研究网站导航(网址大全)的114啦网址导航建站程序,但是发布三级网站点击是报错。版本为 V1.15。其它的版本没有测试过。

  114la导航模板,点开三级分类后,出现的页面内容如下:

———————
Warning: Smarty error: unable to read resource: “class_header.tpl” in D:\wamp\apps\daohang\upload\admin\modules\smarty\Smarty.class.php on line 1114

Warning: Smarty error: unable to read resource: “class_body.tpl” in D:\wamp\apps\daohang\upload\admin\modules\smarty\Smarty.class.php on line 1114

Warning: Smarty error: unable to read resource: “class_footer.tpl” in D:\wamp\apps\daohang\upload\admin\modules\smarty\Smarty.class.php on line 1114
——————–

上网搜索了一些方法,如下是解决方法:
第一步:打开admin\modules下的 mod_make_html.php 的文件,查找

/**
* 生成4级分类 HTML
*
* @param int $cid
* @return string
*/
找到其后面的

1
$path_tpls_main = PATH_TPLS_MAIN . '/' . $dir_tpls_main;

将其修改为

1
$path_tpls_main = PATH_TPLS_MAIN . '/' . $dir_tpls_main . '/class';

// —— 找到以下代码删除

1
2
app_tpl::$instance->compile_id = mod_config::get_one_config('yl_dirtplmain');
$output .= app_tpl::fetch('class_header.tpl', $path_tpls_main);

第二步:
查找

1
2
3
4
/**
* 您的位置
*/
app_tpl::$instance = null;

将其改为

1
2
3
4
/**
* 您的位置
*/
//app_tpl::$instance = null;

第三步:查找以下代码并删除

1
2
3
4
5
6
/*
* 取得主体页尾
*/
app_tpl::$instance->compile_id = mod_config::get_one_config('yl_dirtplmain');
$output .= app_tpl::fetch('class_body.tpl', $path_tpls_main);
app_tpl::$instance = null;

第四步:查找

1
$output .= app_tpl::fetch('class_footer.tpl', $path_tpls_main);

将其删除,并在其后面添加

1
2
$template = empty($class_list[$cid]['template']) ? 'class.tpl' : $class_list[$cid]['template'];
$output .= app_tpl::fetch($template, $path_tpls_main);

保存。至此,此BUG修复完毕。起码我现在用的V1.15版本没有问题.

————————————————————–
方法二 :
  可以下载我修改好后的文件直接覆盖就可以了. 下载下面的文件解压到 admin/modules 覆盖原来的文件 mod_make_html.php
文件 : [ mod_make_html.php ]

wordpress简单添加adsense广告

时间:2011年06月17日作者:ronald查看次数:116 views评论次数:0

一、Wordpress日志内容页面添加环绕广告

进入你的博客后台–>外观–>编辑 –> 打开 文章页面模板 (single.php)
或者直接下载 文章页面模板 (single.php) 文件,然后打开
找到这段代码 “php the_content” 在这段代码之前插入以下代码:

1
2
3
<div style=”float:right; padding-bottom:10px;padding-top:10px;”>
google adsense  广告代码
</div>

实现的关键是float:right

二、Wordpress日志内容页面底部添加广告

继续往下找到这段代码 php comments_template(); 将以下代码放到这段代码的前面

1
2
3
<div style=”float:right; padding-bottom:10px;padding-top:10px;”>
google adsense  广告代码
</div>

三、在Wordpress日志内容顶部加广告

打开single.php,找到php the_content();

在 php the_content(); 上面加上广告代码即可:

1
2
3
4
<div style=”padding-bottom:10px;padding-top:10px;”>
广告代码
</div>
<?php the_content(); ?>

四、博客的首页第一篇文章下面放置google adsense的广告

可以在当前使用的主题文件夹下面找到index.php文件,打开

找到如下代码 php the_content();

在这段代码前面插入代码

1
2
3
4
5
<?php if ($wp_query->current_post == 0) : ?>
<div style=”float:right; padding-bottom:10px;padding-top:10px;”>
google adsense  广告代码
</div>
<?php endif; ?>

在php the_content(); 这段代码的后面插入

1
2
3
4
5
<?php if ($wp_query->current_post == 0) : ?>
<div style=”padding-top:10px;text-align:center;”>
336*280Adsense代码
</div>
<?php endif; ?>

五、在Wordpress侧栏放置广告:

进入后台 — 外观 — 小工具 — 看到里面有一个文本 这个小工具吧。
激活这个小工具 把代码 直接 放到这个文本里就可以了。

前几天刚刚申请adsense成功了,今天打算试一下.很快就添加成功,比想像中还要简单.wordpress真的很强大.
本博客就是使用第五种方式在侧栏添加adsense广告的.
下面是后台添加的截图:

出处:http://www.vanlife001.com/