帝国CMSfetch,帝国CMS付费扣点显示阅读隐藏插件简洁版
当前目录列表:
1、帝国CMS信息反馈页面怎么样才能让一个ip提交一次 2、帝国CMS 批量修改数据 3、帝国CMS 出现: mysql_fetch_array, expects parameter 1 to be resource, boolea 4、利用帝国CMS来仿站需要用到的函数有哪些
帝国CMS信息反馈页面怎么样才能让一个ip提交一次
找到e/class/q_functions.php文件,查到if,$br['groupid'],在上面加入以下代码
//IP是否存在
$sip=egetip,;
$sbr=$empire-fetch1,"select ip from {$dbtbpre}enewsfeedback where ip='$sip';";
if,!empty($sbr['ip'])
{
printerror,"ReDoForPl","history.go(-1",1);
}
具体操作可以参考拾月素材里的帝国CMS教程
帝国CMS 批量修改数据
用帝国做的商城系统,上传了很多产品图片,后来要求把缩略图改小,很伤脑筋,结果找到上面的帖子,但怎么搞也不行,可能那不是针对6.0.所有自己加以修改终于成功!!!
以下为修改方法:
一、首先,在t_functions.php中添加一下两个函数
1.function Titlepic_all ,$id, $classid, $userid, $username, $pwidth, $pheight
2. {
3. global $empire,$class_r,$class_zr,$dbtbpre,$keys;
4. $count = count ,$id;
5. if ,!$count
6. {
7. printerror ,'Noteditpic', 'history.go(-1');
8. }
9. for ,$i = 0; ($i $count; ++$i)
10. {
11. $r = $empire-fetch1 ,'select * from phome_ecms_'.$class_r[$classid][tbname].' where id='.$id[$i].' and titlepic""';
12. if,!emptyempty($r[id]){
13. ImageResize,"../../".$r[titlepic],$pwidth,$pheight,"../../".$r[titlepic];
14.
15. }
16. }
17.printerror ,'TitlepicAllSuccess', $_SERVER['HTTP_REFERER'];
18. }
19.Function ImageResize,$srcFile,$toW,$toH,$toFile=""
20.{
21. global $keys;
22. if,$toFile==""{ $toFile = substr,$srcFile,0,-4."small".substr,$srcFile,-4; }
23. $info = "";
24. $data = GetImageSize,$srcFile,$info;
25. switch ,$data[2]
26. {
27. case 1:
28. if,!function_exists("imagecreatefromgif"){
29. echo "你的GD库不能使用GIF格式的图片,请使用Jpeg或PNG格式
30.
31.!a href='fontjavascript:/fontgo,-1;'返回/a";
32. exit,;
33. }
34. $im = ImageCreateFromGIF,$srcFile;
35. break;
36. case 2:
37. if,!function_exists("imagecreatefromjpeg"){
38. Echo "你的GD库不能使用jpeg格式的图片,请使用其它格式的图
39.
40.片!a href='fontjavascript:/fontgo,-1;'返回/a";
41. Exit,;
42. }
43. $im = ImageCreateFromJpeg,$srcFile;
44. break;
45. case 3:
46. $im = ImageCreateFromPNG,$srcFile;
47. break;
48.}
49.$srcW = ImageSX,$im;
50.$srcH = ImageSY,$im;
51.$keys= 0;
52.if ,($srcW$toW or ,$srH$toH){
53.if,($srcW/$toW=,$srcH/$toH){
54. $temp_height=$toH;
55. $temp_width=$srcW/,$srcH/$toH;
56. $src_X=Abs,($toW-$temp_width/2);
57. $src_Y=0;
58. }
59. else{
60. $temp_width=$toW;
61. $temp_height=$srcH/,$srcW/$toW;
62. $src_X=0;
63. $src_Y=Abs,($toH-$temp_height/2);
64. }
65. $temp_img=ImageCreateTrueColor,$temp_width,$temp_height;
66. imagecopyResampled,$temp_img,$im,0,0,0,0,$temp_width,$temp_height,$srcW,$srcH;
67. $ni=ImageCreateTrueColor,$toW,$toH;
68. imagecopyResampled,$ni,$temp_img,0,0,$src_X,$src_Y,$toW,$toH,$toW,$toH;
69.
70.if,Function_exists('imagejpeg') ImageJpeg,$ni,$toFile;
71. else ImagePNG,$ni,$toFile;
72. ImageDestroy,$ni;
73.$keys= 1;
74.}
75.ImageDestroy,$im;
76.}
二、修改 e/admin/ListNews.php{还有个页面:e/admin/ListAllInfo.php},大约在最后几行“选中全部 /td/tr”的后面添加以下代码:
tr bgcolor="#FFFFFF"
td height="25" colspan="8"div align="right"
缩略图宽: input name="pwidth" type="text" value="120" width="60"
缩略图高: input name="pheight" type="text" value="120" width="60"
input type="submit" name="Submit355" value="修改缩略图" onClick="document.listform.enews.value='Titlepic_all';"
/div/td/tr
其中,图宽和图稿的默认值可按自己的情况设定,设定好后,以后操作更方便。
三、在e/admin/ecmsinfo.php中添加如下代码:
//批量加标题图片
elseif,$enews=="Titlepic_all"
{
$id=$_POST['id'];
$classid=$_POST['classid'];
$bclassid=$_POST['bclassid'];
$pwidth=$_POST['pwidth'];
$pheight=$_POST['pheight'];
Titlepic_all,$id,$classid,$logininid,$loginin,$pwidth,$pheight;
}
四、函数中用到“ printerror ,'Noteditpic', 'history.go(-1');”等操作提示,这个提示可加在e/data/language/gb/pub/message.php;当然这一步不加也不影响操作
在message.php 后面加:
'Noteditpic'='没有选择!',
'TitlepicAllSuccess'='操作成功!',

