Pligg安装啦啦rss导入模块(Rss Importer插件的使用)

Pligg安装啦啦rss导入模块(Rss Importer插件的使用)

by clin003 at 20070916 from:http://clin003.com/或http://blog.csdn.net/clin003/

使用起来功能还不错,只是添加到一定数量会出错,我的是添加第6个的时候

然后报错: Feed Category Id (number): 1 — The ID of the category to place these items into

Warning: MagpieRSS: fetch_rss called without a url in /www/beta/modules/rss_import/magpierss/rss_fetch.inc on line 238

Warning: Invalid argument supplied for foreach() in /www/beta/modules/rss_import/rss_import_main.php on line 373
feed field name: Click To Edit pligg field name: Click To Edit — Remove this link
— Add a new field link

另外这个会占用服务器带宽,最好设置仔细些,一次最好不要生成很多项目!

不过把googlereader订阅共享的feed写入是个不错的注意,只要把feed共享出来,就会自动被pligg检测到然后导入。

使用方法:

1,安装rss插件
2,选择 Admin » RSS Importer
3,Feed URL:下添加rss(feed)地址
4,点击Examine this feed连接根据输出的title,link,content,在下部添加相应的field
最后的样子貌似这样:

Feed Name: BlogSearchForClin003Com
Feed URL: http://blogsearch.google.com/blogsearch_feeds?hl=en&q=link:clin003.com&um=1&tab=wb&ie=utf-8&num=10&output=rss
Delete this feed
Export this feed
Examine this feed

– Feed Frequency (hours): 48 — how often to check for new items.

– Feed Order: 1 — Do we start with the last items first? 0 = no, 1 = yes

– Feed Random Votes: 1 — Do we use a random number of votes? 0 = no, 1 = yes

– Feed Votes (if not random): 1 — how many votes new items recieve (limit 200)

– Feed Votes Minimum (if random): 2 — how many votes new items recieve (limit 200)
– Feed Votes Maximum (if random): 100 — how many votes new items recieve (limit 200)

– Feed Items Limit: 3 — how many new items to take from the feed when it’s checked
– Feed URL Dupes: 0 — Allow duplicate URL’s 0=No, 1=Yes, Allow
– Feed Title Dupes: 0 — Allow duplicate Title’s 0=No, 1=Yes, Allow
– Feed Submitter Id (number): 2 — The ID of the person who will be listed as the submitter
– Feed Category Id (number): 1 — The ID of the category to place these items into

— feed field name: title — pligg field name: link_title — Remove this link
— feed field name: link — pligg field name: link_url — Remove this link
— feed field name: description — pligg field name: link_content — Remove this link
— Add a new field link
,根据需要自己修改相应的部分吧。

另外安装了:
Lightbox v0.1 – disable
desc: Lightbox is a script used to overlay private messages on the current page
Page Statistics v0.2 – disable
desc: Page Statistics gives a detailed information on pageviews of each stories in your Pligg site
Admin Modify Formulas v0.1 – enable — remove
desc: Allows GOD user to modify the formulas.
requires: scriptaculous version 0.1 – pass
RSS Importer v0.5 – disable
desc: Import RSS Feeds
Thickbox v0.1 – disable
desc: Thickbox is a script used to overlay content on the current page. For documentation on Thickbox, visit: http://jquery.com/demo/thickbox/
Profile Extra Fields v0.2 – disable
desc: Allows modules to add extra fields to the users profile.
Send Announcement v0.2 – enable — remove
desc: Send Announcement allows you to send an email to all the users of your Pligg site.
Private Messaging v0.1 – disable
desc: Allow users to send private messages to each other.
requires: lightbox version 0.1 – pass
Embed Videos v0.51 – enable — remove
desc: Embed various video sites into Pligg through simple tags.
Digg.com User Feeds v0.1 – disable
desc: Adds an additional field to users’ profiles and then adds rss feeds for those users digg submit and vote feeds to a specified category.
requires: users_extra_fields version 0.2 – pass
Ajax Contact Form v0.1 – disable
desc: Add a contact form for your users to contact you
演示站点:http://clin003.com/beta/

