<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: getfeed.php 12304 2009-06-03 07:29:34Z liguode $ */ if(!defined('IN_UCHOME')) { exit('Access Denied'); } //从uc获取feed if($_SCONFIG['uc_status']) { include_once(S_ROOT.'./uc_client/client.php'); if($results = uc_feed_get(50)) {//每次取10个 $cols = array('uid','username','appid','icon','dateline','hash_template','hash_data','title_template','title_data','body_template','body_data','body_general','image_1','image_1_link','image_2','image_2_link','image_3','image_3_link','image_4','image_4_link','target_ids'); $inserts = array(); foreach ($results as $value) { if(empty($value['uid']) || empty($value['username'])) continue; $vs = array(); foreach ($cols as $key) { if(is_array($value[$key])) { //数组处理 $value[$key] = addslashes(serialize(sstripslashes($value[$key]))); } else { $value[$key] = addslashes(sstripslashes($value[$key])); } $vs[] = '\''.$value[$key].'\'';
<?php /* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: getfeed.php 9948 2008-11-20 09:09:14Z liguode $ */ if (!defined('IN_UCHOME')) { exit('Access Denied'); } //从uc获取feed include_once S_ROOT . './uc_client/client.php'; if ($results = uc_feed_get(10)) { //每次取10个 $cols = array('uid', 'username', 'appid', 'icon', 'dateline', 'hash_template', 'hash_data', 'title_template', 'title_data', 'body_template', 'body_data', 'body_general', 'image_1', 'image_1_link', 'image_2', 'image_2_link', 'image_3', 'image_3_link', 'image_4', 'image_4_link', 'target_ids'); $inserts = array(); foreach ($results as $value) { if (empty($value['uid']) || empty($value['username'])) { continue; } $vs = array(); foreach ($cols as $key) { if (is_array($value[$key])) { //数组处理 $value[$key] = addslashes(serialize(sstripslashes($value[$key]))); } else { $value[$key] = addslashes(sstripslashes($value[$key])); } $vs[] = '\'' . $value[$key] . '\''; } $inserts[] = '(' . implode(',', $vs) . ')'; }
} } } //我的投稿 if (!empty($_SGLOBAL['supe_uid'])) { $uidsql = "uid='{$_SGLOBAL['supe_uid']}'"; $mine_list = array(); $query = $_SGLOBAL['db']->query('SELECT * FROM ' . tname('spaceitems') . " WHERE {$uidsql} ORDER BY dateline DESC"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { $mine_list[] = $value; } } //本站动态 include_once S_ROOT . './uc_client/client.php'; $feedlist = array(); foreach (uc_feed_get(11, FALSE) as $msg) { $dateline = $msg['dateline']; $template = $msg['title_template']; $actor = $msg['username']; $author = $msg['title_data']['author']; $mommentpost = $msg['title_data']['mommentpost']; $subject = $msg['title_data']['subject']; $modelname = $msg['title_data']['modelname']; $qtitle = $msg['title_data']['qtitle']; $stitle = $msg['title_data']['stitle']; $template = str_replace("{actor}", $actor, $template); $template = str_replace("{author}", $author, $template); $template = str_replace("{mommentpost}", $mommentpost, $template); $template = str_replace("{subject}", $subject, $template); $template = str_replace("{modelname}", $modelname, $template); $template = str_replace("{qtitle}", $qtitle, $template);