首页 >

缁囨ⅵDedeCMS瀹炵幇瀛楁瘝绱㈠紩鎼滅储鍔熻兘

DEDE绯荤粺甯?瀛楁瘝绱㈠紩”鍔熻兘

缁囨ⅵDedeCMS瀹炵幇瀛楁瘝绱㈠紩鎼滅储鍔熻兘

瀹炵幇鏂规硶濡備笅

绗竴姝ワ細棣栧厛蹇呴』淇敼鏁版嵁搴撶粨鏋勶紝澧炲姞瀛樻斁鎷奸煶鐨勭殑瀛楁銆?/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="iscommend" type="checkbox" id="iscommend" value="11″10) echo ” checked”;?>>

鎺ㄨ崘

<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姣嶆帓鍒楋細ABCDEFGHJKLMNOPQRSTWXYZ <- 涓枃杞欢鍚嶆寜绗竴姹夊瓧澹版瘝鎺掑垪

鍏朵腑鍏抽敭閮ㄥ垎涓簁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锛堟帓搴忔柟娉曪級绛夛紝鐜板湪浣犵煡閬撴€庝箞鍔炰簡鍚э紵杩樹笉鐭ラ亾锛屼笅闈㈡槸涓€涓緥瀛愶細

A


缁囨ⅵDedeCMS瀹炵幇瀛楁瘝绱㈠紩鎼滅储鍔熻兘
  • 织梦DedeCMS修改文档标题最大长度
  • 织梦DedeCMS修改文档标题最大长度 | 织梦DedeCMS修改文档标题最大长度 ...

    缁囨ⅵDedeCMS瀹炵幇瀛楁瘝绱㈠紩鎼滅储鍔熻兘
  • 织梦DedeCMS键盘上下翻页教程
  • 织梦DedeCMS键盘上下翻页教程 | 织梦DedeCMS键盘上下翻页教程 ...

    缁囨ⅵDedeCMS瀹炵幇瀛楁瘝绱㈠紩鎼滅储鍔熻兘
  • 织梦DedeCMS利用[field:global.autoindex /]打造文章排行榜代码
  • 织梦DedeCMS利用[field:global.autoindex /]打造文章排行榜代码 | 织梦DedeCMS利用[field:global.autoindex /]打造文章排行榜代码 ...