Dedecms when editing the content, tag tags need to manually lose, the Chinese tag, the middle also have to use half-width character ', ' separation, input method Che cut very inconvenient, so the background code, use the background tags_main.php, let dedecms add content can go Tags_ Main to choose.
1. Open the \dede\templets\album_add.htm file and add the JS method to the JS script area at the top head.
functionvar tagg=window.showmodaldialog ("tags_main.php", "tag", "dialogwidth=800px"; dialogheight=600px "); if (typeof (Tagg)! = ' undefined ') document.form1.tags.value=tagg; }
2. In the TD labeled tag Input, add
<type= "button" onclick= "Setag ()" value= " Select " style=" Width:70px;cursor:pointer; />
a button.
3. Transform the \dede\templets\tags_main.php file. Add the following JS code to the JS script area at the top head.
// Select keywords var tag= ""; function Selecttag (str) {tag=tag+ "," +str; if (TAG.SUBSTR (0,1) = = ', ') tag=tag.substr (1); $ ("#selecttag"). val (tag);} function Selecttagok () {Window.returnvalue= $ ("#selecttag"). Val (); Window.close (); }
4. Add the following HTML to the body anywhere, PS: The place you want to display.
<Divstyle= "padding-left:20px;border:1px">Selected tag:<inputtype= ' text 'ID= ' Selecttag 'name= ' Selecttag 'size= ' + '/><inputtype= "button"OnClick= "Selecttagok ()"value= "OK Selection"/> </Div>
5. In the tag list, locate the
<href= "... /tags.php?/<?php Echo UrlEncode ($fields [' tag ']); >/" target=" _blank ">{ Dede:field.tag/}</a>
Modify it to:
<href= "... /tags.php?/<?php Echo UrlEncode ($fields [' tag ']); >/" target=" _blank ">{ Dede:field.tag/}</a><href= "#" onclick = "Selecttag (' {dede:field.tag/} ')" > Select </ a >
Use Help:
Modify the page to refer to the Add page for JS code additions.
Anti-Wall Google:www.gaomn.com
Heat Map Bar: www.retu8.com
Sexy beauty: http://www.8kmm.com
Original: JS code, let DEDECMS support tag selection, add content more convenient, without hand lose tag