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
网摘: 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 (浏览:697, 评论:0)
Z-Blog 如何安装BackLinks (浏览:779, 评论:5)
Sablog2.0蓝风风格下载 (浏览:3360, 评论:3)
同花顺风格下载 For Sablog2.0 (浏览:3784, 评论:3)
BackLinks的安装方法 For Sablog2.0 (浏览:1662, 评论:7)
» 我要发表评论 你的参与是我最大的动力!    访客评论: (13条记录)
  1. 1 birder :
    2008-07-22 8:54 AM   引用此文发表评论
    原来和TLA一样要改源码
  2. 2 怪鸟 :
    2008-08-05 1:05 PM   引用此文发表评论
    我按你的说明去做了,为什么还激活不了呢?

    出现这个:
    Checking your web page:

    It appears that your web page is not working properly. Please verify that the code you copied from your control panel was pasted properly into your web page. Contact us at support@backlinks.com or call 1-800-731-0046 for assistance on getting your code validated.
  3. 3 samool :
    2008-08-05 1:11 PM   引用此文发表评论
    引用 怪鸟 说过的话:
    我按你的说明去做了,为什么还激活不了呢?
    出现这个:
    Checking your web page:
    It appears that your web page is not working properly. Please verify that the code you copied from your control panel was pasted properly into your web page. Contact us at support@backlinks.com or call 1-800-731-0046 for assistance on getting your code validated.
    仔细检查一下,按照我的说明一步一步地搞, 我已经测试成功了,油菜也测试成功,祝你好运哦.
  4. 4 samool :
    2008-08-05 1:12 PM   引用此文发表评论
    对了,1.6版原理一样的,未经测试,我的博客是2.0已经搞定了.
  5. 5 怪鸟 :
    2008-08-05 1:55 PM   引用此文发表评论
    我发email给官方了,它回信来说,在我的网页找不到代码
    叫我正确的把代码加在网页上
  6. 6 samool :
    2008-08-05 2:09 PM   引用此文发表评论
    引用 怪鸟 说过的话:
    我发email给官方了,它回信来说,在我的网页找不到代码
    叫我正确的把代码加在网页上
    升到2.0吧,哈哈,我现在就用的2.0,已经搞定了,哈哈.
  7. 7 怪鸟 :
    2008-08-05 2:59 PM   引用此文发表评论
    2.0有太多bug了

    我在本地有升过一次,出现了

    \htdocs\sablog\include\func\front.func.php on line 131

    代码内容:$content = preg_replace('/'.$tag.'/i','<a href="'.gettaglink($tag).'" onclick="tagshow(\''.$tag.'\



    Kevin模板的\htdocs\sablog\cache\template\bluefeel_normal.tpl.php on line 10

    代码内容:fiximage('<?=$options['attachments_thumbs_size']?>');

    我不知道还会不会有很多的bug,所以我不敢上到主机去试。
  8. 8 samool :
    2008-08-05 3:17 PM   引用此文发表评论
    程序是2.0的,当然要用2.0的模板了,1.6的模板肯定用不了,不兼容的.我有蓝风最新2.0的模板,上次蓝风给了我一份,有点小问题,我已经解决了,哈哈..这前我就用的蓝风2.0的风格,昨天刚刚换这个新风格.
Total:1312Next ›
 
发表评论:( 来了就留个脚印吧!你的参与是我最大的动力!)

    

(单击图片换张图片)