DEDE绯荤粺甯?瀛楁瘝绱㈠紩”鍔熻兘
瀹炵幇鏂规硶濡備笅
绗竴姝ワ細棣栧厛蹇呴』淇敼鏁版嵁搴撶粨鏋勶紝澧炲姞瀛樻斁鎷奸煶鐨勭殑瀛楁銆?/p>
淇敼dede_archives琛紝鏂板pytitle锛寁archar(250)锛屽厑璁镐负绌恒€備笅闈㈡槸鍒涘缓琛ㄧ殑SQL锛屼粎渚涘弬鑰冿紝绾㈣壊閮ㄥ垎涓烘柊澧炵殑閮ㄥ垎锛屽彲浠ョ敤phpmyadmin鐩存帴淇敼琛ㄧ粨鏋勫疄鐜般€?/p>
CREATE TABLE `dede_archives` (
`ID` int(11) unsigned NOT NULL auto_increment,
`typeid` int(11) unsigned NOT NULL default ‘0′,
`typeid2` int(11) unsigned NOT NULL default ‘0′,
`sortrank` int(11) NOT NULL default ‘0′,
`iscommend` smallint(6) NOT NULL default ‘0′,
`ismake` smallint(6) NOT NULL default ‘0′,
`channel` int(11) NOT NULL default ‘1′,
`arcrank` smallint(6) NOT NULL default ‘0′,
`click` int(11) unsigned NOT NULL default ‘0′,
`money` smallint(6) NOT NULL default ‘0′,
`title` varchar(80) NOT NULL default “,
`shorttitle` varchar(36) NOT NULL default “,
`color` varchar(10) NOT NULL default “,
`writer` varchar(30) NOT NULL default “,
`source` varchar(50) NOT NULL default “,
`litpic` varchar(100) NOT NULL default “,
`pubdate` int(11) NOT NULL default ‘0′,
`senddate` int(11) NOT NULL default ‘0′,
`arcatt` smallint(6) NOT NULL default ‘0′,
`adminID` int(11) NOT NULL default ‘0′,
`memberID` int(11) unsigned NOT NULL default ‘0′,
`description` varchar(250) NOT NULL default “,
`keywords` varchar(60) NOT NULL default “,
`templet` varchar(60) NOT NULL default “,
`lastpost` int(11) NOT NULL default ‘0′,
`postnum` int(11) NOT NULL default ‘0′,
`redirecturl` varchar(150) NOT NULL default “,
`mtype` int(11) NOT NULL default ‘0′,
`userip` varchar(20) NOT NULL default “,
`locklikeid` smallint(6) NOT NULL default ‘0′,
`likeid` varchar(240) default “,
`pytitle` varchar(250) default NULL,
PRIMARY KEY (`ID`),
KEY `click` (`click`),
KEY `senddate` (`senddate`),
KEY `typeid` (`typeid`),
KEY `arcrank` (`arcrank`),
KEY `sortrank` (`sortrank`),
KEY `pubdate` (`pubdate`),
KEY `litpic` (`litpic`),
KEY `typeid2` (`typeid2`)
) ENGINE=MyISAM DEFAULT CHARSET=gbk;
绗簩姝ワ細鑾峰彇鏂囩珷鏍囬鐨勬嫾闊抽瀛楁瘝锛屽苟淇濆瓨鍒版暟鎹簱銆?/p>
闇€瑕佷慨鏀圭殑鏂囦欢鏈夛細
article_add.php銆乤rticle_add_action.php銆乤rticle_edit.php銆乤rticle_eidt_action.php
鍒嗗埆涓烘柊澧炴枃绔犲拰淇敼鏂囩珷鎺у埗鐨勫洓涓枃浠躲€?/p>
淇敼article_add.php涓猴細
鎺ㄨ崘
鍔犵矖
璺宠浆缃戝潃
淇濆瓨鎷奸煶
澧炲姞涓€涓繚瀛樻嫾闊崇殑閫夐」銆?/p>
淇敼article_edit.php涓猴細
鎺ㄨ崘
<input name="isbold" type="checkbox" id="isbold" value="5″>
鍔犵矖
<input name="isjump" onClick="ShowUrlTrEdit()" type="checkbox" id="isjump" value="1″>
璺宠浆缃戝潃
<input name="upinyin" type="checkbox" id="upinyin" value="1″<?php if($arcRow["pytitle"]””) echo ” checked”;?>>
淇濆瓨鎷奸煶
閬撶悊鍚屼笂銆?/p>
淇敼article_add_action.php涓猴細
//鑾峰緱鏍囬鐨勬嫾闊崇爜
if($upinyin==1) $pytitle = str_replace(“_”,””,GetPinyin($title,1));
//鍔犲叆鏁版嵁搴撶殑SQL璇彞
//———————————-
$inQuery = “INSERT INTO dede_archives(
typeid,typeid2,sortrank,iscommend,ismake,channel,
arcrank,click,money,title,shorttitle,color,writer,source,litpic,
pubdate,senddate,arcatt,adminID,memberID,description,keywords,templet,redirecturl,pytitle)
VALUES (‘$typeid’,’$typeid2′,’$sortrank’,’$iscommend’,’$ismake’,’$channelid’,
‘$arcrank’,’0′,’$money’,’$title’,’$shorttitle’,’$color’,’$writer’,’$source’,’$litpic’,
‘$pubdate’,’$senddate’,’$arcatt’,’$adminID’,’0′,’$description’,’$keywords’,’$templet’,’$redirecturl’,‘$pytitle’);”;
閫氳繃绯荤粺鍑芥暟GetPingyin鑾峰緱鏂囩珷鏍囬鐨勬嫾闊抽瀛楁瘝锛屽苟鐢熸垚insert璇彞锛屼繚瀛樻爣棰樻嫾闊抽瀛楁瘝鍒皃ytitle瀛楁銆?/p>
绫讳技锛屼慨鏀筧rticle_eidt_action.php涓猴細
//鐢ㄦ嫾闊冲懡鍚?/p>
if($upinyin==1) $pytitle = str_replace(“_”,””,GetPinyin($title,1));
//鏇存柊鏁版嵁搴撶殑SQL璇彞
//———————————-
$inQuery = “
update dede_archives set
typeid=’$typeid’,
typeid2=’$typeid2′,
sortrank=’$sortrank’,
redirecturl=’$redirecturl’,
iscommend=’$iscommend’,
ismake=’$ismake’,
arcrank=’$arcrank’,
money=’$money’,
title=’$title’,
color=’$color’,
writer=’$writer’,
source=’$source’,
litpic=’$litpic’,
pubdate=’$pubdate’,
description=’$description’,
keywords=’$keywords’,
templet=’$templet’,
shorttitle=’$shorttitle’,
arcatt=’$arcatt’,
pytitle=’$pytitle’
where ID=’$ID’; “;
绗笁姝ワ紝淇敼棣栭〉妯℃澘锛屾垨鑰呭叾瀹冮渶瑕佷娇鐢ㄨ繖涓姛鑳界殑妯℃澘銆?/p>
涓枃鎸夊0姣嶆帓鍒楋細A – B – C – D – E – F – G – H – J – K – L – M – N – O – P – Q – R – S – T – W – X – Y – Z <- 涓枃杞欢鍚嶆寜绗竴姹夊瓧澹版瘝鎺掑垪
鍏朵腑鍏抽敭閮ㄥ垎涓簁eyword=瀛楁瘝&searchtype=pytitle銆?/p>
绗洓姝ワ紝閫氳繃search.php瀹炵幇鎼滅储锛孌edeCMS涓嶅厑璁稿皬浜?涓瓧绗︾殑鎼滅储锛屽洜姝よ淇敼瀹冦€?/p>
淇敼/plus/search.php鏂囦欢锛屼慨鏀圭殑閮ㄥ垎涓虹孩鑹诧細
//鍒ゆ柇鏄惁涓哄0姣嶆悳绱?/p>
if($searchtype”pytitle”){
if($keyword==””||strlen($keyword)<3){
ShowMsg(“鍏抽敭瀛椾笉鑳藉皬浜?涓瓧鑺傦紒”,”-1″);
exit();
}
}
绗簲姝ワ紝淇敼骞跺疄鐜版悳绱€?/p>
淇敼/include/inc_arcsearch_view.php锛岀洰鏍囷細
鑾峰緱瀛楁瘝鍏抽敭瀛楋紝鐢熸垚鏂扮殑妫€绱㈡潯浠讹紝鑾峰彇鎼滅储绫诲瀷鍏抽敭瀛楋紙$searchtype锛夛紝璋冪敤涓嶅悓鐨勬樉绀烘ā鏉裤€?/p>
濂界殑锛岀户缁慨鏀癸紝淇敼濡備笅锛岀孩鑹查儴鍒嗕负鏂板鎴栬€呬慨鏀圭殑閮ㄥ垎銆?/p>
淇敼function GetKeywordSql()鍑芥暟锛屾柊澧烇細
//澹版瘝鎼滅储鏀寔
if($this->SearchType==”pytitle”){
$kwsql .= ” And dede_archives.pytitle like ‘$this->Keywords%’ “;
}
寤鸿鏀惧湪foreach($ks as $k){…}涓嬮潰
绗叚姝ワ紝閫氳繃涓婇潰锛屽凡缁忓疄鐜颁簡鎸夊瓧姣嶇储寮曪紝浣嗘槸璋冪敤鐨勬槸绯荤粺鐨勬悳绱㈡ā鏉匡紝涓嶉€傚悎鎸夌収瀛楁瘝绱㈠紩鐨勭壒鐐癸紝鍥犳闇€瑕佹洿杩涗竴姝ワ紝澧炲姞鏂扮殑妯℃澘鏀寔銆?/p>
1銆佷慨鏀?include/inc_arcsearch_view.php锛屼慨鏀筬unction __construct()鏋勯€犲嚱鏁般€備负锛?/p>
if($this->SearchType==”pytitle”) $tempfile = $GLOBALS[‘cfg_basedir’].$GLOBALS[‘cfg_templets_dir’].”/”.$GLOBALS[‘cfg_df_style’].”/”.$GLOBALS[‘cfg_templets_pysearch’];
else $tempfile = $GLOBALS[‘cfg_basedir’].$GLOBALS[‘cfg_templets_dir’].”/”.$GLOBALS[‘cfg_df_style’].”/search.htm”;
鐩爣鏄垽鏂綋$searchtype==pytitle鐨勬椂鍊欙紝璋冪敤鍏ㄥ眬鍙橀噺cfg_templets_pysearch瀹氫箟鐨勬ā鏉裤€?/p>
2銆佷慨鏀筰nclude/config_hand.php鏂囦欢銆傚鍔犲叏灞€鍙橀噺cfg_templets_pysearch銆?/p>
//鎷奸煶鎼滅储妯℃澘
$cfg_templets_pysearch = ‘pylist.htm’;
鐒跺悗灏卞彲浠ュ湪妯℃澘鏂囦欢澶归噷闈㈡柊澧瀙ylist.htm妯℃澘锛屾潵鏄剧ず瀛楁瘝鍒楄〃鐨勭粨鏋滀簡銆?/p>
绗竷姝ワ紝浜嬫儏杩樻病缁撴潫鍛€傝鏄笇鏈涢檺鍒舵樉绀虹殑鑼冨洿鎬庝箞鍔烇紵渚嬪鍙兂鏄剧ず杞欢鐨勶紝鎴栬€呮煇涓爮鐩殑杩欎箞鏄剧ず锛屾洿杩涗竴姝ャ€?/p>
鍏跺疄search鏀寔寰堝鍙傛暟锛屼緥濡?typeid锛堟爮鐩紪鍙凤級銆?channeltype锛堟枃绔犵被鍨嬬紪鍙凤級銆?orderby锛堟帓搴忔柟娉曪級绛夛紝鐜板湪浣犵煡閬撴€庝箞鍔炰簡鍚э紵杩樹笉鐭ラ亾锛屼笅闈㈡槸涓€涓緥瀛愶細