经常遇到此类情况:后台误操作,不小心删除后台 discuz 代码,导致找不到 discuz 代码设置或者论坛的 discuz 代码无法正常使用;

下面主要讲述 Discuz7.0.0 版本遇到此类情况的一个解决方法,这里以常用的 Flash 为例;

论坛后台 => 工具 => 数据库 => 升级:

INSERT INTO cdb_bbcodes VALUES ('21','0','0','flash','bb_flash.gif','

','Flash Movie','嵌入 Flash 动画','1','请输入 Flash 动画的 URL:','1','20');

  • INSERT INTO cdb_bbcodes VALUES ('21','0','0','flash','bb_flash.gif','<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="550" height="400"><param name="allowScriptAccess" value="sameDomain"><param name="movie" value="{1}"><param name="quality" value="high"><param name="bgcolor" value="#ffffff"><embed src="{1}" quality="high" bgcolor="#ffffff" width="550" height="400" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" /></object>','Flash Movie','嵌入 Flash 动画','1','请输入 Flash 动画的 URL:','1','20');

复制上面的代码执行下,执行后,不小心删除的 Flash 代码就可以正常看到了。

其他的 discuz 代码都可以在论坛的 install 目录下 discuz.sql 文件内看到对应的 SQL 语句。

其他的 discuz 代码的 SQL 语句内容如下:

INSERT INTO cdb_bbcodes VALUES ('1','2','1','b i u','popup_simple','','','粗体 斜体 下划线','1','','1','0');
INSERT INTO cdb_bbcodes VALUES ('2','1','1','font','popup_fontname','','','字体','1','','1','1');
INSERT INTO cdb_bbcodes VALUES ('3','2','1','size','popup_fontsize','','','大小','1','','1','2');
INSERT INTO cdb_bbcodes VALUES ('4','2','1','color','popup_forecolor','','','颜色','1','','1','3');
INSERT INTO cdb_bbcodes VALUES ('5','2','1','align','popup_justify','','','对齐','1','','1','4');
INSERT INTO cdb_bbcodes VALUES ('6','2','1','url','cmd_createlink','','','链接','1','','1','5');
INSERT INTO cdb_bbcodes VALUES ('7','1','1','email','cmd_email','','','Email','1','','1','6');
INSERT INTO cdb_bbcodes VALUES ('8','2','1','img','cmd_insertimage','','','图片','1','','1','7');
INSERT INTO cdb_bbcodes VALUES ('9','2','1','media','popup_media','','','多媒体','1','','1','8');
INSERT INTO cdb_bbcodes VALUES ('10','2','1','quote','cmd_quote','','','引用','1','','1','9');
INSERT INTO cdb_bbcodes VALUES ('11','2','1','code','cmd_code','','','代码','1','','1','10');
INSERT INTO cdb_bbcodes VALUES ('12','2','1','list','popup_list','','','列表','1','','1','11');
INSERT INTO cdb_bbcodes VALUES ('13','2','1','indent outdent','popup_dent','','','缩进','1','','1','12');
INSERT INTO cdb_bbcodes VALUES ('14','1','1','float','popup_float','','','浮动','1','','1','13');
INSERT INTO cdb_bbcodes VALUES ('15','2','1','table','cmd_table','','','表格','1','','1','14');
INSERT INTO cdb_bbcodes VALUES ('16','1','1','free','cmd_free','','','免费信息','1','','1','15');
INSERT INTO cdb_bbcodes VALUES ('17','2','1','hide','cmd_hide','','','隐藏内容','1','','1','16');
INSERT INTO cdb_bbcodes VALUES ('18','2','1','smilies','popup_smilies','','','表情','1','','1','17');
INSERT INTO cdb_bbcodes VALUES ('19','2','1','tools','popup_tools','','','工具','1','','1','99');
INSERT INTO cdb_bbcodes VALUES ('20','0','0','fly','bb_fly.gif','<marquee width="90%" behavior="alternate" scrollamount="3">{1}</marquee>','[fly]This is sample text[/fly]','使内容横向滚动,这个效果类似 HTML 的 marquee 标签,注意:这个效果只在 Internet Explorer 浏览器下有效。','1','请输入滚动显示的文字:','1','19');
INSERT INTO cdb_bbcodes VALUES ('21','0','0','flash','bb_flash.gif','<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="550" height="400"><param name="allowScriptAccess" value="sameDomain"><param name="movie" value="{1}"><param name="quality" value="high"><param name="bgcolor" value="#ffffff"><embed src="{1}" quality="high" bgcolor="#ffffff" width="550" height="400" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" /></object>','Flash Movie','嵌入 Flash 动画','1','请输入 Flash 动画的 URL:','1','20');
INSERT INTO cdb_bbcodes VALUES ('22','1','0','qq','bb_qq.gif','<a href="http://wpa.qq.com/msgrd?V=1&Uin={1}&Site=[Discuz!]&Menu=yes" target="_blank"><img src="http://wpa.qq.com/pa?p=1:{1}:1" border="0"></a>','[qq]688888[/qq]','显示 QQ 在线状态,点这个图标可以和他 (她) 聊天','1','请输入显示在线状态 QQ 号码:','1','21');
INSERT INTO cdb_bbcodes VALUES ('23','0','0','sup','bb_sup.gif','<sup>{1}</sup>','X[sup]2[/sup]','上标','1','请输入上标文字:','1','22');
INSERT INTO cdb_bbcodes VALUES ('24','0','0','sub','bb_sub.gif','<sub>{1}</sub>','X[sub]2[/sub]','下标','1','请输入下标文字:','1','23');