Beispiel #1
0
 public function Pic()
 {
     $page = $_GET['page'] ? (int) $_GET['page'] : 0;
     if ($page) {
         $limit = '40,1000';
     } else {
         $limit = 40;
     }
     $r = jlogic('image')->get(array('where' => 'tid > 0', 'order' => 'id DESC', 'limit' => $limit));
     foreach ($r['list'] as $value) {
         $value['pics'] = topic_image($value['id'], 'small', 0);
         $value['pico'] = topic_image($value['id'], 'default', 0);
         $value['link'] = $this->Config[site_url] . '/index.php?mod=topic&code=' . $value['tid'];
         $topic_list[] = $value;
     }
     $rss = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\r\n";
     $rss .= "<rss version=\"2.0\" xmlns:media=\"http:/" . "/search.yahoo.com/mrss/\" xmlns:atom=\"http:/" . "/www.w3.org/2005/Atom\">\r\n";
     $rss .= "<channel>\r\n";
     $rss .= "<title>photo</title>\r\n";
     $rss .= "<link>{$this->Config[site_url]}</link>\r\n";
     $rss .= "<description>photo</description>\r\n";
     $rss .= "<language>zh_CN</language>\r\n";
     $rss .= "<pubDate>" . Date('Y-m-d H:i:s', time()) . "</pubDate>\r\n";
     $rss .= "<atom:link href=\"{$this->Config[site_url]}/index.php?mod=rss\" rel=\"self\" type=\"application/rss+xml\" />\r\n";
     $rss .= "<atom:link rel=\"next\" href=\"{$this->Config[site_url]}/index.php?mod=rss&amp;page=2\" />\r\n";
     foreach ($topic_list as $val) {
         $val['name'] = array_iconv($GLOBALS['_J']['charset'], 'utf-8', $val['name']);
         $rss .= "<item>\r\n";
         $rss .= "<title><![CDATA[{$val['name']}]]></title>\r\n";
         $rss .= "<link>{$val['link']}</link>\r\n";
         $rss .= "<media:thumbnail url=\"{$val['pics']}\"/>\r\n";
         $rss .= "<media:content url=\"{$val['pico']}\"/>\r\n";
         $rss .= "<guid isPermaLink=\"false\">{$val['link']}</guid>\r\n";
         $rss .= "</item>\r\n";
     }
     $rss .= "</channel>\r\n</rss>";
     return $rss;
 }
