热搜词
发表于 2011-8-30 18:09:57 | 显示全部楼层 |阅读模式
地区操作
province:获取省市名称列表
city:获取指定省、市的市、区代码
area:获取指定城市的区、县列表
目录操作
dir_create:创建目录
dir_copy:目录拷贝
dir_delete:删除目录
dir_chmod:设置目录属性<BR>dir_path:格式化目录路径<BR>文件操作
file_down:通过php读取方式下载文件
fileext:获取文件后缀
file_put_contents:将一个字符串写入文件
array_save:保存数组到文件<BR>get_remotefiles:获取内容中远程文件到本地
获取HTML代码的函数:
menu:获取导航菜单html代码
admin_menu:获得后台操作菜单的html代码
catpos:获取栏目当前位置的html代码
admin_catpos:获取后台栏目当前位置html代码
showgroup:获取用户组表单html代码
style_edit:获取样式设置html代码
ubb:把UBB代码解析为合法的html代码
获取下拉菜单HTML代码的函数:
showtpl:获取同类型模板下拉框html代码
showskin:获取风格下拉框html代码
channel_select:获取当前频道的下拉框html代码
category_select:获取栏目下拉框html代码
type_select:获取类别下拉框html代码
special_select:获取专题下拉框html代码
生成HTML代码的函数<BR>createhtml:生成html
获取地址
channel_url:获取频道首页地址
cat_url:获取栏目地址
special_indexurl:获取专题首页地址
special_listurl:获取专题列表页地址
special_showurl:获取专题页地址
item_url:获取信息地址
itemurl:获取信息url地址
url处理
linkurl:url处理函数
imgurl:图片地址处理函数
获取路径
moduledir:获取模块路径
admintpl:获取后台模板路径
template:获取模板缓存物理路径
缓存操作
cache_all:更新所有公共缓存<BR>cache_module:更新模块配置缓存
cache_channel:更新频道配置信息
cache_categorys:更新模块、频道下的所有栏目基本配置信息<BR>cache_category:更新栏目配置缓存信息
cache_type:更新类别缓存信息
phpcache:php页面输出缓存
cache_table:更新数据表缓存<BR>cache_common:更新公共数组变量缓存
cache_write:写入数组或字符串到缓存文件<BR>cache_read:加载缓存文件
cache_delete:删除缓存文件
模板操作函数
template_cache:重新编译所有模板<BR>template_compile:模板编译
template_module:编译指定模块的所有模板<BR>template_parse:模板代码解析
tpl_data:获取模板执行后的数据
中文标签
tag_read:输出中文标签数据
tag_write:写入中文标签数据到文件<BR>tags_update:更新中文标签
分页函数
listpages:频道栏目信息列表分页函数
specialpages:专题列表分页函数
phppages:php页面分页函数
配置信息
cache_member_group:更新用户组配置信息<BR>module_setting:模块配置保存
channel_setting:获取频道配置信息
subcat:获取栏目夏季栏目配置信息数组<BR>admin_users:获取模块、频道、栏目管理员帐号代码
channel_table:获取频道表名
set_config:设置configiniphp的参数<BR>show_type:获取分类连接ID代码
cookie函数
getcookie:获取cookie的值<BR>mkcookie:创建或删除cookie
字串数值处理<BR>numberval:格式化数字<BR>new_addslashes:转义字符串或数组值<BR>new_htmlspecialchars:实体化字符串或数组值中的html
new_stripslashes:反字符串或者数组转义<BR>random:产生随机字符
reword:字符过滤
str_cut:截取字符串<BR>strip_js:格式化html为合法js字符串<BR>strip_textarea:格式化输出多行文本框提交的内容<BR>转换函数
bytes2x:把字节数转换为合适的单位
convert_encoding:字符编码转换
功能处理
check_puview:判断当前用户是否拥有权限
phpcms_auth:可逆的加密和解密<BR>str_safe:安全过滤表单数据
date_select:日期选择调用
checkcode:验证码输入检测<BR>sql_execute:批量执行sql语句
sendmail:发送E-mail
is_email:判断E_mail地址是否合法
editor:可视化编辑器调用
style:获取带样式的文字keylink:创建关联连接

