Discuz!官方免费开源建站系统

 找回密码
 立即注册
搜索

uchome 通用方法汇总

[复制链接]
fzcm 发表于 2009-12-13 13:08:54 | 显示全部楼层 |阅读模式
了解了以下UCHOME的通用方法,将对我们的二次开发非常的有效,对于开发插件将更加的方便快捷
  1. function_common.php
  2. //SQL ADDSLASHES
  3. function saddslashes($string)   return $string;

  4. //取消HTML代码
  5. function shtmlspecialchars($string)  return $string;

  6. //字符串解密加密
  7. function authcode($string, $operation = 'DECODE', $key = '', $expiry = 0)

  8. //清空cookie
  9. function clearcookie()

  10. //cookie设置
  11. function ssetcookie($var, $value, $life=0)

  12. //数据库连接
  13. function dbconnect()

  14. //获取在线IP
  15. function getonlineip($format=0)

  16. //判断当前用户登录状态
  17. function checkauth()

  18. //获取用户app列表
  19. function getuserapp($uid=0)

  20. //获取到表名
  21. function tname($name)

  22. //对话框
  23. function showmessage($msgkey, $url_forward='', $second=1, $values=array())

  24. //判断提交是否正确
  25. function submitcheck($var)

  26. //添加数据
  27. function inserttable($tablename, $insertsqlarr, $returnid=0, $replace = false, $silent=0)  return insert_id;

  28. //更新数据
  29. function updatetable($tablename, $setsqlarr, $wheresqlarr, $silent=0)

  30. //获取用户空间信息
  31. function getspace($key, $indextype='uid')

  32. //获取当前用户信息
  33. function getmember()

  34. //检查隐私
  35. function ckprivacy($type, $feedmode=0)

  36. //检查APP隐私
  37. function app_ckprivacy($privacy)

  38. //获取用户组
  39. function getgroupid($credit, $gid=0)

  40. //检查权限
  41. function checkperm($permtype)

  42. //写运行日志
  43. function runlog($file, $log, $halt=0)

  44. //获取字符串
  45. function getstr($string, $length, $in_slashes=0, $out_slashes=0, $censor=0, $bbcode=0, $html=0)

  46. //时间格式化
  47. function sgmdate($dateformat, $timestamp='', $format=0)

  48. //字符串时间化
  49. function sstrtotime($string)

  50. //分页
  51. function multi($num, $perpage, $curpage, $mpurl)

  52. //ob
  53. function obclean()

  54. //模板调用
  55. function template($name)

  56. //子模板更新检查
  57. function subtplcheck($subfiles, $mktime, $tpl)

  58. //模块
  59. function block($param)

  60. //获取数目
  61. function getcount($tablename, $wherearr, $get='COUNT(*)')

  62. //调整输出
  63. function ob_out()

  64. //rewrite链接
  65. function rewrite_url($pre, $para)

  66. //外链
  67. function iframe_url($url)

  68. //处理搜索关键字
  69. function stripsearchkey($string)

  70. //是否屏蔽二级域名
  71. function isholddomain($domain)

  72. //连接字符
  73. function simplode($ids)


  74. //显示进程处理时间
  75. function debuginfo()

  76. //格式化大小函数
  77. function formatsize($size)

  78. //获取文件内容
  79. function sreadfile($filename)

  80. //写入文件
  81. function swritefile($filename, $writetext, $openmod='w')

  82. //产生随机字符
  83. function random($length, $numeric = 0)

  84. //判断字符串是否存在
  85. function strexists($haystack, $needle)

  86. //获取数据
  87. function data_get($var, $isarray=0)

  88. //更新数据
  89. function data_set($var, $datavalue, $clean=0)

  90. //检查站点是否关闭
  91. function checkclose()

  92. //站点链接
  93. function getsiteurl()

  94. //获取文件名后缀
  95. function fileext($filename)

  96. //积分
  97. function creditrule($mode, $type)

  98. //更新积分
  99. function updatespacestatus($creditmode, $optype)

  100. //去掉slassh
  101. function sstripslashes($string)

  102. //显示广告
  103. function adshow($pagetype)

  104. //编码转换
  105. function siconv($str, $out_charset, $in_charset='')

  106. //获取用户数据
  107. function getpassport($username, $password)

  108. //用户操作时间间隔检查
  109. function interval_check($type)

  110. //处理上传图片连接
  111. function mkpicurl($pic, $thumb=1)

  112. //处理网络图片链接
  113. function getpicurl($picurl, $maxlenth='200')

  114. //处理积分星星
  115. function getstar($credit)

  116. //处理分页
  117. function smulti($start, $perpage, $count, $url, $ajaxdiv='')

  118. //获取好友状态
  119. function getfriendstatus($uid, $fuid)

  120. //重新组建
  121. function renum($array)

  122. //检查定向
  123. function ckfriend($invalue)

  124. //整理feed
  125. function mkfeed($feed, $actors=array())

  126. //整理分享
  127. function mkshare($share)

  128. //ip访问允许
  129. function ipaccess($ipaccess)

  130. //ip访问禁止
  131. function ipbanned($ipbanned)

  132. //检查start
  133. function ckstart($start, $perpage)

  134. //处理头像
  135. function avatar($uid, $size='small')

  136. //检查是否登录
  137. function checklogin()

  138. //获得前台语言
  139. function lang($key, $vars=array())

  140. //获得后台语言
  141. function cplang($key, $vars=array())

  142. //语言替换
  143. function lang_replace($text, $vars)

  144. //获得用户组名
  145. function getfriendgroup()

  146. //截取链接
  147. function sub_url($url, $length)

  148. //获取用户名
  149. function realname_set($uid, $username, $name='', $namestatus=0)

  150. //获取实名
  151. function realname_get()

  152. //添加窗口标题
  153. function window_set($title, $url, $icon='')

  154. //更新用户配置
  155. function update_space_setting()

  156. //群组信息
  157. function getmtag($id)

  158. //取数组中的随机个
  159. function sarray_rand($arr, $num)

  160. //获得用户唯一串
  161. function space_key($space)

  162. //产生form防伪码
  163. function formhash()

  164. function_cache.php //更新配置文件

  165. function config_cache($updatedata=true)

  166. //更新用户组CACHE
  167. function usergroup_cache()

  168. //更新用户栏目缓存
  169. function profilefield_cache()

  170. //更新群组栏目缓存
  171. function profield_cache()

  172. //更新词语屏蔽
  173. function censor_cache()

  174. //更新积分规则
  175. function creditrule_cache()

  176. //更新广告缓存
  177. function ad_cache()

  178. //更新用户向导任务
  179. function task_cache()

  180. //更新模块
  181. function block_cache()

  182. //更新模板文件
  183. function tpl_cache()

  184. //更新模块缓存
  185. function block_data_cache()

  186. //更新应用名
  187. function app_cache()

  188. //递归清空目录
  189. function deltreedir($dir)

  190. //数组转换成字串
  191. function arrayeval($array, $level = 0)

  192. //写入
  193. function cache_write($name, $var, $values)



  194. function_cp.php //保存图片
  195. function pic_save($FILE, $albumid, $title ,$tid = 0)

  196. //数据流保存,所有数据均为存放相册的所以写入的数据一定只能是图片
  197. function stream_save($strdata, $albumid = 0, $fileext = 'jpg')

  198. //创建相册
  199. function album_creat($arr)

  200. //获取上传路径
  201. function getfilepath($fileext, $mkdir=false)

  202. //获取目录
  203. function sreaddir($dir, $extarr=array())

  204. //检查邮箱是否有效
  205. function isemail($email)

  206. //获取相册封面图片
  207. function getalbumpic($uid, $id)

  208. //获取个人分类
  209. function getclassarr($uid)

  210. //获取相册
  211. function getalbums($uid)

  212. //事件发布
  213. function feed_add($icon, $title_template='', $title_data=array(), $body_template='', $body_data=array(),

  214. $body_general='', $images=array(), $image_links=array(), $target_ids='', $friend='', $appid=UC_APPID,

  215. $returnid=0, $system=0)

  216. //分享发布
  217. function share_add($type, $title_template, $body_template, $body_data, $body_general, $image='',

  218. $image_link='')

  219. //通知
  220. function notification_add($uid, $type, $note, $returnid=0)

  221. //更新好友状态
  222. function friend_update($uid, $username, $fuid, $fusername, $op='add', $gid=0)

  223. //更新好友缓存
  224. function friend_cache($uid)

  225. //检查验证码
  226. function ckseccode($seccode)

  227. //相册产生feed
  228. function album_feed($albumid)

  229. //更新隐私设置
  230. function privacy_update()

  231. //邀请好友
  232. function invite_update($inviteid, $uid, $username, $m_uid, $m_username)

  233. //获得邀请
  234. function invite_get($uid, $code)

  235. //实名认证
  236. function ckrealname($type)

  237. //邮件队列
  238. function addmailcron($touid, $email, $subject, $message='', $mailtype='')

  239. //检查头像是否上传
  240. function ckavatar($uid)

  241. //检查黑名单
  242. function isblacklist($to_uid)


  243. //管理后台通用方法

  244. function_admincp.php

  245. //获取限制条件
  246. function getwheres($intkeys, $strkeys, $randkeys, $likekeys, $pre='')

  247. //获取排序
  248. function getorders($alloworders, $default, $pre='')

  249. //对话框
  250. function cpmessage($msgkey, $url_forward='', $second=1, $values=array())

  251. //检查是否操作创始人
  252. function ckfounder($uid)

  253. //生成站点key
  254. function mksitekey()

  255. //统计数据
  256. function getstatistics()

  257. //日志
  258. function admincp_log()

  259. function_op.php    //帖子操作方法

  260. //合并tag
  261. function mergetag($tagids, $newtagid)

  262. //锁定/开放tag
  263. function closetag($tagids, $optype)

  264. //合并mtag
  265. function mergemtag($tagids, $newtagid)

  266. //锁定/开放tag
  267. function closemtag($tagids, $optype)

  268. //话题精华
  269. function digestthreads($tagid, $tids, $v)

  270. //话题置顶
  271. function topthreads($tagid, $tids, $v)


  272. //模块解析通用方法
  273. function_block.php        
  274.         
  275. //处理模块
  276. function block_batch($param)

  277. //获取模块缓存
  278. function block_get($cachekey)

  279. //更新模块
  280. function block_set($cachekey, $blockarr)

  281. //字符串解析
  282. function parseparameter($param)

  283. //获取缓存分类名
  284. function getcachedirname($cachekey, $ext='')

  285. //MD5规则取缓存名
  286. function smd5($str)

  287. //获取数量sql
  288. function getcountsql($sqlstring, $rule, $tablename, $where)

  289. //获取数量和查询语句
  290. function getparamsql($paramarr)

  291. function mksqltime($time)
复制代码
回复

使用道具 举报

ゾ芯︵亂ジ 发表于 2009-12-13 13:15:57 | 显示全部楼层
有用.................
回复

使用道具 举报

kufou 发表于 2009-12-13 19:29:54 | 显示全部楼层
难得好帖,不支持对不起自己
回复

使用道具 举报

wuzsh 发表于 2010-4-29 23:46:09 | 显示全部楼层
这个很赞,不得不顶!谢谢LZ
http://www.wuzesheng.com
http://www.uyuanren.com
http://blog.uyuanren.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-9-13 07:45 , Processed in 0.122976 second(s), 14 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表