帝国CMS批量设置,帝国CMS万能标签

分类:建站教程 帝国cms教程 时间:2025-10-23 09:28 浏览:0 评论:0
0

当前目录列表:

  • 1、帝国CMS怎么批量添加信息的tags
  • 2、帝国CMS 如何批量替换 专题 内容?因为专题里面有部分内容需要修改 需要批量修改 如何解决?
  • 3、帝国CMS 批量修改数据
  • 4、如何批量修改文件名 帝国CMS
  • 5、帝国CMS7.2能不能批量修改信息中的选项设置?求高手解答!
  • 帝国CMS怎么批量添加信息的tags

    修改步骤:

    1、以下代码加入到admin/ecmsinfo.php,在任意2个elseif中间插入就行

    elseif,$enews=="AddTags_all"//列表批量添加Tags

    {

    $classid=$_POST['classid'];

    $id=$_POST['id'];

    $tags=$_POST['add_listtags'];

    $newstime=time,;

    eInsertTags2,$tags,$classid,$id,$newstime;

    }

    2、将以下代码加入到class/uesrfun.php

    //加入TAG表

    function eInsertTags2,$tags,$classid,$id,$newstime{

    global $empire,$dbtbpre,$class_r;

    if,!trim($tags)

    {

    printerror,"TAGS信息不能为空", "", 1, 0, 1;

    return '';

    }

    $count = count,$id; //统计ID数量

    $tags = RepPostVar,$tags;

    $tag = explode,",", $tags;

    if ,emptyempty($count)

    {

    printerror,"未选择信息ID", "", 1, 0, 1;

    }

    if ,count($tag1)

    {

    printerror,"只能添加一个TAGS词", "", 1, 0, 1;

    }

    $classid=,int$classid;

    $id[$i] = ,int$id[$i];

    $mid=,int$class_r[$classid][modid];

    for,$i=0;$i$count;$i++

    {

    $tbname=$class_r[$classid][tbname];//获取表名

    $r=$empire-fetch1,"select tagid from {$dbtbpre}enewstags where tagname='$tags' limit 1";

    $t = $empire-fetch1,"select infotags from {$dbtbpre}ecms_".$tbname." where id='$id[$i]'";

    $taga=$t['infotags'].",".$tags; //组合TAGS

    $tagb[$i] = explode,",",$taga; //设置数组

    $tagc=array_values,array_unique($tagb[$i]); //数组排重

    for,$t=0;$tcount($tagc;$t++)

    {//二级子循环TAGS数组输出

    $newtags[$i].= ",".$tagc[$t];

    }

    if,$r[tagid]

    {

    $datar=$empire-fetch1,"select tagid,classid,newstime from {$dbtbpre}enewstagsdata where tagid='$r[tagid]' and id='$id[$i]' and mid='$mid' limit 1";

    if,$datar[tagid]

    {

    if,$datar[classid]!=$classid||$datar[newstime]!=$newstime

    {

    $empire-query,"update {$dbtbpre}enewstagsdata set classid='$classid',newstime='$newstime' where tagid='$r[tagid]' and id='$id[$i]' and mid='$mid' limit 1";

    }

    }

    else

    {

    $empire-query,"update {$dbtbpre}enewstags set num=num+1 where tagid='$r[tagid]'";

    $empire-query,"update {$dbtbpre}ecms_".$tbname." set infotags='".trim($newtags[$i],","."' where id='$id[$i]'");

    $empire-query,"insert into {$dbtbpre}enewstagsdata(tagid,classid,id,newstime,mid values,'$r[tagid]','$classid','$id[$i]','$newstime','$mid';");

    }

    }

    else

    {

    $empire-query,"update {$dbtbpre}ecms_".$tbname." set infotags='".trim($newtags[$i],","."' where id='$id[$i]'");

    $empire-query,"insert into {$dbtbpre}enewstags(tagname,num,isgood,cid values,'$tags',1,0,0;");

    $tagid=$empire-lastid,;

    $empire-query,"insert into {$dbtbpre}enewstagsdata(tagid,classid,id,newstime,mid values,'$tagid','$classid','$id[$i]','$newstime','$mid';");

    }

    }

    printerror,"批量添加TAGS成功", "", 1, 0, 1;

    }

    3、信息管理列表模板最后一列修改成以下代码,在e/data/html/list/文件夹内

    td height="25" colspan="8"

    table width="100%" border="0" cellpadding="0" cellspacing="0"

    tr

    td width="68%" height="25"

    font color="#666666"备注:多选框蓝色为未审核信息;发布者红色为会员投稿;信息ID粗体为未生成,点击ID可刷新页面./font

    /td

    td width="32%" input type="text" name="add_listtags" id="add_listtags" size="50" value="" /

    input type="submit" name="Submit100" value="添加TAGS" onClick="document.listform.enews.value='AddTags_all';document.listform.action='ecmsinfo.php';"

    /td

    /tr

    /table

    /td

    帝国CMS 如何批量替换 专题 内容?因为专题里面有部分内容需要修改 需要批量修改 如何解决?

    这个有一个变通的方法:就是到数据库管理里,找到文章存储的那张表,将表导出为文件,具体看你的个人喜好了,我一般导出为csv文件,然后使用文本编辑器编辑这个文件就行,这时你使用查找替换的方法就很简单了。如果文件打开是乱码,则需要改变文件的编码。改完以后保存,记得还要改回原来的文件编码,再到数据库里,找那张表,将表内容清空,然后导入这个文件,导入时的识别参数要设置好。

    帝国cms批量设置,帝国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_

    55. $temp_

    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

    默认情况是这么修改的

    登录后台,依次找到 栏目 - 其他相关 - 批量替换字段值 ,在 选择替换表 中,找到你所用的表,然后选择 替换字段 为 newstext 原字符中填写你网站中存在的电话,新字符填写你现在的电话,现在选择 替换,把 正则替换 打上对勾 替换一下就OK了,最后重新生成就可以了

    帝国CMS7.2能不能批量修改信息中的选项设置?求高手解答!

    自己写sql语句,直接在后台执行就OK了

    update [!db.pre!]ecms_news set newstempid = 3 where classid = 5;

    // 把所有的栏目ID为5的,并且使用的是新闻系统模型的  信息全部修改为内容模版为 3,

    // 内容模版ID,请在后台的模版管理,内容模版管理中查看

    // 这个sql语句请在后台的    系统设置,左侧菜单的最后一项执行sql语句那里操作就OK了

    // 防止操作错误,请先进行数据备份再进行上述操作

    1. 本站所有资源来源于用户上传或网络,仅作为参考研究使用,如有侵权请邮件联系站长!
    2. 本站积分货币获取途径以及用途的解读,想在本站混的好,请务必认真阅读!
    3. 本站强烈打击盗版/破解等有损他人权益和违法作为,请各位会员支持正版!
    4. 建站教程 > 帝国CMS批量设置,帝国CMS万能标签

    用户评论