帝国CMS 出现: mysql_fetch_array, expects parameter 1 to be resource, boolea
mysql_fetch_array, 里面的参数 应该是一个sql语句的结果集 ,而你的语句是
mysql_fetch_array,$sql 似乎 参数是sql 语句 随意报错
改成 $ths-r=mysql_fetch_array,$this-query($sql) 试试
利用帝国CMS来仿站需要用到的函数有哪些
一、esub,截取字段函数语法:esub,字符串,截取字数,后缀
说明:后缀为截取字符后附带内容,此参数可以省略。
使用范例:
,返回结果为:123456
,返回结果为:123456...
二、date,转换时间格式函数
语法:date,时间格式,时间戳
说明:PHP本身函数,使用说明可以参考:
使用范例:
,返回结果为:2010-06-30 10:30:10
三、format_datetime,转换时间格式函数2
语法:format_datetime,正常时间,时间格式
说明:和date,的区别是format_datetime是转换正常时间,而date是转换unix时间戳。
使用范例:
,返回结果为:06/30
四、通过ID取得栏目地址函数
语法:sys_ReturnBqClassname,$r,9
说明:$r为含栏目ID的数组,变量名可任意命名。
使用范例:取得栏目ID=2的栏目地址。
$cr['classid']=2;
$classurl=sys_ReturnBqClassname,$cr,9;
echo $classurl;
?
通过ID取得栏目地址的其他方法:
,1、/e/public/ClassUrl/?classid=栏目ID
,2、/
五、取得信息内容页地址函数
语法:sys_ReturnBqTitleLink,$r
说明:$r为含“id,classid,newspath,filename,groupid,titleurl”字段内容的数组,变量名可任意命名。
使用范例:取得信息ID=8的新闻页面地址
$nr=$empire-fetch1,"select
id,classid,newspath,filename,groupid,titleurl from {$dbtbpre}ecms_news where
id='8' limit 1";
$titleurl=sys_ReturnBqTitleLink,$nr;
echo $titleurl;
?
通过ID取得信息内容页地址的其他方法:
/e/public/InfoUrl/?classid=栏目IDid=信息ID
六、提示信息函数1
语法:printerror,$error,$gotourl,$ecms,$noautourl,$novar
说明:
$error:提示信息内容,可以为语言包变量,也可以直接提示内容。
$gotourl:提示信息转向链接地址
$ecms:0为后台提示信息、1为前台提示信息、8为后台提示信息,alert方式、9为前台提示信息,alert方式
$noautourl:0为自动转向页面,1为不自动转向页面。此参数可省略,默认为0
$novar:0为提示信息内容采用语言包变量,1为提示信息内容为直接提示内容。此参数可以省略,默认为0
2. 本站积分货币获取途径以及用途的解读,想在本站混的好,请务必认真阅读!
3. 本站强烈打击盗版/破解等有损他人权益和违法作为,请各位会员支持正版!
4. 建站教程 > 帝国CMSfetch,帝国CMS付费扣点显示阅读隐藏插件简洁版


