Aug 20

关于UCH中安装了投票后首页的FEED动态显示出现”feed_comment_”问题解决方案:

先下重新下载插件

送礼1.5版 下载地址: uch_gift_115_gbk (586.93 KB)

投票1.5版 下载地址: uch_vote_115 (21.12 KB)

问答1.5版 下载地址: uch_ask_115_gbk (14.05 KB)

然后复制下下面代码生成cp_comment.php文件 ,覆盖到source/cp_comment.php下即可

或直接下载  cp_comment (3.13KB)  直接覆盖。

演示地址:www.mdjlove.com

<?php
/*
 [UCenter Home] (C) 2007-2008 Comsenz Inc.
 $Id: cp_comment.php 8338 2008-08-04 06:09:51Z liguode $
*/

if(!defined(’IN_UCHOME’)) {
 exit(’Access Denied’);
}

include_once(S_ROOT.’./source/function_bbcode.php’);

//共用变量
$tospace = $pic = $blog = $album = $vote = array();

if(submitcheck(’commentsubmit’)) {

 if(!checkperm(’allowcomment’)) {
  showmessage(’no_privilege’);
 }
 //实名认证
 ckrealname(’comment’);

 //判断是否发布太快
 $waittime = interval_check(’post’);
 if($waittime > 0) {
  showmessage(’operating_too_fast’,”,1,array($waittime));
 }

 $message = getstr($_POST['message'], 0, 1, 1, 1, 2);
 if(strlen($message) < 2) {
  showmessage(’content_is_too_short’);
 }

 //摘要
 $summay = getstr($message, 150, 1, 1, 0, 0, -1);

 $id = intval($_POST['id']);

 //引用评论
 $cid = empty($_POST['cid'])?0:intval($_POST['cid']);
 $comment = array();
 if($cid) {
  $query = $_SGLOBAL['db']->query(”SELECT * FROM “.tname(’comment’).” WHERE cid=’$cid’ AND id=’$id’ AND idtype=’$_POST[idtype]‘”);
  $comment = $_SGLOBAL['db']->fetch_array($query);
  if($comment && $comment['authorid'] != $_SGLOBAL['supe_uid']) {
   //实名
   realname_set($comment['authorid'], $comment['author']);
   realname_get();
   
   $comment['message'] = preg_replace(”/\<div class=\”quote\”\>\<span class=\”q\”\>.*?\<\/span\>\<\/div\>/is”, ”, $comment['message']);
   //bbcode转换
   $comment['message'] = html2bbcode($comment['message']);
   $message = addslashes(”<div class=\”quote\”><span class=\”q\”><b>”.$_SN[$comment['authorid']].”</b>: “.getstr($comment['message'], 150, 0, 0, 0, 2).’</span></div>’).$message;
   if($comment['idtype']==’uid’) {
    $id = $comment['authorid'];
   }
  } else {
   $comment = array();
  }
 }

 //对输入的id、idtype进行检查
 checkcomment($id, $_POST['idtype']);

 //事件
 $fs = array();
 $fs['icon'] = ‘comment’;
 $fs['target_ids'] = $fs['friend'] = ”;

 switch ($_POST['idtype']) {
  case ‘uid’:
   //事件
   $fs['icon'] = ‘wall’;
   $fs['title_template'] = cplang(’feed_comment_space’);
   $fs['title_data'] = array(’touser’=>”<a href=\”space.php?uid=$tospace[uid]\”>”.$_SN[$tospace['uid']].”</a>”);
   $fs['body_template'] = ”;
   $fs['body_data'] = array();
   $fs['body_general'] = ”;
   $fs['images'] = array();
   $fs['image_links'] = array();
   break;
  case ‘picid’:
   //事件
   $fs['title_template'] = cplang(’feed_comment_image’);
   $fs['title_data'] = array(’touser’=>”<a href=\”space.php?uid=$tospace[uid]\”>”.$_SN[$tospace['uid']].”</a>”);
   $fs['body_template'] = ‘{pic_title}’;
   $fs['body_data'] = array(’pic_title’=>$pic['title']);
   $fs['body_general'] = $summay;
   $fs['images'] = array(mkpicurl($pic));
   $fs['image_links'] = array(”space.php?uid=$tospace[uid]&do=album&picid=$pic[picid]“);
   $fs['target_ids'] = $album['target_ids'];
   $fs['friend'] = $album['friend'];
   break;
  case ‘blogid’:
   //更新评论统计
   $_SGLOBAL['db']->query(”UPDATE “.tname(’blog’).” SET replynum=replynum+1 WHERE blogid=’$id’”);
   //事件
   $fs['title_template'] = cplang(’feed_comment_blog’);
   $fs['title_data'] = array(’touser’=>”<a href=\”space.php?uid=$tospace[uid]\”>”.$_SN[$tospace['uid']].”</a>”, ‘blog’=>”<a href=\”space.php?uid=$tospace[uid]&do=blog&id=$id\”>$blog[subject]</a>”);
   $fs['body_template'] = ”;
   $fs['body_data'] = array();
   $fs['body_general'] = ”;
   $fs['target_ids'] = $blog['target_ids'];
   $fs['friend'] = $blog['friend'];
   break;
  case ’sid’:
   //事件
   $fs['title_template'] = cplang(’feed_comment_share’);
   $fs['title_data'] = array(’touser’=>”<a href=\”space.php?uid=$tospace[uid]\”>”.$_SN[$tospace['uid']].”</a>”, ’share’=>”<a href=\”space.php?uid=$tospace[uid]&do=share&id=$id\”>”.cplang(’share’).”</a>”);
   $fs['body_template'] = ”;
   $fs['body_data'] = array();
   $fs['body_general'] = ”;
   break;
  //为了投票能使用系统评论而添加 1
  case ‘app_vote_id’: 
   //事件
   $fs['title_template'] = “{actor} 评论了”.$_POST['app_name'].” {touser}”;
   $fs['title_data'] = array(’touser’=>”<a href=\”".$_POST['refer'].”\”>{$_POST['app_title']}</a>”);
   $fs['body_template'] = ”;
   $fs['body_data'] = array();
   //$fs['body_general'] = ”;
   break; 
 }

 $setarr = array(
  ’uid’ => $tospace['uid'],
  ’id’ => $id,
  ’idtype’ => $_POST['idtype'],
  ’authorid’ => $_SGLOBAL['supe_uid'],
  ’author’ => $_SGLOBAL['supe_username'],
  ’dateline’ => $_SGLOBAL['timestamp'],
  ’message’ => $message,
  ’ip’ => getonlineip()
 );
 //入库
 $cid = inserttable(’comment’, $setarr, 1);

 switch ($_POST['idtype']) {
  case ‘uid’:
   $n_url = “space.php?uid=$tospace[uid]&do=wall&cid=$cid”;
   $note_type = ‘wall’;
   $note = cplang(’note_wall’, array($n_url));
   $q_note = cplang(’note_wall_reply’, array($n_url));
   if($comment) {
    $msg = ‘note_wall_reply_success’;
    $magvalues = array($_SN[$tospace['uid']]);
   } else {
    $msg = ‘do_success’;
    $magvalues = array();
   }
   $msgtype = ‘comment_friend’;
   break;
  case ‘picid’:
   $n_url = “space.php?uid=$tospace[uid]&do=album&picid=$id&cid=$cid”;
   $note_type = ‘piccomment’;
   $note = cplang(’note_pic_comment’, array($n_url));
   $q_note = cplang(’note_pic_comment_reply’, array($n_url));
   $msg = ‘do_success’;
   $magvalues = array();
   $msgtype = ‘photo_comment’;
   break;
  case ‘blogid’:
   //通知
   $n_url = “space.php?uid=$tospace[uid]&do=blog&id=$id&cid=$cid”;
   $note_type = ‘blogcomment’;
   $note = cplang(’note_blog_comment’, array($n_url, $blog['subject']));
   $q_note = cplang(’note_blog_comment_reply’, array($n_url));
   $msg = ‘do_success’;
   $magvalues = array();
   $msgtype = ‘blog_comment’;
   break;
  case ’sid’:
   //分享
   $n_url = “space.php?uid=$tospace[uid]&do=share&id=$id&cid=$cid”;
   $note_type = ’sharecomment’;
   $note = cplang(’note_share_comment’, array($n_url));
   $q_note = cplang(’note_share_comment_reply’, array($n_url));
   $msg = ‘do_success’;
   $magvalues = array();
   $msgtype = ’share_comment’;
   break;
  //为了投票能使用系统评论而添加 2
  case ‘app_vote_id’:
   $n_url = “app.php?do=vote&ac=view&id=$id&uid=$tospace[uid]“;
   $note_type = ‘app_comment’;
   $note = “评论了你的投票 <a href=’{$n_url}’ target=’_blank’>”.addslashes($_POST['app_title']).”</a>”;
   $q_note = “回复了你的投票 <a href=’{$n_url}’ target=’_blank’>”.addslashes($_POST['app_title']).”</a>”;
   $msg = ‘do_success’;
   $magvalues = array();
   $msgtype = ‘app_comment’;
   break; 
 }

 //发送邮件通知
 $msgtype = empty($comment)?$msgtype:$msgtype.’_reply’;
 $touid = empty($comment['authorid']) ? $tospace['uid'] : $comment['authorid'];
 addmailcron($touid, ”, cplang($msgtype, array($_SGLOBAL['supe_username'])), ”, $msgtype);

 if(empty($comment)) {
  //非引用评论
  if($tospace['uid'] != $_SGLOBAL['supe_uid']) {
   //事件发布
   if(ckprivacy(’comment’, 1)) {
    feed_add($fs['icon'], $fs['title_template'], $fs['title_data'], $fs['body_template'], $fs['body_data'], $fs['body_general'],$fs['images'], $fs['image_links'], $fs['target_ids'], $fs['friend']);
   }
   //发送通知
   notification_add($tospace['uid'], $note_type, $note);
   //留言发送短消息
   if($_POST['idtype'] == ‘uid’ && $tospace['updatetime'] == $tospace['dateline']) {
    include_once S_ROOT.’./uc_client/client.php’;
    uc_pm_send($_SGLOBAL['supe_uid'], $tospace['uid'], cplang(’wall_pm_subject’), cplang(’wall_pm_message’, array(addslashes(getsiteurl().$n_url))), 1, 0, 0);
   }
  }
 } elseif($comment['authorid'] != $_SGLOBAL['supe_uid']) {
  notification_add($comment['authorid'], $note_type, $q_note);
 }

 //积分
 if($tospace['uid'] != $_SGLOBAL['supe_uid']) {
  updatespacestatus(’get’, ‘comment’);
 }

 showmessage($msg, $_POST['refer'], 0, $magvalues);
}

$cid = empty($_GET['cid'])?0:intval($_GET['cid']);

//编辑
if($_GET['op'] == ‘edit’) {

 $query = $_SGLOBAL['db']->query(”SELECT * FROM “.tname(’comment’).” WHERE cid=’$cid’ AND authorid=’$_SGLOBAL[supe_uid]‘”);
 if(!$comment = $_SGLOBAL['db']->fetch_array($query)) {
  showmessage(’no_privilege’);
 }

 //提交编辑
 if(submitcheck(’editsubmit’)) {

  $message = getstr($_POST['message'], 0, 1, 1, 1, 2);
  if(strlen($message) < 2) showmessage(’content_is_too_short’);

  updatetable(’comment’, array(’message’=>$message), array(’cid’=>$comment['cid']));

  showmessage(’do_success’, $_POST['refer'], 0);
 }

 //bbcode转换
 $comment['message'] = html2bbcode($comment['message']);//显示用

} elseif($_GET['op'] == ‘delete’) {

 if(submitcheck(’deletesubmit’)) {
  include_once(S_ROOT.’./source/function_delete.php’);
  if(deletecomments(array($cid))) {
   showmessage(’do_success’, $_POST['refer'], 0);
  } else {
   showmessage(’no_privilege’);
  }
 }

} elseif($_GET['op'] == ‘reply’) {

 $query = $_SGLOBAL['db']->query(”SELECT * FROM “.tname(’comment’).” WHERE cid=’$cid’”);
 if(!$comment = $_SGLOBAL['db']->fetch_array($query)) {
  showmessage(’comments_do_not_exist’);
 }

} else {

 showmessage(’no_privilege’);
}

include template(’cp_comment’);

//检查
function checkcomment($id, $idtype) {
 global $_SGLOBAL;
 global $tospace, $pic, $blog, $album;

 switch ($idtype) {
  case ‘uid’:
   //检索空间
   $tospace = getspace($id);
   break;
  case ‘picid’:
   //检索图片
   $query = $_SGLOBAL['db']->query(”SELECT * FROM “.tname(’pic’).” WHERE picid=’$id’ LIMIT 1″);
   $pic = $_SGLOBAL['db']->fetch_array($query);
   //图片不存在
   if(empty($pic)) {
    showmessage(’view_images_do_not_exist’);
   }

   //检索空间
   $tospace = getspace($pic['uid']);

   //获取相册
   $album = array();
   if($pic['albumid']) {
    $query = $_SGLOBAL['db']->query(”SELECT * FROM “.tname(’album’).” WHERE albumid=’$pic[albumid]‘”);
    if(!$album = $_SGLOBAL['db']->fetch_array($query)) {
     updatetable(’pic’, array(’albumid’=>0), array(’albumid’=>$pic['albumid']));//相册丢失
    } else {
     if($album['target_ids']) {
      $album['target_ids'] .= “,$album[uid]“;
     }
    }
   }
   break;
  case ‘blogid’:
   //读取日志
   $query = $_SGLOBAL['db']->query(”SELECT b.*, bf.target_ids
    FROM “.tname(’blog’).” b
    LEFT JOIN “.tname(’blogfield’).” bf ON bf.blogid=b.blogid
    WHERE b.blogid=’$id’”);
   $blog = $_SGLOBAL['db']->fetch_array($query);
   //日志不存在
   if(empty($blog)) {
    showmessage(’view_to_info_did_not_exist’);
   }

   //是否允许评论
   if(!empty($blog['noreply'])) {
    showmessage(’do_not_accept_comments’);
   }
   if($blog['target_ids']) {
    $blog['target_ids'] .= “,$blog[uid]“;
   }
   //检索空间
   $tospace = getspace($blog['uid']);
   break;
  case ’sid’:
   //读取日志
   $query = $_SGLOBAL['db']->query(”SELECT * FROM “.tname(’share’).” WHERE sid=’$id’”);
   $share = $_SGLOBAL['db']->fetch_array($query);
   //日志不存在
   if(empty($share)) {
    showmessage(’sharing_does_not_exist’);
   }

   //检索空间
   $tospace = getspace($share['uid']);
   break;
  case ‘app_vote_id’:
   $cspace = array(’uid’=>$_POST['app_uid'], ‘username’=>$_POST['app_username'], ‘app_title’=>$_POST['app_title'], ‘app_link’ => $_POST['refer'], ‘app_name’ =>$_POST['app_name']);
   //检索空间
   $tospace = getspace($_POST['app_uid']);
   break;
  default:
   showmessage(’non_normal_operation’);
   break;
 }
 if(empty($tospace)) {
  showmessage(’space_does_not_exist’);
 }
 //黑名单
 if(isblacklist($tospace['uid'])) {
  showmessage(’is_blacklist’);
 }
}

?>

written by Toby \\ tags:

Jul 23

牡丹江站长不知道有多少,想找哪个站长也很麻烦

今天跟朋友商量一下,建个群,把牡丹江的站长都邀请进来一起交流

群号:24602385

欢迎牡丹江的各位站长加入! 

written by Toby \\ tags: ,

Apr 15

名字:issusine

预览:http://www.toby.org.cn

下载:http://www.seobasic.com/z-blog/issusine.rar

这个是去年十月一直用着的,再就没换过,只有最近做的SEOBASIC.CN的那个了,再就没有什么模版了

下一次,TOBY一定要做个漂亮的WORDPRESS模版放出来,一定要好好研究研究。

written by Toby

Apr 15

主题名称:BUNNY

主题预览:http://www.seobasic.cn/

主题下载:http://www.seobasic.com/z-blog/bunny.rar

虽然是1.8版的,但是压缩的是RAR格式,机器里没装ZTI

下载下来直接像传1.7的模版那样上传就可以了

这个主题当时改了又改,修了又修,弄了1个礼拜左右,一直是最喜欢的主题

再加上1.8版的静态处理,很利于博客在搜索中的友好程度

written by Toby

Apr 14

说实话,这是我第一次做博客的模版,而且此前跟本没接触过WORDPRESS

但是经过一夜的努力,终于完成了第一个作品,虽然很简单(只有27.8KB,一张背景图),但是用起来很舒服,因为是自己做的,嘿嘿

大家可以下载感受下,下载地址:http://www.seobasic.com/wordpress/simplethemes.rar

如果感觉实用的话,欢迎使用!

如果有什么地方有错误请帮我指出来,我还是个新手不太懂这方面的东西。

written by Toby

Apr 14

一夜下来,新博客已经弄的差不多了。天亮了,看到太阳心情也好了很多。

这个博客注定会是Toby的私人BLOG,主要是一些时光刻录和作品以及不断进步的过程。

第一个博客是和讯的,地址早已经记不清了。

第二个博客是初学SEO时实验用的www.seosos.net.cn 后来改成静态的页,挂排名去liao~失败

第三个博客准备定为私人博客的,结果后来改成竞争关键词了.地址是www.toby.org.cn(惭愧,已经3个多月没更新了,写的东西也乱七八糟 - -!)

第四个也是最后一个,就是现在的www.seobasic.com了,不想做词,不想实验,只想安心的写一些心里所想的东西。

其实每天都有很多想写下来的东西,只是人比较懒不愿意动手,想着写下来,结果过几天就忘光啦,哈哈哈

现在好了,在这里安营、驻留、扎寨、生根、发芽、成长、进步…生活、生存、繁衍…乱~

写给自己的回忆 - Toby’s Blog

written by Toby