Beispiel #2
0
 function &current()
 {
     $temp = parent::current();
     /* Get this user's last seen time */
     //$last_seen				= is_a($this->session['user'], 'Member') ? iif($this->session['seen'] > $this->session['user']->info['last_seen'], $this->session['seen'], $this->session['user']->info['last_seen']) : $this->session['seen'];
     $last_seen = time();
     /* Set the topic icons */
     $temp['posticon'] = $temp['posticon'] != '' ? iif(file_exists(FORUM_BASE_DIR . '/tmp/upload/posticons/' . $temp['posticon']), $temp['posticon'], 'clear.gif') : 'clear.gif';
     $temp['topicicon'] = topic_image($temp, &$this->user, $this->img_dir, $last_seen);
     /* Set the number of replies */
     $temp['num_replies'] = @(($temp['row_right'] - $temp['row_left'] - 1) / 2);
     if ($this->forum['postsperpage'] < $temp['num_replies']) {
         /* Create a pager */
         $temp['pager'] = paginate($temp['num_replies'], '&laquo;', '&lt;', '', '&gt;', '&raquo;', $this->forum['postsperpage'], $temp['id']);
     }
     /* Check if this topic has been read or not */
     //if(($temp['created'] > $last_seen && $temp['poster_id'] != $this->session['user']->info['id'])
     //|| (isset($this->forums[$temp['forum_id']][$temp['id']]) && $this->forums[$temp['forum_id']][$temp['id']])
     //	) {
     //
     //	$this->forums[$temp['forum_id']][$temp['id']]	= TRUE;
     //
     //	$temp['name']									= '<strong>'. $temp['name'] .'</strong>';
     //}
     /* Is this a sticky or an announcement and is it expired? */
     if ($temp['topic_type'] > TOPIC_NORMAL && $temp['topic_expire'] > 0) {
         if ($temp['created'] + 3600 * 24 * $temp['topic_expire'] > time()) {
             $this->dba->executeUpdate("UPDATE " . TOPICS . " SET topic_expire=0,topic_type=" . TOPIC_NORMAL . " WHERE topic_id = " . intval($temp['id']));
         }
     }
     /* Should we free the result? */
     if ($this->row == $this->size - 1) {
         $this->result->freeResult();
         /* Reset the forums cookie if we're at the end of the iteration */
         //bb_settopic_cache_item('forums', serialize($this->forums), time() + 3600 * 25 * 5);
     }
     return $temp;
 }
 /**
  * 同步主题 For JishiGou
  * @param $tid int 记事狗微博 topic id
  * @param $totid int 记事狗微博 topic id
  * @param $message string 微博内容
  * @param $imageid mixed 微博关联的图片ID 或者 完整的图片地址
  * @return array
  */
 function topic($tid, $totid = 0, $message = '', $imageid = '')
 {
     $tid = max(0, (int) $tid);
     $totid = max(0, (int) $totid);
     if ($tid < 1) {
         return false;
     }
     if ($this->_isSyn($tid)) {
         return false;
     }
     $db = XWB_plugin::getDB();
     $baseurl = XWB_plugin::siteUrl();
     if (empty($message)) {
         //可以通过$tid, $pid进行查询
         //但由于此方法主要用于hook,而hook已经实施了拦截,因此可以无需通过数据查询即可进行获取
         return false;
     } else {
         // 转码前的内容保存
         $postinfo = array();
         $postinfo['message'] = $message;
     }
     // 转码
     $message = $this->_convert($postinfo['message']);
     // 过滤UBB与表情
     $message = $this->_filter($message);
     // 去除HTML标记
     $message = strip_tags($message);
     $link = ' ' . $baseurl . 'index.php?mod=topic&code=' . $tid;
     if (function_exists('get_full_url')) {
         $link = ' ' . get_full_url($baseurl, 'index.php?mod=topic&code=' . $tid);
     }
     $length = 140 - ceil(strlen(urlencode($link)) * 0.5);
     //2个字母为1个字
     $message = $this->_substr($message, $length);
     //将最后附带的url给删除。
     $message = preg_replace("|\\s*http:/" . "/[a-z0-9-\\.\\?\\=&_@/%#]*\$|sim", "", $message);
     $message .= $link;
     $wb = XWB_plugin::getWB();
     /**
      * 全新发布微博
      */
     if ($totid < 1 && XWB_plugin::pCfg('is_synctopic_toweibo')) {
         // 取出第一张图片
         $first_img_url = '';
         if (XWB_plugin::pCfg('is_upload_image') && $imageid) {
             if (is_string($imageid) && false !== strpos($imageid, ':/' . '/')) {
                 $first_img_url = $imageid;
             } else {
                 $imageid = (int) $imageid;
                 if ($imageid > 0) {
                     if ($GLOBALS['_J']['config']['ftp_on']) {
                         $first_img_url = topic_image($imageid, 'original', 0);
                     } else {
                         $tpic = topic_image($imageid, 'original', 1);
                         if (is_file(XWB_S_ROOT . $tpic)) {
                             $first_img_url = topic_image($imageid, 'original', 0);
                         }
                     }
                 }
             }
         }
         $ret = array();
         // 同步到微博
         if ($first_img_url) {
             $ret = $wb->upload($message, $first_img_url, null, null, false);
             if (isset($ret['error_code']) && 400 == (int) $ret['error_code']) {
                 $ret = $wb->update($message, false);
             }
         } else {
             $ret = $wb->update($message, false);
         }
         //同步微博后的ID
         $mid = $ret['idstr'] ? $ret['idstr'] : ($ret['mid'] ? $ret['mid'] : $ret['id']);
         if ($mid) {
             //json_decode可能存在解析超过int最大数的错误(#47644),需要注意
             $this->_setSynId($tid, $mid);
         }
     } elseif ($totid > 0 && XWB_plugin::pCfg('is_syncreply_toweibo')) {
         $mid = $this->_isSyn($totid);
         if (!$mid) {
             return false;
         }
         $rs = $wb->comment($mid, $message, null, false);
         $_mid = $rs['idstr'] ? $rs['idstr'] : ($rs['mid'] ? $rs['mid'] : $rs['id']);
         if ($_mid) {
             $this->_setSynId($tid, $_mid);
         }
     }
 }