Beta消息搜索引擎优化——修改title显示部分

Beta消息搜索引擎优化——修改title显示部分

from:http://blog.csdn.net/clin003/archive/2007/09/14/1785251.aspx

上次重装后就已经修改啦只是没说出来

by clin003 at 20070914 from:http://clin003.com/或http://blog.csdn.net/clin003/

这次又重新对9.8做啦修改,具体可以参考下边

/templates/yget/
目录中的pligg.tpl
搜索到title部分
然后修改为
下边的代码:

<title>
{
if $meta_keywords neq “”}
{
|.$posttitle}
{
else}{
{
if isset($pretitle)}{$pretitle}{/if}{#PLIGG_Visual_Name#}{if isset($pretitle)}{$posttitle}{/if}
}{/if}</title>
大致就这样子啦,如果不是查看的文章内容则显示,title为文章标题(前边的’|’为和标题中的’-‘符号连起来美观加上的,根据个人需要自行修改吧)
如果不是查看的文章内容就显示站的名字。

这个方法的启发来自meta.tpl中对keywords部分的处理,嘿嘿,如果朋友您有更好的办法,谢谢分享。

Pligg9.8中文问题暂时解决啦,同时今天也架起啦wp的blog,感觉很不错

Pligg9.8中文问题暂时解决啦,同时今天也架起啦wp的blog,感觉很不错
Pligg9.8中文问题暂时解决啦

解决办法:

http://blog.csdn.net/clin003/archive/2007/09/14/1784521.aspx
可数据恢复中断问题还没解决,先告一段落吧,

演示地址1: http://clin003.com/beta/
演示地址2: http://beta.clin003.com/
本来想通过远程数据库连接的,可测试实在是太慢啦,就都放在localhost上啦

同时今天也架起啦wp的blog,感觉很不错

1,模板使用非常方便,而且官方有很多模板可以下载

2,可以导出导入pages或post或all,支持google的blogger还有几个没见过的(大概是国外的比较有影响力的blog吧),还支持feed导入,rss导入!!

都配置差不多后再去测试别的导入。今天就测试啦blogger的通过google第三方接口直接整合。

不过这个csdn的blog还是主要的blog,另外会在wp的blog上测试不同功能,呵呵,不排除哪天把blog搬上去,嘿嘿。

睡觉ing

Pligg beta9.7升级到pligg beta 9.8过程遇到的(中文支持)问题解决

Pligg beta9.7升级到pligg beta 9.8过程遇到的(中文支持)问题解决

from:http://blog.csdn.net/clin003/archive/2007/09/14/1784521.aspx

刚升级完会出现乱码(比如很多问号),这因该是升级前没有修改/libs/db.php文件中数据库连接限定连接字符集导致(如果默认的数据库连接就为utf8的就不会出现问题,这个主要跟空间商的mysql有关。)
下边说具体需要做什么:
我的因为没有做的很好,升级心切解决数据丢失!!,这次留个教训下次一定要在测试站点上测试后在做进一步活动,希望其它朋友在升级前也做好备份准备(这个pligg备份不知道怎么了,数据库恢复不了!老提示重复复制什么!提示忘掉啦,再试试吧)

并且这次决定不去汉化前台显示啦,直接使用英文的站,只是修改支持中文的功能,不再做表面工作。
by clin003 at 20070914 from:http://clin003.com/或http://blog.csdn.net/clin003/

1,升级办法我就不说啦在readme文件中说的很详细啦
2,升级前基本的注意事项(readme文档中提到的)我就不说啦
2,升级前推荐修改/libs/db.php
这个可以参考9.7中修改办法:http://blog.csdn.net/clin003/archive/2007/08/16/1745853.aspx
大致在:202行回车添加代码

$dbcharset=utf8;
mysql_query(SET character_set_connection=$dbcharset, character_set_results=$dbcharset, character_set_client=binary);

这部分添加后的样子是这样的:

if ( ! isset($this->dbh) || ! $this->dbh )
{
$this->connect($this->dbuser, $this->dbpassword, $this->dbhost);
$dbcharset=utf8;
mysql_query(SET character_set_connection=$dbcharset, character_set_results=$dbcharset, character_set_client=binary);
$this->select($this->dbname);
}

这是解决中文文章乱码问题。

—————————-
另外一个问题是:9.8升级后查看文章内容后,在Pligg beta 9 Home » About i0Day »后便显示的文章标题会变成乱码的

这个解决办法目前我就知道一个:
这个问题的解决办法参考自:http://forums.pligg.com/bug-report/8793-chinese-characters-bug.html

打开/libs/html1.php在大致124行找到函数function do_sidebar($var_smarty)使用9.7中的相应函数替换即可。
替换前的9.8的样子是这样的:

function do_sidebar($var_smarty) {
// show the categories in the sidebar
global $db, $dblang, $globals, $the_cats, $navwhere;

// fix for ‘undefined index’ errors
if(!isset($navwhere[text4])){$navwhere[text4] = ;}else{$navwhere[text4] = htmlentities($navwhere[text4]);}
if(!isset($navwhere[text3])){$navwhere[text3] = ;}else{$navwhere[text3] = htmlentities($navwhere[text3]);}
if(!isset($navwhere[text2])){$navwhere[text2] = ;}else{$navwhere[text2] = htmlentities($navwhere[text2]);}
if(!isset($navwhere[text1])){$navwhere[text1] = ;}else{$navwhere[text1] = htmlentities($navwhere[text1]);}
if(!isset($navwhere[link4])){$navwhere[link4] = ;}
if(!isset($navwhere[link3])){$navwhere[link3] = ;}
if(!isset($navwhere[link2])){$navwhere[link2] = ;}
if(!isset($navwhere[link1])){$navwhere[link1] = ;}
$var_smarty->assign(navbar_where, $navwhere);

$var_smarty->assign(body_args, );
// fix for ‘undefined index’ errors

$_caching = $var_smarty->cache; // get the current cache settings
$var_smarty->cache = true; // cache has to be on otherwise is_cached will always be false
$var_smarty->cache_lifetime = 1; // lifetime has to be set to something otherwise is_cached will always be false
$thetpl = $var_smarty->get_template_vars(the_template_sidebar_modules) . /categories.tpl;

// check to see if the category sidebar module is already cached
// if it is, use it


if(isset($_REQUEST[category])){
$thecat = sanitize($_REQUEST[category], 3);
}
else{
$thecat = ;
}
if ($var_smarty->is_cached($thetpl, sidebar|category|.$thecat)) {
$var_smarty->assign(cat_array, x); // this is needed. sidebar.tpl won’t include the category module if cat_array doesnt have some data
}else{
if(isset($_REQUEST[category])){$thecat = $db->get_var(SELECT category_name FROM . table_categories . WHERE `category_safe_name` = ‘.urlencode(sanitize($_REQUEST[category], 1)).‘;);}

if(!empty($_REQUEST[id])) {
$doing_story=true;
}
else {
$doing_story=false;
}

$var_smarty->assign(UrlMethod, urlmethod);

foreach($the_cats as $cat){
if($cat->category_id == $thecat && $cat->category_lang == $dblang && $cat->category_parent == 0)
{
$globals[category_id] = $cat->category_id;
$globals[category_name] = $cat->category_name;
}
}

$pos = strrpos($_SERVER[SCRIPT_NAME], /);
$script_name = substr($_SERVER[SCRIPT_NAME], $pos + 1, 100);
$script_name = str_replace(.php, “”, $script_name);

include_once(dbtree.php);
$array = tree_to_array(0, table_categories);
$var_smarty->assign(lastspacer, 0);
$var_smarty->assign(cat_array, $array);

// use the ‘totals’ table now
$published_count = get_story_count(published);

$var_smarty->assign(published_count, $published_count);
$categories = mysql_query(select *, count(*) as count from . table_links . , . table_categories . where category_lang=’$dblang’ and category_id=link_category group by link_category ORDER BY category_name ASC);

$categorylist = array();
while ($rows = mysql_fetch_array ($categories, MYSQL_ASSOC)) array_push ($categorylist, $rows);
$var_smarty->assign(categorylist, $categorylist);
$var_smarty->assign(category_url, getmyurl(maincategory));

}

$var_smarty->cache = $_caching; // set cache back to original value

check_actions(
do_sidebar);

return $var_smarty;
}

替换后的为9.7中的对应函数样子是这样的:

function do_sidebar($var_smarty) {
// show the categories in the sidebar
global $db, $dblang, $globals, $the_cats;

$_caching = $var_smarty->cache; // get the current cache settings
$var_smarty->cache = true; // cache has to be on otherwise is_cached will always be false
$var_smarty->cache_lifetime = 1; // lifetime has to be set to something otherwise is_cached will always be false
$thetpl = $var_smarty->get_template_vars(the_template_sidebar_modules) . /categories.tpl;

// check to see if the category sidebar module is already cached
// if it is, use it


if(isset($_REQUEST[category])){
$thecat = sanitize($_REQUEST[category], 3);
}
else{
$thecat = ;
}
if ($var_smarty->is_cached($thetpl, sidebar|category|.$thecat)) {
$var_smarty->assign(cat_array, x); // this is needed. sidebar.tpl won’t include the category module if cat_array doesnt have some data
}else{
if(isset($_REQUEST[category])){$thecat = $db->get_var(SELECT category_name FROM . table_categories . WHERE `category_safe_name` = ‘.urlencode(sanitize($_REQUEST[category], 1)).‘;);}

if(!empty($_REQUEST[id])) {
$doing_story=true;
}
else {
$doing_story=false;
}

$var_smarty->assign(UrlMethod, urlmethod);

foreach($the_cats as $cat){
if($cat->category_id == $thecat && $cat->category_lang == $dblang && $cat->category_parent == 0)
{
$globals[category_id] = $cat->category_id;
$globals[category_name] = $cat->category_name;
}
}

$pos = strrpos($_SERVER[SCRIPT_NAME], /);
$script_name = substr($_SERVER[SCRIPT_NAME], $pos + 1, 100);
$script_name = str_replace(.php, “”, $script_name);

include_once(dbtree.php);
$array = tree_to_array(0, table_categories);
$var_smarty->assign(lastspacer, 0);
$var_smarty->assign(cat_array, $array);

// use the ‘totals’ table now
$published_count = get_story_count(published);

$var_smarty->assign(published_count, $published_count);
$categories = mysql_query(select *, count(*) as count from . table_links . , . table_categories . where category_lang=’$dblang’ and category_id=link_category group by link_category ORDER BY category_name ASC);

$categorylist = array();
while ($rows = mysql_fetch_array ($categories, MYSQL_ASSOC)) array_push ($categorylist, $rows);
$var_smarty->assign(categorylist, $categorylist);
$var_smarty->assign(category_url, getmyurl(maincategory));

}

$var_smarty->cache = $_caching; // set cache back to original value

check_actions(
do_sidebar);

return $var_smarty;
}

Pligg安装啦啦rss导入模块

Pligg安装啦啦rss导入模块

使用起来功能还不错,只是添加到一定数量会出错,我的是添加第6个的时候

然后报错: Feed Category Id (number): 1 — The ID of the category to place these items into

Warning: MagpieRSS: fetch_rss called without a url in /www/beta/modules/rss_import/magpierss/rss_fetch.inc on line 238

Warning: Invalid argument supplied for foreach() in /www/beta/modules/rss_import/rss_import_main.php on line 373
— feed field name: Click To Edit — pligg field name: Click To Edit — Remove this link
— Add a new field link

另外这个会占用服务器带宽,最好设置仔细些,一次最好不要生成很多项目!

不过把googlereader订阅共享的feed写入是个不错的注意,只要把feed共享出来,就会自动被pligg检测到然后导入。