了解了以下UCHOME的通用方法,将对我们的二次开发非常的有效,对于开发插件将更加的方便快捷- function_common.php
- //SQL ADDSLASHES
- function saddslashes($string) return $string;
- //取消HTML代码
- function shtmlspecialchars($string) return $string;
- //字符串解密加密
- function authcode($string, $operation = 'DECODE', $key = '', $expiry = 0)
- //清空cookie
- function clearcookie()
- //cookie设置
- function ssetcookie($var, $value, $life=0)
- //数据库连接
- function dbconnect()
- //获取在线IP
- function getonlineip($format=0)
- //判断当前用户登录状态
- function checkauth()
- //获取用户app列表
- function getuserapp($uid=0)
- //获取到表名
- function tname($name)
- //对话框
- function showmessage($msgkey, $url_forward='', $second=1, $values=array())
- //判断提交是否正确
- function submitcheck($var)
- //添加数据
- function inserttable($tablename, $insertsqlarr, $returnid=0, $replace = false, $silent=0) return insert_id;
- //更新数据
- function updatetable($tablename, $setsqlarr, $wheresqlarr, $silent=0)
- //获取用户空间信息
- function getspace($key, $indextype='uid')
- //获取当前用户信息
- function getmember()
- //检查隐私
- function ckprivacy($type, $feedmode=0)
- //检查APP隐私
- function app_ckprivacy($privacy)
- //获取用户组
- function getgroupid($credit, $gid=0)
- //检查权限
- function checkperm($permtype)
- //写运行日志
- function runlog($file, $log, $halt=0)
- //获取字符串
- function getstr($string, $length, $in_slashes=0, $out_slashes=0, $censor=0, $bbcode=0, $html=0)
- //时间格式化
- function sgmdate($dateformat, $timestamp='', $format=0)
- //字符串时间化
- function sstrtotime($string)
- //分页
- function multi($num, $perpage, $curpage, $mpurl)
- //ob
- function obclean()
- //模板调用
- function template($name)
- //子模板更新检查
- function subtplcheck($subfiles, $mktime, $tpl)
- //模块
- function block($param)
- //获取数目
- function getcount($tablename, $wherearr, $get='COUNT(*)')
- //调整输出
- function ob_out()
- //rewrite链接
- function rewrite_url($pre, $para)
- //外链
- function iframe_url($url)
- //处理搜索关键字
- function stripsearchkey($string)
- //是否屏蔽二级域名
- function isholddomain($domain)
- //连接字符
- function simplode($ids)
- //显示进程处理时间
- function debuginfo()
- //格式化大小函数
- function formatsize($size)
- //获取文件内容
- function sreadfile($filename)
- //写入文件
- function swritefile($filename, $writetext, $openmod='w')
- //产生随机字符
- function random($length, $numeric = 0)
- //判断字符串是否存在
- function strexists($haystack, $needle)
- //获取数据
- function data_get($var, $isarray=0)
- //更新数据
- function data_set($var, $datavalue, $clean=0)
- //检查站点是否关闭
- function checkclose()
- //站点链接
- function getsiteurl()
- //获取文件名后缀
- function fileext($filename)
- //积分
- function creditrule($mode, $type)
- //更新积分
- function updatespacestatus($creditmode, $optype)
- //去掉slassh
- function sstripslashes($string)
- //显示广告
- function adshow($pagetype)
- //编码转换
- function siconv($str, $out_charset, $in_charset='')
- //获取用户数据
- function getpassport($username, $password)
- //用户操作时间间隔检查
- function interval_check($type)
- //处理上传图片连接
- function mkpicurl($pic, $thumb=1)
- //处理网络图片链接
- function getpicurl($picurl, $maxlenth='200')
- //处理积分星星
- function getstar($credit)
- //处理分页
- function smulti($start, $perpage, $count, $url, $ajaxdiv='')
- //获取好友状态
- function getfriendstatus($uid, $fuid)
- //重新组建
- function renum($array)
- //检查定向
- function ckfriend($invalue)
- //整理feed
- function mkfeed($feed, $actors=array())
- //整理分享
- function mkshare($share)
- //ip访问允许
- function ipaccess($ipaccess)
- //ip访问禁止
- function ipbanned($ipbanned)
- //检查start
- function ckstart($start, $perpage)
- //处理头像
- function avatar($uid, $size='small')
- //检查是否登录
- function checklogin()
- //获得前台语言
- function lang($key, $vars=array())
- //获得后台语言
- function cplang($key, $vars=array())
- //语言替换
- function lang_replace($text, $vars)
- //获得用户组名
- function getfriendgroup()
- //截取链接
- function sub_url($url, $length)
- //获取用户名
- function realname_set($uid, $username, $name='', $namestatus=0)
- //获取实名
- function realname_get()
- //添加窗口标题
- function window_set($title, $url, $icon='')
- //更新用户配置
- function update_space_setting()
- //群组信息
- function getmtag($id)
- //取数组中的随机个
- function sarray_rand($arr, $num)
- //获得用户唯一串
- function space_key($space)
- //产生form防伪码
- function formhash()
-
- function_cache.php //更新配置文件
- function config_cache($updatedata=true)
- //更新用户组CACHE
- function usergroup_cache()
- //更新用户栏目缓存
- function profilefield_cache()
- //更新群组栏目缓存
- function profield_cache()
- //更新词语屏蔽
- function censor_cache()
- //更新积分规则
- function creditrule_cache()
- //更新广告缓存
- function ad_cache()
- //更新用户向导任务
- function task_cache()
- //更新模块
- function block_cache()
- //更新模板文件
- function tpl_cache()
- //更新模块缓存
- function block_data_cache()
- //更新应用名
- function app_cache()
- //递归清空目录
- function deltreedir($dir)
- //数组转换成字串
- function arrayeval($array, $level = 0)
- //写入
- function cache_write($name, $var, $values)
-
- function_cp.php //保存图片
- function pic_save($FILE, $albumid, $title ,$tid = 0)
- //数据流保存,所有数据均为存放相册的所以写入的数据一定只能是图片
- function stream_save($strdata, $albumid = 0, $fileext = 'jpg')
- //创建相册
- function album_creat($arr)
- //获取上传路径
- function getfilepath($fileext, $mkdir=false)
- //获取目录
- function sreaddir($dir, $extarr=array())
- //检查邮箱是否有效
- function isemail($email)
- //获取相册封面图片
- function getalbumpic($uid, $id)
- //获取个人分类
- function getclassarr($uid)
- //获取相册
- function getalbums($uid)
- //事件发布
- function feed_add($icon, $title_template='', $title_data=array(), $body_template='', $body_data=array(),
- $body_general='', $images=array(), $image_links=array(), $target_ids='', $friend='', $appid=UC_APPID,
- $returnid=0, $system=0)
- //分享发布
- function share_add($type, $title_template, $body_template, $body_data, $body_general, $image='',
- $image_link='')
- //通知
- function notification_add($uid, $type, $note, $returnid=0)
- //更新好友状态
- function friend_update($uid, $username, $fuid, $fusername, $op='add', $gid=0)
- //更新好友缓存
- function friend_cache($uid)
- //检查验证码
- function ckseccode($seccode)
- //相册产生feed
- function album_feed($albumid)
- //更新隐私设置
- function privacy_update()
- //邀请好友
- function invite_update($inviteid, $uid, $username, $m_uid, $m_username)
- //获得邀请
- function invite_get($uid, $code)
- //实名认证
- function ckrealname($type)
- //邮件队列
- function addmailcron($touid, $email, $subject, $message='', $mailtype='')
- //检查头像是否上传
- function ckavatar($uid)
- //检查黑名单
- function isblacklist($to_uid)
- //管理后台通用方法
- function_admincp.php
- //获取限制条件
- function getwheres($intkeys, $strkeys, $randkeys, $likekeys, $pre='')
- //获取排序
- function getorders($alloworders, $default, $pre='')
- //对话框
- function cpmessage($msgkey, $url_forward='', $second=1, $values=array())
- //检查是否操作创始人
- function ckfounder($uid)
- //生成站点key
- function mksitekey()
- //统计数据
- function getstatistics()
- //日志
- function admincp_log()
- function_op.php //帖子操作方法
- //合并tag
- function mergetag($tagids, $newtagid)
- //锁定/开放tag
- function closetag($tagids, $optype)
- //合并mtag
- function mergemtag($tagids, $newtagid)
- //锁定/开放tag
- function closemtag($tagids, $optype)
- //话题精华
- function digestthreads($tagid, $tids, $v)
- //话题置顶
- function topthreads($tagid, $tids, $v)
- //模块解析通用方法
- function_block.php
-
- //处理模块
- function block_batch($param)
- //获取模块缓存
- function block_get($cachekey)
- //更新模块
- function block_set($cachekey, $blockarr)
- //字符串解析
- function parseparameter($param)
- //获取缓存分类名
- function getcachedirname($cachekey, $ext='')
- //MD5规则取缓存名
- function smd5($str)
- //获取数量sql
- function getcountsql($sqlstring, $rule, $tablename, $where)
- //获取数量和查询语句
- function getparamsql($paramarr)
- function mksqltime($time)
复制代码 |