code stringlengths 1 2.01M | repo_name stringlengths 3 62 | path stringlengths 1 267 | language stringclasses 231
values | license stringclasses 13
values | size int64 1 2.01M |
|---|---|---|---|---|---|
<?php
defined('IN_IK') or die('Access Denied.');
//获取小组全部内容列表
$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
$url = 'index.php?app=tag&ac=admin&mg=list&page=';
$sLimit = $page*10-10;
$arrTags = $db->fetch_all_assoc("select * from ".dbprefix."tag order by uptime desc limit $sLimit,10");
$tagNum = $db->once_num_rows("select * from ".dbprefix."tag");
$pageUrl = pagination($tagNum, 10, $page, $url);
include template("admin/list"); | 12ik | trunk/app/tag/action/admin/list.php | PHP | oos | 485 |
<?php
defined('IN_IK') or die('Access Denied.');
switch($ts){
case "":
$objname = $_GET['objname'];
$idname = $_GET['idname'];
$objid = $_GET['objid'];
include template("add_ajax");
break;
case "do":
$objname = $_POST['objname'];
$idname = $_POST['idname'];
$objid = $_POST['objid'];
$tags = trim($_POST['tags']);
$new['tag']->addTag($objname,$idname,$objid,$tags);
echo "<script language=JavaScript>parent.window.location.reload();</script>";
break;
} | 12ik | trunk/app/tag/action/add_ajax.php | PHP | oos | 522 |
<?php
defined('IN_IK') or die('Access Denied.');
//管理入口
if(is_file('app/'.$app.'/action/admin/'.$mg.'.php')){
include_once 'app/'.$app.'/action/admin/'.$mg.'.php';
}else{
qiMsg('sorry:no index!');
} | 12ik | trunk/app/tag/action/admin.php | PHP | oos | 219 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="160780470@qq.com" />
<meta name="Copyright" content="{$IK_SOFT[info][copyright]" />
<title></title>
<link type="text/css" rel="stylesheet" href="{$IK_APP[system][skin]}default/style.css" id="skin" />
<!--公用的JS-->
<script src="{SITE_URL}public/js/jquery.js" type="text/javascript"></script>
<!--ymPrompt组件-->
<script type="text/javascript" src="{SITE_URL}public/js/ymPrompt/ymPrompt.js"></script>
<link href="{SITE_URL}public/js/ymPrompt/skin/simple/ymPrompt.css" rel="stylesheet" type="text/css" />
<!--ymPrompt组件-->
<script src="{SITE_URL}app/{$app}/js/admin.js" type="text/javascript"></script>
</head>
<body>
<!--header--> | 12ik | trunk/app/tag/html/admin/header.html | HTML | oos | 934 |
{php include template("admin/header");}
<!--main-->
<div class="midder">
{php include template("admin/menu");}
<div class="page">{$pageUrl}</div>
<table cellpadding="0" cellspacing="0">
<tr class="old"><td width="20">ID</td><td width="100">标签名字</td><td>创建时间</td><td>操作</td></tr>
<!--{loop $arrTags $key $item}-->
<tr class="odd"><td>{$item[tagid]}</td><td>{$item[tagname]}</td><td>{php echo date('Y-m-d H:i:s',$item[uptime])}</td><td>
<a href="{SITE_URL}index.php?app=tag&ac=admin&mg=do&ts=opt&tagid={$item[tagid]}">[优化]</a>
<a href="{SITE_URL}index.php?app=tag&ac=admin&mg=do&ts=isenable&tagid={$item[tagid]}&isenable=<!--{if $item[isenable]=='0'}-->1<!--{else}-->0<!--{/if}-->"><!--{if $item[isenable]=='0'}-->[禁用]<!--{else}--><font color="red">[启用]</font><!--{/if}--></a> <a href="{SITE_URL}index.php?app=tag&ac=admin&mg=do&ts=del&tagid={$item[tagid]}">[删除]</a></td></tr>
<!--{/loop}-->
</table>
</div>
{php include template("admin/footer");} | 12ik | trunk/app/tag/html/admin/list.html | HTML | oos | 989 |
{php include template("admin/header");}
<!--main-->
<div class="midder">
{php include template("admin/menu");}
<div>暂无配置文件!</div>
</div>
{php include template("admin/footer");} | 12ik | trunk/app/tag/html/admin/options.html | HTML | oos | 194 |
<h2>标签管理</h2>
<div class="tabnav">
<ul>
<li <!--{if $mg=='options'}-->class="select"<!--{/if}-->><a href="{SITE_URL}index.php?app=tag&ac=admin&mg=options">标签配置</a></li>
<li <!--{if $mg=='list'}-->class="select"<!--{/if}-->><a href="{SITE_URL}index.php?app=tag&ac=admin&mg=list">全部标签</a></li>
</ul>
</div> | 12ik | trunk/app/tag/html/admin/menu.html | HTML | oos | 328 |
<!--footer-->
</body>
</html> | 12ik | trunk/app/tag/html/admin/footer.html | HTML | oos | 29 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style>
body{ font-size:12px;font-family:Arial;margin:0 auto;color:#434343;background#FFFFFF;}
p,form{margin:0;padding:0;}
a{color:#66873E;text-decoration:none;}
/*链接按钮*/
.subab{
background: #EBF5EB;
border: 1px solid #B8CACB;
border-radius: 12px 12px 12px 12px;
color: #333333;
cursor: pointer;
font-weight: bold;
padding: 4px 10px;
text-shadow: 0 1px 0 #FFFFFF;
}
</style>
</head>
<body>
<div style="text-align:center;padding:10px 0;">
<form method="POST" action="{SITE_URL}index.php?app=tag&ac=add_ajax&ts=do">
<p><input class="tagtxt" type="text" name="tags" /> </p>
<p>
<br />
<input type="hidden" name="objname" value="{$objname}" />
<input type="hidden" name="idname" value="{$idname}" />
<input type="hidden" name="objid" value="{$objid}" />
<button type="submit" class="subab">添 加</button>
</p>
</form>
</div>
</body>
</html> | 12ik | trunk/app/tag/html/add_ajax.html | HTML | oos | 1,185 |
<?php
defined('IN_IK') or die('Access Denied.');
class tag extends IKApp{
//构造函数
public function __construct($db){
parent::__construct($db);
}
//添加多个标签
function addTag($objname,$idname,$objid,$tags){
if($objname != '' && $idname != '' && $objid!='' && $tags!=''){
//$tags = str_replace ( ',', ',', $tags );
$tag = preg_replace('/\s+/', ',', $tags );//修正用空格 分割 tag标签
$arrTag = explode(',', $tag);
foreach($arrTag as $item){
$tagname = t($item);
if(strlen($tagname) < '32' && $tagname != ''){
$uptime = time();
$tagcount = $this->db->once_num_rows("select * from ".dbprefix."tag where tagname='".$tagname."'");
if($tagcount == '0'){
$this->db->query("INSERT INTO ".dbprefix."tag (`tagname`,`uptime`) VALUES ('".$tagname."','".$uptime."')");
$tagid = $this->db->insert_id();
$tagIndexCount = $this->db->once_num_rows("select * from ".dbprefix."tag_".$objname."_index where ".$idname."='".$objid."' and tagid='".$tagid."'");
if($tagIndexCount == '0'){
$this->db->query("INSERT INTO ".dbprefix."tag_".$objname."_index (`".$idname."`,`tagid`) VALUES ('".$objid."','".$tagid."')");
}
$tagIdCount = $this->db->once_num_rows("select * from ".dbprefix."tag_".$objname."_index where tagid='".$tagid."'");
$this->db->query("update ".dbprefix."tag set `count_".$objname."`='".$tagIdCount."',`uptime`='".$uptime."' where tagid='".$tagid."'");
}else{
$tagData = $this->db->once_fetch_assoc("select * from ".dbprefix."tag where tagname='".$tagname."'");
$tagIndexCount = $this->db->once_num_rows("select * from ".dbprefix."tag_".$objname."_index where ".$idname."='".$objid."' and tagid='".$tagData['tagid']."'");
if($tagIndexCount == '0'){
$this->db->query("INSERT INTO ".dbprefix."tag_".$objname."_index (`".$idname."`,`tagid`) VALUES ('".$objid."','".$tagData['tagid']."')");
}
$tagIdCount = $this->db->once_num_rows("select * from ".dbprefix."tag_".$objname."_index where tagid='".$tagData['tagid']."'");
$this->db->query("update ".dbprefix."tag set `count_".$objname."`='".$tagIdCount."',`uptime`='".$uptime."' where tagid='".$tagData['tagid']."'");
}
}
}
}
}
//通过topic获取tag
function getObjTagByObjid($objname,$idname,$objid){
$arrTagIndex = $this->db->fetch_all_assoc("select * from ".dbprefix."tag_".$objname."_index where ".$idname."='$objid'");
if(is_array($arrTagIndex)){
foreach($arrTagIndex as $item){
$arrTag[] = $this->getOneTag($item['tagid']);
}
}
return $arrTag;
}
//通过topic删除tag
function delObjTagByObjid($objname,$idname,$objid)
{
$arrTagIndex = $this->db->fetch_all_assoc("select * from ".dbprefix."tag_".$objname."_index where ".$idname."='$objid'");
if(is_array($arrTagIndex))
{
foreach($arrTagIndex as $item){
$this->delete('tag',array('tagid'=>$item['tagid']));
}
//删除索引 tag_obj_index 表
$this->delete('tag_'.$objname.'_index',array($idname=>$item[$idname]));
}
}
//通过tagid获得tagname
function getOneTag($tagid){
$tagData = $this->db->once_fetch_assoc("select * from ".dbprefix."tag where tagid='$tagid'");
return $tagData;
}
//通过tagname获取tagid
function getTagId($tagname){
$strTag = $this->db->once_fetch_assoc("select tagid from ".dbprefix."tag where `tagname`='$tagname'");
return $strTag['tagid'];
}
} | 12ik | trunk/app/tag/class.tag.php | PHP | oos | 3,566 |
<?php
defined('IN_IK') or die('Access Denied.');
return array (
'name' => '标签',
'version' => '1.0',
'desc' => '标签',
'url' => 'http://www.12ik.com',
'email' => '160780470@qq.com',
'author' => '小麦',
'author_url' => 'http://www.12ik.com',
'isoption' => '1',
'isinstall' => '1',
'issql' => '1',
'issystem' => '1',
'isappnav' => '0',
);
?> | 12ik | trunk/app/tag/about.php | PHP | oos | 386 |
<?php
defined('IN_IK') or die('Access Denied.');
require_once IKDATA."/config.inc.php"; | 12ik | trunk/app/tag/config.php | PHP | oos | 91 |
<?php
defined('IN_IK') or die('Access Denied.');
class message extends IKApp{
//构造函数
public function __construct($db){
parent::__construct($db);
}
//发送消息
public function sendmsg($userid,$touserid,$title,$content){
$userid = intval($userid);
$touserid = intval($touserid);
$content = addslashes(trim($content));
if($touserid && $content){
$messageid = $this->create('message',array(
'userid' => $userid,
'touserid' => $touserid,
'title' => $title,
'content' => $content,
'addtime' => time(),
));
}
}
} | 12ik | trunk/app/message/class.message.php | PHP | oos | 623 |
<?php
defined('IN_IK') or die('Access Denied.');
/*
* 系统消息盒子
*/
$userid = '0';
$touserid= $_GET['userid'];
$arrMessages = $db->fetch_all_assoc("select * from ".dbprefix."message where userid='0' and touserid='$touserid' order by addtime desc limit 10");
$pattern='/(http:\/\/|https:\/\/|ftp:\/\/)([\w:\/\.\?=&-_]+)/is';
if(is_array($arrMessages)){
foreach($arrMessages as $key=>$item){
$arrMessage[] = $item;
$arrMessage[$key]['content'] = nl2br(preg_replace($pattern, '<a href="\1\2">\1\2</a>', $item['content']));
}
$arrMessage = array_reverse($arrMessage);
}
//isread设为已读
$db->query("update ".dbprefix."message set `isread`='1' where userid='0' and touserid='$touserid' and `isread`='0'");
$title = '系统消息盒子';
include template("systembox"); | 12ik | trunk/app/message/action/systembox.php | PHP | oos | 822 |
<?php
defined('IN_IK') or die('Access Denied.');
/*
* 发送盒子
*/
$userid= $_GET['userid'];
$strTouser = $db->once_fetch_assoc("select * from ".dbprefix."user_info where userid='$userid'");
$title = '发送盒子';
include template("sendbox"); | 12ik | trunk/app/message/action/sendbox.php | PHP | oos | 264 |
<?php
defined('IN_IK') or die('Access Denied.'); | 12ik | trunk/app/message/action/index.php | PHP | oos | 49 |
<?php
defined('IN_IK') or die('Access Denied.');
//用户是否登录
$userid = aac('user')->isLogin();
$arrToUsers = $db->fetch_all_assoc("select userid from ".dbprefix."message where userid > '0' and touserid='$userid' group by userid");
if(is_array($arrToUsers)){
foreach($arrToUsers as $key=>$item){
$arrToUser[] = $item;
$arrToUser[$key]['user'] = aac('user')->getOneUser($item['userid']);
$arrToUser[$key]['count'] = $db->once_num_rows("select * from ".dbprefix."message where touserid='$userid' and userid='".$item['userid']."' and isread='0'");
}
}
//统计系统消息
$systemNum = $db->once_num_rows("select * from ".dbprefix."message where userid='0' and touserid='$userid' and isread='0'");
include template("my");
| 12ik | trunk/app/message/action/my.php | PHP | oos | 763 |
<?php
defined('IN_IK') or die('Access Denied.');
$userid = $_POST['userid'];
$touserid = $_POST['touserid'];
$title = $_POST['title'];
$content = $_POST['content'];
$new['message']->sendmsg($userid,$touserid,$title,$content);
echo '1'; | 12ik | trunk/app/message/action/sendmsg.php | PHP | oos | 248 |
<?php
defined('IN_IK') or die('Access Denied.');
//消息盒子
$userid = intval($IK_USER['user']['userid']);
$touserid= intval($_GET['userid']);
if($userid == 0 || $touserid == 0) qiMsg("非法操作!");
$msgCount = $db->once_fetch_assoc("select count(messageid) from ".dbprefix."message where (userid='$userid' and touserid='$touserid') or (userid='$touserid' and touserid='$userid') ");
if($msgCount['count(messageid)'] ==0) qiMsg("非法操作");
$sql = "select * from ".dbprefix."message where (userid='$userid' and touserid='$touserid') or (userid='$touserid' and touserid='$userid') order by addtime desc LIMIT 0 , 10";
$arrMessages = $db->fetch_all_assoc($sql);
if(is_array($arrMessages)){
foreach($arrMessages as $key=>$item){
$arrMessage[] = $item;
$arrMessage[$key]['user'] = aac('user')->getOneUser($item['userid']);
}
$arrMessage = array_reverse($arrMessage);
}
//isread设为已读
$db->query("update ".dbprefix."message set `isread`='1' where userid='$touserid' and touserid='$userid' and `isread`='0'");
$title = '消息盒子';
include template("msgbox"); | 12ik | trunk/app/message/action/msgbox.php | PHP | oos | 1,126 |
<?php
defined('IN_IK') or die('Access Denied.');
//用户是否登录
$userid = aac('user')->isLogin();
/**
$arrToUsers = $db->fetch_all_assoc("select userid from ".dbprefix."message where userid > '0' and touserid='$userid' group by userid");
if(is_array($arrToUsers)){
foreach($arrToUsers as $key=>$item){
$arrToUser[] = $item;
$arrToUser[$key]['user'] = aac('user')->getOneUser($item['userid']);
$arrToUser[$key]['count'] = $db->once_num_rows("select * from ".dbprefix."message where touserid='$userid' and userid='".$item['userid']."' and isread='0'");
}
}
//统计系统消息
$systemNum = $db->once_num_rows("select * from ".dbprefix."message where userid='0' and touserid='$userid' and isread='0'");
**/
switch($ts){
//收件箱
case "inbox":
$sql = "select * from ".dbprefix."message where touserid='$userid' and isspam<>1 and isinbox='0' order by addtime desc LIMIT 0 , 10";
$unreadnum = aac('message')->findCount('message',array('touserid'=>$userid,'isread'=>'0','isinbox'=>'0'));//未读邮件数目
$spamnum = aac('message')->findCount('message',array('touserid'=>$userid,'isspam'=>'1','isinbox'=>'0'));//垃圾邮件数目
$arrMessages = $db->fetch_all_assoc($sql);
foreach($arrMessages as $key=>$item){
$arrMessage[] = $item;
$arrMessage[$key]['user'] = aac('user')->getOneUser($item['userid']);
$arrMessage[$key]['content'] = getsubstrutf8(t($item['content']),0,200);
$arrMessage[$key]['addtime'] = date('Y-m-d H:i',$item['addtime']);
}
$title = '我的收件箱';
include template("inbox");
break;
//收件箱
case "unread":
$sql = "select * from ".dbprefix."message where touserid='$userid' and isread='0' and isinbox='0' order by addtime desc LIMIT 0 , 10";
$unreadnum = aac('message')->findCount('message',array('touserid'=>$userid,'isread'=>'0','isinbox'=>'0'));//未读邮件数目
$spamnum = aac('message')->findCount('message',array('touserid'=>$userid,'isspam'=>'1','isinbox'=>'0'));//垃圾邮件数目
$arrMessages = $db->fetch_all_assoc($sql);
foreach($arrMessages as $key=>$item){
$arrMessage[] = $item;
$arrMessage[$key]['user'] = aac('user')->getOneUser($item['userid']);
$arrMessage[$key]['content'] = getsubstrutf8(t($item['content']),0,200);
$arrMessage[$key]['addtime'] = date('Y-m-d H:i',$item['addtime']);
}
$title = '我的收件箱';
include template("inbox");
break;
//收件箱
case "spam":
$sql = "select * from ".dbprefix."message where touserid='$userid' and isspam='1' and isinbox='0' order by addtime desc LIMIT 0 , 10";
$unreadnum = aac('message')->findCount('message',array('touserid'=>$userid,'isread'=>'0','isinbox'=>'0'));//未读邮件数目
$spamnum = aac('message')->findCount('message',array('touserid'=>$userid,'isspam'=>'1','isinbox'=>'0'));//垃圾邮件数目
$arrMessages = $db->fetch_all_assoc($sql);
foreach($arrMessages as $key=>$item){
$arrMessage[] = $item;
$arrMessage[$key]['user'] = aac('user')->getOneUser($item['userid']);
$arrMessage[$key]['content'] = getsubstrutf8(t($item['content']),0,200);
$arrMessage[$key]['addtime'] = date('Y-m-d H:i',$item['addtime']);
}
$title = '我的收件箱';
include template("inbox");
break;
case "outbox":
$sql = "select * from ".dbprefix."message where userid='$userid' and isoutbox='0' order by addtime desc LIMIT 0 , 10";
$arrMessages = $db->fetch_all_assoc($sql);
foreach($arrMessages as $key=>$item){
$arrMessage[] = $item;
$arrMessage[$key]['touser'] = aac('user')->getOneUser($item['touserid']);
$arrMessage[$key]['content'] = getsubstrutf8(t($item['content']),0,200);
$arrMessage[$key]['addtime'] = date('Y-m-d H:i',$item['addtime']);
}
$title = '我的发件箱';
include template("outbox");
break;
case "notification":
$title = '我的提醒';
include template("notification");
break;
case "choose":
$followUsers = $db->fetch_all_assoc("select userid_follow from ".dbprefix."user_follow where userid='$userid' order by addtime");
if(is_array($followUsers)){
foreach($followUsers as $item){
$arrFollowUser[] = aac('user')->getOneUser($item['userid_follow']);
}
}
$title = '写信-选择收件人';
include template("choose");
break;
} | 12ik | trunk/app/message/action/ikmail.php | PHP | oos | 4,289 |
<?php
defined('IN_IK') or die('Access Denied.');
/*
* 是否有新消息
*/
// 如果用户id为0或非数字,则直接返回0
$userid = intval($_GET['userid']);
if(!$userid) {
echo '0';
}
$newMsgNum = $db->once_num_rows("select * from ".dbprefix."message where touserid='$userid' and isread='0' and isinbox='0'");
if($newMsgNum == '0'){
$arrJson = array('r'=>1, 'num'=>'0');
header("Content-Type: application/json", true);
echo json_encode($arrJson);
}else{
$arrJson = array('r'=>0, 'num'=>$newMsgNum);
header("Content-Type: application/json", true);
echo json_encode($arrJson);
} | 12ik | trunk/app/message/action/newmsg.php | PHP | oos | 638 |
<?php
defined('IN_IK') or die('Access Denied.');
//用户是否登录
$userid = aac('user')->isLogin();
$messageid = empty($_POST['messageid']) ? $_GET['messageid'] : $_POST['messageid'];
switch($ts){
//删除
case "del":
if($_GET['type']=='inbox')
{
$status = aac('message')->update('message',array('touserid'=>$userid,'messageid'=>$messageid),array('isinbox'=>1));
}
if($_GET['type']=='outbox')
{
$status = aac('message')->update('message',array('userid'=>$userid,'messageid'=>$messageid),array('isoutbox'=>1));
}
header("Location: ".$_SERVER['HTTP_REFERER']);
break;
case "spam":
$status = aac('message')->update('message',array('messageid'=>$messageid,'touserid'=>$userid),array('isspam'=>1));
header("Location: ".SITE_URL.tsUrl('message','ikmail',array('ts'=>'spam')));
break;
case "all":
if(trim($_POST['mc_submit'])=='删除' && $_POST['type']=='inbox')
{
for($i=0; $i<count($messageid); $i++)
{
aac('message')->update('message',array('touserid'=>$userid,'messageid'=>$messageid[$i]),array('isinbox'=>1));
}
//删除
aac('message')->delete('message',array('isinbox'=>'1','isoutbox'=>'1'));
header("Location: ".$_SERVER['HTTP_REFERER']);
}
if(trim($_POST['mc_submit'])=='删除' && $_POST['type']=='outbox')
{
for($i=0; $i<count($messageid); $i++)
{
aac('message')->update('message',array('userid'=>$userid,'messageid'=>$messageid[$i]),array('isoutbox'=>1));
}
//删除
aac('message')->delete('message',array('isinbox'=>'1','isoutbox'=>'1'));
header("Location: ".$_SERVER['HTTP_REFERER']);
}
if(trim($_POST['mc_submit'])=='垃圾消息')
{
for($i=0; $i<count($messageid); $i++)
{
aac('message')->update('message',array('messageid'=>$messageid[$i],'touserid'=>$userid),array('isspam'=>1));
}
header("Location: ".SITE_URL.tsUrl('message','ikmail',array('ts'=>'spam')));
}
if(trim($_POST['mc_submit'])=='标记为已读')
{
for($i=0; $i<count($messageid); $i++)
{
aac('message')->update('message',array('messageid'=>$messageid[$i],'touserid'=>$userid),array('isread'=>1));
}
header("Location: ".$_SERVER['HTTP_REFERER']);
}
break;
}
| 12ik | trunk/app/message/action/do.php | PHP | oos | 2,265 |
<?php
defined('IN_IK') or die('Access Denied.');
//用户是否登录
$userid = aac('user')->isLogin();
$messageid = intval($_GET['messageid']);
$arrMessages = aac('message')->find('message',array('messageid'=>$messageid));
$arrMessages['addtime'] = date('Y-m-d H:i',$arrMessages['addtime']);
if($arrMessages['userid'] == $userid)
{
//发往对方
if($arrMessages['isoutbox']==1){ header("Location: ".SITE_URL.tsUrl('message','ikmail',array('ts'=>'inbox'))); }
$touser = aac('user')->getOneUser($arrMessages['touserid']);//来自哪位用户
$touserArea = aac('location')->getAreaForApp($touser['areaid']);//来自哪位用户的地址
$touserArea = empty($touserArea['three']['areaname']) ? '火星' : $touserArea['three']['areaname'];
$strUserinfo = '<span class="m">发往:'.$touser['username'].'('.$touserArea.')</span>';
$type = 'outbox';
$title = '我发送的消息';
}
if($arrMessages['touserid'] == $userid)
{
//接收的信息
if($arrMessages['isinbox']==1){ header("Location: ".SITE_URL.tsUrl('message','ikmail',array('ts'=>'inbox'))); }
$touser = aac('user')->getOneUser($arrMessages['userid']);//来自哪位用户
$touserArea = aac('location')->getAreaForApp($touser['areaid']);//来自哪位用户的地址
$touserArea = empty($touserArea['three']['areaname']) ? '火星' : $touserArea['three']['areaname'];
$strUserinfo = '<span class="m">来自:'.$touser['username'].'('.$touserArea.')</span>';
$type = 'inbox';
//isread设为已读
$db->query("update ".dbprefix."message set `isread`='1' where touserid='$userid' and `isread`='0' and messageid='$messageid' ");
$title = '我接收的消息';
}
if($arrMessages['userid'] == 0 && $arrMessages['touserid']==$userid)
{
//接收的信息 系统消息
if($arrMessages['isinbox']==1){ header("Location: ".SITE_URL.tsUrl('message','ikmail',array('ts'=>'inbox'))); }
$strUserinfo = '<span class="m">来自:<span class="sys_doumail_big">系统邮件</span> </span>';
$touser = aac('user')->getOneUser($arrMessages['userid']);//来自哪位用户;
//isread设为已读
$db->query("update ".dbprefix."message set `isread`='1' where userid='0' and touserid='$userid' and `isread`='0' and messageid='$messageid' ");
$title = '我接收的系统消息';
}
include template("show");
| 12ik | trunk/app/message/action/show.php | PHP | oos | 2,343 |
<?php
defined('IN_IK') or die('Access Denied.');
//管理入口
if(is_file('app/'.$app.'/action/admin/'.$mg.'.php')){
include_once 'app/'.$app.'/action/admin/'.$mg.'.php';
}else{
qiMsg('sorry:no index!');
} | 12ik | trunk/app/message/action/admin.php | PHP | oos | 219 |
{template header}
<!--main-->
<div class="midder">
<div class="mc">
<h1>我的收件箱({$unreadnum}封未拆)</h1>
<div class="cleft">
{template menu}
<div class="clear"></div>
<div id="db-timeline-hd">
<ul class="menu-list">
<li <!--{if $ts=="inbox"}--> class="on" <!--{/if}-->>
<a href="{SITE_URL}{tsUrl('message','ikmail',array('ts'=>'inbox'))}">
所有消息
</a>
</li>
<li <!--{if $ts=="unread"}--> class="on" <!--{/if}--> >
<a href="{SITE_URL}{tsUrl('message','ikmail',array('ts'=>'unread'))}">
未读消息({$unreadnum})
</a>
</li>
<li <!--{if $ts=="spam"}--> class="on" <!--{/if}--> >
<a href="{SITE_URL}{tsUrl('message','ikmail',array('ts'=>'spam'))}">
垃圾消息({$spamnum})
</a>
</li>
</ul>
</div>
<form method="post" onSubmit="return isConfirmed" action="{SITE_URL}{tsUrl('message','do',array('ts'=>'all'))}">
<table class="olt">
<tbody>
<tr>
<td class="pl" style="width:112px;"><span class="doumail_from">来自</span></td>
<td width="20"></td>
<td class="pl">话题</td>
<td class="pl" style="width:110px;">时间</td>
<td class="pl" style="width:40px;" align="center">选择</td>
<td class="pl" style="width:120px;visibility:hidden;border-bottom:none" align="center">mail_options</td>
</tr>
<!--{loop $arrMessage $key $item}-->
<tr>
<td>{if $item[userid]==0}<span class="sys_doumail">系统邮件</span>{else} <span class="doumail_from">{$item[user][username]}</span> {/if}</td>
<td class="m" align="center">></td>
<td><a href="{SITE_URL}{tsUrl('message','show',array('messageid'=>$item[messageid]))}">{$item[title]}</a></td>
<td>{$item[addtime]}</td>
<td align="center"><input name="messageid[]" value="{$item[messageid]}" type="checkbox"></td>
<td style="display: none;" class="mail_options">
{if $ts!="spam"}<a rel="direct" class="post_link" href="{SITE_URL}{tsUrl('message','do',array('ts'=>'spam','messageid'=>$item[messageid]))}">垃圾消息</a>{/if}
<a onClick="return confirm('真的要删除消息吗?')" class="post_link" href="{SITE_URL}{tsUrl('message','do',array('ts'=>'del','type'=>'inbox','messageid'=>$item[messageid]))}">删除</a>
</td>
</tr>
<!--{/loop}-->
<tr>
<td colspan="4" align="right">
<input name="type" value="inbox" type="hidden">
{if $ts=="spam"}
<input name="mc_submit" value="删除" data-confirm="真的要删除短消息吗?" type="submit">
{/if}
{if $ts=="inbox" || $ts=="unread"}
<input name="mc_submit" value="删除" data-confirm="真的要删除短消息吗?" type="submit">
<input name="mc_submit" value="垃圾消息" type="submit">
<input name="mc_submit" value="标记为已读" type="submit">
{/if}
</td>
<td align="center"><input name="checkAll" value="checkAll" onclick="ToggleCheck(this);" type="checkbox"></td>
</tr>
</tbody>
</table>
</form>
</div>
<div class="cright">
{template rightmenu}
</div>
</div>
</div>
{template footer} | 12ik | trunk/app/message/html/inbox.html | HTML | oos | 4,101 |
{template header}
<!--main-->
<div class="midder">
<div class="mc">
<h1>选择收件人</h1>
<div class="cleft">
<div style="width:100%" class="indent">
<!--{loop $arrFollowUser $key $item}-->
<dl class="obu">
<dt>
<a class="nbg" href="{SITE_URL}{tsUrl('user','message',array('ts'=>'message_add','touserid'=>$item[userid]))}">
<img alt="{$item[username]}" class="m_sub_img" src="{$item[face]}">
</a>
</dt>
<dd><a href="{SITE_URL}{tsUrl('user','message',array('ts'=>'message_add','touserid'=>$item[userid]))}" title="{$item[username]}">{$item[username]}</a></dd>
</dl>
<!--{/loop}-->
<br clear="all">
</div>
</div>
<div class="cright">
<p class="pl2">> <a href="{SITE_URL}{tsUrl('message','ikmail',array('ts'=>'inbox'))}">回到我的收件箱</a></p>
</div>
</div>
</div>
{template footer} | 12ik | trunk/app/message/html/choose.html | HTML | oos | 1,101 |
{template header}
<!--main-->
<div class="midder">
<div class="mc">
<h1>我的发件箱</h1>
<div class="cleft">
{template menu}
<div class="clear"></div>
<div class="notification-items">
<ul class="old">
<li class="date">8月22日</li>
<li id="n-323808353"></li>
<li id="n-323760940">
<a href="http://www.douban.com/group/pubanimals/">北京夜店族BeijingPub小组</a>的管理员通过了你的请求,你现在加入了该小组并可以发言了。
</li>
<li class="date">8月16日</li>
<li id="n-321262705">
<a href="http://www.douban.com/group/197226/">不靠谱的勾搭小组小组</a>的管理员通过了你的请求,你现在加入了该小组并可以发言了。
</li>
</ul>
</div>
</div>
<div class="cright">
<p class="pl2">> <a href="http://www.douban.com/doumail/choose">给我关注的人写信</a></p>
<p class="pl2">> <a href="http://www.douban.com/contacts/list">去我关注的人列表</a></p>
<p class="pl2">> <a href="http://www.douban.com/people/charm_888/black_list">管理黑名单</a></p>
</div>
</div>
</div>
{template footer} | 12ik | trunk/app/message/html/notification.html | HTML | oos | 1,469 |
<div class="sendbox">
<p>和<span style="color:#0066cc;">{$strTouser[username]}</span>进行及时消息通话中</p>
<p><textarea id="boxcontent"></textarea> </p>
<p>
<span id="sendbutton" style="display:block;"><a href="javascript:void('0');" onclick="window.parent.sendmsg('{$IK_USER[user][userid]}','{$strTouser[userid]}');">发送</a></span>
<span id="loading" style="display:none;">消息送达中<img src="{SITE_URL}app/{$app}/skins/{$skin}/loading.gif" alt="Loading..." /></span>
</p>
</div> | 12ik | trunk/app/message/html/sendbox.html | HTML | oos | 506 |
<p class="pl2">> <a href="{SITE_URL}{tsUrl('message','ikmail',array('ts'=>'choose'))}">给我关注的人写信</a></p>
<p class="pl2">> <a href="{SITE_URL}{tsUrl('user','follow',array('userid'=>$userid))}">去我关注的人列表</a></p>
<!--<p class="pl2">> <a href="{SITE_URL}{tsUrl('message','choose',array('ts'=>'choose'))}">管理黑名单</a></p>--> | 12ik | trunk/app/message/html/rightmenu.html | HTML | oos | 368 |
{php include pubTemplate("header");} | 12ik | trunk/app/message/html/header.html | HTML | oos | 36 |
<div class="msgbox">
<ul>
<!--{loop $arrMessage $key $item}-->
<li <!--{if $item[userid] == $IK_USER[user][userid]}-->class="mysend"<!--{/if}-->>
<!--{if $item[userid]==$IK_USER[user][userid]}--><span style="color:#006efe;">{$item[user][username]} {php echo date('Y-m-d H:i:s',$item[addtime])}</span><!--{else}--><span style="color:#42b475;">{$item[user][username]} {php echo date('Y-m-d H:i:s',$item[addtime])}</span>{/if}
<br />
{$item[content]}
</li>
<!--{/loop}-->
</ul>
</div> | 12ik | trunk/app/message/html/msgbox.html | HTML | oos | 491 |
<div class="tabnav">
<ul>
<!--
<li {if $ts=="notification"} class="select" {/if} >
<a href="{SITE_URL}{tsUrl('message','ikmail',array(ts=>notification))}">提醒</a>
</li>
-->
<li <!--{if $ts=="outbox"}-->class="select"<!--{/if}--> ><a href="{SITE_URL}{tsUrl('message','ikmail',array(ts=>outbox))}">发件箱</a></li>
<li <!--{if $ts=="inbox" || $ts=="spam" || $ts=="unread"}-->class="select"<!--{/if}--> ><a href="{SITE_URL}{tsUrl('message','ikmail',array(ts=>inbox))}">收件箱</a></li>
</ul>
</div> | 12ik | trunk/app/message/html/menu.html | HTML | oos | 520 |
<div class="msgbox">
<ul>
<!--{loop $arrMessage $key $item}-->
<li>
<span style="color:#42b475;">{$item[user][username]} {php echo date('H:i:s',$item[addtime])}</span>
<br />
{$item[content]}
</li>
<!--{/loop}-->
</ul>
</div> | 12ik | trunk/app/message/html/systembox.html | HTML | oos | 225 |
{php include pubTemplate("footer");} | 12ik | trunk/app/message/html/footer.html | HTML | oos | 36 |
{template header}
<!--main-->
<div class="midder">
<div><a href="{SITE_URL}index.php?app=message&ac=my"><img src="{SITE_URL}app/{$app}/skins/{$skin}/imbox.gif" alt="消息盒子" /></a></div>
<div class="imbox">
<table width="100%">
<tr>
<td valign="top">
<div id="msgbox" style="background:#fafbfb; height:250px; overflow:auto">
</div>
<div id="sendbox"></div>
</td>
<td valign="top" width="200" style="background:#eaf5f9;">
<div class="leftbar" style="max-height:400px; overflow:auto">
<div class="bartitle">系统消息</div>
<ul>
<li><a href="javascript:void(0);" onclick="systembox('{$IK_USER[user][userid]}');"><img src="{SITE_URL}app/{$app}/skins/{$skin}/system.gif" align="absmiddle" />系统消息</a>
<!--{if $systemNum > '0'}-->({$systemNum})<!--{/if}--></li>
</ul>
<div class="bartitle">好友消息</div>
<ul>
<!--{loop $arrToUser $key $item}-->
<li>
<a href="javascript:void(0);" onclick="sendbox('{$item[userid]}');"><img alt="{$item[user][username]}" class="m_sub_img" width="16" src="{$item[user][face]}" align="absmiddle" /> {$item[user][username]} </a><!--{if $item[count] > 0}-->({$item[count]})<!--{/if}-->
</li>
<!--{/loop}-->
</ul>
</div> </td>
</tr>
</table>
</div>
</div>
{template footer} | 12ik | trunk/app/message/html/my.html | HTML | oos | 1,300 |
{template header}
<!--main-->
<div class="midder">
<div class="mc">
<h1>{$title}</h1>
<div class="cleft">
<table width="100%" cellpadding="0" cellspacing="0" class="showtable">
<tr>
<td width="75" valign="top">
{if $touser[userid]}
<a href="{SITE_URL}{tsUrl('hi','',array('id'=>$touser[doname]))}" class="nbg">
<img alt="{$touser[username]}" style="padding:5px;" src="{$touser[face]}">
</a>
{else}
<img alt="{$touser[username]}" style="padding:5px;" src="{$touser[face]}">
{/if}
</td>
<td valign="top">
<div class="pl2">{$strUserinfo}</div>
<div class="pl2">时间: {$arrMessages[addtime]}</div>
<div class="ul"><span class="pl2">话题: </span><span class="m">{$arrMessages[title]}</span></div>
<div class="messagebox">
{php echo nl2br($arrMessages[content])}
</div>
{if $type == 'inbox'}
{if $arrMessages[userid]!=0}
<a class="submit" title="回信" href="{SITE_URL}{tsUrl('user','message',array('ts'=>'message_add','touserid'=>$touser[userid]))}">回信</a>
{/if}
<a class="gray-submit" onclick="return confirm('真的要删除消息吗?')" title="删除" href="{SITE_URL}{tsUrl('message','do',array('ts'=>'del','type'=>'inbox','messageid'=>$messageid))}">删除</a>
{/if}
{if $type == 'outbox'}
<a class="gray-submit" onclick="return confirm('真的要删除消息吗?')" title="删除" href="{SITE_URL}{tsUrl('message','do',array('ts'=>'del','type'=>'outbox','messageid'=>$messageid))}">删除</a>
{/if}
</td>
</tr>
</table>
</div>
<div class="cright">
{if $type == 'inbox'}
<p class="pl2">> <a href="{SITE_URL}{tsUrl('message','ikmail',array('ts'=>'inbox'))}">返回到我的收件箱</a></p>
<p class="pl2">> <a href="{SITE_URL}{tsUrl('hi','',array('id'=>$touser[doname]))}">去{$touser[username]}的主页看看</a></p>
{/if}
{if $type == 'outbox'}
<p class="pl2">> <a href="{SITE_URL}{tsUrl('message','ikmail',array('ts'=>'outbox'))}">回我的发件箱</a></p>
<p class="pl2">> <a href="{SITE_URL}{tsUrl('message','ikmail',array('ts'=>'inbox'))}">去我的收件箱</a></p><br/>
<p class="pl2">> <a href="{SITE_URL}{tsUrl('hi','',array('id'=>$touser[doname]))}">去{$touser[username]}的主页看看</a></p>
{/if}
</div>
</div>
</div>
{template footer} | 12ik | trunk/app/message/html/show.html | HTML | oos | 2,695 |
{template header}
<!--main-->
<div class="midder">
<div class="mc">
<h1>我的发件箱</h1>
<div class="cleft">
{template menu}
<div class="clear"></div>
<form method="post" onSubmit="return isConfirmed" action="{SITE_URL}{tsUrl('message','do',array('ts'=>'all'))}"> <table class="olt">
<tbody>
<tr>
<td class="pl" style="width:112px;"><span class="doumail_from">送往</span></td>
<td width="20"></td>
<td class="pl">话题</td>
<td class="pl" style="width:110px;">时间</td>
<td class="pl" style="width:40px;" align="center">选择</td>
<td class="pl" style="width:120px;visibility:hidden;border-bottom:none" align="center">mail_options</td>
</tr>
<!--{loop $arrMessage $key $item}-->
<tr>
<td><span class="doumail_from">{$item[touser][username]}</span></td>
<td class="m" align="center">></td>
<td><a href="{SITE_URL}{tsUrl('message','show',array('messageid'=>$item[messageid]))}">{$item[title]}</a></td>
<td>{$item[addtime]}</td>
<td align="center"><input name="messageid[]" value="{$item[messageid]}" type="checkbox"></td>
<td style="display: none;" class="mail_options">
<a onClick="return confirm('真的要删除消息吗?')" class="post_link" href="{SITE_URL}{tsUrl('message','do',array('ts'=>'del','type'=>'outbox','messageid'=>$item[messageid]))}">删除</a>
</td>
</tr>
<!--{/loop}-->
<tr>
<td colspan="4" align="right">
<input name="type" value="outbox" type="hidden">
<input name="mc_submit" value="删除" data-confirm="真的要删除短消息吗?" type="submit">
</td>
<td align="center"><input name="checkAll" value="checkAll" onclick="ToggleCheck(this);" type="checkbox"></td>
</tr>
</tbody>
</table>
</form>
</div>
<div class="cright">
{template rightmenu}
</div>
</div>
</div>
{template footer} | 12ik | trunk/app/message/html/outbox.html | HTML | oos | 2,401 |
<?php
defined('IN_IK') or die('Access Denied.');
return array (
'name' => '站内信',
'version' => '1.0',
'desc' => '站内消息',
'url' => 'http://www.12ik.com',
'email' => '160780470@qq.com',
'author' => '小麦',
'author_url' => 'http://www.12ik.com',
'isoption' => '0',
'isinstall' => '1',
'issql' => '1',
'issystem' => '1',
'isappnav' => '0',
);
?> | 12ik | trunk/app/message/about.php | PHP | oos | 395 |
/**框架CSS**/
.tabnav{ margin-bottom:21px}
.tabnav ul{ float:right}
#db-timeline-hd {
border-bottom:1px solid #ddd;
margin-bottom:5px;
height:28px;
}
#db-timeline-hd .menu-list {
float:left;
width:515px;
padding-top:3px
}
#db-timeline-hd .menu-list li {
float:left;
display:inline;
_position:relative;
_z-index:88;
margin:0 10px 0 0
}
#db-timeline-hd .menu-list li a {
_float:left;
zoom:1;
display:block;
padding:1px 5px;
white-space:nowrap;
_overflow:hidden;
height:16px;
line-height:16px
}
#db-timeline-hd .menu-list .on a {
color:#fff;
background:#83bf73;
border-radius:3px;
-webkit-border-radius:3px;
-moz-border-radius:3px
}
#db-timeline-hd .opt-area {
float:right
}
#db-timeline-hd .last {
margin:0
}
.olt {
width:760px;
padding:0;
margin-bottom:3px;
}
.olt td {
border-bottom:1px dashed #ddd;
padding:3px 3px 3px 0;
word-wrap:break-word;
word-break:break-word
}
.olt td.date {
width:75px;
text-align:center;
color:#999;
padding-right:0
}
.olt .tb-author {
min-width:6em
}
.m {
color: #006600;
font-size: 14px;
line-height: 120%;
}
table { table-layout:fixed; }
td { word-break:break-all;word-wrap:break-word; }
td.mail_options { display:none;border-bottom:none; }
.mail_options a:hover,
.mail_options a { background-color:#fff;color:#aaa;border:none; }
.sys_doumail {
background:url(system_9px.gif) no-repeat 0 center;
padding-left:12px
}
.sys_doumail_big {
background:url(system_16px.gif) no-repeat 0 center;
padding:20px
}
.doumail_from {
padding-left:12px
}
.notification-items ul.old {
color:#808080
}
.notification-items li {
padding:6px 10px 4px
}
.notification-items li.date {
font-size:14px;
color:#060;
padding-left:0
}
.notification-items ul.new li {
background:#ffe
}
.notification-items ul.new li.date {
background:0
}
.notification-items a.discard {
float:right;
color:#ccc;
padding:0 6px
}
.notification-items a:hover, .notification-items a:active {
color:#fff;
background:#ccc
}
.notification-items q {
display:block;
text-indent:3.3em
}
.notification-items .old q em {
color:#aaa
}
.notification-items q em {
color:#808080
}
.indent {
word-break:break-all
}
.obu {
margin:0 0 10px 0;
width:76px;
float:left;
display:inline
}
.obu dt {
margin:0;
height:50px;
overflow:hidden;
text-align:center;
line-height:16px
}
.obu dd {
margin:0;
height:55px;
text-align:center;
overflow:hidden
}
.showtable{}
.showtable .pl2{ line-height:24px;}
.showtable .ul{
clear: both;
line-height: 100%;
margin-top:10px;
}
.showtable .messagebox{ padding:10px; border-bottom: 1px dashed #DDDDDD; border-top: 1px dashed #DDDDDD; margin-bottom:10px} | 12ik | trunk/app/message/skins/default/style.css | CSS | oos | 2,794 |
<?php
defined('IN_IK') or die('Access Denied.');
/*
*包含数据库配置文件
*/
require_once IKDATA."/config.inc.php";
$skin = 'default';
//APP配置
$IK_APP['options']['appname'] = '消息中心'; | 12ik | trunk/app/message/config.php | PHP | oos | 224 |
//发送盒子
/**
function sendbox(userid){
$("#msgbox").html("加载消息中......")
$("#sendbox").html("加载输入框中......")
$.ajax({
type: "GET",
url: siteUrl+"index.php?app=message&ac=msgbox&userid="+userid,
success: function(msg){
$('#msgbox').html(msg);
var msgbox=document.getElementById('msgbox');
if(msgbox.scrollHeight>msgbox.offsetHeight) msgbox.scrollTop=msgbox.scrollHeight-msgbox.offsetHeight+20;
}
});
$.ajax({
type: "GET",
url: siteUrl+"index.php?app=message&ac=sendbox&userid="+userid,
success: function(msg){
$('#sendbox').html(msg);
}
});
}
//发送消息
function sendmsg(userid,touserid){
var content = $("#boxcontent").val();
if(content == ''){
alert("请输入你要发送的内容!");return false;
}
//清空内容
$("#boxcontent").attr("value",'');
$("#sendbutton").css('display','none');
$("#loading").css('display','block');
$.ajax({
type: "POST",
url: siteUrl+"index.php?app=message&ac=sendmsg",
data: "userid="+userid+"&touserid="+touserid+"&content="+content,
beforeSend: function(){},
success: function(result){
if(result == '1'){
$.ajax({
type: "GET",
url: siteUrl+"index.php?app=message&ac=msgbox&userid="+touserid,
success: function(msg){
$('#msgbox').html(msg);
var msgbox=document.getElementById('msgbox');
if(msgbox.scrollHeight>msgbox.offsetHeight) msgbox.scrollTop=msgbox.scrollHeight-msgbox.offsetHeight+20;
$("#loading").css('display','none');
$("#sendbutton").css('display','block');
}
});
}
}
});
}
//系统消息盒子
function systembox(userid){
$("#sendbox").html("");
$("#msgbox").html("加载系统消息中......")
$.ajax({
type: "GET",
url: siteUrl+"index.php?app=message&ac=systembox&userid="+userid,
success: function(msg){
$('#msgbox').html(msg);
var msgbox=document.getElementById('msgbox');
if(msgbox.scrollHeight>msgbox.offsetHeight) msgbox.scrollTop=msgbox.scrollHeight-msgbox.offsetHeight+20;
}
});
}
**/
//****************新增2012-11-5*****************
//邮件收件箱
var isConfirmed = false;
$(function(){
$(".olt tr").bind('mouseenter mouseleave', function (e) {
switch (e.type) {
case "mouseenter":
$(this).find(".mail_options").show();
break;
case "mouseleave":
$(this).find(".mail_options").hide();
break;
}
});
$('input[name="mc_submit"]').bind('click', function() {
var num_checked = $('input[type=checkbox]:checked').length;
if (num_checked > 0) {
if($(this).val()=='删除')
{
isConfirmed = confirm($(this).attr('data-confirm'));
}else{
isConfirmed = true;
}
}
else {
isConfirmed = false;
}
});
});
function ToggleCheck(source)
{
$('input[type=checkbox]').each(function(){this.checked=source.checked;});
}
| 12ik | trunk/app/message/js/extend.func.js | JavaScript | oos | 3,105 |
<?php
defined ( 'IN_IK' ) or die ( 'Access Denied.' );
//小组首页
/*
if ($IK_USER ['user'] == '') {
//推荐小组列表
$arrRecommendGroups = aac ( 'group' )->getRecommendGroup ( '12' );
foreach ( $arrRecommendGroups as $key => $item ) {
$arrRecommendGroup [] = $item;
$arrRecommendGroup [$key] ['groupdesc'] = getsubstrutf8 ( t ( $item ['groupdesc'] ), 0, 35 );
}
//最新10个小组
$arrNewGroup = aac ( 'group' )->getNewGroup ( '10' );
//最新发表日志
$arrNewNote = aac('note')->getNewNote('10');
//热门10个热门话题
$arrHotTopics = aac('group')->findAll('group_topics',null,'count_comment desc','userid,topicid,title,content,count_comment,
count_view,addtime,uptime',10);
if( is_array($arrHotTopics)){
foreach($arrHotTopics as $key=>$item){
$arrHotTopic[] = $item;
//$arrHotTopic[$key]['typename'] = $arrTopicType[$item['typeid']]['typename'];
$arrHotTopic[$key]['user'] = aac('user')->getOneUser($item['userid']);
//$arrHotTopic[$key]['group'] = aac('group')->getOneGroup($item['groupid']);
$arrHotTopic[$key]['content'] = getsubstrutf8(t($item['content']),0,50);
}
}
//活跃会员
$arrHotUser = aac('user')->getHotUser(16);
//获取用户数
$count_user = aac('user')->getUsers();
} else {
header ( "Location: " . SITE_URL . tsUrl ( 'group' ) );
}
*/
//获取全部用户相册图片
$user = $IK_USER ['user'];
$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
$lstart = $page*10-10;
$url = SITE_URL.'index.php?app=photo&ac=admin&mg=photo&ts=list&page=';
$arrPhoto = $db->fetch_all_assoc("select * from ".dbprefix."photo order by addtime desc limit $lstart,15");
$photoNum = $db->once_fetch_assoc("select count(*) from ".dbprefix."photo");
$photoNum = $photoNum['count(*)'];
$title = $IK_SITE ['base'] ['site_subtitle'];
include template ( "index" ); | 12ik | trunk/app/home/action/index.php | PHP | oos | 1,920 |
<?php
defined('IN_IK') or die('Access Denied.');
$strInfo = $db->once_fetch_assoc("select * from ".dbprefix."home_info where `infokey`='$ac'");
$title = '联系我们';
include template('contact'); | 12ik | trunk/app/home/action/contact.php | PHP | oos | 202 |
<?php
switch($ts){
case "about":
$strInfo = $db->once_fetch_assoc("select * from ".dbprefix."home_info where `infokey`='about'");
include template('admin/info_about');
break;
case "about_do":
$infocontent = $_POST['infocontent'];
$db->query("update ".dbprefix."home_info set `infocontent`='$infocontent' where `infokey`='about'");
qiMsg("修改成功!");
break;
case "contact":
$strInfo = $db->once_fetch_assoc("select * from ".dbprefix."home_info where `infokey`='contact'");
include template('admin/info_contact');
break;
case "contact_do":
$infocontent = $_POST['infocontent'];
$db->query("update ".dbprefix."home_info set `infocontent`='$infocontent' where `infokey`='contact'");
qiMsg("修改成功!");
break;
case "agreement":
$strInfo = $db->once_fetch_assoc("select * from ".dbprefix."home_info where `infokey`='agreement'");
include template('admin/info_agreement');
break;
case "agreement_do":
$infocontent = $_POST['infocontent'];
$db->query("update ".dbprefix."home_info set `infocontent`='$infocontent' where `infokey`='agreement'");
qiMsg("修改成功!");
break;
case "privacy":
$strInfo = $db->once_fetch_assoc("select * from ".dbprefix."home_info where `infokey`='privacy'");
include template('admin/info_privacy');
break;
case "privacy_do":
$infocontent = $_POST['infocontent'];
$db->query("update ".dbprefix."home_info set `infocontent`='$infocontent' where `infokey`='privacy'");
qiMsg("修改成功!");
break;
} | 12ik | trunk/app/home/action/admin/info.php | PHP | oos | 1,576 |
<?php
defined('IN_IK') or die('Access Denied.');
/*
* 配置选项
*/
switch($ts){
//基本配置
case "":
include template("admin/options");
break;
} | 12ik | trunk/app/home/action/admin/options.php | PHP | oos | 180 |
<?php
defined('IN_IK') or die('Access Denied.');
$strInfo = $db->once_fetch_assoc("select * from ".dbprefix."home_info where `infokey`='$ac'");
$title = '用户协议';
include template('agreement'); | 12ik | trunk/app/home/action/agreement.php | PHP | oos | 204 |
<?php
//插件条件入口
defined('IN_IK') or die('Access Denied.');
if(is_file('plugins/'.$app.'/'.$plugin.'/'.$in.'.php')){
require_once('plugins/'.$app.'/'.$plugin.'/'.$in.'.php');
}else{
qiMsg('sorry:no plugin!');
} | 12ik | trunk/app/home/action/plugin.php | PHP | oos | 231 |
<?php
defined('IN_IK') or die('Access Denied.');
$strInfo = $db->once_fetch_assoc("select * from ".dbprefix."home_info where `infokey`='$ac'");
$title = '关于我们';
include template('about'); | 12ik | trunk/app/home/action/about.php | PHP | oos | 202 |
<?php
defined('IN_IK') or die('Access Denied.');
switch($ts){
case "":
$title = '更换主题';
$arrTheme = tsScanDir('theme');
include template("theme");
break;
//执行
case "do":
$theme = $_POST['site_theme'];
setcookie("ik_theme", $theme, time()+3600*30,'/');
qiMsg("主题更换成功!");
break;
} | 12ik | trunk/app/home/action/theme.php | PHP | oos | 364 |
<?php
defined('IN_IK') or die('Access Denied.');
$strInfo = $db->once_fetch_assoc("select * from ".dbprefix."home_info where `infokey`='$ac'");
$title = '隐私声明';
include template('privacy'); | 12ik | trunk/app/home/action/privacy.php | PHP | oos | 202 |
<?php
defined('IN_IK') or die('Access Denied.');
//管理入口
if(is_file('app/'.$app.'/action/admin/'.$mg.'.php')){
include_once 'app/'.$app.'/action/admin/'.$mg.'.php';
}else{
qiMsg('sorry:no index!');
} | 12ik | trunk/app/home/action/admin.php | PHP | oos | 219 |
<?php
defined ( 'IN_IK' ) or die ( 'Access Denied.' );
$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
$lstart = $page*10-10;
$arrPhoto = $db->fetch_all_assoc("select * from ".dbprefix."photo order by addtime desc limit $lstart,10");
include template ( "homepage" ); | 12ik | trunk/app/home/action/homepage.php | PHP | oos | 293 |
<?php
defined('IN_IK') or die('Access Denied.');
tsNotice('呃哦...你想访问的页面不存在!'); | 12ik | trunk/app/home/action/404.php | PHP | oos | 107 |
<?php
defined('IN_IK') or die('Access Denied.');
$hl = $_GET['hl'];
setcookie("ik_lang", $hl, time()+3600*30,'/');
header("Location: ".SITE_URL.'index.php'); | 12ik | trunk/app/home/action/lang.php | PHP | oos | 166 |
{template header}
<div class="midder">
<div class="mc">
<h1>隐私声明</h1>
<div class="cleft">
<div class="infocontent">
{$strInfo[infocontent]}
</div>
</div>
<div class="cright">
{template menu}
</div>
</div>
</div>
{template footer} | 12ik | trunk/app/home/html/privacy.html | HTML | oos | 240 |
{template header}
<div class="midder">
<div class="mc">
<h1>用户条款</h1>
<div class="cleft">
<div class="infocontent">{$strInfo[infocontent]}</div>
</div>
<div class="cright">{template menu}</div>
</div>
</div>
{template footer}
| 12ik | trunk/app/home/html/agreement.html | HTML | oos | 237 |
{php include template("admin/header");}
<!--main-->
<div class="midder">
{php include template("admin/menu");}
<form method="POST" action="{SITE_URL}index.php?app=home&ac=admin&mg=info&ts=contact_do">
<table cellpadding="0" cellspacing="0">
<tr><td>联系我们</td></tr>
<tr><td><textarea style="width:600px;height:300px" name="infocontent" class="uinput">{$strInfo[infocontent]}</textarea></td></tr>
<tr><td>
<input type="hidden" name="infokey" value="contact" />
<input type="submit" value="提 交" class="submit" /></td></tr>
</table>
</form>
</div>
{php include template("admin/footer");} | 12ik | trunk/app/home/html/admin/info_contact.html | HTML | oos | 617 |
{php include template("admin/header");}
<!--main-->
<div class="midder">
{php include template("admin/menu");}
<form method="POST" action="{SITE_URL}index.php?app=home&ac=admin&mg=info&ts=privacy_do">
<table cellpadding="0" cellspacing="0">
<tr><td>隐私声明</td></tr>
<tr><td><textarea style="width:600px;height:300px" name="infocontent" class="uinput">{$strInfo[infocontent]}</textarea></td></tr>
<tr><td>
<input type="hidden" name="infokey" value="privacy" />
<input type="submit" value="提 交" class="submit"/></td></tr>
</table>
</form>
</div>
{php include template("admin/footer");} | 12ik | trunk/app/home/html/admin/info_privacy.html | HTML | oos | 617 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="160780470@qq.com" />
<meta name="Copyright" content="{$IK_SOFT[info][copyright]" />
<title></title>
<link type="text/css" rel="stylesheet" href="{$IK_APP[system][skin]}default/style.css" id="skin" />
<!--公用的JS-->
<script src="{SITE_URL}public/js/jquery.js" type="text/javascript"></script>
<script>
var siteUrl = '{SITE_URL}';
</script>
<script src="{SITE_URL}app/{$app}/js/admin.js" type="text/javascript"></script>
</head>
<body>
<!--header--> | 12ik | trunk/app/home/html/admin/header.html | HTML | oos | 743 |
{php include template("admin/header");}
<!--main-->
<div class="midder">
{php include template("admin/menu");}
<form method="POST" action="{SITE_URL}index.php?app=home&ac=admin&mg=info&ts=about_do">
<table cellpadding="0" cellspacing="0">
<tr><td>关于我们</td></tr>
<tr><td><textarea style="width:600px;height:300px" name="infocontent" class="uinput">{$strInfo[infocontent]}</textarea></td></tr>
<tr><td>
<input type="hidden" name="infokey" value="about" class="uinput" />
<input type="submit" value="提 交" class="submit"/></td></tr>
</table>
</form>
</div>
{php include template("admin/footer");} | 12ik | trunk/app/home/html/admin/info_about.html | HTML | oos | 628 |
{php include template("admin/header");}
<!--main-->
<div class="midder">
{php include template("admin/menu");}
<div>暂无配置</div>
</div>
{php include template("admin/footer");} | 12ik | trunk/app/home/html/admin/options.html | HTML | oos | 185 |
{php include template("admin/header");}
<!--main-->
<div class="midder">
{php include template("admin/menu");}
<form method="POST" action="{SITE_URL}index.php?app=home&ac=admin&mg=info&ts=agreement_do">
<table cellpadding="0" cellspacing="0">
<tr><td>用户协议</td></tr>
<tr><td><textarea style="width:600px;height:300px" name="infocontent">{$strInfo[infocontent]}</textarea></td></tr>
<tr><td>
<input type="hidden" name="infokey" value="agreement" class="uinput" />
<input type="submit" value="提 交" class="submit" /></td></tr>
</table>
</form>
</div>
{php include template("admin/footer");} | 12ik | trunk/app/home/html/admin/info_agreement.html | HTML | oos | 621 |
<h2>首页管理</h2>
<div class="tabnav">
<ul>
<li {if $mg=='options'} class="select" {/if} ><a href="{SITE_URL}index.php?app=home&ac=admin&mg=options">首页配置</a></li>
<li {if $mg=='info' && $ts=='about'} class="select" {/if} ><a href="{SITE_URL}index.php?app=home&ac=admin&mg=info&ts=about">关于我们</a></li>
<li {if $mg=='info' && $ts=='contact'} class="select" {/if} ><a href="{SITE_URL}index.php?app=home&ac=admin&mg=info&ts=contact">联系我们</a></li>
<li {if $mg=='info' && $ts=='agreement'} class="select" {/if} ><a href="{SITE_URL}index.php?app=home&ac=admin&mg=info&ts=agreement">用户条款</a></li>
<li {if $mg=='info' && $ts=='privacy'} class="select" {/if}><a href="{SITE_URL}index.php?app=home&ac=admin&mg=info&ts=privacy">隐私声明</a></li>
</ul>
</div> | 12ik | trunk/app/home/html/admin/menu.html | HTML | oos | 806 |
<!--footer-->
</body>
</html> | 12ik | trunk/app/home/html/admin/footer.html | HTML | oos | 29 |
{template header}
<div class="midder">
<div class="mc">
<h1>更换主题</h1>
<div>
<form method="POST" action="{SITE_URL}{tsUrl('home','theme',array('ts'=>'do'))}">
<ul>
<!--{loop $arrTheme $key $item}-->
<li class="fl" style="padding:5px;">
<img src="{SITE_URL}theme/{$item}/preview.gif">
<br />
<input type="radio" {if $site_theme==$item} checked="select" {/if} name="site_theme" value="{$item}" /> {$item}
</li>
<!--{/loop}-->
</ul>
<div class="clear"></div>
<input class="submit" type="submit" value="更换" />
</form>
</div>
</div>
</div>
{template footer} | 12ik | trunk/app/home/html/theme.html | HTML | oos | 597 |
{php include pubTemplate("header");}
| 12ik | trunk/app/home/html/header.html | HTML | oos | 38 |
{template header}
<div class="midder">
{if $user==''}
<div class="anony-nav">
<div class="bd">
<div class="reg">
<strong>爱客社区</strong>
<div>
<b>12ik创新社区新体验,内容互动性强,交流更方便</b><br><em>简单</em><em>快捷</em><em>方便</em><em>建设本地化,垂直型社区;目前已有<cite>{$count_user}</cite>位用户加入!</em>
</div>
<a class="submit" href="{SITE_URL}{tsUrl('user','register')}">加入我们</a>
</div>
<div class="login">
<form action="{SITE_URL}{tsUrl('user','login',array('ts'=>'do'))}" method="post" name="lzform" id="lzform">
<fieldset>
<legend>登录</legend>
<div class="item">
<label>Email:</label><input type="email" tabindex="1" value="" name="email" class="txt">
</div>
<div class="item">
<label>密码:</label><input type="password" tabindex="2" class="txt" name="pwd" > <a href="{SITE_URL}index.php?app=user&ac=forgetpwd">忘记密码?</a>
</div>
<div class="item1">
<label for="form_remember"><input type="checkbox" tabindex="3" id="form_remember" name="remember"> 记住我</label>
</div>
<div class="item1">
<input type="hidden" name="cktime" value="2592000" />
<input type="submit" tabindex="4" class="submit" value="登录" style="margin-left:10px">
{php doAction('pub_header_login')}
</div>
</fieldset>
</form>
</div>
</div>
</div>
{/if}
<div class="mc">
<div id="content" class="cf">
<div class="joykumodel">
<h2>
<strong>这里正在流行...</strong>
<em>[ 共 {$photoNum} 张美图 ]</em>
</h2>
<div id="container">
<!--{loop $arrPhoto $key $item}-->
<div class="item"><a href="{SITE_URL}{tsUrl('photo','album',array(ts=>photo,albumid=>$item[albumid]))}" target="_blank"><img src="{SITE_URL}{php echo tsXimg($item[photourl],'photo',210,0,$item[path])}" /></a></div>
<!--{/loop}-->
</div>
<nav id="page-nav">
<a href="{SITE_URL}{tsUrl('home','homepage',array('page'=>'2'))}"></a>
</nav>
</div>
</div>
</div>
</div>
{template footer} | 12ik | trunk/app/home/html/index.html | HTML | oos | 2,169 |
{template header}
<div class="midder">
<div class="mc">
<h1>关于我们</h1>
<div class="cleft">
<div class="infocontent">{$strInfo[infocontent]}</div>
</div>
<div class="cright">{template menu}</div>
</div>
</div>
{template footer}
| 12ik | trunk/app/home/html/about.html | HTML | oos | 251 |
<div id="container">
<!--{loop $arrPhoto $key $item}-->
<div class="item"><a href="{SITE_URL}{tsUrl('photo','album',array(ts=>photo,albumid=>$item[albumid]))}" target="_blank"><img src="{SITE_URL}{php echo tsXimg($item[photourl],'photo',210,0,$item[path])}" /></a></div>
<!--{/loop}-->
</div> | 12ik | trunk/app/home/html/homepage.html | HTML | oos | 323 |
<div class="infomenu">
<ul>
<li><a {if $ac=='about'} class="select" {/if} href="{SITE_URL}{tsUrl('home','about')}">关于我们</a></li>
<li><a {if $ac=='contact'} class="select" {/if} href="{SITE_URL}{tsUrl('home','contact')}">联系我们</a></li>
<li><a {if $ac=='agreement'} class="select" {/if} href="{SITE_URL}{tsUrl('home','agreement')}">用户协议</a></li>
<li><a {if $ac=='privacy'} class="select" {/if} href="{SITE_URL}{tsUrl('home','privacy')}">隐私声明</a></li>
</ul>
</div> | 12ik | trunk/app/home/html/menu.html | HTML | oos | 503 |
{php doAction('body_foot')} {php include pubTemplate("footer");}
| 12ik | trunk/app/home/html/footer.html | HTML | oos | 65 |
{template header}
<div class="midder">
<div class="mc">
<h1>联系我们</h1>
<div class="cleft">
<div class="infocontent">{$strInfo[infocontent]}</div>
</div>
<div class="cright">{template menu}</div>
</div>
</div>
{template footer}
| 12ik | trunk/app/home/html/contact.html | HTML | oos | 237 |
<?php
defined ( 'IN_IK' ) or die ( 'Access Denied.' );
return array ('name' => '首页', 'version' => '1.0', 'desc' => '首页', 'url' => 'http://www.12ik.com', 'email' => '160780470@qq.com', 'author' => '小麦', 'author_url' => 'http://www.12ik.com', 'isoption' => '1', 'isinstall' => '1', 'issql' => '1', 'issystem' => '1', 'isappnav' => '1' ); | 12ik | trunk/app/home/about.php | PHP | oos | 349 |
/*index*/
.inserch {
border: 1px solid #C3C3C3;
height: 24px;
line-height: 24px;
width: 140px
}
.anony-nav {
overflow: hidden;
background: #E9EEF2;
margin-bottom: 10px;
border-radius: 5px;
}
.anony-nav .reg {
background: #E9EEF2;
color: #666666;
float: left;
font-size: 14px;
line-height: 1.6;
width: 590px;
}
.anony-nav .reg strong {
float: left;
font-size: 24px;
height: 80px;
padding-top: 46px;
text-align: center;
width: 200px;
}
.anony-nav .reg div {
padding: 45px 0 18px;
}
.anony-nav .reg b {
font-size: 16px;
font-weight: 400;
margin-right: 5px;
}
a.lnk-reg:link,a.lnk-reg:visited,a.lnk-reg:hover,a.lnk-reg:active {
background: url("ui_nav_logo_4.png") no-repeat scroll -120px -48px
transparent;
color: #FFFFFF;
display: inline-block;
font-size: 12px;
height: 27px;
line-height: 28px;
text-align: left;
width: 130px;
}
.anony-nav .reg em {
color: #666666;
font-size: 12px;
font-style: normal;
}
.anony-nav .reg strong {
float: left;
font-size: 24px;
height: 80px;
padding-top: 55px;
text-align: center;
width: 200px;
}
.anony-nav .reg .lnk-reg strong {
color: #FFFFFF;
float: none;
font-size: 16px;
font-weight: 400;
margin: 0 10px 0 16px;
padding: 0;
}
.anony-nav .login {
background: #E9EEF2;
float: right;
font-size: 14px;
width: 380px;
border-left: #fff solid 5px
}
.anony-nav .login form {
padding: 23px 0 0 20px;
position: relative;
}
.anony-nav legend {
display: none;
}
.anony-nav fieldset {
border: 0 none;
margin: 0;
padding: 0;
margin-bottom: 15px;
}
fieldset legend {
color: #666666;
padding: 0 5px;
}
.anony-nav .login .item {
margin-bottom: 10px;
line-height: 32px;
}
.anony-nav .item label {
width: 4em;
float: left;
text-align: right;
}
label {
font-family: Tahoma;
vertical-align: middle;
}
.anony-nav .item input {
padding: 3px 2px;
width: 200px;
}
.anony-nav .login .item a {
font-size: 12px;
}
.anony-nav .login .item1 {
color: #666666;
float: left;
font-size: 12px;
margin: 0 2px 10px 0;
}
.anony-nav .login .item1 label {
display: inline-block;
margin-left: 4.5em;
margin-top: 4px;
}
.anony-nav .bn-submit {
background: url("ui_nav_logo_4.png") no-repeat scroll -23px -48px
transparent;
border: medium none;
color: #FFFFFF;
cursor: pointer;
font-size: 14px;
height: 28px;
line-height: 28px;
padding-bottom: 3px;
width: 80px;
}
/*活动*/
.events-list li {
float: left;
height: 140px;
}
.events-list .pic {
float: left;
height: 75px;
overflow: hidden;
width: 75px;
}
.events-list .pic {
margin-right: 10px;
}
.events-list .info {
float: left;
width: 205px;
}
.events-list .title {
line-height: 1.5;
margin-bottom: 5px;
}
.events-list .info a {
font-size: 14px;
}
.events-list .datetime {
margin-bottom: 5px;
}
.events-list address {
color: #666666;
display: block;
font-style: normal;
}
.events-list .followers {
color: #999999;
}
#db-sidesrh {
width: 100%;
}
#db-sidesrh {
float: left;
margin-bottom: 20px;
}
.aside .mod {
margin: 0 0 40px;
}
#db-sidesrh form {
float: right;
width: 100%;
}
#db-sidesrh input {
float: left;
}
#db-sidesrh input {
border: 1px solid #C3C3C3;
height: 24px;
line-height: 24px;
}
#db-sidesrh .inp input {
padding: 0 2px;
vertical-align: baseline;
width: 246px;
}
.hide {
display: none;
}
input,button,textarea,select,optgroup,option {
font-family: inherit;
font-size: inherit;
font-style: inherit;
font-weight: inherit;
}
.submenu {
-moz-border-bottom-colors: none;
-moz-border-image: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
background: none repeat scroll 0 0 #FFFFFF;
border-color: #B6C9C1 #B6C9C1 #B6C9C1 -moz-use-text-color;
border-style: solid solid solid none;
border-width: 1px 1px 1px medium;
float: left;
height: 21px;
margin: 0 2px 0 -5px;
padding: 2px 0 1px;
position: relative;
width: 45px;
}
#db-sidesrh .submenu,#db-sidesrh .submenu .selected,#db-sidesrh .submenu .menu
{
border-color: #C3C3C3;
}
.submenu .selected {
border-left: 1px solid #B6C9C1;
cursor: pointer;
padding: 0 0 0 5px;
}
.submenu .selected span {
background: url("ui_ns_sbg4.png") no-repeat scroll -240px -124px
transparent;
height: 5px;
overflow: hidden;
position: absolute;
right: 4px;
top: 10px;
width: 7px;
}
#db-sidesrh .submenu .selected span {
background-image: url("ui_ns_sbg3.png");
background-position: -450px -124px;
}
.submenu .menu {
background: none repeat scroll 0 0 #FFFFFF;
border: 1px solid #B6C9C1;
position: absolute;
right: -1px;
top: 24px;
width: 85px;
}
#db-sidesrh .submenu .menu {
width: 60px;
}
#db-sidesrh .bn-srh {
background: url("ui_ns_sbg3.png") no-repeat scroll -360px -100px
transparent;
border: medium none;
cursor: pointer;
height: 26px;
letter-spacing: 3px;
margin: 0 0 0 2px;
padding-bottom: 2px;
padding-left: 1px;
width: 50px;
line-height: 24px;
}
/****************/
.subitem {
left: 20px;
position: absolute;
top: 23px;
width: 95%;
}
.sub-item {
border-bottom: 1px dashed #AAAAAA;
float: left;
height: 72px;
margin: 0 2px 15px 0;
overflow: hidden;
width: 49%;
}
.sub-item .pic {
float: left;
display: table-cell;
height: 48px;
padding-right: 1em;
vertical-align: top;
width: 48px;
}
.sub-item .info {
color: #666666;
display: table-cell;
vertical-align: top;
word-wrap: break-word;
}
.sub-item .pic img {
height: 48px;
margin-bottom: -3px;
width: 48px;
}
.sub-item p {
margin: 0;
width: 220px;
}
/*infomenu*/
.infocontent {
font-size: 14px;
line-height: 25px;
}
.infomenu {
overflow: hidden;
}
.infomenu ul {
}
.infomenu ul li {
font-size: 14px;
height: 30px;
line-height: 30px;
}
.infomenu ul li a {
padding: 5px 10px;
}
.infomenu .select {
background: #F0F0F0;
font-weight: bold;
padding: 5px 10px;
}
/**热门话题**/
.topic-list{}
.topic-list dl{ margin-bottom:15px; border-bottom:#aaa dashed 1px; padding-bottom:15px}
.topic-list dl .title{ font-size:12px; }
.topic-list dl .title span{ float:right; }
.topic-list dl .title span a{ color:#fff;background-color:#8096b3;padding:0px 4px; border-radius:3px;}
.topic-list dl .title span a:hover{ background-color:#336699}
.topic-list dl dt{ float:left; width:48px; height:48px; margin-right:1em; display:table-cell; vertical-align:top}
.topic-list dl dd{ display:table-cell; vertical-align:top; width:580px}
.topic-list dl summary{ color:#666}
.topic-list dl p{ margin-top:5px}
/**活跃会员**/
.obu {
display: inline;
margin: 0 0 0px;
width: 76px; float: left;
}
.obu dt {
height: 50px;
line-height: 16px;
margin: 0;
overflow: hidden;
text-align: center;
}
.obu dd {
height: 55px;
margin: 0;
overflow: hidden;
text-align: center;
}
/*****相册******/
.joykumodel{}
.joykumodel h2{ display:block; overflow: hidden;padding-bottom: 5px;}
.joykumodel h2 strong{font-family: '微软雅黑';font-size: 25px;margin-right: 5px; color:#494949}
.joykumodel h2 em{ color:#F39800}
#container{ }
#container .item {width:220px; float: left; margin-left:20px; margin-top:5px}
#container .item img{ border:#fff solid 1px; padding:1px}
#container .item img:hover{ border:#eee solid 1px; padding:1px}
#infscr-loading {
text-align: center;
z-index: 100;
position: fixed;
left: 45%;
bottom: 40px;
width: 200px;
padding: 10px;
background: #000;
opacity: 0.8;
filter:alpha(opacity=80);
color: #fff;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
} | 12ik | trunk/app/home/skins/default/style.css | CSS | oos | 7,938 |
<?php
defined ( 'IN_IK' ) or die ( 'Access Denied.' );
/*
*包含数据库配置文件
*/
require_once IKDATA . "/config.inc.php";
$skin = 'default';
$IK_APP ['options'] ['appname'] = '首页'; | 12ik | trunk/app/home/config.php | PHP | oos | 208 |
<?php
defined ( 'IN_IK' ) or die ( 'Access Denied.' );
class home extends IKApp {
//构造函数
public function __construct($db) {
parent::__construct ( $db );
}
}
| 12ik | trunk/app/home/class.home.php | PHP | oos | 185 |
<?php
defined('IN_IK') or die('Access Denied.');
class user extends IKApp{
//构造函数
public function __construct($db){
parent::__construct($db);
}
//获取最新会员
function getNewUser($num){
$arrNewUserId = $this->db->fetch_all_assoc("select userid from ".dbprefix."user_info order by addtime desc limit $num");
foreach($arrNewUserId as $item){
$arrNewUser[] = $this->getOneUser($item['userid']);
}
return $arrNewUser;
}
//获取活跃会员
function getHotUser($num){
$arrNewUserId = $this->db->fetch_all_assoc("select userid from ".dbprefix."user_info order by uptime desc limit $num");
foreach($arrNewUserId as $item){
$arrHotUser[] = $this->getOneUser($item['userid']);
}
return $arrHotUser;
}
//获取一个用户的信息
function getOneUser($userid){
$strUser = $this->find('user_info',array(
'userid'=>$userid,
));
//头像
if($strUser['face']){
$strUser['face_120'] = SITE_URL.tsXimg($strUser['face'],'user',120,120,$strUser['path']);
$strUser['face_32'] = SITE_URL.tsXimg($strUser['face'],'user',32,32,$strUser['path'],1);
$strUser['face'] = SITE_URL.tsXimg($strUser['face'],'user',48,48,$strUser['path'],1);
/*
$bigFace = tsXimg($strUser['face'],'user',120,120,$strUser['path']);
$strUser['face_120'] = SITE_URL.$bigFace;
$strUser['face_32'] = SITE_URL.tsXimg($strUser['face'],'user',32,32,$strUser['path'],1);
$strUser['face'] = SITE_URL.tsXimg($bigFace,'user',48,48,$strUser['path'],1,array(
'X'=>20, 'Y'=>20,'W'=>60,'H'=>60,'R'=>1
));
*/
}else{
$strUser['face_120'] = SITE_URL.'public/images/user_large.jpg';
$strUser['face_32'] = SITE_URL.'public/images/user_normal.jpg';
$strUser['face'] = SITE_URL.'public/images/user_normal.jpg';
}
//地区
if($strUser['areaid'] > 0){
$strUser['area'] = $this->getOneArea($strUser['areaid']);
}else{
$strUser['area'] = array(
'areaid' => '0',
'areaname' => '火星',
);
}
//签名
$pattern='/(http:\/\/|https:\/\/|ftp:\/\/)([\w:\/\.\?=&-_]+)/is';
$strUser['signed'] = hview(preg_replace($pattern, '<a rel="nofollow" target="_blank" href="\1\2">\1\2</a>', $strUser['signed']));
return $strUser;
}
//用户是否存在
public function isUser($userid){
$isUser = $this->findCount('user',array('userid'=>$userid));
if($isUser == 0){
return false;
}else{
return true;
}
}
//是否登录
public function isLogin(){
$userid = intval($_SESSION['tsuser']['userid']);
if($userid>0){
if($this->isUser($userid)){
return $userid;
}else{
header("Location: ".SITE_URL.tsUrl('user','login',array('ts'=>'out')));
exit;
}
}else{
header("Location: ".SITE_URL.tsUrl('user','login',array('ts'=>'out')));
exit;
}
}
public function getOneArea($areaid){
$strArea = $this->find('area',array('areaid'=>$areaid));
return $strArea;
}
//根据用户积分获取用户角色
public function getRole($score){
$arrRole = fileRead('data/user_role.php');
foreach($arrRole as $key=>$item){
if($score > $item['score_start'] && $score <= $item['score_end'] || $score > $item['score_start'] && $item['score_end']==0 || $score >=0 && $score <= $item['score_end']){
return $item['rolename'];
}
}
}
//统计会员总数
public function getUsers(){
$users = $this->findCount('user');
return $users;
}
//唯一性判断存在doname
public function haveDoname($doname)
{
$donamenum = $this->findCount('user_info',array('doname'=>$doname));
if($donamenum==0)
{
return false;
}else{
return true;
}
}
//析构函数
public function __destruct(){
}
} | 12ik | trunk/app/user/class.user.php | PHP | oos | 3,831 |
<?php
defined('IN_IK') or die('Access Denied.');
//用户是否登录
$userid = aac('user')->isLogin();
$strUser = $new['user']->getOneUser($userid);
if($userid != $strUser['userid']) header("Location: ".SITE_URL."index.php");
switch($ts){
case "base":
$strArea = aac('location')->getAreaForApp($strUser['areaid']);
$title = '基本设置';
include template("set_base");
break;
case "face":
$title = '头像设置';
include template("set_face");
break;
//设置密码
case "pwd":
$title = '密码修改';
include template("set_pwd");
break;
//设置常居地
case "city":
$strArea = aac('location')->getAreaForApp($strUser['areaid']);
//调出省份数据
$arrOne = $db->fetch_all_assoc("select * from ".dbprefix."area where referid='0'");
$title = '常居地修改';
include template("set_city");
break;
//个人标签
case "tag":
$arrTag = aac('tag')->getObjTagByObjid('user','userid',$userid);
$title = '个人标签修改';
include template("set_tag");
break;
//个人域名
case "doname":
$title = '个性域名修改';
include template("set_doname");
break;
} | 12ik | trunk/app/user/action/set.php | PHP | oos | 1,224 |
<?php
defined('IN_IK') or die('Access Denied.');
//用户注册
switch($ts){
case "":
if(intval($IK_USER['user']['userid']) > 0) tsNotice("请退出后再注册!");
//邀请用户ID
$fuserid = intval($_GET['fuserid']);
$title = '注册';
include template("register");
break;
case "do":
$email = trim($_POST['email']);
$pwd = trim($_POST['pwd']);
$repwd = trim($_POST['repwd']);
$username = t($_POST['username']);
$fuserid = intval($_POST['fuserid']);
$authcode = strtoupper($_POST['authcode']);
//是否开启邀请注册
if($IK_SITE['base']['isinvite']=='1'){
$invitecode = trim($_POST['invitecode']);
if($invitecode == '') tsNotice("邀请码不能为空!");
$codeNum = $new['user']->findCount('user_invites',array(
'invitecode'=>$invitecode,
'isused'=>0,
));
if($codeNum == 0) tsNotice("邀请码已经被使用,请更换其他邀请码!");
}
$isEmail = $new['user']->findCount('user',array(
'email'=>$email,
));
$isUserName = $new['user']->findCount('user_info',array(
'username'=>$username,
));
if($email=='' || $pwd=='' || $repwd=='' || $username==''){
tsNotice('所有必选项都不能为空!');
}elseif(valid_email($email) == false){
tsNotice('Email邮箱输入有误!');
}elseif($isEmail > 0){
tsNotice('Email已经注册^_^');
}elseif($pwd != $repwd){
tsNotice('两次输入密码不正确!');
}elseif(strlen($username) < 4 || strlen($username) > 20){
tsNotice('姓名长度必须在4和20之间!');
}elseif($isUserName > 0){
tsNotice("用户名已经存在,请换个用户名!");
}elseif($authcode != $_SESSION['authcode']){
tsNotice("验证码输入有误,请重新输入!");
}else{
$salt = md5(rand());
$db->query("insert into ".dbprefix."user (`pwd` , `salt`,`email`) values ('".md5($salt.$pwd)."', '$salt' ,'$email');");
$userid = $db->insert_id();
//积分
$db->query("insert into ".dbprefix."user_scores (`userid`,`scorename`,`score`,`addtime`) values ('".$userid."','注册','1000','".time()."')");
$expemail = explode('@',$email);
//判断是否存在doname
$ishaveDoname = aac('user')->haveDoname($expemail[0]);
if($ishaveDoname)
{
$doname = $expemail[0].'_'.$userid;
}else{
$doname = $expemail[0];
}
//用户信息
$arrData = array(
'userid' => $userid,
'fuserid' => $fuserid,
'username' => $username,
'email' => $email,
'doname' => $doname,
'ip' => getIp(),
'count_score' => '1000',
'addtime' => time(),
'uptime' => time(),
);
//插入用户信息
$db->insertArr($arrData,dbprefix.'user_info');
//默认加入小组
$isgroup = $db->once_fetch_assoc("select optionvalue from ".dbprefix."user_options where optionname='isgroup'");
if($isgroup['optionvalue'] != ''){
$arrGroup = explode(',',$isgroup['optionvalue']);
foreach($arrGroup as $item){
$groupusernum = $db->once_num_rows("select * from ".dbprefix."group_users where `userid`='".$userid."' and `groupid`='".$item."'");
if($groupusernum == '0'){
$db->query("insert into ".dbprefix."group_users (`userid`,`groupid`,`addtime`) values('".$userid."','".$item."','".time()."')");
//统计更新
$count_user = $db->once_num_rows("select * from ".dbprefix."group_users where `groupid`='".$item."'");
$db->query("update ".dbprefix."group set `count_user`='".$count_user."' where `groupid`='".$item."'");
}
}
}
//用户信息
$userData = $db->once_fetch_assoc("select * from ".dbprefix."user_info where userid='$userid'");
//用户session信息
$sessionData = array(
'userid' => $userData['userid'],
'username' => $userData['username'],
'doname' => $userData['doname'],
'areaid' => $userData['areaid'],
'path' => $userData['path'],
'face' => $userData['face'],
'count_score' => $userData['count_score'],
'isadmin' => $userData['isadmin'],
'uptime' => $userData['uptime'],
);
$_SESSION['tsuser'] = $sessionData;
//发送系统消息(恭喜注册成功)
$msg_userid = '0';
$msg_touserid = $userid;
$msg_title = '亲爱的 '.$username.'您成功加入了爱客网!';
$msg_content = '亲爱的 '.$username.' :<br />您成功加入了 '
.$IK_SITE['base']['site_title'].'<br />在遵守本站的规定的同时,享受您的愉快之旅吧!';
aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_title,$msg_content);
//注销邀请码
if($IK_SITE['base']['isinvite']=='1'){
$db->query("update ".dbprefix."user_invites set `isused`='1' where `invitecode`='$invitecode'");
}
//跳转
header('Location: '.SITE_URL.'index.php');
}
break;
//邀请链接过来的用户
case "from_invite_user":
$email = trim($_POST['email']);
$pwd = trim($_POST['pwd']);
$username = t($_POST['username']);
$fuserid = intval($_POST['fuserid']);
$isEmail = $new['user']->findCount('user',array(
'email'=>$email,
));
if($isEmail > 0){
tsNotice('Email已经注册^_^');
}else{
$salt = md5(rand());
$db->query("insert into ".dbprefix."user (`pwd` , `salt`,`email`) values ('".md5($salt.$pwd)."', '$salt' ,'$email');");
$userid = $db->insert_id();
//积分
$db->query("insert into ".dbprefix."user_scores (`userid`,`scorename`,`score`,`addtime`) values ('".$userid."','注册','1000','".time()."')");
//用户信息
$arrData = array(
'userid' => $userid,
'fuserid' => $fuserid,
'username' => $username,
'email' => $email,
'ip' => getIp(),
'count_score' => '1000',
'addtime' => time(),
'uptime' => time(),
);
//插入用户信息
$db->insertArr($arrData,dbprefix.'user_info');
//用户信息
$userData = $db->once_fetch_assoc("select * from ".dbprefix."user_info where userid='$userid'");
//用户session信息
$sessionData = array(
'userid' => $userData['userid'],
'username' => $userData['username'],
'areaid' => $userData['areaid'],
'path' => $userData['path'],
'face' => $userData['face'],
'count_score' => $userData['count_score'],
'isadmin' => $userData['isadmin'],
'uptime' => $userData['uptime'],
);
$_SESSION['tsuser'] = $sessionData;
//发送系统消息(恭喜注册成功)
$msg_userid = '0';
$msg_touserid = $userid;
$msg_title = '亲爱的 '.$username.' 您成功加入了爱客网!';
$msg_content = '亲爱的 '.$username.' :<br />您成功加入了 '
.$IK_SITE['base']['site_title'].'<br />在遵守本站的规定的同时,享受您的愉快之旅吧!';
aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_title,$msg_content);
//给邀请者加分
//给邀请者发送消息
//邀请者 和 被邀请者 互相加为好友
//跳转
header('Location: '.SITE_URL.'index.php');
}
break;
} | 12ik | trunk/app/user/action/register.php | PHP | oos | 7,235 |
<?php
defined('IN_IK') or die('Access Denied.');
//用户空间
$userid = isset($_GET['id']) ? $_GET['id'] : intval($IK_USER['user']['userid']);
if(!((int) $userid)>0)
{
$userdoname = aac('user')->find('user_info',array('doname'=>$userid));
$userid = $userdoname['userid'];
}
if($userid == 0){
header("Location: ".SITE_URL);
exit;
}
$new['user']->isUser($userid);
$strUser = $new['user']->getOneUser($userid);
$strUser['rolename'] = $new['user']->getRole($strUser['count_score']);
//所在地区
$arrArea = aac('location')->getAreaForApp($strUser['area']['areaid']);
//是否跟随
if($IK_USER['user']['userid'] != '' && $IK_USER['user']['userid'] != $strUser['userid']){
$followNum = $db->once_num_rows("select * from ".dbprefix."user_follow where userid='".$IK_USER['user']['userid']."' and userid_follow='$userid'");
if($followNum > '0'){
$strUser['isfollow'] = true;
}else{
$strUser['isfollow'] = false;
}
}else{
$strUser['isfollow'] = false;
}
//他跟随的用户
$followUsers = $db->fetch_all_assoc("select userid_follow from ".dbprefix."user_follow where userid='$userid' order by addtime limit 12");
if(is_array($followUsers)){
foreach($followUsers as $item){
$arrFollowUser[] = $new['user']->getOneUser($item['userid_follow']);
}
}
//加入的小组
$arrGroups = $db->fetch_all_assoc("select * from ".dbprefix."group_users where userid='$userid' limit 12");
if(is_array($arrGroups)){
foreach($arrGroups as $key=>$item){
$arrGroup[] = aac('group')->getOneGroup($item['groupid']);
}
}
//自己的帖子
$arrMyTopic = $db->fetch_all_assoc("select * from ".dbprefix."group_topics where userid='$userid' order by addtime desc limit 15");
//回复的帖子
$arrComments = $db->fetch_all_assoc("select topicid from ".dbprefix."group_topics_comments where userid='$userid' group by topicid order by addtime desc limit 15");
if(is_array($arrComments)){
foreach($arrComments as $item){
$oneTopic = $db->once_fetch_assoc("select * from ".dbprefix."group_topics where topicid='".$item['topicid']."'");
if($oncTopic['userid'] != $userid){
$arrMyComment[] = $oneTopic;
}
}
}
//收藏的帖子
$arrCollect = $db->fetch_all_assoc("select * from ".dbprefix."group_topics_collects where userid='".$userid."' order by addtime desc limit 10");
if(is_array($arrCollect)){
foreach($arrCollect as $item){
$strTopic = $db->once_fetch_assoc("select * from ".dbprefix."group_topics where topicid = '".$item['topicid']."'");
$arrMyCollect[] = $strTopic;
}
}
$title = $strUser['username'].'的个人空间';
include template("index");
| 12ik | trunk/app/user/action/index.php | PHP | oos | 2,673 |
<?php
/*
* 用户管理
*/
switch ($ts) {
//用户列表
case "list" :
$page = isset ( $_GET ['page'] ) ? intval ( $_GET ['page'] ) : 1;
$lstart = $page * 20 - 20;
$url = 'index.php?app=user&ac=admin&mg=user&ts=list&page=';
$arrAllUser = $new ['user']->findAll ( 'user_info', null, 'userid desc', null, $lstart . ',20' );
$userNum = $new ['user']->findCount ( 'user_info' );
$pageUrl = pagination ( $userNum, 20, $page, $url );
include template ( "admin/user_list" );
break;
//用户编辑
case "edit" :
$userid = $_GET ['userid'];
$strUser = $new ['user']->getOneUser ( $userid );
include template ( "admin/user_edit" );
break;
//用户查看
case "view" :
$userid = $_GET ['userid'];
$strUser = $new ['user']->getOneUser ( $userid );
include template ( "admin/user_view" );
break;
//用户停用启用
case "isenable" :
$userid = $_GET ['userid'];
$isenable = $_GET ['isenable'];
$db->query ( "update " . dbprefix . "user_info set `isenable`='$isenable' where userid='$userid'" );
header ( "Location: " . SITE_URL . "index.php?app=user&ac=admin&mg=user&ts=list" );
break;
} | 12ik | trunk/app/user/action/admin/user.php | PHP | oos | 1,223 |
<?php
/*
* 配置选项
*/
switch ($ts) {
//配置
case "" :
$arrOptions = $db->fetch_all_assoc ( "select * from " . dbprefix . "user_options" );
foreach ( $arrOptions as $item ) {
$strOption [$item ['optionname']] = $item ['optionvalue'];
}
include template ( "admin/options" );
break;
//配置执行
case "do" :
$arrData = array ('appname' => trim ( $_POST ['appname'] ), 'appdesc' => trim ( $_POST ['appdesc'] ), 'isenable' => trim ( $_POST ['isenable'] ), 'isvalidate' => trim ( $_POST ['isvalidate'] ), 'isgroup' => trim ( $_POST ['isgroup'] ) );
foreach ( $arrData as $key => $val ) {
$db->query ( "UPDATE " . dbprefix . "user_options SET optionvalue='$val' where optionname='$key'" );
}
//更新缓存
$arrOptions = $db->fetch_all_assoc ( "select optionname,optionvalue from " . dbprefix . "user_options" );
foreach ( $arrOptions as $item ) {
$arrOption [$item ['optionname']] = $item ['optionvalue'];
}
fileWrite ( 'user_options.php', 'data', $arrOption );
qiMsg ( "用户APP配置成功!" );
break;
} | 12ik | trunk/app/user/action/admin/options.php | PHP | oos | 1,099 |
<?php
//用户是否登录
$userid = aac('user')->isLogin();
switch($ts){
//发送验证
case "post":
$strUser = $db->once_fetch_assoc("select username,email,isverify,verifycode from ".dbprefix."user_info where userid='$userid'");
if($strUser['verifycode']==''){
$verifycode = random(11);
$db->query("update ".dbprefix."user_info set `verifycode`='$verifycode' where `userid`='$userid'");
}else{
$verifycode = $strUser['verifycode'];
}
$email = $strUser['email'];
//发送邮件
$subject = $IK_SITE['base']['site_title'].'会员真实性验证';
$content = '尊敬的'.$strUser['username'].',<br />请点击以下链接进行会员验证:<a href="'.$IK_SITE['base']['site_url'].'index.php?app=user&ac=verify&ts=do&email='.$email.'&verifycode='.$verifycode.'">'.$IK_SITE['base']['site_url'].'index.php?app=user&ac=verify&ts=do&email='.$email.'&verifycode='.$verifycode.'</a>';
$result = aac('mail')->postMail($email,$subject,$content);
if($result == '0'){
tsNotice("验证失败,可能是你的Email邮箱错误哦^_^");
}elseif($result == '1'){
tsNotice("系统已经向你的邮箱发送了验证邮件,请尽快查收^_^");
}
break;
//接收验证
case "do":
$email = $_GET['email'];
$verifycode = $_GET['verifycode'];
$verify = $db->once_fetch_assoc("select count(*) from ".dbprefix."user_info where `email`='$email' and `verifycode`='$verifycode'");
if($verify['count(*)'] > 0){
$db->query("update ".dbprefix."user_info set `isverify`='1' where `email`='$email'");
tsNotice("Email验证成功!点击返回首页!",'点击回首页!',SITE_URL);
}else{
tsNotice("Email验证失败!");
}
break;
} | 12ik | trunk/app/user/action/verify.php | PHP | oos | 1,749 |
<?php
//插件条件入口
defined('IN_IK') or die('Access Denied.');
if(is_file('plugins/'.$app.'/'.$plugin.'/'.$in.'.php')){
require_once('plugins/'.$app.'/'.$plugin.'/'.$in.'.php');
}else{
tsNotice('sorry:no plugin!');
}
//形如这样
//index.php?app=group&ac=plugin&plugin=qq&in=do | 12ik | trunk/app/user/action/plugin.php | PHP | oos | 303 |
<?php
defined('IN_IK') or die('Access Denied.');
$title = '找回登陆密码';
switch($ts){
case "":
include template("forgetpwd");
break;
//执行登录
case "do":
$email = trim($_POST['email']);
$emailNum = $db->once_fetch_assoc("select count(*) from ".dbprefix."user where `email`='$email'");
if($email==''){
tsNotice('Email输入不能为空^_^');
}elseif($emailNum['count(*)'] == '0'){
tsNotice("Email不存在,你可能还没有注册^_^");
}else{
//随机MD5加密
$resetpwd = md5(rand());
$db->query("update ".dbprefix."user set resetpwd='$resetpwd' where email='$email'");
//发送邮件
$subject = $IK_SITE['base']['site_title'].'会员密码找回';
$content = '您的登陆信息:<br />Email:'.$email.'<br />重设密码链接:<br /><a href="'.$IK_SITE['base']['site_url'].'index.php?app=user&ac=resetpwd&mail='.$email.'&set='.$resetpwd.'">'.$IK_SITE['base']['site_url'].'index.php?app=user&ac=resetpwd&mail='.$email.'&set='.$resetpwd.'</a>';
$result = aac('mail')->postMail($email,$subject,$content);
if($result == '0'){
tsNotice("找回密码所需信息不完整^_^");
}elseif($result == '1'){
tsNotice("系统已经向你的邮箱发送了邮件,请尽快查收^_^");
}
}
break;
} | 12ik | trunk/app/user/action/forgetpwd.php | PHP | oos | 1,369 |
<?php
defined('IN_IK') or die('Access Denied.');
switch($ts){
case "login":
$jump = $_SERVER['HTTP_REFERER'];
include template("login_form");
break;
} | 12ik | trunk/app/user/action/misc.php | PHP | oos | 168 |
<?php
$imgWidth = isset($_REQUEST["width"]) ? intval($_REQUEST["width"]) : 0;
$imgHeight = isset($_REQUEST["height"]) ? intval($_REQUEST["height"]) : 0;
$captcha = new SimpleCaptcha(array('width'=>$imgWidth,'height'=>$imgHeight));
$captcha->CreateImage();
class SimpleCaptcha {
public $width = 80;
public $height = 30;
public $glbVerifySeed = "abcdefghjkmnpqrstuvwxyz";
public $strLength = 5;
public $session_var = 'authcode';
public $backgroundColor = array(255, 255, 255);
public $colors = array(
array(27,78,181), // blue
array(22,163,35), // green
array(214,36,7), // red
array(78,78,78),
);
public $PolluteNum = 100;
public $Yperiod = 11;
public $Yamplitude = 12;
public $Xperiod = 13;
public $Xamplitude = 1;
public $maxRotation = 0;
public $scale = 2;
public $imageFormat = 'png';
public $im;
public function __construct($config = array()) {
if(intval($config['width'])>120) $this->width = $config['width'];
if(intval($config['height'])>50) $this->height = $config['height'];
if($this->width > 150 || $this->height>50) {
$this->scale = 1;
}
//$this->PolluteNum = intval($this->width*$this->height/20);
$this->PolluteNum = 0;
}
public function CreateImage() {
$ini = microtime(true);
$this->ImageAllocate();
$text = $this->GetCaptchaText();
$this->WriteText($text);
session_start();
$_SESSION[$this->session_var] = strtoupper($text);
if($this->height>30) {
$this->WaveImage();
}
$this->ReduceImage();
$this->Pollute();
$this->Line();
$this->WriteImage();
$this->Cleanup();
}
protected function ImageAllocate() {
if (!empty($this->im)) {
imagedestroy($this->im);
}
$this->im = imagecreatetruecolor($this->width*$this->scale, $this->height*$this->scale);
$this->GdBgColor = imagecolorallocate($this->im,
$this->backgroundColor[0],
$this->backgroundColor[1],
$this->backgroundColor[2]
);
imagefilledrectangle($this->im, 0, 0, $this->width*$this->scale, $this->height*$this->scale, $this->GdBgColor);
$color = $this->colors[mt_rand(0, sizeof($this->colors)-1)];
$this->GdFgColor = imagecolorallocate($this->im, $color[0], $color[1], $color[2]);
}
protected function GetCaptchaText() {
$bgnIdx = 0;
$endIdx = strlen($this->glbVerifySeed)-1;
$code = "";
for($i=0; $i<$this->strLength; $i++) {
$curPos = rand($bgnIdx, $endIdx);
$code .= substr($this->glbVerifySeed, $curPos, 1);
}
return $code;
}
protected function WriteText($text) {
$fontcfg = array(
'spacing' => 0,
'minSize' => $this->height/2+2,
'maxSize' => $this->height/2+4,
'font' => realpath(dirname(__FILE__)).'/'.'MONACO.ttf'
);
$x = 10*$this->scale;
$y = round(($this->height*27/40)*$this->scale);
$length = strlen($text);
for ($i=0; $i<$length; $i++) {
$degree = rand($this->maxRotation*-1, $this->maxRotation);
$fontsize = rand($fontcfg['minSize'], $fontcfg['maxSize'])*$this->scale;
$letter = substr($text, $i, 1);
$coords = imagettftext($this->im, $fontsize, $degree,
$x, $y,
$this->GdFgColor, $fontcfg['font'], $letter);
$x += ($coords[2]-$x) + ($fontcfg['spacing']*$this->scale);
}
}
protected function WaveImage() {
$xp = $this->scale*$this->Xperiod*rand(1,3);
$k = rand(0, 100);
for ($i = 0; $i < ($this->width*$this->scale); $i++) {
imagecopy($this->im, $this->im,
$i-1, sin($k+$i/$xp) * ($this->scale*$this->Xamplitude),
$i, 0, 1, $this->height*$this->scale);
}
$k = rand(0, 100);
$yp = $this->scale*$this->Yperiod*rand(1,2);
for ($i = 0; $i < ($this->height*$this->scale); $i++) {
imagecopy($this->im, $this->im,
sin($k+$i/$yp) * ($this->scale*$this->Yamplitude), $i-1,
0, $i, $this->width*$this->scale, 1);
}
}
// 缩小图片
protected function ReduceImage() {
$imResampled = imagecreatetruecolor($this->width, $this->height);
imagecopyresampled($imResampled, $this->im,
0, 0, 0, 0,
$this->width, $this->height,
$this->width*$this->scale, $this->height*$this->scale
);
imagedestroy($this->im);
$this->im = $imResampled;
}
// 输出图片
protected function WriteImage() {
if ($this->imageFormat == 'png' && function_exists('imagepng')) {
header("Content-type: image/png");
imagepng($this->im);
} else {
header("Content-type: image/jpeg");
imagejpeg($this->im, null, 90);
}
}
// 画出杂点
protected function Pollute() {
$imgWidth = imagesx($this->im);
$imgHeight = imagesy($this->im);
for($j=0; $j<$this->PolluteNum; $j++) {
$x = rand(0, $imgWidth);
$y = rand(0, $imgHeight);
imagesetpixel($this->im, $x, $y, $this->GdFgColor);
}
}
// 画出一条线
protected function Line() {
$imgWidth = imagesx($this->im);
$imgHeight = imagesy($this->im);
$y = ceil($imgHeight/2);
$border = floor($imgHeight/20);
for($j=10; $j<($imgWidth-10); $j++) {
$x = $j;
$y = rand(-1,1)+$y;
for($i=-1; $i<($border-1); $i++) {
imagesetpixel($this->im, $x, $y+$i, $this->GdFgColor);
}
}
}
protected function Cleanup() {
imagedestroy($this->im);
}
}
?> | 12ik | trunk/app/user/action/checkcode.php | PHP | oos | 5,850 |
<?php
defined('IN_IK') or die('Access Denied.');
/*
* 用户被跟随
*/
$userid = intval($_GET['userid']);
$strUser = $new['user']->getOneUser($userid);
if($strUser == '') header("Location: ".SITE_URL."index.php");
//我关注的人
$followUsers = $db->fetch_all_assoc("select userid_follow from ".dbprefix."user_follow where userid='$userid'");
echo $followUsersNum;
if(is_array($followUsers)){
foreach($followUsers as $item){
$arrFollowUser[] = $new['user']->getOneUser($item['userid_follow']);
}
}
if($userid == $IK_USER['user']['userid'])
{
$title = '我关注的人';
}else{
$title = $strUser['username'].'关注的人';
}
include template("follow"); | 12ik | trunk/app/user/action/follow.php | PHP | oos | 726 |
<?php
defined('IN_IK') or die('Access Denied.');
//确认邀请码
$saltmail = trim($_GET['confirmation']);
$invitedUser = aac('user')->find('user_invited',array('saltmail'=>$saltmail));
if($invitedUser)
{
$title = '爱客网邀请您加入';
include template("invited");
}else{
header ( "Location: ".SITE_URL);
}
| 12ik | trunk/app/user/action/invited.php | PHP | oos | 343 |
<?php
defined('IN_IK') or die('Access Denied.');
//用户是否登录
$userid = aac('user')->isLogin();
$strUser = $db->once_fetch_assoc("select * from ".dbprefix."user_info where userid='$userid'");
//邀请好友
switch($ts){
case "":
$codeNum = $db->once_num_rows("select * from ".dbprefix."user_invites where isused='0'");
$title = '邀请码';
include template("invite");
break;
//取邀请码
case "code":
//计算是否还有邀请码
$codeNum = $db->once_num_rows("select * from ".dbprefix."user_invites where isused='0'");
if($codeNum > 0){
//取一个码
$strCode = $db->once_fetch_assoc("select * from ".dbprefix."user_invites where isused='0' limit 1");
}else{
//当数据库中没码的时间生成50个码
for($i=1;$i<=50;$i++){
$db->query("insert into ".dbprefix."user_invites (`invitecode`,`addtime`) values ('".random(18)."','".time()."')");
}
//再次取码
$strCode = $db->once_fetch_assoc("select * from ".dbprefix."user_invites where isused='0' limit 1");
}
$title = '邀请码';
include template("invite_code");
break;
} | 12ik | trunk/app/user/action/invite.php | PHP | oos | 1,166 |
<?php
switch($ts){
//验证Email是否唯一
case "inemail":
$email = $_GET['email'];
$emailNum = $new['user']->findCount('user',array(
'email'=>$email,
));
if($emailNum > '0'):
echo 'false';
else:
echo 'true';
endif;
break;
//验证用户名是否唯一
case "isusername":
$username = $_GET['username'];
$usernameNum = $db->once_num_rows("select * from ".dbprefix."user_info where `username`='".$username."'");
if($usernameNum > '0'):
echo 'false';
else:
echo 'true';
endif;
break;
//验证邀请码是否使用
case "isinvitecode":
$invitecode = trim($_GET['invitecode']);
$codeNum = $db->once_num_rows("select * from ".dbprefix."user_invites where invitecode='$invitecode' and isused='0'");
if($codeNum > 0){
echo 'true';
}else{
echo 'false';
}
break;
} | 12ik | trunk/app/user/action/check.php | PHP | oos | 903 |
<?php
defined('IN_IK') or die('Access Denied.');
$userid = intval($_GET['userid']);
$strUser = $new['user']->getOneUser($userid);
if($strUser == '') header("Location: ".SITE_URL."index.php");
//关注我的人
$followedUsers = $db->fetch_all_assoc("select userid from ".dbprefix."user_follow where userid_follow='$userid' order by addtime");
if(is_array($followedUsers)){
foreach($followedUsers as $key=> $item){
$arrFollowedUser[$key] = $new['user']->getOneUser($item['userid']);
$isfollow = $db->fetch_all_assoc("select userid from ".dbprefix."user_follow where userid ='$userid' and userid_follow='$item[userid]' order by addtime");
$arrFollowedUser[$key]['isfollow'] = empty($isfollow)?0:1;
}
}
if($userid == $IK_USER['user']['userid'])
{
$title = '关注我的人';
}else{
$title = '关注'.$strUser['username'].'的人';
}
include template('followed'); | 12ik | trunk/app/user/action/followed.php | PHP | oos | 912 |
<?php
defined('IN_IK') or die('Access Denied.');
switch($ts){
case "two":
$oneid = $_GET['oneid'];
$arrArea = $db->fetch_all_assoc("select * from ".dbprefix."area where referid='$oneid'");
if($arrArea){
echo '<select id="twoid" name="twoid" class="txt">';
echo '<option value="0">请选择</option>';
foreach($arrArea as $item){
echo '<option value="'.$item['areaid'].'">'.$item['areaname'].'</option>';
}
echo "</select>";
}else{
echo '';
}
break;
case "three":
$twoid = $_GET['twoid'];
$arrArea = $db->fetch_all_assoc("select * from ".dbprefix."area where referid='$twoid'");
if($arrArea){
echo '<select id="threeid" name="threeid" class="txt">';
echo '<option value="0">请选择</option>';
foreach($arrArea as $item){
echo '<option value="'.$item['areaid'].'">'.$item['areaname'].'</option>';
}
echo "</select>";
}else{
echo '';
}
break;
} | 12ik | trunk/app/user/action/area.php | PHP | oos | 957 |
<?php
defined('IN_IK') or die('Access Denied.');
//用户是否登录
$userid = aac('user')->isLogin();
switch($ts){
//设置头像
case "setface":
//上传
$arrUpload = tsUpload($_FILES['picfile'],$userid,'user/face',array('jpg','gif','png'));
if($arrUpload){
$new['user']->update('user_info',array(
'userid'=>$userid,
),array(
'path'=>'face/'.$arrUpload['path'],
'face'=>'face/'.$arrUpload['url'],
));
//清除缓存图片
ClearAppCache($app.'/face/'.$arrUpload['path']);
tsNotice("头像修改成功!","点击返回",$_SERVER['HTTP_REFERER']);
}else{
tsNotice("上传出问题啦!");
}
break;
//基本信息设置
case "setbase":
$strUser = $db->once_fetch_assoc("select username from ".dbprefix."user_info where userid='$userid'");
$username = t($_POST['username']);
if($IK_USER['user'] == '') tsNotice("机房重地,闲人免进!");
if($username == '') tsNotice("不管做什么都需要有一个名号吧^_^");
if(mb_strlen($username,'utf8') < 2 || mb_strlen($username,'utf8') > 14) tsNotice("名字长度必须在 2 到 14 汉字之间!");
if($username != $strUser['username']){
$isusername = $db->once_num_rows("select * from ".dbprefix."user_info where username='$username'");
if($isusername > 0) tsNotice("用户名已经存在,请换个用户名!");
}
//更新数据
$new['user']->update('user_info',array(
'userid'=>$userid,
),array(
'username' => $username,
'sex' => $_POST['sex'],
'signed' => h($_POST['signed']),
'phone' => t($_POST['phone']),
'blog' => t($_POST['blog']),
'about' => h($_POST['about']),
));
tsNotice("基本资料更新成功!");
break;
//修改常居地
case "setcity":
$oneid = intval($_POST['oneid']);
$twoid = intval($_POST['twoid']);
$threeid = intval($_POST['threeid']);
if($oneid != 0 && $twoid==0 && $threeid==0){
$areaid = $oneid;
}elseif($oneid!=0 && $twoid !=0 && $threeid==0){
$areaid = $twoid;
}elseif($oneid!=0 && $twoid !=0 && $threeid!=0){
$areaid = $threeid;
}else{
$areaid = 0;
}
$db->query("update ".dbprefix."user_info set `areaid`='$areaid' where userid='$userid'");
$_SESSION['tsuser']['areaid'] = $areaid;
tsNotice("常居地更新成功!");
break;
//修改用户密码
case "setpwd":
$userid = intval($IK_USER['user']['userid']);
if($userid == 0) tsNotice('你应该出发去火星报到啦。');
$oldpwd = trim($_POST['oldpwd']);
$newpwd = trim($_POST['newpwd']);
$renewpwd = trim($_POST['renewpwd']);
if($oldpwd == '' || $newpwd=='' || $renewpwd=='') tsNotice("所有项都不能为空!");
$strUser = $new['user']->find('user',array(
'userid'=>$userid,
));
if(md5($strUser['salt'].$oldpwd) != $strUser['pwd']) tsNotice("旧密码输入有误!");
if($newpwd != $renewpwd) tsNotice('两次输入新密码密码不一样!');
//更新密码
$salt = md5(rand());
$new['user']->update('user',array(
'pwd'=>md5($salt.$newpwd),
'salt'=>$salt
),array(
'userid'=>$userid
));
tsNotice("密码修改成功!");
break;
//用户跟随
case "user_follow":
$userid_follow = intval($_GET['userid_follow']);
if($userid_follow==0){
header("Location: ".SITE_URL);
exit;
}
$new['user']->isUser($userid_follow);
$followNum = $db->once_num_rows("select * from ".dbprefix."user_follow where userid='$userid' and userid_follow='$userid_follow'");
if($followNum > '0'){
tsNotice("请不要重复关注同一用户!");
}else{
$db->query("insert into ".dbprefix."user_follow (`userid`,`userid_follow`,`addtime`) values ('$userid','$userid_follow','".time()."')");
//统计更新跟随和被跟随数
//统计自己的
$count_follow = $db->once_num_rows("select * from ".dbprefix."user_follow where userid='$userid'");
$count_followed = $db->once_num_rows("select * from ".dbprefix."user_follow where userid_follow='$userid'");
$db->query("update ".dbprefix."user_info set `count_follow`='$count_follow',`count_followed`='$count_followed' where userid='$userid'");
//统计别人的
$count_follow_userid = $db->once_num_rows("select * from ".dbprefix."user_follow where userid='$userid_follow'");
$count_followed_userid = $db->once_num_rows("select * from ".dbprefix."user_follow where userid_follow='$userid_follow'");
$db->query("update ".dbprefix."user_info set `count_follow`='$count_follow_userid',`count_followed`='$count_followed_userid' where userid='$userid_follow'");
//发送系统消息
$strdoname = aac('user')->find('user_info',array('userid'=>$userid));
$msg_userid = '0';
$msg_touserid = $userid_follow;
$msg_title = '恭喜,您被人跟随啦!看看他是谁吧';
$msg_content = '恭喜,您被人跟随啦!看看他是谁吧<br />'.SITE_URL.tsUrl('hi','',array('id'=>$strdoname['doname']));
aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_title,$msg_content);
$strUser = $db->once_fetch_assoc("select userid,username,path,face from ".dbprefix."user_info where `userid`='$userid_follow'");
//feed开始
$feed_template = '<a href="{link}"><img title="{username}" alt="{username}" src="{face}" class="broadimg"></a>
<span class="pl">关注<a href="{link}">{username}</a></span>';
$strdoname = aac('user')->find('user_info',array('userid'=>$userid_follow));
$feed_data = array(
'link' => SITE_URL.tsUrl('hi','',array('id'=>$strdoname['doname'])),
'username' => $strUser['username'],
);
if($strUser['face']!=''){
$feed_data['face'] = SITE_URL.tsXimg($strUser['face'],'user',48,48,$strUser['path']);
}else{
$feed_data['face'] = SITE_URL.'public/images/user_normal.jpg';
}
aac('feed')->add($userid,$feed_template,serialize($feed_data));
//feed结束
$strdoname = aac('user')->find('user_info',array('userid'=>$userid_follow));
header("Location: ".SITE_URL.tsUrl('hi','',array('id'=>$strdoname['doname'])));
}
break;
//用户取消跟随
case "user_nofollow":
$userid_follow = $_GET['userid_follow'];
$db->query("DELETE FROM ".dbprefix."user_follow WHERE userid = '$userid' AND userid_follow = '$userid_follow'");
//统计更新跟随和被跟随数
//统计自己的
$count_follow = $db->once_num_rows("select * from ".dbprefix."user_follow where userid='$userid'");
$count_followed = $db->once_num_rows("select * from ".dbprefix."user_follow where userid_follow='$userid'");
$db->query("update ".dbprefix."user_info set `count_follow`='$count_follow',`count_followed`='$count_followed' where userid='$userid'");
//统计别人的
$count_follow_userid = $db->once_num_rows("select * from ".dbprefix."user_follow where userid='$userid_follow'");
$count_followed_userid = $db->once_num_rows("select * from ".dbprefix."user_follow where userid_follow='$userid_follow'");
$db->query("update ".dbprefix."user_info set `count_follow`='$count_follow_userid',`count_followed`='$count_followed_userid' where userid='$userid_follow'");
$strdoname = aac('user')->find('user_info',array('userid'=>$userid_follow));
header("Location: ".SITE_URL.tsUrl('hi','',array('id'=>$strdoname['doname'])));
break;
//用户取消跟随
case "user_nofollow_ajax":
$userid_follow = $_POST['userid_follow'];
$db->query("DELETE FROM ".dbprefix."user_follow WHERE userid = '$userid' AND userid_follow = '$userid_follow'");
//统计更新跟随和被跟随数
//统计自己的
$count_follow = $db->once_num_rows("select * from ".dbprefix."user_follow where userid='$userid'");
$count_followed = $db->once_num_rows("select * from ".dbprefix."user_follow where userid_follow='$userid'");
$db->query("update ".dbprefix."user_info set `count_follow`='$count_follow',`count_followed`='$count_followed' where userid='$userid'");
//统计别人的
$count_follow_userid = $db->once_num_rows("select * from ".dbprefix."user_follow where userid='$userid_follow'");
$count_followed_userid = $db->once_num_rows("select * from ".dbprefix."user_follow where userid_follow='$userid_follow'");
$db->query("update ".dbprefix."user_info set `count_follow`='$count_follow_userid',`count_followed`='$count_followed_userid' where userid='$userid_follow'");
$arrJson = array('r'=>0, 'html'=>'update success');
header("Content-Type: application/json", true);
echo json_encode($arrJson);
break;
//个性域名修改
case "setdoname":
$doname = trim($_POST['doname']);
if(empty($doname))
{
tsNotice("个性域名不能为空!");
}else if(strlen($doname)<2)
{
tsNotice("个性域名至少要2位数字、字母、或下划线(_)组成!");
}else if(!preg_match ( '/^[A-Za-z0-9]+([._\-\+]*[A-Za-z0-9]+)*$/', $doname ))
{
tsNotice("个性域名必须是数字、字母或下划线(_)组成!");
}
$ishave = aac('user')->haveDoname($doname);
if($ishave)
{
tsNotice("该域名已经被其他人抢注了,请试试别的吧!");
}else{
aac('user')->update('user_info',array('userid'=>$userid), array('doname'=>$doname));
tsNotice("个性域名修改成功!");
}
break;
}
| 12ik | trunk/app/user/action/do.php | PHP | oos | 9,560 |
<?php
defined('IN_IK') or die('Access Denied.');
//用户是否登录
$userid = aac('user')->isLogin();
switch($ts){
//发送消息页面
case "message_add":
$touserid = intval($_GET['touserid']);
if($userid == $touserid || !$touserid) tsNotice("Sorry!自己不能给自己发送消息的!& 对方为空!");
$strUser = $new['user']->getOneUser($userid);
$strTouser = $new['user']->getOneUser($touserid);
if(!$strTouser) tsNotice("Sorry!对方不存在!");
$title = "发送短消息";
include template("message_add");
break;
//
case "message_add_do":
$msg_userid = $_POST['userid'];
$msg_touserid = $_POST['touserid'];
$msg_title = htmlspecialchars(trim($_POST['title']));
$msg_content = htmlspecialchars(trim($_POST['content']));
if($msg_title=='' || $msg_content=='') qiMsg("标题和内容都不能为空!");
if(mb_strlen($msg_title,'utf8')>64) tsNotice('标题很长很长很长很长...^_^');
if(mb_strlen($msg_content,'utf8')>50000) tsNotice('发这么多内容干啥^_^');
aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_title,$msg_content);
header("Location: ".SITE_URL.tsUrl('message','ikmail',array('ts'=>'outbox')));
break;
} | 12ik | trunk/app/user/action/message.php | PHP | oos | 1,258 |
<?php
defined('IN_IK') or die('Access Denied.');
switch($ts){
case "login":
$jump = $_SERVER['HTTP_REFERER'];
include template("ajax_login");
break;
} | 12ik | trunk/app/user/action/ajax.php | PHP | oos | 180 |
<?php
defined('IN_IK') or die('Access Denied.');
//管理入口
if(is_file('app/'.$app.'/action/admin/'.$mg.'.php')){
include_once 'app/'.$app.'/action/admin/'.$mg.'.php';
}else{
tsNotice('sorry:no index!');
} | 12ik | trunk/app/user/action/admin.php | PHP | oos | 222 |
<?php
defined('IN_IK') or die('Access Denied.');
//用户是否登录
$userid = aac('user')->isLogin();
$strUser = aac('user')->getOneUser($userid);
//邀请好友
switch($ts){
case "invite":
$title = '爱客网邀请';
include template("email_invite");
break;
case "sendmail":
$emails = trim($_POST['emails']);
$emails = str_replace ( ',', ',', $emails);
$stremail = explode("," , $emails);
$message = t(trim($_POST['message']));
if($emails==''){
$msg = '<p class="attn" style="margin:5px 0px">请输入至少一个完整的Email地址!</p>';
}else if(valid_email($stremail[0]) == false)
{
$msg = '<p class="attn" style="margin:5px 0px">Email邮箱输入有误!</p>';
}else{
foreach($stremail as $key=>$item)
{
//生成tomail加密
$saltmail = substr(md5($item),8,16); //16位加密
//发送邮件
$subject = '你的朋友'.$strUser['username'].'邀请你来爱客网';
$inviteurl = SITE_URL.tsUrl('user','invited',array('confirmation'=>$saltmail));
$content = '爱客网站的成员'.$strUser['username'].'('.$strUser['email'].')邀请您去看看,<br/>'.$message.'<br/>请点击以下链接接受邀请加入我们:<br/>(Your friend at '.$strUser['email'].' invites you to join him/her at 12ik.com. Please click this link to accept the invitation:)
<a href="'.$inviteurl.'">'.$inviteurl.'</a><br/>如果您愿意先去随便逛逛,点<a href="http://www.12ik.com">http://www.12ik.com</a> 。你的朋友的爱客主页在 '.SITE_URL.tsUrl('hi','',array('id'=>$strUser['doname'])).' 。想注册请直接用以上链接,这样你和小麦狼会自动加入彼此的友邻行列。<br/>
如果您的email程序不支持链接点击,请将上面的地址拷贝至您的浏览器(例如IE)的地址栏进入爱客网。<br/>
希望您在爱客网的体验有益和愉快。<br/>----爱客网<br/>(这是一封自动产生的email,请勿回复。)';
//判断是否已经被注册
$ishave = aac('user')->find('user',array('email'=>$item));
if(empty($ishave))
{
$result = aac('mail')->postMail($stremail[0],$subject,$content);
if($result == '1')
{
aac('user')->create('user_invited',array(
'userid'=>$userid,
'invitemail'=>$stremail[0],
'saltmail'=>$saltmail,
'addtime'=>time(),
));
$msg = '<p class="inviteok" style="margin:8px 0px">邀请已经成功发出,继续邀请?</p>';
}
}
}
}
$title = '爱客网邀请';
include template("email_invite");
break;
} | 12ik | trunk/app/user/action/contacts.php | PHP | oos | 2,630 |
<?php
defined('IN_IK') or die('Access Denied.');
//重设密码
$title = '重设密码';
switch($ts){
case "":
$email = trim($_GET['mail']);
$resetpwd = trim($_GET['set']);
$userNum = $new['user']->findCount('user',array(
'email'=>$email,
'resetpwd'=>$resetpwd,
));
if($email=='' || $resetpwd==''){
tsNotice("你应该去火星生活啦!");
}elseif($userNum == 0){
tsNotice("你应该去火星生活啦!");
}else{
include template("resetpwd");
}
break;
case "do":
$email = trim($_POST['email']);
$pwd = trim($_POST['pwd']);
$repwd = trim($_POST['repwd']);
$resetpwd = trim($_POST['resetpwd']);
$userNum = $new['user']->findCount('user',array(
'email'=>$email,
'resetpwd'=>$resetpwd,
));
if($email=='' || $pwd=='' || $repwd=='' || $resetpwd==''){
tsNotice("所有输入项都不能为空!");
}elseif($userNum == '0'){
tsNotice("你应该去火星生活啦!");
}else{
$new['user']->update('user',array(
'pwd'=>md5($salt.$pwd),
'salt'=>$salt,
),array(
'email'=>$email,
));
tsNotice("密码修改成功^_^","点击登陆",SITE_URL.tsUrl('user','login'));
}
break;
}
| 12ik | trunk/app/user/action/resetpwd.php | PHP | oos | 1,274 |
<?php
defined('IN_IK') or die('Access Denied.');
//用户空间
$userid = intval($_GET['id']);
if($userid == 0){
header("Location: ".SITE_URL);
exit;
}
$new['user']->isUser($userid);
$strUser = $new['user']->getOneUser($userid);
$strUser['rolename'] = $new['user']->getRole($strUser['count_score']);
//所在地区
$arrArea = aac('location')->getAreaForApp($strUser['area']['areaid']);
//是否跟随
if($IK_USER['user']['userid'] != '' && $IK_USER['user']['userid'] != $strUser['userid']){
$followNum = $db->once_num_rows("select * from ".dbprefix."user_follow where userid='".$IK_USER['user']['userid']."' and userid_follow='$userid'");
if($followNum > '0'){
$strUser['isfollow'] = true;
}else{
$strUser['isfollow'] = false;
}
}else{
$strUser['isfollow'] = false;
}
//他跟随的用户
$followUsers = $db->fetch_all_assoc("select userid_follow from ".dbprefix."user_follow where userid='$userid' order by addtime limit 12");
if(is_array($followUsers)){
foreach($followUsers as $item){
$arrFollowUser[] = $new['user']->getOneUser($item['userid_follow']);
}
}
//加入的小组
$arrGroups = $db->fetch_all_assoc("select * from ".dbprefix."group_users where userid='$userid' limit 12");
if(is_array($arrGroups)){
foreach($arrGroups as $key=>$item){
$arrGroup[] = aac('group')->getOneGroup($item['groupid']);
}
}
//自己的帖子
$arrMyTopic = $db->fetch_all_assoc("select * from ".dbprefix."group_topics where userid='$userid' order by addtime desc limit 15");
//回复的帖子
$arrComments = $db->fetch_all_assoc("select topicid from ".dbprefix."group_topics_comments where userid='$userid' group by topicid order by addtime desc limit 15");
if(is_array($arrComments)){
foreach($arrComments as $item){
$oneTopic = $db->once_fetch_assoc("select * from ".dbprefix."group_topics where topicid='".$item['topicid']."'");
if($oncTopic['userid'] != $userid){
$arrMyComment[] = $oneTopic;
}
}
}
//收藏的帖子
$arrCollect = $db->fetch_all_assoc("select * from ".dbprefix."group_topics_collects where userid='".$userid."' order by addtime desc limit 10");
if(is_array($arrCollect)){
foreach($arrCollect as $item){
$strTopic = $db->once_fetch_assoc("select * from ".dbprefix."group_topics where topicid = '".$item['topicid']."'");
$arrMyCollect[] = $strTopic;
}
}
$title = $strUser['username'].'的个人空间';
include template("space");
| 12ik | trunk/app/user/action/space.php | PHP | oos | 2,481 |