function str_charset($in_charset, $out_charset, $str_or_arr) //转换字符串或者数组的编码   
function set_cookie($var, $value = '', $time = 0) //设置cookie   
function get_cookie($var) //取得cookie   
function menu($parentid, $code = '') //获取菜单   
function is_ie() //判断当前浏览器是否为IE   
function is_date($ymd, $sep='-') //检查日期的合法性&nbsp;  
function is_email($email) //验证Email   
function file_down($filepath, $filename = '') //下载函数   
function ip() //取得IP地址   
function str_cut($string, $length, $dot = '...') //截取字符串&nbsp;  
function cache_read($file, $path = '', $iscachevar = 0) //读取缓存   
function cache_write($file, $array, $path = '') //写缓存&nbsp;  
function cache_delete($file, $path = '') //删除缓存文件   
function string2array($data) //把字符串转化成数组&nbsp;  
function array2string($data, $isformdata = 1) //把数组转换成字符串&nbsp;  
function subarea($parentid = 0) //取得地区   
function subtype($module = 'phpcms') //取得模块的分类&nbsp;  
function thumb($imgurl, $width = 100, $height = 100 ,$autocut = 1) //生成缩略图&nbsp;  
function get_sql_catid($catid) //取得$catid的所有子栏目ID   
function get_sql_in($string, $s = ' ') //创建一个in 子句   
function pages($total, $page = 1, $perpage = 20, $urlrule = '', $array = array(), $catid = 0) //分页函数   
function showmessage($msg, $url_forward = 'goback', $ms = 1250, $direct = 0) //创建提示信息   
function load($file, $module = 'phpcms', $dir = '', $isinit = 1) //包含一个类文件(如同:include_once),同时返回一个对象&nbsp;  
function areaname($areaid) //返回$areaid 对应的地区名字&nbsp;  
function username($userid) //取得用户名&nbsp;  
function userid($username) //取得用户id
function str_charset($in_charset, $out_charset, $str_or_arr) //转换字符串或者数组的编码
function set_cookie($var, $value = '', $time = 0) //设置cookie
function get_cookie($var) //取得cookie
function menu($parentid, $code = '') //获取菜单
function is_ie() //判断当前浏览器是否为IE
function is_date($ymd, $sep='-') //检查日期的合法性<BR>function is_email($email) //验证Email
function file_down($filepath, $filename = '') //下载函数
function ip() //取得IP地址
function str_cut($string, $length, $dot = '...') //截取字符串<BR>function cache_read($file, $path = '', $iscachevar = 0) //读取缓存
function cache_write($file, $array, $path = '') //写缓存<BR>function cache_delete($file, $path = '') //删除缓存文件
function string2array($data) //把字符串转化成数组<BR>function array2string($data, $isformdata = 1) //把数组转换成字符串<BR>function subarea($parentid = 0) //取得地区
function subtype($module = 'phpcms') //取得模块的分类<BR>function thumb($imgurl, $width = 100, $height = 100 ,$autocut = 1) //生成缩略图<BR>function get_sql_catid($catid) //取得$catid的所有子栏目ID
function get_sql_in($string, $s = ' ') //创建一个in 子句
function pages($total, $page = 1, $perpage = 20, $urlrule = '', $array = array(), $catid = 0) //分页函数
function showmessage($msg, $url_forward = 'goback', $ms = 1250, $direct = 0) //创建提示信息
function load($file, $module = 'phpcms', $dir = '', $isinit = 1) //包含一个类文件(如同:include_once),同时返回一个对象<BR>function areaname($areaid) //返回$areaid 对应的地区名字<BR>function username($userid) //取得用户名<BR>function userid($username) //取得用户id

数据库类,打开include/db_mysql.class.php
系统会自动载入 db_mysql.class.php 文件,并用进行初始化数据库连接,因此在工程所有文件中均不需要单独初始化这个类,可直接用$db 进行操作,为了防止错误,操作完后不必关闭数据库</FONT> 常用的方法:
1、执行一个非查询类型的SQL语句,如 insert 、create 、update 等<BR>$db->query($sql);
返回值为是否执行成功。<BR>2、对数据库进行插入操作<BR>$db->insert($tablename, $array);//$tablename 表名,$array 字段名与值的对应 数组
返回值为是否执行成功。<BR>3、执行一条更新操作<BR>$db->update($tablename, $array, $where);// $tablename 表名, $array 字段名与值的对应 数组, $where 更新条件
返回值为是否执行成功。<BR>4、返回单条记录<BR>$db->get_one($sql);
5、执行条件查询语句<BR>$result = $db->query($sql);
while($r = $db->fetch_array($result))
{
}
等效于:
$arr = $db->select($sql);
6、重新选择要操作的数据库<BR>$db->select_db($tablename);
7、获取上一个插入的自动递增主键id值<BR>$db->insert_id();
8、获得MySql的版本号
$db->version();
9、析放某查询的资源<BR>$db->free_result($result);



全部评论0
回复
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|管理员之家 ( 苏ICP备2023053177号-2 )

GMT+8, 2024-9-19 09:49 , Processed in 0.119340 second(s), 22 queries .

Powered by Discuz! X3.5

Cpoyright © 2001-2024 Discuz! Team