BackLinks的安装方法 For Sablog1.6

该日志由 samool 发表于 2008-07-21 9:32 PM



今天偶注册了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修改,不能使用记事本打开修改,切记。。切记。。

 傻猫网络日志标签:    sablog, backlinks  tiffany jewelry  
网摘: Yahoo Baidu Google Bolaa 365Key Yesky Wozhai POCO ViVi YouNote Hexun Del.icio.us Yeeyoo igooi I2Key Cn3 Bytemen Furl Blinklist Blogmarks Technorati 分享到饭否
相关文章: (最多只显示5条记录)
PJBlog3 如何安装BackLinks (浏览:7236, 评论:0)
Z-Blog 如何安装BackLinks (浏览:6813, 评论:5)
Sablog2.0蓝风风格下载 (浏览:8203, 评论:6)
同花顺风格下载 For Sablog2.0 (浏览:8387, 评论:3)
BackLinks的安装方法 For Sablog2.0 (浏览:4473, 评论:8)
» 我要发表评论 你的参与是我最大的动力!    访客评论: (23条记录)
  1. 17 samool :
    2008-09-28 11:18 AM   引用此文发表评论
    只是理论阶段,没有具体实施过啊,因为我是sa2.0预览版的.
  2. 18 秋爱 :
    2008-09-28 4:23 PM   引用此文发表评论
    <h2>赞助商链接</h2>
    <ul>
    <table width="100%" style="background-color: #FFFFFF;"   cellpadding="2" cellspacing="0" align="center">
        <tr><td></td></tr>
    </table>
    </ul>


    实现了以后好像就是这样的代码吧?
  3. 19 秋爱 :
    2008-09-28 4:24 PM   引用此文发表评论
    呃....我发的是2.0的
  4. 20 samool :
    2008-09-28 7:15 PM   引用此文发表评论
    引用 秋爱 说过的话:
    呃....我发的是2.0的
    安装成功后就是这样的.你在后台激活一下,只是后台显示绿色的Active就可以了,慢慢等客户吧.
  5. 21 秋爱 :
    2008-09-28 7:43 PM   引用此文发表评论
    唉....

    恐怕有的等了.
  6. 22 jaord :
    2008-09-28 10:19 PM   引用此文发表评论
    再请教一下傻猫
    发现现在官方提供的代码修改了

    那模板的index文件 调用的“$BLcode”应该是没有用了
    但是我不知道应该修改成什么样子
    可以指点一下吗?
  7. 23 jaord :
    2008-09-28 10:22 PM   引用此文发表评论
    代码好像发布上来
    我抓图了 帮忙指点一下可以嘛?
    http://www.3g-info.net/code.gif
    代码中已经没有了“$BLcode”
Total:23‹ Prev123
 
发表评论:( 来了就留个脚印吧!你的参与是我最大的动力!)

    

(单击图片换张图片)