Beispiel #4
0
 DB::query("insert into " . DB::table('xwb_bind_topic') . " (`tid`) values ('{$tid}')");
 $p = array('access_token' => $xwb_bind_info['access_token']);
 $rets = array();
 if ($totid < 1) {
     $p['status'] = $content;
     if ($imageid > 0) {
         /*
         //高级接口,需要额外的申请
         $p['url'] = topic_image($imageid, 'original', 0);
         $rets = sina_weibo_api('2/statuses/upload_url_text', $p);
         */
         $p['pic'] = topic_image($imageid, 'original', 1);
         if ($GLOBALS['_J']['config']['ftp_on']) {
             $p['pic'] = RELATIVE_ROOT_PATH . 'data/cache/temp_images/topic/' . $p['pic'];
             if (!is_file($p['pic'])) {
                 $ppic = topic_image($imageid, 'original', 0);
                 if (false !== strpos($ppic, ':/' . '/')) {
                     $temp_image = dfopen($ppic, 99999999, '', '', true, 3, $_SERVER['HTTP_USER_AGENT']);
                     if (!$temp_image) {
                         jio()->MakeDir(dirname($p['pic']));
                         jio()->WriteFile($p['pic'], $temp_image);
                     }
                 }
             }
         }
         if (is_image($p['pic'])) {
             $rets = sina_weibo_api('2/statuses/upload', $p, 'POST', null, 1);
         } else {
             unset($p['pic']);
             $rets = sina_weibo_api('2/statuses/update', $p);
         }
Beispiel #5
0
function kaixin_sync($data)
{
    $sys_config = kaixin_init();
    if (!$sys_config) {
        return 'kaixin_init is invalid';
    }
    $tid = is_numeric($data['tid']) ? $data['tid'] : 0;
    if ($tid < 1) {
        return 'tid is invalid';
    }
    $uid = is_numeric($data['uid']) ? $data['uid'] : 0;
    if ($uid < 1) {
        return 'uid is invalid';
    }
    $totid = is_numeric($data['totid']) ? $data['totid'] : 0;
    $content = $data['content'];
    if (false !== strpos($content, '[')) {
        $content = preg_replace('~\\[([^\\]]{1,6}?)\\]~', '(#\\1)', $content);
    }
    $content = array_iconv($sys_config['charset'], 'UTF-8', trim(strip_tags($content)));
    if (!$content) {
        return 'content is invalid';
    }
    $content .= " " . get_full_url($sys_config['site_url'], 'index.php?mod=topic&code=' . $tid);
    $kaixin_bind_info = kaixin_bind_info($uid);
    if (!$kaixin_bind_info) {
        return 'bind_info is empty';
    }
    if (!kaixin_has_bind($uid)) {
        return 'bind_info is invalid';
    }
    $kaixin_bind_topic = DB::fetch_first("select * from " . DB::table('kaixin_bind_topic') . " where `tid`='{$tid}'");
    if ($kaixin_bind_topic) {
        return 'bind_topic is invalid';
    } else {
        DB::query("insert into " . DB::table('kaixin_bind_topic') . " (`tid`) values ('{$tid}')");
    }
    $ret = array();
    if ($totid < 1) {
        $p = array();
        $p['access_token'] = $kaixin_bind_info['token'];
        $p['content'] = $content;
        $imageid = (int) $data['imageid'];
        if ($imageid > 0 && $sys_config['kaixin']['is_sync_image']) {
            $topic_image = topic_image($imageid, 'original');
            if (is_image(ROOT_PATH . $topic_image)) {
                $p['picurl'] = $sys_config['site_url'] . '/' . $topic_image;
                $p['save_to_album'] = 1;
            }
        }
        $ret = kaixin_api('records/add', $p);
    }
    $kaixin_id = is_numeric($ret['rid']) ? $ret['rid'] : 0;
    if ($kaixin_id > 0) {
        DB::query("UPDATE " . DB::table('kaixin_bind_topic') . " SET `kaixin_id`='{$kaixin_id}' WHERE `tid`='{$tid}'");
    }
    return $ret;
}
 function get_photo_list($param)
 {
     $sql_where = '';
     $uid = max(0, (int) $param['uid']);
     $cache_key = "{$uid}-get_photo_list-" . md5(serialize($param));
     if (false === ($info = cache_db('get', $cache_key))) {
         if ($uid > 0) {
             $uids = get_buddyids($uid, $GLOBALS['_J']['config']['topic_myhome_time_limit']);
             if ($uids) {
                 $sql_where = " AND t.uid in(" . jimplode($uids) . ") ";
             } else {
                 return array();
             }
         }
         $total_photo = (int) $param['count'];
         if ($total_photo < 1) {
             if ($param['vip']) {
                 $total_photo = DB::result_first("select count(1) as `total` from " . DB::table('topic_image') . " t left join " . DB::table('members') . " m on m.uid=t.uid where t.tid>0 and m.validate='1'" . $sql_where);
             } else {
                 $total_photo = DB::result_first("SELECT COUNT(*) FROM " . DB::table('topic_image') . " AS t WHERE t.tid > 0 " . $sql_where);
             }
         }
         $info = false;
         $limit_sql = '';
         $photo_i = 0;
         $topic_list = array();
         $user_lists = array();
         if ($total_photo > 0) {
             if ($param['perpage']) {
                 $page_arr = page($total_photo, $param['perpage'], $param['page_url'], array('return' => 'array'));
                 $limit_sql = $page_arr['limit'];
             } else {
                 if ($param['limit']) {
                     $limit_sql = ' LIMIT ' . $param['limit'];
                 } elseif ($param['count']) {
                     $limit_sql = ' LIMIT ' . $param['count'];
                 }
             }
             if ($param['vip']) {
                 $query = DB::query("SELECT t.id,t.tid,t.uid,t.name,t.width,t.height,t.dateline,tr.content,tr.content2,tr.forwards,tr.replys,tr.digcounts\r\n\t\t\t\t\t\t\t\t\tFROM " . DB::table('topic_image') . " AS t\r\n\t\t\t\t\t\t\t\t\tLEFT JOIN " . DB::table('topic') . " AS tr\r\n\t\t\t\t\t\t\t\t\tON t.tid = tr.tid\r\n\t\t\t\t\t\t\t\t\tleft join " . DB::table('members') . " as m\r\n\t\t\t\t\t\t\t\t\ton m.uid=t.uid\r\n\t\t\t\t\t\t\t\t\tWHERE t.tid > 0 and m.validate='1' " . $sql_where . "\r\n\t\t\t\t\t\t\t\t\tORDER BY t.id DESC\r\n\t\t\t\t\t\t\t\t\t{$limit_sql} ");
             } else {
                 $query = DB::query("SELECT t.id,t.tid,t.uid,t.name,t.width,t.height,t.dateline,tr.content,tr.content2,tr.forwards,tr.replys,tr.digcounts\r\n\t\t\t\t\t\t\t\t\tFROM " . DB::table('topic_image') . " AS t\r\n\t\t\t\t\t\t\t\t\tLEFT JOIN " . DB::table('topic') . " AS tr\r\n\t\t\t\t\t\t\t\t\tON t.tid = tr.tid\r\n\t\t\t\t\t\t\t\t\tWHERE t.tid > 0  " . $sql_where . "\r\n\t\t\t\t\t\t\t\t\tORDER BY t.id DESC\r\n\t\t\t\t\t\t\t\t\t{$limit_sql} ");
             }
             while ($value = DB::fetch($query)) {
                 $value['content'] .= $value['content2'];
                 $value['content'] = jhtmlspecialchars(strip_tags($value['content']));
                 if (!is_file(topic_image($value['id'], 'photo', 1))) {
                     $image_file = RELATIVE_ROOT_PATH . 'images/topic/' . face_path($value['id']) . $value['id'] . "_o.jpg";
                     $image_file_photo = RELATIVE_ROOT_PATH . 'images/topic/' . face_path($value['id']) . $value['id'] . "_p.jpg";
                     if ($value['width'] > 280) {
                         $p_width = 280;
                         $p_height = round($value['height'] * 280 / $value['width']);
                         $result = makethumb($image_file, $image_file_photo, $p_width, $p_height);
                     }
                     if ($value['width'] <= 280 || !$result && !is_file($image_file_photo)) {
                         @copy($image_file, $image_file_photo);
                     }
                 }
                 $value['photo'] = topic_image($value['id'], 'photo', 0);
                 $value['height'] = $value['width'] > 280 ? round($value['height'] * 280 / $value['width']) : $value['height'];
                 $value['width'] = $value['width'] > 280 ? 280 : $value['width'];
                 $value['dateline'] = my_date_format2($value['dateline']);
                 if (false != strpos($value['content'], '</U>')) {
                     $value['content'] = preg_replace('#\\<U(.*?)\\>(.*?)\\</U\\>#', '<a href="\\2" target="_blank">Click Here</a>', $value['content']);
                 }
                 if (false !== strpos($value['content'], 'http:/' . '/')) {
                     $value['content'] = preg_replace('~(http:/' . '/[a-z0-9-\\.\\?\\=&;_@/%#]+?)\\s+~i', '<a href="\\1" target="_blank">Click Here</a> ', $value['content']);
                     $value['content'] = preg_replace("|\\s*http:/" . "/[a-z0-9-\\.\\?\\=&;_@/%#]*\$|sim", "", $value['content']);
                 }
                 $topic_list[] = $value;
             }
             if ($topic_list) {
                 $topic_list_count = count($topic_list);
                 $topic_list = $this->TopicLogic->MakeAll($topic_list, 0);
                 $info = array('list' => $topic_list, 'count' => $param['count'] ? $topic_list_count : $total_photo, 'page' => $page_arr);
             }
         }
         cache_db('set', $cache_key, $info, $uid > 0 ? 3600 : 600);
     }
     if ($info['count'] > 0 && $info['list']) {
         if ($GLOBALS['_J']['config']['is_topic_user_follow'] && !$GLOBALS['_J']['disable_user_follow']) {
             $info['list'] = buddy_follow_html($info['list'], 'uid', 'follow_html2');
         }
         $pi = 0;
         $list = array();
         foreach ($info['list'] as $v) {
             $list[$pi++ % 3][] = $v;
         }
         $info['list'] = $list;
     }
     return $info;
 }
Beispiel #7
0
function renren_sync($data)
{
    $sys_config = renren_init();
    if (!$sys_config) {
        return 'renren_init is invalid';
    }
    $tid = is_numeric($data['tid']) ? $data['tid'] : 0;
    if ($tid < 1) {
        return 'tid is invalid';
    }
    $uid = is_numeric($data['uid']) ? $data['uid'] : 0;
    if ($uid < 1) {
        return 'uid is invalid';
    }
    $totid = is_numeric($data['totid']) ? $data['totid'] : 0;
    $content = $data['content'];
    if (false !== strpos($content, '[')) {
        $content = preg_replace('~\\[([^\\]]{1,6}?)\\]~', '(\\1)', $content);
    }
    $content = trim(strip_tags($content));
    $name = array_iconv($sys_config['charset'], 'UTF-8', cutstr($content, 50));
    $content = array_iconv($sys_config['charset'], 'UTF-8', $content);
    if (!$content) {
        return 'content is invalid';
    }
    $url = get_full_url($sys_config['site_url'], 'index.php?mod=topic&code=' . $tid);
    $renren_bind_info = renren_bind_info($uid);
    if (!$renren_bind_info) {
        return 'bind_info is empty';
    }
    if (!renren_has_bind($uid)) {
        return 'bind_info is invalid';
    }
    $renren_bind_topic = DB::fetch_first("select * from " . DB::table('renren_bind_topic') . " where `tid`='{$tid}'");
    if ($renren_bind_topic) {
        return 'bind_topic is invalid';
    } else {
        DB::query("insert into " . DB::table('renren_bind_topic') . " (`tid`) values ('{$tid}')");
    }
    $ret = array();
    if ($totid < 1) {
        $p = array();
        $p['access_token'] = $renren_bind_info['token'];
        $p['name'] = $name;
        $p['description'] = $content;
        $p['url'] = $url;
        $p['action_name'] = array_iconv($sys_config['charset'], 'UTF-8', '来自:' . $sys_config['site_name']);
        $p['action_link'] = $url;
        $imageid = (int) $data['imageid'];
        if ($imageid > 0 && $sys_config['renren']['is_sync_image']) {
            $topic_image = topic_image($imageid, 'original');
            if (is_image(ROOT_PATH . $topic_image)) {
                $p['image'] = $sys_config['site_url'] . '/' . $topic_image;
            }
        }
        $ret = renren_api('feed.publishFeed', $p);
    }
    $renren_id = is_numeric($ret['post_id']) ? $ret['post_id'] : 0;
    if ($renren_id > 0) {
        DB::query("UPDATE " . DB::table('renren_bind_topic') . " SET `renren_id`='{$renren_id}' WHERE `tid`='{$tid}'");
    }
    return $ret;
}
Beispiel #8
0
 function delalbumimg($type = 'album', $id = 0)
 {
     $uid = MEMBER_ID;
     $count = 0;
     if ($uid > 0 and $id > 0) {
         if ('album' == $type) {
             $count = DB::result_first("SELECT COUNT(*) FROM " . DB::table('album') . " WHERE `albumid`='{$id}' and `picnum` = 0 and `uid` = '{$uid}'");
             if ($count > 0) {
                 DB::query("delete from " . DB::table('album') . " where `albumid`='{$id}'");
             }
         } else {
             $count = DB::result_first("SELECT COUNT(*) FROM " . DB::table('topic_image') . " where `id`='{$id}' and `tid` = 0 and `uid` = '{$uid}'");
             if ($count > 0) {
                 jio()->DeleteFile(topic_image($id, 'small'));
                 jio()->DeleteFile(topic_image($id, 'photo'));
                 jio()->DeleteFile(topic_image($id, 'original'));
                 $this->_update_album_pic_by_imgid($id);
             }
         }
     }
     return $count;
 }
Beispiel #9
0
 function ModifyList()
 {
     $title = "编辑微博";
     $tid = (int) $this->Get['tid'];
     $verify = $this->Get['verify'];
     if (!empty($tid)) {
         if ($verify) {
             $action = "admin.php?mod=topic&code=domodify&verify=verify";
             $sql = "select  T.tid , T.imageid, T.videoid , T.musicid ,T.content,T.content2 ,M.nickname,M.username , T.*\r\n\t\t\t\t\t\tfrom `" . TABLE_PREFIX . "members` M\r\n\t\t\t\t\t\tleft join `" . TABLE_PREFIX . "topic_verify` T on M.uid=T.uid\r\n\t\t\t\t\t\twhere T.tid='{$tid}' limit 0,1";
         } else {
             $action = "admin.php?mod=topic&code=domodify";
             $sql = "select  T.tid , T.imageid, T.videoid , T.musicid ,T.content,T.content2 ,M.nickname,M.username , T.*\r\n\t\t\t\t\t\tfrom `" . TABLE_PREFIX . "members` M\r\n\t\t\t\t\t\tleft join `" . TABLE_PREFIX . "topic` T on M.uid=T.uid\r\n\t\t\t\t\t\twhere T.tid='{$tid}' limit 0,1";
         }
         $query = $this->DatabaseHandler->Query($sql);
         $topiclist = $query->GetRow();
         if ($topiclist['longtextid'] > 0) {
             $topiclist['content'] = jtable('topic_more')->get_longtext($topiclist['tid'], $verify);
         } else {
             $topiclist['content'] = $topiclist['content'] . $topiclist['content2'];
         }
     } else {
         $this->Messager(NULL, 'admin.php?mod=topic', 0);
     }
     if ($topiclist == false) {
         $this->Messager("您要编辑的微博信息已经不存在!");
     }
     $topiclist['content'] = preg_replace('~<U ([0-9a-zA-Z]+)>(.+?)</U>~', '', $topiclist['content']);
     $topiclist['content'] = strip_tags($topiclist['content']);
     if ('both' == $topiclist['type'] || 'forward' == $topiclist['type']) {
         $topiclist['content'] = $this->TopicLogic->GetForwardContent($topiclist['content']);
     }
     $image_list = array();
     if ($topiclist['imageid']) {
         $image_id_arr = explode(",", $topiclist['imageid']);
         foreach ($image_id_arr as $value) {
             $value = (int) $value;
             if ($value > 0) {
                 $img = jtable('topic_image')->info($value);
                 $image_list[$img['id']]['id'] = $img['id'];
                 $image_list[$img['id']]['img_path'] = topic_image($img['id']);
             }
         }
     }
     $attach_list = array();
     if ($topiclist['attachid']) {
         $attach_id_arr = explode(",", $topiclist['attachid']);
         foreach ($attach_id_arr as $value) {
             if (($value = (int) $value) < 1) {
                 continue;
             }
             $attach = jtable('topic_attach')->info($value);
             $attach_list[$attach['id']]['id'] = $attach['id'];
             $attach_list[$attach['id']]['attach_name'] = topic_attach($attach['id'], 'name');
             $attach_list[$attach['id']]['attach_score'] = topic_attach($attach['id'], 'score');
             $attach_list[$attach['id']]['attach_img'] = 'images/filetype/' . topic_attach($attach['id'], 'filetype') . '.gif';
         }
     }
     if ($topiclist['videoid']) {
         $video = jtable('topic_video')->info($topiclist['videoid']);
         $videoid = $video['id'];
         $videohost = $video['video_hosts'];
         $videolink = $video['video_link'];
         $videoimg = $video['video_img'];
     }
     if ($topiclist['musicid']) {
         $topic_music = jtable('topic_music')->info($topiclist['musicid']);
         $musicid_id = $topic_music['id'];
         $ContentMusicid = $topic_music['music_url'];
     }
     include template('admin/topic_info');
 }