淘客泡泡为淘宝客API程序, 目前技术领先的专业淘宝客程序。程序着重于搜索引擎SEO优化,伪原创跟自定义URL等。最新淘宝客程序模板引擎技术,会HTML就会做淘客程序模板。高效.完善.智能的API数据系统实现无人值守全自动化运作。见演示站点:http://fat.2081.org.

WordPress 是一个注重美学、易用性和网络标准的个人信息发布平台。WordPress 虽为免费的开源软件,但其价值无法用金钱来衡量。使用 WordPress 可以搭建功能强大的网络信息发布平台,但更多的是应用于个性化的博客。针对博客的应用,WordPress 能让您省却对后台技术的担心,集中精力做好网站的内容。见演示站点:http://fat.2081.org/?author=1

整合方法:

1.引用wordpress的配置文件

 

require('./wp-config.php');    

2.调用wordpress的文章数据.

 

$news_str="";
$news=$wpdb->get_results("SELECT id,post_title FROM wp_posts ORDER BY post_date DESC LIMIT 10");
foreach($news as $np){
$news_str = $news_str."<a href='/?p=".$np->id."' target='_blank'>". iconv("UTF-8","gbk",$np->post_title)."</a>&nbsp;|&nbsp;";
}
global $news_str;

注意这里的 global $news_str;这是为了在其他模块页面调用.

3.因为两套程序部署在同一的站点下,因此要坚决index.php的数据访问问题.

 

$p_wp= $_GET['p']; 
if(!empty($p_wp) || !empty($_GET['author']) || !empty($_GET['page_id']) || !empty($_GET['cat']) || !empty($_GET['m'])){
require('./wp-blog-header.php');
}

这样wordpress的数据就被正确的访问了.

完整的代码如下:

 

define('IN_PPT', true);
define('PPT_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR);
define('WP_USE_THEMES', true);
$p_wp= $_GET['p'];
if(!empty($p_wp) || !empty($_GET['author']) || !empty($_GET['page_id']) || !empty($_GET['cat']) || !empty($_GET['m'])){
require('./wp-blog-header.php');
}else{

!file_exists(PPT_PATH.'data/install.lock') && exit(header('Location:install'));
require PPT_PATH.'include/common.inc.php';
require INCLUDE_PATH.'smarty.inc.php';
require('./wp-config.php');
ppt_load::func('taoke_index');
ppt_load::func('taoke_search');
/***----- 以上代码必须,请勿修改 -----***/

$news_str="";
$news=$wpdb->get_results("SELECT id,post_title FROM wp_posts ORDER BY post_date DESC LIMIT 10");
foreach($news as $np){
$news_str = $news_str."<a href='/?p=".$np->id."' target='_blank'>". iconv("UTF-8","gbk",$np->post_title)."</a>&nbsp;|&nbsp;";
}
global $news_str;
/*
* 本程序里的文件不建议修改,一般修改模板文件以及模板配置文件已足够。
* 模板配置文件位于 “/templates/模板目录/base/” 目录下。
*/


//加载模板配置文件
template_inc('index');


}


到此整合完成.这样的整合有利于做SEO优化.

posted on 2011-10-29 20:39  tralea  阅读(1728)  评论(1)    收藏  举报