BackLinks的安装方法 For Sablog1.6

samool 发布23 条评论50808 阅读

AI摘要

文章介绍了如何在Sablog1.6模板中安装BackLinks。首先,需要在根目录下的index.php文件中替换代码,并添加密钥代码。然后,在templates/default/index.php文件中替换友情链接部分的代码,以显示BackLinks链接。最后,需要在BackLinks后台激活广告位,并确保网页编码为UTF-8,推荐使用DreamWave或EditPlus进行文件修改。

今天偶注册了BackLinks,在安装代码的时候遇到问题,由于Sablog采用模板方式,不能直接插入BackLinks的代码,必须换一种方法才行,经过本人研究测试后,得到如下方法,先共享给需要帮助的朋友。

什么是BackLinks?

打开根目录下的index.php  在第37行修改

if (in_array($action, array('index', 'finduser', 'search', 'tags'))) {
 session_start();

将他们替换成以下代码,并将密钥代码换成你的密钥,在BlackLink网站上获取代码的地方可以看到钥。

if (in_array($action, array('index', 'finduser', 'search', 'tags'))) {
 session_start();

//BlackLink链接代码

// The following variable defines whether links are opened in a new window
// (1 = Yes, 0 = No)
$OpenInNewWindow = "1";

// ********************************************************************
// Please DO NOT modify anything below
// ********************************************************************

$BLKey = "密钥代码";

$BLQueryString  = "LinkUrl=".urlencode((($_SERVER['HTTPS']=='on')?'https://':'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
$BLQueryString .= "&Key=" .urlencode($BLKey);
$BLQueryString .= "&OpenInNewWindow=" .urlencode($OpenInNewWindow);


if(intval(get_cfg_var('allow_url_fopen')) && function_exists('file')) {
    if($BLcontent = @file("http://www.backlinks.com/engine.php?".$BLQueryString)) 
        $BLcode = @join('', $BLcontent);
}
else {
    $BLcode = "It appears that your web host has disabled all functions for handling remote pages and as a result the BackLinks software will not function on your web page. Please contact your web host for more information.";
}

现在链接代码已经生成了,现在将链接变量代码输出来,打开templates\default\index.php文件,在第303行处修改,将  <h2>友情链接</h2>  替换成以下代码即可,我把BackLinks链接放在友情链接上面的。

<h2>赞助商链接<h2>
    <ul>
     $BLcode
    </ul>

<h2>友情链接</h2>

代码修改好后,到BackLinks后台把广告位激活一下,点“My Link Pages”,看到网址后面红色字体是“Inactive”,表示还未激活,点一下“Validate Web Page”检测一下代码,看到最后“Congratulations! It appears that your web page is configured correctly! ”,就OK了,再看一下网址那里就显示的是绿色的“active”,表示已经激活,等着别人来买你的链接吧。

什么是BackLinks?

最后提一下,应该Sablog采用的是UTF-8网页编码,所以在修改文件的时候,建议使用DreamWave或者使用EditPlus修改,不能使用记事本打开修改,切记。。切记。。

  1. 01Sablog探秘之《全面了解Sablog-X V2.0》2009-07-28
  2. 02PJBlog3 如何安装BackLinks2008-08-23
  3. 03Z-Blog 如何安装BackLinks2008-08-23
  4. 04同花顺风格下载 For Sablog2.02008-08-12
  5. 05BackLinks的安装方法 For Sablog2.02008-07-21
  6. 06通过BackLinks卖链接赚美元2008-07-21
  7. 07我快成Sablog风格达人了,哈哈2008-06-01
  8. 08博客程序升级到Sablog2.0的前前后后2008-05-16
  9. 09Sablog1.6 站点地图(SiteMap)插件2007-10-12
  10. 10[转]Sablog1.6模板下载《蓝风中秋雨梦版》2007-10-06
COMMENTS / 一纸留言

读者留言 23 条

一纸留言,便是山水间的一次相逢。

  1. jaord jaord
  2. jaord jaord

    再请教一下傻猫
    发现现在官方提供的代码修改了

    那模板的index文件 调用的“$BLcode”应该是没有用了
    但是我不知道应该修改成什么样子
    可以指点一下吗?

  3. 唉....

    恐怕有的等了.

  4. 呃....我发的是2.0的

    1. 回复 秋爱

      安装成功后就是这样的.你在后台激活一下,只是后台显示绿色的Active就可以了,慢慢等客户吧.

  5. 赞助商链接

    实现了以后好像就是这样的代码吧?

  6. 只是理论阶段,没有具体实施过啊,因为我是sa2.0预览版的.

  7. 回复 samool

    [quote=samool]引用 jaord 说过的话:
    请教一下 我的网站现在有人买链接了,但是链接显示在页面的最上方,显示在规定的地方 这是为什么啊?
    可以指点一下吗?
    我的站点 效果显示在页面最上方
    http://www.3g-info.net
    代码没有放对啊.sa1.6的我没试过,2.0是完全正常的,请看我首页效果.[/quote]
    我是完全按照这个帖子的内容添加的信息的
    不知道为什么哦

  8. 请教一下 我的网站现在有人买链接了,但是链接显示在页面的最上方,显示在规定的地方 这是为什么啊?
    可以指点一下吗?
    我的站点 效果显示在页面最上方
    http://www.3g-info.net

    1. 回复 jaord

      [quote=jaord]请教一下 我的网站现在有人买链接了,但是链接显示在页面的最上方,显示在规定的地方 这是为什么啊?
      可以指点一下吗?
      我的站点 效果显示在页面最上方
      http://www.3g-info.net[/quote]代码没有放对啊.sa1.6的我没试过,2.0是完全正常的,请看我首页效果.

WRITE A COMMENT

写下你的留言