code
stringlengths
1
2.01M
repo_name
stringlengths
3
62
path
stringlengths
1
267
language
stringclasses
231 values
license
stringclasses
13 values
size
int64
1
2.01M
<!-- * FCKeditor - The text editor for internet * Copyright (C) 2003-2005 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: * http://www.opensource.org/licenses/lgpl-license.php * * For further information visit: * http://www.fckeditor.net/ * * "Support Open Source software. What about a donation today?" * * File Name: fck_table.html * Table dialog window. * * File Authors: * Frederico Caldeira Knabben (fredck@fckeditor.net) --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <html> <head> <title>Table Properties</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="robots" content="noindex, nofollow" /> <script type="text/javascript"> var oEditor = window.parent.InnerDialogLoaded() ; // Gets the document DOM var oDOM = oEditor.FCK.EditorDocument ; // Gets the table if there is one selected. var table ; var e = oEditor.FCKSelection.GetSelectedElement() ; if ( ( !e && document.location.search.substr(1) == 'Parent' ) || ( e && e.tagName != 'TABLE' ) ) e = oEditor.FCKSelection.MoveToAncestorNode( 'TABLE' ) ; if ( e && e.tagName == "TABLE" ) table = e ; // Fired when the window loading process is finished. It sets the fields with the // actual values if a table is selected in the editor. window.onload = function() { // First of all, translate the dialog box texts oEditor.FCKLanguageManager.TranslatePage(document) ; if (table) { document.getElementById('txtRows').value = table.rows.length ; document.getElementById('txtColumns').value = table.rows[0].cells.length ; // Gets the value from the Width or the Style attribute var iWidth = (table.style.width ? table.style.width : table.width ) ; var iHeight = (table.style.height ? table.style.height : table.height ) ; if (iWidth.indexOf('%') >= 0) // Percentual = % { iWidth = parseInt( iWidth.substr(0,iWidth.length - 1) ) ; document.getElementById('selWidthType').value = "percent" ; } else if (iWidth.indexOf('px') >= 0) // Style Pixel = px { // iWidth = iWidth.substr(0,iWidth.length - 2); document.getElementById('selWidthType').value = "pixels" ; } if (iHeight && iHeight.indexOf('px') >= 0) // Style Pixel = px iHeight = iHeight.substr(0,iHeight.length - 2); document.getElementById('txtWidth').value = iWidth ; document.getElementById('txtHeight').value = iHeight ; document.getElementById('txtBorder').value = table.border ; document.getElementById('selAlignment').value = table.align ; document.getElementById('txtCellPadding').value = table.cellPadding ; document.getElementById('txtCellSpacing').value = table.cellSpacing ; document.getElementById('txtSummary').value = table.summary; // document.getElementById('cmbFontStyle').value = table.className ; if (table.caption) document.getElementById('txtCaption').value = table.caption.innerHTML ; document.getElementById('txtRows').disabled = true ; document.getElementById('txtColumns').disabled = true ; } window.parent.SetOkButton( true ) ; window.parent.SetAutoSize( true ) ; } // Fired when the user press the OK button function Ok() { var bExists = ( table != null ) ; if ( ! bExists ) { table = document.createElement( "TABLE" ) ; } // Removes the Width and Height styles if ( bExists && table.style.width ) table.style.width = null ; //.removeAttribute("width") ; if ( bExists && table.style.height ) table.style.height = null ; //.removeAttribute("height") ; table.width = document.getElementById('txtWidth').value + ( document.getElementById('selWidthType').value == "percent" ? "%" : "") ; table.height = document.getElementById('txtHeight').value ; table.border = document.getElementById('txtBorder').value ; table.align = document.getElementById('selAlignment').value ; table.cellPadding = document.getElementById('txtCellPadding').value ; table.cellSpacing = document.getElementById('txtCellSpacing').value ; table.summary = document.getElementById('txtSummary').value ; // table.className = cmbFontStyle.value ; if ( document.getElementById('txtCaption').value != '') { if (! table.caption) table.createCaption() ; table.caption.innerHTML = document.getElementById('txtCaption').value ; } else if ( bExists && table.caption ) { if ( document.all ) table.caption.innerHTML = '' ; // TODO: It causes an IE internal error if using removeChild. else table.caption.parentNode.removeChild( table.caption ) ; } if (! bExists) { var iRows = document.getElementById('txtRows').value ; var iCols = document.getElementById('txtColumns').value ; for ( var r = 0 ; r < iRows ; r++ ) { var oRow = table.insertRow(-1) ; for ( var c = 0 ; c < iCols ; c++ ) { var oCell = oRow.insertCell(-1) ; if ( oEditor.FCKBrowserInfo.IsGecko ) oCell.innerHTML = '<br _moz_editor_bogus_node="TRUE">' ; //oCell.innerHTML = "&nbsp;" ; } } oEditor.FCKUndo.SaveUndoStep() ; // START iCM MODIFICATIONS // Amended to ensure that newly inserted tables are not incorrectly nested in P tags, etc // We insert the table first and then rectify any nestings afterwards so we can re-use the // FCKTablesProcessor function that corrects tables on SetHTML() /* table = oEditor.FCK.InsertElementAndGetIt( table ) ; if ( !oEditor.FCKConfig.UseBROnCarriageReturn ) { oEditor.FCKTablesProcessor.CheckTableNesting( table ) ; } */ // END iCM MODIFICATIONS oEditor.FCK.InsertElement( table ) ; } return true ; } function IsDigit( e ) { e = e || event ; var iCode = ( e.keyCode || e.charCode ) ; return ( ( iCode >= 48 && iCode <= 57 ) // Numbers || (iCode >= 37 && iCode <= 40) // Arrows || iCode == 8 // Backspace || iCode == 46 // Delete ) ; } </script> </head> <body bottommargin="5" leftmargin="5" topmargin="5" rightmargin="5" scroll="no" style="OVERFLOW: hidden"> <table id="otable" cellSpacing="0" cellPadding="0" width="100%" border="0" height="100%"> <tr> <td> <table cellSpacing="1" cellPadding="1" width="100%" border="0"> <tr> <td valign="top"> <table cellSpacing="0" cellPadding="0" border="0"> <tr> <td><span fckLang="DlgTableRows">Rows</span>:</td> <td>&nbsp;<input id="txtRows" type="text" maxLength="3" size="2" value="3" name="txtRows" onkeypress="return IsDigit(event);"></td> </tr> <tr> <td><span fckLang="DlgTableColumns">Columns</span>:</td> <td>&nbsp;<input id="txtColumns" type="text" maxLength="2" size="2" value="2" name="txtColumns" onkeypress="return IsDigit(event);"></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td><span fckLang="DlgTableBorder">Border size</span>:</td> <td>&nbsp;<INPUT id="txtBorder" type="text" maxLength="2" size="2" value="1" name="txtBorder" onkeypress="return IsDigit(event);"></td> </tr> <tr> <td><span fckLang="DlgTableAlign">Alignment</span>:</td> <td>&nbsp;<select id="selAlignment" name="selAlignment"> <option fckLang="DlgTableAlignNotSet" value="" selected>&lt;Not set&gt;</option> <option fckLang="DlgTableAlignLeft" value="left">Left</option> <option fckLang="DlgTableAlignCenter" value="center">Center</option> <option fckLang="DlgTableAlignRight" value="right">Right</option> </select></td> </tr> </table> </td> <td>&nbsp;&nbsp;&nbsp;</td> <td align="right" valign="top"> <table cellSpacing="0" cellPadding="0" border="0"> <tr> <td><span fckLang="DlgTableWidth">Width</span>:</td> <td>&nbsp;<input id="txtWidth" type="text" maxLength="4" size="3" value="200" name="txtWidth" onkeypress="return IsDigit(event);"></td> <td>&nbsp;<select id="selWidthType" name="selWidthType"> <option fckLang="DlgTableWidthPx" value="pixels" selected>pixels</option> <option fckLang="DlgTableWidthPc" value="percent">percent</option> </select></td> </tr> <tr> <td><span fckLang="DlgTableHeight">Height</span>:</td> <td>&nbsp;<INPUT id="txtHeight" type="text" maxLength="4" size="3" name="txtHeight" onkeypress="return IsDigit(event);"></td> <td>&nbsp;<span fckLang="DlgTableWidthPx">pixels</span></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td nowrap><span fckLang="DlgTableCellSpace">Cell spacing</span>:</td> <td>&nbsp;<input id="txtCellSpacing" type="text" maxLength="2" size="2" value="1" name="txtCellSpacing" onkeypress="return IsDigit(event);"></td> <td>&nbsp;</td> </tr> <tr> <td nowrap><span fckLang="DlgTableCellPad">Cell padding</span>:</td> <td>&nbsp;<input id="txtCellPadding" type="text" maxLength="2" size="2" value="1" name="txtCellPadding" onkeypress="return IsDigit(event);"></td> <td>&nbsp;</td> </tr> </table> </td> </tr> </table> <table cellSpacing="0" cellPadding="0" width="100%" border="0"> <!-- <tr> <td nowrap> <span fcklang="DlgClassName">Class Name</span>:</td> <td>&nbsp;</td> <td> <script type="text/javascript"> // var tbstyles = new TBCombo( "FontStyle" , "null" , "", oEditor.config.StyleNames, oEditor.config.StyleValues, 'CheckStyle("cmbFontStyle")'); // document.write(tbstyles.GetHTML()); </script></td> </tr> --> <tr> <td nowrap><span fckLang="DlgTableCaption">Caption</span>:</td> <td>&nbsp;</td> <td width="100%" nowrap>&nbsp; <input id="txtCaption" type="text" style="WIDTH: 100%"></td> </tr> <tr> <td nowrap><span fckLang="DlgTableSummary">Summary</span>:</td> <td>&nbsp;</td> <td width="100%" nowrap>&nbsp; <input id="txtSummary" type="text" style="WIDTH: 100%"></td> </tr> </table> </td> </tr> </table> </body> </html>
zyyhong
trunk/jiaju001/news/include/FCKeditor/editor/dialog/fck_table.html
HTML
asf20
10,624
<HTML> <HEAD> <title>插入Flash</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <style> .td{font-size:10pt;} </style> <script language=javascript> var oEditor = window.parent.InnerDialogLoaded() ; var oDOM = oEditor.FCK.EditorDocument ; var FCK = oEditor.FCK; function TableOK(){ var furl,widthdd,heightdd,doflash; furl = encodeURI(document.form1.furl.value); widthdd = document.form1.fwidth.value; heightdd = document.form1.fheight.value; doflash = "<embed src='"+ furl +"' document.document.form1.='hight' wmode='transparent' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+ widthdd +"' height='"+ heightdd +"'></embed>\r\n"; if(document.all) oDOM.selection.createRange().pasteHTML(doflash); else FCK.InsertHtml(doflash); window.close(); } function SelectMedia(fname) { var posLeft = 150; var posTop = 100; window.open("../../../dialoguser/select_media.php?f="+fname, "popUpMediaWin", "scrollbars=yes,resizable=yes,statebar=no,width=600,height=450,left="+posLeft+", top="+posTop); } </script> <link href="base.css" rel="stylesheet" type="text/css"> <base target="_self"> </HEAD> <body bgcolor="#EBF6CD" topmargin="8"> <form name="form1" id="form1"> <table border="0" width="98%" align="center"> <tr> <td align="right">网 址:</td> <td colspan="3"> <input name="furl" type="text" id="furl" style="width:200px" value="http://"> <input type="button" name="selmedia" class="binput" style="width:60px" value="浏览..." onClick="SelectMedia('form1.furl')"> </td> </tr> <tr> <td align="right">宽 度:</td> <td nowrap colspan="3"> <input type="text" name="fwidth" id="fwidth" size="8" value="400" > &nbsp;&nbsp; 高 度: <input name="fheight" type="text" id="fheight" value="300" size="8" ></td> </tr> <tr height="50"> <td align="right">&nbsp;</td> <td nowrap>&nbsp; </td> <td colspan="2" align="right" nowrap> <input onclick="TableOK();" type="button" name="Submit2" value=" 确定 " class="binput"> </td> </tr> </table> </form> </body> </HTML>
zyyhong
trunk/jiaju001/news/include/FCKeditor/editor/dialog/flashuser.htm
HTML
asf20
2,266
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- * FCKeditor - The text editor for internet * Copyright (C) 2003-2005 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: * http://www.opensource.org/licenses/lgpl-license.php * * For further information visit: * http://www.fckeditor.net/ * * "Support Open Source software. What about a donation today?" * * File Name: fck_find.html * "Find" dialog window. * * File Authors: * Frederico Caldeira Knabben (fredck@fckeditor.net) --> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta content="noindex, nofollow" name="robots"> <script type="text/javascript"> var oEditor = window.parent.InnerDialogLoaded() ; function OnLoad() { // Whole word is available on IE only. if ( oEditor.FCKBrowserInfo.IsIE ) document.getElementById('divWord').style.display = '' ; // First of all, translate the dialog box texts. oEditor.FCKLanguageManager.TranslatePage( document ) ; window.parent.SetAutoSize( true ) ; } function btnStat(frm) { document.getElementById('btnFind').disabled = ( document.getElementById('txtFind').value.length == 0 ) ; } function ReplaceTextNodes( parentNode, regex, replaceValue, replaceAll ) { for ( var i = 0 ; i < parentNode.childNodes.length ; i++ ) { var oNode = parentNode.childNodes[i] ; if ( oNode.nodeType == 3 ) { var sReplaced = oNode.nodeValue.replace( regex, replaceValue ) ; if ( oNode.nodeValue != sReplaced ) { oNode.nodeValue = sReplaced ; if ( ! replaceAll ) return true ; } } else { if ( ReplaceTextNodes( oNode, regex, replaceValue ) ) return true ; } } return false ; } function GetRegexExpr() { if ( document.getElementById('chkWord').checked ) var sExpr = '\\b' + document.getElementById('txtFind').value + '\\b' ; else var sExpr = document.getElementById('txtFind').value ; return sExpr ; } function GetCase() { return ( document.getElementById('chkCase').checked ? '' : 'i' ) ; } function Ok() { if ( document.getElementById('txtFind').value.length == 0 ) return ; if ( oEditor.FCKBrowserInfo.IsIE ) FindIE() ; else FindGecko() ; } var oRange ; if ( oEditor.FCKBrowserInfo.IsIE ) oRange = oEditor.FCK.EditorDocument.body.createTextRange() ; function FindIE() { var iFlags = 0 ; if ( chkCase.checked ) iFlags = iFlags | 4 ; if ( chkWord.checked ) iFlags = iFlags | 2 ; var bFound = oRange.findText( document.getElementById('txtFind').value, 1, iFlags ) ; if ( bFound ) { oRange.scrollIntoView() ; oRange.select() ; oRange.collapse(false) ; oLastRangeFound = oRange ; } else { oRange = oEditor.FCK.EditorDocument.body.createTextRange() ; alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ; } } function FindGecko() { var bCase = document.getElementById('chkCase').checked ; var bWord = document.getElementById('chkWord').checked ; // window.find( searchString, caseSensitive, backwards, wrapAround, wholeWord, searchInFrames, showDialog ) ; oEditor.FCK.EditorWindow.find( document.getElementById('txtFind').value, bCase, false, false, bWord, false, false ) ; } </script> </head> <body onload="OnLoad()" scroll="no" style="OVERFLOW: hidden"> <table cellSpacing="3" cellPadding="2" width="100%" border="0"> <tr> <td nowrap> <label for="txtFind" fckLang="DlgReplaceFindLbl">Find what:</label>&nbsp; </td> <td width="100%"> <input id="txtFind" style="WIDTH: 100%" tabIndex="1" type="text"> </td> <td> <input id="btnFind" style="WIDTH: 100%; PADDING-RIGHT: 5px; PADDING-LEFT: 5px" onclick="Ok();" type="button" value="Find" fckLang="DlgFindFindBtn"> </td> </tr> <tr> <td valign="bottom" colSpan="3"> &nbsp;<input id="chkCase" tabIndex="3" type="checkbox"><label for="chkCase" fckLang="DlgReplaceCaseChk">Match case</label> <br> <div id="divWord" style="DISPLAY: none"> &nbsp;<input id="chkWord" tabIndex="4" type="checkbox"><label for="chkWord" fckLang="DlgReplaceWordChk">Match whole word</label> </div> </td> </tr> </table> </body> </html>
zyyhong
trunk/jiaju001/news/include/FCKeditor/editor/dialog/fck_find.html
HTML
asf20
4,358
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- * FCKeditor - The text editor for internet * Copyright (C) 2003-2005 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: * http://www.opensource.org/licenses/lgpl-license.php * * For further information visit: * http://www.fckeditor.net/ * * "Support Open Source software. What about a donation today?" * * File Name: fck_docprops.html * Link dialog window. * * File Authors: * Frederico Caldeira Knabben (fredck@fckeditor.net) --> <html> <head> <title>Document Properties</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta content="noindex, nofollow" name="robots"> <script src="common/fck_dialog_common.js" type="text/javascript"></script> <script language="javascript"> var oEditor = window.parent.InnerDialogLoaded() ; var FCK = oEditor.FCK ; var FCKLang = oEditor.FCKLang ; var FCKConfig = oEditor.FCKConfig ; //#### Dialog Tabs // Set the dialog tabs. window.parent.AddTab( 'General' , FCKLang.DlgDocGeneralTab ) ; window.parent.AddTab( 'Background' , FCKLang.DlgDocBackTab ) ; window.parent.AddTab( 'Colors' , FCKLang.DlgDocColorsTab ) ; window.parent.AddTab( 'Meta' , FCKLang.DlgDocMetaTab ) ; // Function called when a dialog tag is selected. function OnDialogTabChange( tabCode ) { ShowE( 'divGeneral' , ( tabCode == 'General' ) ) ; ShowE( 'divBackground' , ( tabCode == 'Background' ) ) ; ShowE( 'divColors' , ( tabCode == 'Colors' ) ) ; ShowE( 'divMeta' , ( tabCode == 'Meta' ) ) ; ShowE( 'ePreview' , ( tabCode == 'Background' || tabCode == 'Colors' ) ) ; } //#### Get Base elements from the document: BEGIN // The HTML element of the document. var oHTML = FCK.EditorDocument.getElementsByTagName('html')[0] ; // The HEAD element of the document. var oHead = oHTML.getElementsByTagName('head')[0] ; var oBody = FCK.EditorDocument.body ; // This object contains all META tags defined in the document. var oMetaTags = new Object() ; // Get all META tags defined in the document. var aMetas = oHead.getElementsByTagName('meta') ; // Loop throw all METAs and put it in the HashTable. for ( var i = 0 ; i < aMetas.length ; i++ ) { // Try to get the "name" attribute. var sName = GetAttribute( aMetas[i], 'name', GetAttribute( aMetas[i], '___fcktoreplace:name', '' ) ) ; // If no "name", try with the "http-equiv" attribute. if ( sName.length == 0 ) { if ( document.all ) { // Get the http-equiv value from the outerHTML. var oHttpEquivMatch = aMetas[i].outerHTML.match( oEditor.FCKRegexLib.MetaHttpEquiv ) ; if ( oHttpEquivMatch ) sName = oHttpEquivMatch[1] ; } else sName = GetAttribute( aMetas[i], 'http-equiv', '' ) ; } if ( sName.length > 0 ) oMetaTags[ sName.toLowerCase() ] = aMetas[i] ; } //#### END // Set a META tag in the document. function SetMetadata( name, content, isHttp ) { if ( content.length == 0 ) { RemoveMetadata( name ) ; return ; } var oMeta = oMetaTags[ name.toLowerCase() ] ; if ( !oMeta ) { oMeta = oHead.appendChild( FCK.EditorDocument.createElement('META') ) ; if ( isHttp ) SetAttribute( oMeta, 'http-equiv', name ) ; else { // On IE, it is not possible to set the "name" attribute of the META tag. // So a temporary attribute is used and it is replaced when getting the // editor's HTML/XHTML value. This is sad, I know :( if ( document.all ) SetAttribute( oMeta, '___fcktoreplace:name', name ) ; else SetAttribute( oMeta, 'name', name ) ; } oMetaTags[ name.toLowerCase() ] = oMeta ; } oMeta.content = content ; } function RemoveMetadata( name ) { var oMeta = oMetaTags[ name.toLowerCase() ] ; if ( oMeta && oMeta != null ) { oMeta.parentNode.removeChild( oMeta ) ; oMetaTags[ name.toLowerCase() ] = null ; } } function GetMetadata( name ) { var oMeta = oMetaTags[ name.toLowerCase() ] ; if ( oMeta && oMeta != null ) return oMeta.content ; else return '' ; } window.onload = function () { // Show/Hide the "Browse Server" button. GetE('tdBrowse').style.display = oEditor.FCKConfig.ImageBrowser ? "" : "none"; // First of all, translate the dialog box texts oEditor.FCKLanguageManager.TranslatePage( document ) ; FillFields() ; UpdatePreview() ; // Show the "Ok" button. window.parent.SetOkButton( true ) ; window.parent.SetAutoSize( true ) ; } function FillFields() { // ### General Info GetE('txtPageTitle').value = FCK.EditorDocument.title ; GetE('selDirection').value = GetAttribute( oHTML, 'dir', '' ) ; GetE('txtLang').value = GetAttribute( oHTML, 'xml:lang', GetAttribute( oHTML, 'lang', '' ) ) ; // "xml:lang" takes precedence to "lang". // Character Set Encoding. // if ( document.all ) // var sCharSet = FCK.EditorDocument.charset ; // else var sCharSet = GetMetadata( 'Content-Type' ) ; if ( sCharSet != null && sCharSet.length > 0 ) { // if ( !document.all ) sCharSet = sCharSet.match( /[^=]*$/ ) ; GetE('selCharSet').value = sCharSet ; if ( GetE('selCharSet').selectedIndex == -1 ) { GetE('selCharSet').value = '...' ; GetE('txtCustomCharSet').value = sCharSet ; CheckOther( GetE('selCharSet'), 'txtCustomCharSet' ) ; } } // Document Type. if ( FCK.DocTypeDeclaration && FCK.DocTypeDeclaration.length > 0 ) { GetE('selDocType').value = FCK.DocTypeDeclaration ; if ( GetE('selDocType').selectedIndex == -1 ) { GetE('selDocType').value = '...' ; GetE('txtDocType').value = FCK.DocTypeDeclaration ; CheckOther( GetE('selDocType'), 'txtDocType' ) ; } } // Document Type. GetE('chkIncXHTMLDecl').checked = ( FCK.XmlDeclaration && FCK.XmlDeclaration.length > 0 ) ; // ### Background GetE('txtBackColor').value = GetAttribute( oBody, 'bgColor' , '' ) ; GetE('txtBackImage').value = GetAttribute( oBody, 'background' , '' ) ; GetE('chkBackNoScroll').checked = ( GetAttribute( oBody, 'bgProperties', '' ).toLowerCase() == 'fixed' ) ; // ### Colors GetE('txtColorText').value = GetAttribute( oBody, 'text' , '' ) ; GetE('txtColorLink').value = GetAttribute( oBody, 'link' , '' ) ; GetE('txtColorVisited').value = GetAttribute( oBody, 'vLink' , '' ) ; GetE('txtColorActive').value = GetAttribute( oBody, 'aLink' , '' ) ; // ### Margins GetE('txtMarginTop').value = GetAttribute( oBody, 'topMargin' , '' ) ; GetE('txtMarginLeft').value = GetAttribute( oBody, 'leftMargin' , '' ) ; GetE('txtMarginRight').value = GetAttribute( oBody, 'rightMargin' , '' ) ; GetE('txtMarginBottom').value = GetAttribute( oBody, 'bottomMargin' , '' ) ; // ### Meta Data GetE('txtMetaKeywords').value = GetMetadata( 'keywords' ) ; GetE('txtMetaDescription').value = GetMetadata( 'description' ) ; GetE('txtMetaAuthor').value = GetMetadata( 'author' ) ; GetE('txtMetaCopyright').value = GetMetadata( 'copyright' ) ; } // Called when the "Ok" button is clicked. function Ok() { // ### General Info FCK.EditorDocument.title = GetE('txtPageTitle').value ; var oHTML = FCK.EditorDocument.getElementsByTagName('html')[0] ; SetAttribute( oHTML, 'dir' , GetE('selDirection').value ) ; SetAttribute( oHTML, 'lang' , GetE('txtLang').value ) ; SetAttribute( oHTML, 'xml:lang' , GetE('txtLang').value ) ; // Character Set Enconding. var sCharSet = GetE('selCharSet').value ; if ( sCharSet == '...' ) sCharSet = GetE('txtCustomCharSet').value ; if ( sCharSet.length > 0 ) sCharSet = 'text/html; charset=' + sCharSet ; // if ( document.all ) // FCK.EditorDocument.charset = sCharSet ; // else SetMetadata( 'Content-Type', sCharSet, true ) ; // Document Type var sDocType = GetE('selDocType').value ; if ( sDocType == '...' ) sDocType = GetE('txtDocType').value ; FCK.DocTypeDeclaration = sDocType ; // XHTML Declarations. if ( GetE('chkIncXHTMLDecl').checked ) { if ( sCharSet.length == 0 ) sCharSet = 'utf-8' ; FCK.XmlDeclaration = '<?xml version="1.0" encoding="' + sCharSet + '"?>' ; SetAttribute( oHTML, 'xmlns', 'http://www.w3.org/1999/xhtml' ) ; } else { FCK.XmlDeclaration = null ; oHTML.removeAttribute( 'xmlns', 0 ) ; } // ### Background SetAttribute( oBody, 'bgcolor' , GetE('txtBackColor').value ) ; SetAttribute( oBody, 'background' , GetE('txtBackImage').value ) ; SetAttribute( oBody, 'bgproperties' , GetE('chkBackNoScroll').checked ? 'fixed' : '' ) ; // ### Colors SetAttribute( oBody, 'text' , GetE('txtColorText').value ) ; SetAttribute( oBody, 'link' , GetE('txtColorLink').value ) ; SetAttribute( oBody, 'vlink', GetE('txtColorVisited').value ) ; SetAttribute( oBody, 'alink', GetE('txtColorActive').value ) ; // ### Margins SetAttribute( oBody, 'topmargin' , GetE('txtMarginTop').value ) ; SetAttribute( oBody, 'leftmargin' , GetE('txtMarginLeft').value ) ; SetAttribute( oBody, 'rightmargin' , GetE('txtMarginRight').value ) ; SetAttribute( oBody, 'bottommargin' , GetE('txtMarginBottom').value ) ; // ### Meta data SetMetadata( 'keywords' , GetE('txtMetaKeywords').value ) ; SetMetadata( 'description' , GetE('txtMetaDescription').value ) ; SetMetadata( 'author' , GetE('txtMetaAuthor').value ) ; SetMetadata( 'copyright' , GetE('txtMetaCopyright').value ) ; return true ; } var bPreviewIsLoaded = false ; var oPreviewWindow ; var oPreviewBody ; // Called by the Preview page when loaded. function OnPreviewLoad( previewWindow, previewBody ) { oPreviewWindow = previewWindow ; oPreviewBody = previewBody ; bPreviewIsLoaded = true ; UpdatePreview() ; } function UpdatePreview() { if ( !bPreviewIsLoaded ) return ; // ### Background SetAttribute( oPreviewBody, 'bgcolor' , GetE('txtBackColor').value ) ; SetAttribute( oPreviewBody, 'background' , GetE('txtBackImage').value ) ; SetAttribute( oPreviewBody, 'bgproperties' , GetE('chkBackNoScroll').checked ? 'fixed' : '' ) ; // ### Colors SetAttribute( oPreviewBody, 'text', GetE('txtColorText').value ) ; oPreviewWindow.SetLinkColor( GetE('txtColorLink').value ) ; oPreviewWindow.SetVisitedColor( GetE('txtColorVisited').value ) ; oPreviewWindow.SetActiveColor( GetE('txtColorActive').value ) ; } function CheckOther( combo, txtField ) { var bNotOther = ( combo.value != '...' ) ; GetE(txtField).style.backgroundColor = ( bNotOther ? '#cccccc' : '' ) ; GetE(txtField).disabled = bNotOther ; } function SetColor( inputId, color ) { GetE( inputId ).value = color + '' ; UpdatePreview() ; } function SelectBackColor( color ) { SetColor('txtBackColor', color ) ; } function SelectColorText( color ) { SetColor('txtColorText', color ) ; } function SelectColorLink( color ) { SetColor('txtColorLink', color ) ; } function SelectColorVisited( color ) { SetColor('txtColorVisited', color ) ; } function SelectColorActive( color ) { SetColor('txtColorActive', color ) ; } function SelectColor( wich ) { switch ( wich ) { case 'Back' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectBackColor, window ) ; return ; case 'ColorText' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectColorText, window ) ; return ; case 'ColorLink' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectColorLink, window ) ; return ; case 'ColorVisited' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectColorVisited, window ) ; return ; case 'ColorActive' : oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectColorActive, window ) ; return ; } } function BrowseServerBack() { OpenFileBrowser( FCKConfig.ImageBrowserURL, FCKConfig.ImageBrowserWindowWidth, FCKConfig.ImageBrowserWindowHeight ) ; } function SetUrl( url ) { GetE('txtBackImage').value = url ; UpdatePreview() ; } </script> </head> <body scroll="no" style="OVERFLOW: hidden"> <table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0"> <tr> <td vAlign="top" height="100%"> <div id="divGeneral"> <span fckLang="DlgDocPageTitle">Page Title</span><br> <input id="txtPageTitle" style="WIDTH: 100%" type="text"> <br> <table cellSpacing="0" cellPadding="0" border="0"> <tr> <td> <span fckLang="DlgDocLangDir">Language Direction</span><br> <select id="selDirection"> <option value="" selected></option> <option value="ltr" fckLang="DlgDocLangDirLTR">Left to Right (LTR)</option> <option value="rtl" fckLang="DlgDocLangDirRTL">Right to Left (RTL)</option> </select> </td> <td>&nbsp;&nbsp;&nbsp;</td> <td> <span fckLang="DlgDocLangCode">Language Code</span><br> <input id="txtLang" type="text"> </td> </tr> </table> <br> <table cellSpacing="0" cellPadding="0" width="100%" border="0"> <tr> <td noWrap><span fckLang="DlgDocCharSet">Character Set Encoding</span><br> <select id="selCharSet" onChange="CheckOther( this, 'txtCustomCharSet' );"> <option value="" selected></option> <option value="us-ascii">ASCII</option> <option value="iso-8859-2">Central European</option> <option value="big5">Chinese Traditional (Big5)</option> <option value="iso-8859-5">Cyrillic</option> <option value="iso-8859-7">Greek</option> <option value="iso-2022-jp">Japanese</option> <option value="iso-2022-kr">Korean</option> <option value="iso-8859-9">Turkish</option> <option value="utf-8">Unicode (UTF-8)</option> <option value="iso-8859-1">Western European</option> <option value="..." fckLang="DlgOpOther">&lt;Other&gt;</option> </select> </td> <td>&nbsp;&nbsp;&nbsp;</td> <td width="100%"> <span fckLang="DlgDocCharSetOther">Other Character Set Encoding</span><br> <input id="txtCustomCharSet" style="WIDTH: 100%; BACKGROUND-COLOR: #cccccc" disabled type="text"> </td> </tr> <tr> <td colspan="3">&nbsp;</td> </tr> <tr> <td nowrap> <span fckLang="DlgDocDocType">Document Type Heading</span><br> <select id="selDocType" name="selDocType" onChange="CheckOther( this, 'txtDocType' );"> <option value="" selected></option> <option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'>HTML 4.01 Transitional</option> <option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">'>HTML 4.01 Strict</option> <option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">'>HTML 4.01 Frameset</option> <option value='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'>XHTML 1.0 Transitional</option> <option value='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'>XHTML 1.0 Strict</option> <option value='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">'>XHTML 1.0 Frameset</option> <option value='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'>XHTML 1.1</option> <option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">'>HTML 3.2</option> <option value='<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">'>HTML 2.0</option> <option value="..." fckLang="DlgOpOther">&lt;Other&gt;</option> </select> </td> <td></td> <td width="100%"> <span fckLang="DlgDocDocTypeOther">Other Document Type Heading</span><br> <input id="txtDocType" style="WIDTH: 100%; BACKGROUND-COLOR: #cccccc" disabled type="text"> </td> </tr> </table> <br> <input id="chkIncXHTMLDecl" type="checkbox"> <label for="chkIncXHTMLDecl" fckLang="DlgDocIncXHTML">Include XHTML Declarations</label> </div> <div id="divBackground" style="DISPLAY: none"> <span fckLang="DlgDocBgColor">Background Color</span><br> <input id="txtBackColor" type="text" onChange="UpdatePreview();" onKeyUp="UpdatePreview();">&nbsp;<input id="btnSelBackColor" onClick="SelectColor( 'Back' )" type="button" value="Select..." fckLang="DlgCellBtnSelect"><br> <br> <span fckLang="DlgDocBgImage">Background Image URL</span><br> <table cellSpacing="0" cellPadding="0" width="100%" border="0"> <tr> <td width="100%"><input id="txtBackImage" style="WIDTH: 100%" type="text" onChange="UpdatePreview();" onKeyUp="UpdatePreview();"></td> <td id="tdBrowse" nowrap>&nbsp;<input id="btnBrowse" onclick="BrowseServerBack();" type="button" fckLang="DlgBtnBrowseServer" value="Browse Server" fckLang="DlgBtnBrowseServer"></td> </tr> </table> <input id="chkBackNoScroll" type="checkbox" onClick="UpdatePreview();"> <label for="chkBackNoScroll" fckLang="DlgDocBgNoScroll">Nonscrolling Background</label> </div> <div id="divColors" style="DISPLAY: none"> <table cellSpacing="0" cellPadding="0" width="100%" border="0"> <tr> <td> <span fckLang="DlgDocCText">Text</span><br> <input id="txtColorText" type="text" onChange="UpdatePreview();" onKeyUp="UpdatePreview();"><input onClick="SelectColor( 'ColorText' )" type="button" value="Select..." fckLang="DlgCellBtnSelect"> <br> <span fckLang="DlgDocCLink">Link</span><br> <input id="txtColorLink" type="text" onChange="UpdatePreview();" onKeyUp="UpdatePreview();"><input onClick="SelectColor( 'ColorLink' )" type="button" value="Select..." fckLang="DlgCellBtnSelect"> <br> <span fckLang="DlgDocCVisited">Visited Link</span><br> <input id="txtColorVisited" type="text" onChange="UpdatePreview();" onKeyUp="UpdatePreview();"><input onClick="SelectColor( 'ColorVisited' )" type="button" value="Select..." fckLang="DlgCellBtnSelect"> <br> <span fckLang="DlgDocCActive">Active Link</span><br> <input id="txtColorActive" type="text" onChange="UpdatePreview();" onKeyUp="UpdatePreview();"><input onClick="SelectColor( 'ColorActive' )" type="button" value="Select..." fckLang="DlgCellBtnSelect"> </td> <td valign="middle" align="center"> <table cellspacing="2" cellpadding="0" border="0"> <tr> <td><span fckLang="DlgDocMargins">Page Margins</span></td> </tr> <tr> <td style="BORDER: #000000 1px solid; PADDING: 5px"> <table cellpadding="0" cellspacing="0" border="0" dir="ltr"> <tr> <td align="center" colspan="3"> <span fckLang="DlgDocMaTop">Top</span><br> <input id="txtMarginTop" type="text" size="3"> </td> </tr> <tr> <td align="left"> <span fckLang="DlgDocMaLeft">Left</span><br> <input id="txtMarginLeft" type="text" size="3"> </td> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td> <td align="right"> <span fckLang="DlgDocMaRight">Right</span><BR> <input id="txtMarginRight" type="text" size="3"> </td> </tr> <tr> <td align="center" colspan="3"> <span fckLang="DlgDocMaBottom">Bottom</span><br> <input id="txtMarginBottom" type="text" size="3"> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </div> <div id="divMeta" style="DISPLAY: none"> <span fckLang="DlgDocMeIndex">Document Indexing Keywords (comma separated)</span><br> <textarea id="txtMetaKeywords" style="WIDTH: 100%" rows="2" cols="20"></textarea> <br> <span fckLang="DlgDocMeDescr">Document Description</span><br> <textarea id="txtMetaDescription" style="WIDTH: 100%" rows="4" cols="20"></textarea> <br> <span fckLang="DlgDocMeAuthor">Author</span><br> <input id="txtMetaAuthor" style="WIDTH: 100%" type="text"><br> <br> <span fckLang="DlgDocMeCopy">Copyright</span><br> <input id="txtMetaCopyright" type="text" style="WIDTH: 100%"> </div> </td> </tr> <tr id="ePreview" style="DISPLAY: none"> <td> <span fckLang="DlgDocPreview">Preview</span><br> <iframe id="frmPreview" src="fck_docprops/fck_document_preview.html" width="100%" height="100"></iframe> </td> </tr> </table> </body> </html>
zyyhong
trunk/jiaju001/news/include/FCKeditor/editor/dialog/fck_docprops.html
HTML
asf20
21,664
/* * FCKeditor - The text editor for internet * Copyright (C) 2003-2005 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: * http://www.opensource.org/licenses/lgpl-license.php * * For further information visit: * http://www.fckeditor.net/ * * "Support Open Source software. What about a donation today?" * * File Name: fckplugin.js * Plugin to insert "Placeholders" in the editor. * * File Authors: * Frederico Caldeira Knabben (fredck@fckeditor.net) */ // Register the related command. FCKCommands.RegisterCommand( 'Placeholder', new FCKDialogCommand( 'Placeholder', FCKLang.PlaceholderDlgTitle, FCKPlugins.Items['placeholder'].Path + 'fck_placeholder.html', 340, 170 ) ) ; // Create the "Plaholder" toolbar button. var oPlaceholderItem = new FCKToolbarButton( 'Placeholder', FCKLang.PlaceholderBtn ) ; oPlaceholderItem.IconPath = FCKPlugins.Items['placeholder'].Path + 'placeholder.gif' ; FCKToolbarItems.RegisterItem( 'Placeholder', oPlaceholderItem ) ; // The object used for all Placeholder operations. var FCKPlaceholders = new Object() ; // Add a new placeholder at the actual selection. FCKPlaceholders.Add = function( name ) { var oSpan = FCK.CreateElement( 'SPAN' ) ; this.SetupSpan( oSpan, name ) ; } FCKPlaceholders.SetupSpan = function( span, name ) { span.innerHTML = '[[ ' + name + ' ]]' ; span.style.backgroundColor = '#ffff00' ; span.style.color = '#000000' ; if ( FCKBrowserInfo.IsGecko ) span.style.cursor = 'default' ; span._fckplaceholder = name ; span.contentEditable = false ; // To avoid it to be resized. span.onresizestart = function() { FCK.EditorWindow.event.returnValue = false ; return false ; } } // On Gecko we must do this trick so the user select all the SPAN when clicking on it. FCKPlaceholders._SetupClickListener = function() { FCKPlaceholders._ClickListener = function( e ) { if ( e.target.tagName == 'SPAN' && e.target._fckplaceholder ) FCKSelection.SelectNode( e.target ) ; } FCK.EditorDocument.addEventListener( 'click', FCKPlaceholders._ClickListener, true ) ; } // Open the Placeholder dialog on double click. FCKPlaceholders.OnDoubleClick = function( span ) { if ( span.tagName == 'SPAN' && span._fckplaceholder ) FCKCommands.GetCommand( 'Placeholder' ).Execute() ; } FCK.RegisterDoubleClickHandler( FCKPlaceholders.OnDoubleClick, 'SPAN' ) ; // Check if a Placholder name is already in use. FCKPlaceholders.Exist = function( name ) { var aSpans = FCK.EditorDocument.getElementsByTagName( 'SPAN' ) for ( var i = 0 ; i < aSpans.length ; i++ ) { if ( aSpans[i]._fckplaceholder == name ) return true ; } } if ( FCKBrowserInfo.IsIE ) { FCKPlaceholders.Redraw = function() { var aPlaholders = FCK.EditorDocument.body.innerText.match( /\[\[[^\[\]]+\]\]/g ) ; if ( !aPlaholders ) return ; var oRange = FCK.EditorDocument.body.createTextRange() ; for ( var i = 0 ; i < aPlaholders.length ; i++ ) { if ( oRange.findText( aPlaholders[i] ) ) { var sName = aPlaholders[i].match( /\[\[\s*([^\]]*?)\s*\]\]/ )[1] ; oRange.pasteHTML( '<span style="color: #000000; background-color: #ffff00" contenteditable="false" _fckplaceholder="' + sName + '">' + aPlaholders[i] + '</span>' ) ; } } } } else { FCKPlaceholders.Redraw = function() { var oInteractor = FCK.EditorDocument.createTreeWalker( FCK.EditorDocument.body, NodeFilter.SHOW_TEXT, FCKPlaceholders._AcceptNode, true ) ; var aNodes = new Array() ; while ( oNode = oInteractor.nextNode() ) { aNodes[ aNodes.length ] = oNode ; } for ( var n = 0 ; n < aNodes.length ; n++ ) { var aPieces = aNodes[n].nodeValue.split( /(\[\[[^\[\]]+\]\])/g ) ; for ( var i = 0 ; i < aPieces.length ; i++ ) { if ( aPieces[i].length > 0 ) { if ( aPieces[i].indexOf( '[[' ) == 0 ) { var sName = aPieces[i].match( /\[\[\s*([^\]]*?)\s*\]\]/ )[1] ; var oSpan = FCK.EditorDocument.createElement( 'span' ) ; FCKPlaceholders.SetupSpan( oSpan, sName ) ; aNodes[n].parentNode.insertBefore( oSpan, aNodes[n] ) ; } else aNodes[n].parentNode.insertBefore( FCK.EditorDocument.createTextNode( aPieces[i] ) , aNodes[n] ) ; } } aNodes[n].parentNode.removeChild( aNodes[n] ) ; } FCKPlaceholders._SetupClickListener() ; } FCKPlaceholders._AcceptNode = function( node ) { if ( /\[\[[^\[\]]+\]\]/.test( node.nodeValue ) ) return NodeFilter.FILTER_ACCEPT ; else return NodeFilter.FILTER_SKIP ; } } FCK.Events.AttachEvent( 'OnAfterSetHTML', FCKPlaceholders.Redraw ) ; // The "Redraw" method must be called on startup. FCKPlaceholders.Redraw() ; // We must process the SPAN tags to replace then with the real resulting value of the placeholder. FCKXHtml.TagProcessors['span'] = function( node, htmlNode ) { if ( htmlNode._fckplaceholder ) node = FCKXHtml.XML.createTextNode( '[[' + htmlNode._fckplaceholder + ']]' ) ; else FCKXHtml._AppendChildNodes( node, htmlNode, false ) ; return node ; }
zyyhong
trunk/jiaju001/news/include/FCKeditor/editor/plugins/placeholder/fckplugin.js
JavaScript
asf20
5,213
/* * FCKeditor - The text editor for internet * Copyright (C) 2003-2005 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: * http://www.opensource.org/licenses/lgpl-license.php * * For further information visit: * http://www.fckeditor.net/ * * "Support Open Source software. What about a donation today?" * * File Name: en.js * Placholder English language file. * * File Authors: * Frederico Caldeira Knabben (fredck@fckeditor.net) */ FCKLang.PlaceholderBtn = 'Insert/Edit Placeholder' ; FCKLang.PlaceholderDlgTitle = 'Placeholder Properties' ; FCKLang.PlaceholderDlgName = 'Placeholder Name' ; FCKLang.PlaceholderErrNoName = 'Please type the placeholder name' ; FCKLang.PlaceholderErrNameInUse = 'The specified name is already in use' ;
zyyhong
trunk/jiaju001/news/include/FCKeditor/editor/plugins/placeholder/lang/en.js
JavaScript
asf20
842
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- * FCKeditor - The text editor for internet * Copyright (C) 2003-2005 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: * http://www.opensource.org/licenses/lgpl-license.php * * For further information visit: * http://www.fckeditor.net/ * * "Support Open Source software. What about a donation today?" * * File Name: fck_placeholder.html * Placeholder Plugin. * * File Authors: * Frederico Caldeira Knabben (fredck@fckeditor.net) --> <html> <head> <title>Placeholder Properties</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta content="noindex, nofollow" name="robots"> <script language="javascript"> var oEditor = window.parent.InnerDialogLoaded() ; var FCKLang = oEditor.FCKLang ; var FCKPlaceholders = oEditor.FCKPlaceholders ; window.onload = function () { // First of all, translate the dialog box texts oEditor.FCKLanguageManager.TranslatePage( document ) ; LoadSelected() ; // Show the "Ok" button. window.parent.SetOkButton( true ) ; } var eSelected = oEditor.FCKSelection.GetSelectedElement() ; function LoadSelected() { if ( !eSelected ) return ; if ( eSelected.tagName == 'SPAN' && eSelected._fckplaceholder ) document.getElementById('txtName').value = eSelected._fckplaceholder ; else eSelected == null ; } function Ok() { var sValue = document.getElementById('txtName').value ; if ( eSelected && eSelected._fckplaceholder == sValue ) return true ; if ( sValue.length == 0 ) { alert( FCKLang.PlaceholderErrNoName ) ; return false ; } if ( FCKPlaceholders.Exist( sValue ) ) { alert( FCKLang.PlaceholderErrNameInUse ) ; return false ; } FCKPlaceholders.Add( sValue ) ; return true ; } </script> </head> <body scroll="no" style="OVERFLOW: hidden"> <table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0"> <tr> <td> <table cellSpacing="0" cellPadding="0" align="center" border="0"> <tr> <td> <span fckLang="PlaceholderDlgName">Placeholder Name</span><br> <input id="txtName" type="text"> </td> </tr> </table> </td> </tr> </table> </body> </html>
zyyhong
trunk/jiaju001/news/include/FCKeditor/editor/plugins/placeholder/fck_placeholder.html
HTML
asf20
2,381
/* * FCKeditor - The text editor for internet * Copyright (C) 2003-2005 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: * http://www.opensource.org/licenses/lgpl-license.php * * For further information visit: * http://www.fckeditor.net/ * * "Support Open Source software. What about a donation today?" * * File Name: fckplugin.js * This plugin register the required Toolbar items to be able to insert the * toolbar commands in the toolbar. * * File Authors: * Frederico Caldeira Knabben (fredck@fckeditor.net) */ FCKToolbarItems.RegisterItem( 'TableInsertRow' , new FCKToolbarButton( 'TableInsertRow' , FCKLang.InsertRow ) ) ; FCKToolbarItems.RegisterItem( 'TableDeleteRows' , new FCKToolbarButton( 'TableDeleteRows' , FCKLang.DeleteRows ) ) ; FCKToolbarItems.RegisterItem( 'TableInsertColumn' , new FCKToolbarButton( 'TableInsertColumn' , FCKLang.InsertColumn ) ) ; FCKToolbarItems.RegisterItem( 'TableDeleteColumns' , new FCKToolbarButton( 'TableDeleteColumns', FCKLang.DeleteColumns ) ) ; FCKToolbarItems.RegisterItem( 'TableInsertCell' , new FCKToolbarButton( 'TableInsertCell' , FCKLang.InsertCell ) ) ; FCKToolbarItems.RegisterItem( 'TableDeleteCells' , new FCKToolbarButton( 'TableDeleteCells' , FCKLang.DeleteCells ) ) ; FCKToolbarItems.RegisterItem( 'TableMergeCells' , new FCKToolbarButton( 'TableMergeCells' , FCKLang.MergeCells ) ) ; FCKToolbarItems.RegisterItem( 'TableSplitCell' , new FCKToolbarButton( 'TableSplitCell' , FCKLang.SplitCell ) ) ;
zyyhong
trunk/jiaju001/news/include/FCKeditor/editor/plugins/tablecommands/fckplugin.js
JavaScript
asf20
1,576
/* * FCKeditor - The text editor for internet * Copyright (C) 2003-2005 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: * http://www.opensource.org/licenses/lgpl-license.php * * For further information visit: * http://www.fckeditor.net/ * * "Support Open Source software. What about a donation today?" * * File Name: fckplugin.js * This plugin register Toolbar items for the combos modifying the style to * not show the box. * * File Authors: * Frederico Caldeira Knabben (fredck@fckeditor.net) */ FCKToolbarItems.RegisterItem( 'SourceSimple' , new FCKToolbarButton( 'Source', FCKLang.Source, null, FCK_TOOLBARITEM_ONLYICON, true, true ) ) ; FCKToolbarItems.RegisterItem( 'StyleSimple' , new FCKToolbarStyleCombo( null, FCK_TOOLBARITEM_ONLYTEXT ) ) ; FCKToolbarItems.RegisterItem( 'FontNameSimple' , new FCKToolbarFontsCombo( null, FCK_TOOLBARITEM_ONLYTEXT ) ) ; FCKToolbarItems.RegisterItem( 'FontSizeSimple' , new FCKToolbarFontSizeCombo( null, FCK_TOOLBARITEM_ONLYTEXT ) ) ; FCKToolbarItems.RegisterItem( 'FontFormatSimple', new FCKToolbarFontFormatCombo( null, FCK_TOOLBARITEM_ONLYTEXT ) ) ;
zyyhong
trunk/jiaju001/news/include/FCKeditor/editor/plugins/simplecommands/fckplugin.js
JavaScript
asf20
1,208
<!-- * FCKeditor - The text editor for internet * Copyright (C) 2003-2005 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: * http://www.opensource.org/licenses/lgpl-license.php * * For further information visit: * http://www.fckeditor.net/ * * "Support Open Source software. What about a donation today?" * * File Name: fckeditor.original.html * Main page that holds the editor. * * File Authors: * Frederico Caldeira Knabben (fredck@fckeditor.net) --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>FCKeditor</title> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"> <!-- @Packager.RemoveLine --> <meta name="robots" content="noindex, nofollow" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="lang/fcklanguagemanager.js"></script> <!-- @Packager.RemoveLine <meta http-equiv="Cache-Control" content="public"> @Packager.RemoveLine --> <!-- @Packager.Remove.Start --> <script type="text/javascript" src="_source/internals/fcknamespace.js"></script> <script type="text/javascript" src="_source/internals/fckcoreextensions.js"></script> <script type="text/javascript" src="_source/globals/fck_constants.js"></script> <script type="text/javascript" src="_source/internals/fckbrowserinfo.js"></script> <script type="text/javascript" src="_source/internals/fckscriptloader.js"></script> <script type="text/javascript" src="_source/internals/fckurlparams.js"></script> <script type="text/javascript" src="_source/internals/fck.js"></script> <script type="text/javascript" src="_source/internals/fckconfig.js"></script> <script type="text/javascript" src="_source/globals/fckeditorapi.js"></script> <script type="text/javascript" src="_source/internals/fck_onload.js"></script> <!-- @Packager.Remove.End --> <!-- @Packager.RemoveLine <script type="text/javascript" src="js/fck_startup.js"></script> @Packager.RemoveLine --> </head> <body> <table height="100%" width="100%" cellpadding="0" cellspacing="0" border="0" style="TABLE-LAYOUT: fixed"> <tr> <td style="OVERFLOW: hidden"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr id="Collapsed" style="DISPLAY: none"> <td id="ExpandHandle" class="TB_Expand" colspan="3" onclick="FCKToolbarSet.Expand();return false;"><img class="TB_ExpandImg" src="images/spacer.gif" width="8" height="4"></td> </tr> <tr id="Expanded" style="DISPLAY: none"> <td id="CollapseHandle" style="DISPLAY: none" class="TB_Collapse" valign="bottom" onclick="FCKToolbarSet.Collapse();return false;"><img class="TB_CollapseImg" src="images/spacer.gif" width="8" height="4"></td> <td id="eToolbar" class="TB_ToolbarSet"></td> <td width="1" class="TB_SideBorder"></td> </tr> </table> </td> </tr> <tr id="eWysiwyg"> <td id="eWysiwygCell" height="100%" valign="top"> <iframe id="eEditorArea" name="eEditorArea" height="100%" width="100%" frameborder="no" src="fckblank.html"></iframe> </td> </tr> <tr id="eSource" style="DISPLAY: none"> <td class="Source" height="100%" valign="top"> <textarea id="eSourceField" dir="ltr" style="WIDTH: 100%; HEIGHT: 100%"></textarea> </td> </tr> </table> </body> </html>
zyyhong
trunk/jiaju001/news/include/FCKeditor/editor/fckeditor.original.html
HTML
asf20
3,495
<html> <head><title></title></head> <body></body> </html>
zyyhong
trunk/jiaju001/news/include/FCKeditor/editor/fckblank.html
HTML
asf20
60
/* * FCKeditor - The text editor for internet * Copyright (C) 2003-2005 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: * http://www.opensource.org/licenses/lgpl-license.php * * For further information visit: * http://www.fckeditor.net/ * * "Support Open Source software. What about a donation today?" * * File Name: fck_internal.css * This CSS Style Sheet defines rules used by the editor for its internal use. * * File Authors: * Frederico Caldeira Knabben (fredck@fckeditor.net) */ TABLE.FCK__ShowTableBorders, TABLE.FCK__ShowTableBorders TD, TABLE.FCK__ShowTableBorders TH { border: #d3d3d3 1px solid; } FORM { border: 1px dotted #FF0000; padding: 2px; } .FCK__Flash { border: darkgray 1px solid; background-position: center center; background-image: url(images/fck_flashlogo.gif); background-repeat: no-repeat; width: 80px; height: 80px; } .FCK__Anchor { background-position: center center; background-image: url(images/fck_anchor.gif); background-repeat: no-repeat; width: 16px; height: 15px; } .FCK__PageBreak { background-position: center center; background-image: url(images/fck_pagebreak.gif); background-repeat: no-repeat; clear: both; display: block; float: none; width: 100%; border-top: #999999 1px dotted; border-bottom: #999999 1px dotted; border-right: 0px; border-left: 0px; height: 5px; } input[type="hidden"] { display: inline; width:20px; height:20px; border:1px dotted #FF0000 ; background-image: url(behaviors/hiddenfield.gif); background-repeat: no-repeat; } input[type="hidden"]:after { padding-left: 20px; content: "" ; }
zyyhong
trunk/jiaju001/news/include/FCKeditor/editor/css/fck_internal.css
CSS
asf20
1,748
/* * FCKeditor - The text editor for internet * Copyright (C) 2003-2005 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: * http://www.opensource.org/licenses/lgpl-license.php * * For further information visit: * http://www.fckeditor.net/ * * "Support Open Source software. What about a donation today?" * * File Name: fck_editorarea.css * This is the default CSS file used by the editor area. It defines the * initial font of the editor and background color. * * A user can configure the editor to use another CSS file. Just change * the value of the FCKConfig.EditorAreaCSS key in the configuration * file. * * File Authors: * Frederico Caldeira Knabben (fredck@fckeditor.net) */ body { font-family: Arial, Verdana, Sans-Serif; font-size: 12px; padding: 5px 5px 5px 5px; margin: 0px; border-style: none; background-color: #ffffff; } /* Just uncomment the following block if you want to avoid spaces between paragraphs. Remember to apply the same style in your output front end page. */ /* P, UL, LI { margin-top: 0px; margin-bottom: 0px; } */ .Bold { font-weight: bold; } .Title { font-weight: bold; font-size: 18px; color: #cc3300; } .Code { border: #8b4513 1px solid; padding-right: 5px; padding-left: 5px; color: #000066; font-family: 'Courier New' , Monospace; background-color: #ff9933; }
zyyhong
trunk/jiaju001/news/include/FCKeditor/editor/css/fck_editorarea.css
CSS
asf20
1,475
/* * FCKeditor - The text editor for internet * Copyright (C) 2003-2005 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: * http://www.opensource.org/licenses/lgpl-license.php * * For further information visit: * http://www.fckeditor.net/ * * "Support Open Source software. What about a donation today?" * * File Name: fck_showtableborders_gecko.css * This CSS Style Sheet defines the rules to show table borders on Gecko. * * File Authors: * Frederico Caldeira Knabben (fredck@fckeditor.net) */ TABLE[border="0"], TABLE[border="0"] > TR > TD, TABLE[border="0"] > TR > TH, TABLE[border="0"] > TBODY > TR > TD, TABLE[border="0"] > TBODY > TR > TH, TABLE[border="0"] > THEAD > TR > TD, TABLE[border="0"] > THEAD > TR > TH, TABLE[border="0"] > TFOOT > TR > TD, TABLE[border="0"] > TFOOT > TR > TH, TABLE:not([border]), TABLE:not([border]) > TR > TD, TABLE:not([border]) > TR > TH, TABLE:not([border]) > TBODY > TR > TD, TABLE:not([border]) > TBODY > TR > TH, TABLE:not([border]) > THEAD > TR > TD, TABLE:not([border]) > THEAD > TR > TH, TABLE:not([border]) > TFOOT > TR > TD, TABLE:not([border]) > TFOOT > TR > TH { border: #d3d3d3 1px dotted ; }
zyyhong
trunk/jiaju001/news/include/FCKeditor/editor/css/fck_showtableborders_gecko.css
CSS
asf20
1,259
<!-- * FCKeditor - The text editor for internet * Copyright (C) 2003-2005 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: * http://www.opensource.org/licenses/lgpl-license.php * * For further information visit: * http://www.fckeditor.net/ * * "Support Open Source software. What about a donation today?" * * File Name: fckdialog.html * This page is used by all dialog box as the container. * * File Authors: * Frederico Caldeira Knabben (fredck@fckeditor.net) --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="robots" content="noindex, nofollow" /> <script type="text/javascript"> // On some Gecko browsers (probably over slow connections) the // "dialogArguments" are not set so we must get it from the opener window. if ( !window.dialogArguments ) window.dialogArguments = window.opener.FCKLastDialogInfo ; // Sets the Skin CSS document.write( '<link href="' + window.dialogArguments.Editor.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ; // Sets the language direction. window.document.dir = window.dialogArguments.Editor.FCKLang.Dir ; var sTitle = window.dialogArguments.Title ; document.write( '<title>' + sTitle + '<\/title>' ) ; function LoadInnerDialog() { if ( window.onresize ) window.onresize() ; // First of all, translate the dialog box contents. window.dialogArguments.Editor.FCKLanguageManager.TranslatePage( document ) ; window.frames["frmMain"].document.location.href = window.dialogArguments.Page ; } function InnerDialogLoaded() { var oInnerDoc = document.getElementById('frmMain').contentWindow.document ; // Set the language direction. oInnerDoc.dir = window.dialogArguments.Editor.FCKLang.Dir ; // Sets the Skin CSS. oInnerDoc.write( '<link href="' + window.dialogArguments.Editor.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ; SetOnKeyDown( oInnerDoc ) ; DisableContextMenu( oInnerDoc ) ; return window.dialogArguments.Editor ; } function SetOkButton( showIt ) { document.getElementById('btnOk').style.visibility = ( showIt ? '' : 'hidden' ) ; } var bAutoSize = false ; function SetAutoSize( autoSize ) { bAutoSize = autoSize ; RefreshSize() ; } function RefreshSize() { if ( bAutoSize ) { var oInnerDoc = document.getElementById('frmMain').contentWindow.document ; var iFrameHeight ; if ( document.all ) iFrameHeight = oInnerDoc.body.offsetHeight ; else iFrameHeight = document.getElementById('frmMain').contentWindow.innerHeight ; var iInnerHeight = oInnerDoc.body.scrollHeight ; var iDiff = iInnerHeight - iFrameHeight ; if ( iDiff > 0 ) { if ( document.all ) window.dialogHeight = ( parseInt( window.dialogHeight ) + iDiff ) + 'px' ; else window.resizeBy( 0, iDiff ) ; } } } function Ok() { if ( window.frames["frmMain"].Ok && window.frames["frmMain"].Ok() ) Cancel() ; } function Cancel() { window.close() ; } // Object that holds all available tabs. var oTabs = new Object() ; function TabDiv_OnClick() { SetSelectedTab( this.TabCode ) ; } function AddTab( tabCode, tabText, startHidden ) { if ( typeof( oTabs[ tabCode ] ) != 'undefined' ) return ; var eTabsRow = document.getElementById( 'Tabs' ) ; var oCell = eTabsRow.insertCell( eTabsRow.cells.length - 1 ) ; oCell.noWrap = true ; var oDiv = document.createElement( 'DIV' ) ; oDiv.className = 'PopupTab' ; oDiv.innerHTML = tabText ; oDiv.TabCode = tabCode ; oDiv.onclick = TabDiv_OnClick ; if ( startHidden ) oDiv.style.display = 'none' ; eTabsRow = document.getElementById( 'TabsRow' ) ; oCell.appendChild( oDiv ) ; if ( eTabsRow.style.display == 'none' ) { var eTitleArea = document.getElementById( 'TitleArea' ) ; eTitleArea.className = 'PopupTitle' ; oDiv.className = 'PopupTabSelected' ; eTabsRow.style.display = '' ; if ( ! window.dialogArguments.Editor.FCKBrowserInfo.IsIE ) window.onresize() ; } oTabs[ tabCode ] = oDiv ; oTabs[ tabCode ].Index = oTabs.length - 1 ; } function SetSelectedTab( tabCode ) { for ( var sCode in oTabs ) { if ( sCode == tabCode ) oTabs[sCode].className = 'PopupTabSelected' ; else oTabs[sCode].className = 'PopupTab' ; } if ( typeof( window.frames["frmMain"].OnDialogTabChange ) == 'function' ) window.frames["frmMain"].OnDialogTabChange( tabCode ) ; } function SetTabVisibility( tabCode, isVisible ) { var oTab = oTabs[ tabCode ] ; oTab.style.display = isVisible ? '' : 'none' ; if ( ! isVisible && oTab.className == 'PopupTabSelected' ) { for ( var sCode in oTabs ) { if ( oTabs[sCode].style.display != 'none' ) { SetSelectedTab( sCode ) ; break ; } } } } function SetOnKeyDown( targetDocument ) { targetDocument.onkeydown = function ( e ) { e = e || event || this.parentWindow.event ; switch ( e.keyCode ) { case 13 : // ENTER var oTarget = e.srcElement || e.target ; if ( oTarget.tagName == 'TEXTAREA' ) return ; Ok() ; return false ; case 27 : // ESC Cancel() ; return false ; break ; } return true ; } } SetOnKeyDown( document ) ; function DisableContextMenu( targetDocument ) { if ( window.dialogArguments.Editor.FCKBrowserInfo.IsIE ) return ; // Disable Right-Click var oOnContextMenu = function( e ) { var sTagName = e.target.tagName ; if ( ! ( ( sTagName == "INPUT" && e.target.type == "text" ) || sTagName == "TEXTAREA" ) ) e.preventDefault() ; } targetDocument.addEventListener( 'contextmenu', oOnContextMenu, true ) ; } DisableContextMenu( document ) ; if ( ! window.dialogArguments.Editor.FCKBrowserInfo.IsIE ) { window.onresize = function() { var oFrame = document.getElementById("frmMain") ; if ( ! oFrame ) return ; oFrame.height = 0 ; var oCell = document.getElementById("FrameCell") ; var iHeight = oCell.offsetHeight ; oFrame.height = iHeight - 2 ; } } if ( window.dialogArguments.Editor.FCKBrowserInfo.IsIE ) { function Window_OnBeforeUnload() { for ( var t in oTabs ) oTabs[t] = null ; window.dialogArguments.Editor = null ; } window.attachEvent( "onbeforeunload", Window_OnBeforeUnload ) ; } </script> </head> <body onload="LoadInnerDialog();" class="PopupBody"> <table height="100%" cellspacing="0" cellpadding="0" width="100%" border="0"> <tr> <td id="TitleArea" class="PopupTitle PopupTitleBorder"> <script type="text/javascript"> document.write( sTitle ) ; </script> </td> </tr> <tr id="TabsRow" style="DISPLAY: none"> <td class="PopupTabArea"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr id="Tabs" onselectstart="return false;"> <td class="PopupTabEmptyArea">&nbsp;</td> <td class="PopupTabEmptyArea" width="100%">&nbsp;</td> </tr> </table> </td> </tr> <tr> <td id="FrameCell" height="100%" valign="top"> <iframe id="frmMain" src="fckblank.html" name="frmMain" frameborder="0" height="100%" width="100%" scrolling="auto"> </iframe> </td> </tr> <tr> <td class="PopupButtons"> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td width="100%">&nbsp;</td> <td nowrap="nowrap"> <input id="btnOk" style="VISIBILITY: hidden; WIDTH: 100px" type="button" value="Ok" class="Button" onclick="Ok();" fckLang="DlgBtnOK" />&nbsp; <input type="button" value="Cancel" class="Button" onclick="Cancel();" fckLang="DlgBtnCancel" /> </td> </tr> </table> </td> </tr> </table> </body> </html>
zyyhong
trunk/jiaju001/news/include/FCKeditor/editor/fckdialog.html
HTML
asf20
7,974
<!-- * FCKeditor - The text editor for internet * Copyright (C) 2003-2005 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: * http://www.opensource.org/licenses/lgpl-license.php * * For further information visit: * http://www.fckeditor.net/ * * "Support Open Source software. What about a donation today?" * * File Name: fckeditor.html * Main page that holds the editor. * * File Authors: * Frederico Caldeira Knabben (fredck@fckeditor.net) --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>FCKeditor</title> <meta name="robots" content="noindex, nofollow" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="lang/fcklanguagemanager.js"></script> <meta http-equiv="Cache-Control" content="public"> <script type="text/javascript" src="js/fck_startup.js"></script> </head> <body> <table height="100%" width="100%" cellpadding="0" cellspacing="0" border="0" style="TABLE-LAYOUT: fixed"> <tr> <td style="OVERFLOW: hidden"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr id="Collapsed" style="DISPLAY: none"> <td id="ExpandHandle" class="TB_Expand" colspan="3" onclick="FCKToolbarSet.Expand();return false;"><img class="TB_ExpandImg" src="images/spacer.gif" width="8" height="4"></td> </tr> <tr id="Expanded" style="DISPLAY: none"> <td id="CollapseHandle" style="DISPLAY: none" class="TB_Collapse" valign="bottom" onclick="FCKToolbarSet.Collapse();return false;"><img class="TB_CollapseImg" src="images/spacer.gif" width="8" height="4"></td> <td id="eToolbar" class="TB_ToolbarSet"></td> <td width="1" class="TB_SideBorder"></td> </tr> </table> </td> </tr> <tr id="eWysiwyg"> <td id="eWysiwygCell" height="100%" valign="top"> <iframe id="eEditorArea" name="eEditorArea" height="100%" width="100%" frameborder="no" src="fckblank.html"></iframe> </td> </tr> <tr id="eSource" style="DISPLAY: none"> <td class="Source" height="100%" valign="top"> <textarea id="eSourceField" dir="ltr" style="WIDTH: 100%; HEIGHT: 100%"></textarea> </td> </tr> </table> </body> </html>
zyyhong
trunk/jiaju001/news/include/FCKeditor/editor/fckeditor.html
HTML
asf20
2,352
/* * FCKeditor - The text editor for internet * Copyright (C) 2003-2005 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: * http://www.opensource.org/licenses/lgpl-license.php * * For further information visit: * http://www.fckeditor.net/ * * "Support Open Source software. What about a donation today?" * * File Name: fckeditor.js * This is the integration file for JavaScript. * * It defines the FCKeditor class that can be used to create editor * instances in a HTML page in the client side. For server side * operations, use the specific integration system. * * File Authors: * Frederico Caldeira Knabben (fredck@fckeditor.net) */ // FCKeditor Class var FCKeditor = function( instanceName, width, height, toolbarSet, value ) { // Properties this.InstanceName = instanceName ; this.Width = width || '100%' ; this.Height = height || '200' ; this.ToolbarSet = toolbarSet || 'Default' ; this.Value = value || '' ; this.BasePath = '/fckeditor/' ; this.CheckBrowser = true ; this.DisplayErrors = true ; this.EnableSafari = false ; // This is a temporary property, while Safari support is under development. this.EnableOpera = false ; // This is a temporary property, while Opera support is under development. this.Config = new Object() ; // Events this.OnError = null ; // function( source, errorNumber, errorDescription ) } FCKeditor.prototype.Create = function() { // Check for errors if ( !this.InstanceName || this.InstanceName.length == 0 ) { this._ThrowError( 701, 'You must specify an instance name.' ) ; return ; } document.write( '<div>' ) ; if ( !this.CheckBrowser || this._IsCompatibleBrowser() ) { document.write( '<input type="hidden" id="' + this.InstanceName + '" name="' + this.InstanceName + '" value="' + this._HTMLEncode( this.Value ) + '" style="display:none" />' ) ; document.write( this._GetConfigHtml() ) ; document.write( this._GetIFrameHtml() ) ; } else { var sWidth = this.Width.toString().indexOf('%') > 0 ? this.Width : this.Width + 'px' ; var sHeight = this.Height.toString().indexOf('%') > 0 ? this.Height : this.Height + 'px' ; document.write('<textarea name="' + this.InstanceName + '" rows="4" cols="40" style="WIDTH: ' + sWidth + '; HEIGHT: ' + sHeight + '">' + this._HTMLEncode( this.Value ) + '<\/textarea>') ; } document.write( '</div>' ) ; } FCKeditor.prototype.ReplaceTextarea = function() { if ( !this.CheckBrowser || this._IsCompatibleBrowser() ) { // We must check the elements firstly using the Id and then the name. var oTextarea = document.getElementById( this.InstanceName ) ; var colElementsByName = document.getElementsByName( this.InstanceName ) ; var i = 0; while ( oTextarea || i == 0 ) { if ( oTextarea && oTextarea.tagName == 'TEXTAREA' ) break ; oTextarea = colElementsByName[i++] ; } if ( !oTextarea ) { alert( 'Error: The TEXTAREA with id or name set to "' + this.InstanceName + '" was not found' ) ; return ; } oTextarea.style.display = 'none' ; this._InsertHtmlBefore( this._GetConfigHtml(), oTextarea ) ; this._InsertHtmlBefore( this._GetIFrameHtml(), oTextarea ) ; } } FCKeditor.prototype._InsertHtmlBefore = function( html, element ) { if ( element.insertAdjacentHTML ) // IE element.insertAdjacentHTML( 'beforeBegin', html ) ; else // Gecko { var oRange = document.createRange() ; oRange.setStartBefore( element ) ; var oFragment = oRange.createContextualFragment( html ); element.parentNode.insertBefore( oFragment, element ) ; } } FCKeditor.prototype._GetConfigHtml = function() { var sConfig = '' ; for ( var o in this.Config ) { if ( sConfig.length > 0 ) sConfig += '&amp;' ; sConfig += escape(o) + '=' + escape( this.Config[o] ) ; } return '<input type="hidden" id="' + this.InstanceName + '___Config" value="' + sConfig + '" style="display:none" />' ; } FCKeditor.prototype._GetIFrameHtml = function() { var sFile = (/fcksource=true/i).test( window.top.location.search ) ? 'fckeditor.original.html' : 'fckeditor.html' ; var sLink = this.BasePath + 'editor/' + sFile + '?InstanceName=' + this.InstanceName ; if (this.ToolbarSet) sLink += '&Toolbar=' + this.ToolbarSet ; return '<iframe id="' + this.InstanceName + '___Frame" src="' + sLink + '" width="' + this.Width + '" height="' + this.Height + '" frameborder="no" scrolling="no"></iframe>' ; } FCKeditor.prototype._IsCompatibleBrowser = function() { var sAgent = navigator.userAgent.toLowerCase() ; // Internet Explorer if ( sAgent.indexOf("msie") != -1 && sAgent.indexOf("mac") == -1 && sAgent.indexOf("opera") == -1 ) { var sBrowserVersion = navigator.appVersion.match(/MSIE (.\..)/)[1] ; return ( sBrowserVersion >= 5.5 ) ; } // Gecko if ( navigator.product == "Gecko" && navigator.productSub >= 20030210 ) return true ; // Opera if ( this.EnableOpera ) { var aMatch = sAgent.match( /^opera\/(\d+\.\d+)/ ) ; if ( aMatch && aMatch[1] >= 9.0 ) return true ; } // Safari if ( this.EnableSafari && sAgent.indexOf( 'safari' ) != -1 ) return ( sAgent.match( /safari\/(\d+)/ )[1] >= 312 ) ; // Build must be at least 312 (1.3) return false ; } FCKeditor.prototype._ThrowError = function( errorNumber, errorDescription ) { this.ErrorNumber = errorNumber ; this.ErrorDescription = errorDescription ; if ( this.DisplayErrors ) { document.write( '<div style="COLOR: #ff0000">' ) ; document.write( '[ FCKeditor Error ' + this.ErrorNumber + ': ' + this.ErrorDescription + ' ]' ) ; document.write( '</div>' ) ; } if ( typeof( this.OnError ) == 'function' ) this.OnError( this, errorNumber, errorDescription ) ; } FCKeditor.prototype._HTMLEncode = function( text ) { if ( typeof( text ) != "string" ) text = text.toString() ; text = text.replace(/&/g, "&amp;") ; text = text.replace(/"/g, "&quot;") ; text = text.replace(/</g, "&lt;") ; text = text.replace(/>/g, "&gt;") ; text = text.replace(/'/g, "&#39;") ; return text ; }
zyyhong
trunk/jiaju001/news/include/FCKeditor/fckeditor.js
JavaScript
asf20
6,242
/* * FCKeditor - The text editor for internet * Copyright (C) 2003-2005 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: * http://www.opensource.org/licenses/lgpl-license.php * * For further information visit: * http://www.fckeditor.net/ * * "Support Open Source software. What about a donation today?" * * File Name: fckconfig.js * Editor configuration settings. * See the documentation for more info. * * File Authors: * Frederico Caldeira Knabben (fredck@fckeditor.net) */ FCKConfig.CustomConfigurationsPath = '' ; FCKConfig.EditorAreaCSS = FCKConfig.BasePath + 'css/fck_editorarea.css' ; FCKConfig.DocType = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' ; FCKConfig.BaseHref = '' ; FCKConfig.FullPage = false ; FCKConfig.Debug = false ; FCKConfig.AllowQueryStringDebug = true ; FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/default/' ; FCKConfig.PluginsPath = FCKConfig.BasePath + 'plugins/' ; // FCKConfig.Plugins.Add( 'placeholder', 'de,en,fr,it,pl' ) ; FCKConfig.ProtectedSource.Add( /<script[\s\S]*?\/script>/gi ) ; // <SCRIPT> tags. // FCKConfig.ProtectedSource.Add( /<%[\s\S]*?%>/g ) ; // ASP style server side code <%...%> // FCKConfig.ProtectedSource.Add( /<\?[\s\S]*?\?>/g ) ; // PHP style server side code <?php ...?> // FCKConfig.ProtectedSource.Add( /(<asp:[^\>]+>[\s|\S]*?<\/asp:[^\>]+>)|(<asp:[^\>]+\/>)/gi ) ; // ASP.Net style tags <asp:control> FCKConfig.AutoDetectLanguage = true ; FCKConfig.DefaultLanguage = 'zh-cn' ; FCKConfig.ContentLangDirection = 'ltr' ; FCKConfig.EnableXHTML = false ; // Unsupported: Do not change. FCKConfig.EnableSourceXHTML = false ; // Unsupported: Do not change. FCKConfig.ProcessHTMLEntities = true ; FCKConfig.IncludeLatinEntities = true ; FCKConfig.IncludeGreekEntities = true ; FCKConfig.FillEmptyBlocks = true ; FCKConfig.FormatSource = true ; FCKConfig.FormatOutput = true ; FCKConfig.FormatIndentator = ' ' ; FCKConfig.ForceStrongEm = true ; FCKConfig.GeckoUseSPAN = true ; FCKConfig.StartupFocus = false ; FCKConfig.ForcePasteAsPlainText = false ; FCKConfig.AutoDetectPasteFromWord = true ; // IE only. FCKConfig.ForceSimpleAmpersand = false ; FCKConfig.TabSpaces = 0 ; FCKConfig.ShowBorders = true ; FCKConfig.UseBROnCarriageReturn = false ; // IE only. FCKConfig.ToolbarStartExpanded = true ; FCKConfig.ToolbarCanCollapse = true ; FCKConfig.IEForceVScroll = false ; FCKConfig.IgnoreEmptyParagraphValue = true ; FCKConfig.PreserveSessionOnFileBrowser = false ; FCKConfig.FloatingPanelsZIndex = 10000 ; FCKConfig.ToolbarSets["Default"] = [ ['Source','DocProps','-','Preview'], ['Cut','Copy','Paste','PasteText','PasteWord','-'], ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'], ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'], ['OrderedList','UnorderedList','-','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'], ['Link','Unlink','Anchor'], ['Image','Flash','Media','Addon','Table'], ['Smiley','SpecialChar','Rule','PageBreak','Quote','LineBr'], ['DedeTag'], ['Style','FontFormat','FontName','FontSize'], ['TextColor','BGColor'],['About'] ] ; FCKConfig.ToolbarSets["Basic"] = [ ['Source','Preview'], ['Cut','Copy','Paste','PasteText','PasteWord','-'], ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'], ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'], ['OrderedList','UnorderedList','-','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'], ['Link','Unlink','Anchor'], ['Image','Flash','Media','Addon','Table'], ['Smiley','SpecialChar','Rule','PageBreak','Quote','LineBr'], ['Style','FontFormat','FontName','FontSize'], ['TextColor','BGColor'] ] ; FCKConfig.ToolbarSets["Small"] = [ ['Source','Preview'],['Cut','Copy','Paste','PasteText','PasteWord'], ['OrderedList','UnorderedList','-','Bold','Italic','Underline','StrikeThrough'], ['Link','Unlink','Anchor'], ['Image','Flash','Table','Rule'],['TextColor','BGColor'] ] ; FCKConfig.ToolbarSets["Member"] = [ ['Source','Preview'],['Cut','Copy','Paste','PasteText','PasteWord'], ['Bold','Italic','Underline','StrikeThrough'], ['ImageUser','FlashUser'], ['Link','Unlink'], ['Table','Rule','Quote','LineBr'], ['TextColor','FontSize'] ] ; FCKConfig.ToolbarSets["MemberLit"] = [ ['Source','Preview'],['Cut','Copy','Paste','PasteText','PasteWord'], ['Bold','Italic','Underline','StrikeThrough'], ['ImageUser','FlashUser'], ['Link','Unlink'], ['Table','Rule','Quote','LineBr'], ['TextColor','FontSize'] ] ; FCKConfig.ContextMenu = ['Generic','Link','Anchor','Image','Flash','BulletedList','NumberedList','TableCell','Table'] ; FCKConfig.FontColors = '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,808080,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF' ; FCKConfig.FontNames = '宋体;黑体;楷体_GB2312;Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ; FCKConfig.FontSizes = '1/极细字;2/细字;3/小字体;4/中字体;5/大字体;6/加大字;7/特大字' ; FCKConfig.FontFormats = 'p;div;pre;address;h1;h2;h3;h4;h5;h6' ; FCKConfig.StylesXmlPath = FCKConfig.EditorPath + 'fckstyles.xml' ; FCKConfig.TemplatesXmlPath = FCKConfig.EditorPath + 'fcktemplates.xml' ; //FCKConfig.SpellChecker = 'ieSpell' ; // 'ieSpell' | 'SpellerPages' //FCKConfig.IeSpellDownloadUrl = 'http://www.iespell.com/rel/ieSpellSetup211325.exe' ; FCKConfig.MaxUndoLevels = 15 ; FCKConfig.DisableImageHandles = false ; FCKConfig.DisableTableHandles = false ; FCKConfig.LinkDlgHideTarget = false ; FCKConfig.LinkDlgHideAdvanced = false ; FCKConfig.ImageDlgHideLink = false ; FCKConfig.ImageDlgHideAdvanced = false ; FCKConfig.FlashDlgHideAdvanced = false ; // The following value defines which File Browser connector and Quick Upload // "uploader" to use. It is valid for the default implementaion and it is here // just to make this configuration file cleaner. // It is not possible to change this value using an external file or even // inline when creating the editor instance. In that cases you must set the // values of LinkBrowserURL, ImageBrowserURL and so on. // Custom implementations should just ignore it. var _FileBrowserLanguage = 'php' ; // asp | aspx | cfm | lasso | perl | php | py var _QuickUploadLanguage = 'php' ; // asp | aspx | cfm | lasso | php // Don't care about the following line. It just calculates the correct connector // extension to use for the default File Browser (Perl uses "cgi"). var _FileBrowserExtension = _FileBrowserLanguage == 'perl' ? 'cgi' : _FileBrowserLanguage ; FCKConfig.LinkBrowser = true ; FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ; FCKConfig.LinkBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; // 70% FCKConfig.LinkBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; // 70% FCKConfig.ImageBrowser = true ; FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ; FCKConfig.ImageBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; // 70% ; FCKConfig.ImageBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; // 70% ; FCKConfig.FlashBrowser = true ; FCKConfig.FlashBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ; FCKConfig.FlashBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; //70% ; FCKConfig.FlashBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; //70% ; FCKConfig.LinkUpload = true ; FCKConfig.LinkUploadURL = FCKConfig.BasePath + 'filemanager/upload/' + FCKConfig.QuickUploadLanguage + '/upload.' + _QuickUploadLanguage ; FCKConfig.LinkUploadAllowedExtensions = "" ; // empty for all FCKConfig.LinkUploadDeniedExtensions = ".(php|php3|php5|phtml|asp|aspx|ascx|jsp|cfm|cfc|pl|bat|exe|dll|reg|cgi)$" ; // empty for no one FCKConfig.ImageUpload = true ; FCKConfig.ImageUploadURL = FCKConfig.BasePath + 'filemanager/upload/' + FCKConfig.QuickUploadLanguage + '/upload.' + _QuickUploadLanguage + '?Type=Image' ; FCKConfig.ImageUploadAllowedExtensions = ".(jpg|gif|jpeg|png)$" ; // empty for all FCKConfig.ImageUploadDeniedExtensions = "" ; // empty for no one FCKConfig.FlashUpload = true ; FCKConfig.FlashUploadURL = FCKConfig.BasePath + 'filemanager/upload/' + FCKConfig.QuickUploadLanguage + '/upload.' + _QuickUploadLanguage + '?Type=Flash' ; FCKConfig.FlashUploadAllowedExtensions = ".(swf|fla)$" ; // empty for all FCKConfig.FlashUploadDeniedExtensions = "" ; // empty for no one FCKConfig.SmileyPath = FCKConfig.BasePath + 'images/smiley/msn/' ; FCKConfig.SmileyImages = ['regular_smile.gif','sad_smile.gif','wink_smile.gif','teeth_smile.gif','confused_smile.gif','tounge_smile.gif','embaressed_smile.gif','omg_smile.gif','whatchutalkingabout_smile.gif','angry_smile.gif','angel_smile.gif','shades_smile.gif','devil_smile.gif','cry_smile.gif','lightbulb.gif','thumbs_down.gif','thumbs_up.gif','heart.gif','broken_heart.gif','kiss.gif','envelope.gif'] ; FCKConfig.SmileyColumns = 8 ; FCKConfig.SmileyWindowWidth = 320 ; FCKConfig.SmileyWindowHeight = 240 ; if( window.console ) window.console.log( 'Config is loaded!' ) ; // @Packager.Compactor.RemoveLine
zyyhong
trunk/jiaju001/news/include/FCKeditor/fckconfig.js
JavaScript
asf20
9,927
<?php /* * FCKeditor - The text editor for internet * Copyright (C) 2003-2005 Frederico Caldeira Knabben * * Licensed under the terms of the GNU Lesser General Public License: * http://www.opensource.org/licenses/lgpl-license.php * * For further information visit: * http://www.fckeditor.net/ * * "Support Open Source software. What about a donation today?" * * File Name: fckeditor.php * This is the integration file for PHP. * * It defines the FCKeditor class that can be used to create editor * instances in PHP pages on server side. * * File Authors: * Frederico Caldeira Knabben (fredck@fckeditor.net) */ class FCKeditor { var $InstanceName ; var $BasePath ; var $Width ; var $Height ; var $ToolbarSet ; var $Value ; var $Config ; // PHP 5 Constructor (by Marcus Bointon <coolbru@users.sourceforge.net>) function __construct( $instanceName ) { $this->InstanceName = $instanceName ; $this->BasePath = '' ; $this->Width = '100%' ; $this->Height = '300' ; $this->ToolbarSet = 'Default' ; $this->Value = '' ; $this->Config = array() ; } // PHP 4 Contructor function FCKeditor( $instanceName ) { $this->__construct( $instanceName ) ; } function Create() { echo $this->CreateHtml() ; } function CreateHtml() { $HtmlValue = htmlspecialchars( $this->Value ) ; $Html = '<div>' ; if ( $this->IsCompatible() ) { if ( isset( $_GET['fcksource'] ) && $_GET['fcksource'] == "true" ) $File = 'fckeditor.original.html' ; else $File = 'fckeditor.html' ; $Link = "{$this->BasePath}editor/{$File}?InstanceName={$this->InstanceName}" ; if ( $this->ToolbarSet != '' ) $Link .= "&amp;Toolbar={$this->ToolbarSet}" ; // Render the linked hidden field. $Html .= "<input type=\"hidden\" id=\"{$this->InstanceName}\" name=\"{$this->InstanceName}\" value=\"{$HtmlValue}\" style=\"display:none\" />" ; // Render the configurations hidden field. $Html .= "<input type=\"hidden\" id=\"{$this->InstanceName}___Config\" value=\"" . $this->GetConfigFieldString() . "\" style=\"display:none\" />" ; // Render the editor IFRAME. $Html .= "<iframe id=\"{$this->InstanceName}___Frame\" src=\"{$Link}\" width=\"{$this->Width}\" height=\"{$this->Height}\" frameborder=\"no\" scrolling=\"no\"></iframe>" ; } else { if ( strpos( $this->Width, '%' ) === false ) $WidthCSS = $this->Width . 'px' ; else $WidthCSS = $this->Width ; if ( strpos( $this->Height, '%' ) === false ) $HeightCSS = $this->Height . 'px' ; else $HeightCSS = $this->Height ; $Html .= "<textarea name=\"{$this->InstanceName}\" rows=\"4\" cols=\"40\" style=\"width: {$WidthCSS}; height: {$HeightCSS}\">{$HtmlValue}</textarea>" ; } $Html .= '</div>' ; return $Html ; } function IsCompatible() { global $HTTP_USER_AGENT ; if ( isset( $HTTP_USER_AGENT ) ) $sAgent = $HTTP_USER_AGENT ; else $sAgent = $_SERVER['HTTP_USER_AGENT'] ; if ( strpos($sAgent, 'MSIE') !== false && strpos($sAgent, 'mac') === false && strpos($sAgent, 'Opera') === false ) { $iVersion = (float)substr($sAgent, strpos($sAgent, 'MSIE') + 5, 3) ; return ($iVersion >= 5.5) ; } else if ( strpos($sAgent, 'Gecko/') !== false ) { $iVersion = (int)substr($sAgent, strpos($sAgent, 'Gecko/') + 6, 8) ; return ($iVersion >= 20030210) ; } else return false ; } function GetConfigFieldString() { $sParams = '' ; $bFirst = true ; foreach ( $this->Config as $sKey => $sValue ) { if ( $bFirst == false ) $sParams .= '&amp;' ; else $bFirst = false ; if ( $sValue === true ) $sParams .= $this->EncodeConfig( $sKey ) . '=true' ; else if ( $sValue === false ) $sParams .= $this->EncodeConfig( $sKey ) . '=false' ; else $sParams .= $this->EncodeConfig( $sKey ) . '=' . $this->EncodeConfig( $sValue ) ; } return $sParams ; } function EncodeConfig( $valueToEncode ) { $chars = array( '&' => '%26', '=' => '%3D', '"' => '%22' ) ; return strtr( $valueToEncode, $chars ) ; } } ?>
zyyhong
trunk/jiaju001/news/include/FCKeditor/fckeditor.php
PHP
asf20
4,239
<?php if(!defined('DEDEINC')) { exit("Request Error!"); } require_once(dirname(__FILE__)."/pub_dedetag.php"); require_once(dirname(__FILE__)."/inc_typelink.php"); require_once(dirname(__FILE__)."/inc_channel_unit_functions.php"); /****************************************************** //Copyright 2005-2007 by DedeCms.com itprato //本类的用途是用于浏览频道RSS或对RSS生成静态文件 //最后修改日期 2007-3-27 By dedecms 用户 baijixing ******************************************************/ @set_time_limit(0); class RssView { var $dsql; var $TypeID; var $TypeLink; var $TypeFields; var $MaxRow; var $dtp; //------------------------------- //php5构造函数 //------------------------------- function __construct($typeid,$max_row=50) { $this->TypeID = $typeid; $this->dtp = new DedeTagParse(); $templetfiles = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/plus/rss.htm"; $this->dtp->LoadTemplate($templetfiles); $this->dsql = new DedeSql(false); $this->TypeLink = new TypeLink($typeid); $this->TypeFields = $this->TypeLink->TypeInfos; $this->MaxRow = $max_row; $this->TypeFields['title'] = $this->TypeLink->GetPositionLink(false); $this->TypeFields['title'] = ereg_replace("[<>]"," / ",$this->TypeFields['title']); $this->TypeFields['typelink'] = $this->TypeLink->GetOneTypeUrl($this->TypeFields); $this->TypeFields['powerby'] = $GLOBALS['cfg_powerby']; $this->TypeFields['adminemail'] = $GLOBALS['cfg_adminemail']; foreach($this->TypeFields as $k=>$v){ $this->TypeFields[$k] = htmlspecialchars($v); } $this->ParseTemplet(); } //php4构造函数 //--------------------------- function RssView($typeid,$max_row=50){ $this->__construct($typeid,$max_row); } //--------------------------- //关闭相关资源 //--------------------------- function Close() { $this->dsql->Close(); $this->TypeLink->Close(); } //------------------ //显示列表 //------------------ function Display() { $this->dtp->Display(); } //------------------ //开始创建列表 //------------------ function MakeRss() { $murl = $GLOBALS['cfg_plus_dir']."/rss/".$this->TypeID.".xml"; $mfile = $GLOBALS['cfg_basedir'].$murl; $this->dtp->SaveTo($mfile); return $murl; } //------------------ //解析模板 //------------------ function ParseTemplet() { foreach($this->dtp->CTags as $tid => $ctag) { if($ctag->GetName()=="field") { $this->dtp->Assign($tid,$this->TypeFields[$ctag->GetAtt('name')]); } else if($ctag->GetName()=="rssitem"){ $this->dtp->Assign($tid, $this->GetArcList($ctag->GetInnerText()) ); } } } //---------------------------------- //获得文档列表 //--------------------------------- function GetArcList($innertext="") { $typeid=$this->TypeID; $innertext = trim($innertext); if($innertext=="") $innertext = GetSysTemplets("rss.htm"); $orwhere = " #@__archives.arcrank > -1 "; $orwhere .= " And (".$this->TypeLink->GetSunID($this->TypeID,"#@__archives",$this->TypeFields['channeltype'])." Or #@__archives.typeid2='".$this->TypeID."') "; $ordersql=" order by #@__archives.senddate desc"; //---------------------------- $query = "Select #@__archives.ID,#@__archives.title,#@__archives.source,#@__archives.writer,#@__archives.typeid,#@__archives.ismake,#@__archives.money, #@__archives.description,#@__archives.pubdate,#@__archives.senddate,#@__archives.arcrank,#@__archives.click, #@__archives.litpic,#@__arctype.typedir,#@__arctype.typename,#@__arctype.isdefault, #@__arctype.defaultname,#@__arctype.namerule,#@__arctype.namerule2,#@__arctype.ispart, #@__arctype.siteurl from #@__archives left join #@__arctype on #@__archives.typeid=#@__arctype.ID where $orwhere $ordersql limit 0,".$this->MaxRow; $this->dsql->SetQuery($query); $this->dsql->Execute("al"); $artlist = ""; $dtp2 = new DedeTagParse(); $dtp2->SetNameSpace("field","[","]"); $dtp2->LoadSource($innertext); while($row = $this->dsql->GetArray("al")) { //处理一些特殊字段 if($row["litpic"]=="") $row["litpic"] = $GLOBALS["cfg_plus_dir"]."/img/dfpic.gif"; $row["picname"] = $row["litpic"]; $row["arcurl"] = $this->GetArcUrl($row["ID"],$row["typeid"],$row["senddate"],$row["title"], $row["ismake"],$row["arcrank"],$row["namerule"],$row["typedir"],$row["money"]); $row["typeurl"] = $this->GetListUrl($row["typeid"],$row["typedir"],$row["isdefault"],$row["defaultname"],$row["ispart"],$row["namerule2"]); $row["info"] = $row["description"]; $row["filename"] = $row["arcurl"]; $row["stime"] = GetDateMK($row["pubdate"]); $row["image"] = "<img src='".$row["picname"]."' border='0'>"; $row["fullurl"] = $row['siteurl'].$row["arcurl"]; $row["phpurl"] = $GLOBALS["cfg_plus_dir"]; $row["templeturl"] = $GLOBALS["cfg_templets_dir"]; if($row["source"]=="") $row["source"] = $GLOBALS['cfg_webname']; if($row["writer"]=="") $row["writer"] = "秩名"; foreach($row as $k=>$v){ $row[$k] = htmlspecialchars($v); } //--------------------------- if(is_array($dtp2->CTags)){ foreach($dtp2->CTags as $k=>$ctag){ if(isset($row[$ctag->GetName()])) $dtp2->Assign($k,$row[$ctag->GetName()]); else $dtp2->Assign($k,""); } } $artlist .= $dtp2->GetResult()."\r\n"; } $this->dsql->FreeResult("al"); return $artlist; } //-------------------------- //获得一个指定的频道的链接 //-------------------------- function GetListUrl($typeid,$typedir,$isdefault,$defaultname,$ispart,$namerule2) { return GetTypeUrl($typeid,MfTypedir($typedir),$isdefault,$defaultname,$ispart,$namerule2); } //-------------------------- //获得一个指定档案的链接 //-------------------------- function GetArcUrl($aid,$typeid,$timetag,$title,$ismake=0,$rank=0,$namerule="",$artdir="",$money=0) { return GetFileUrl($aid,$typeid,$timetag,$title,$ismake,$rank,$namerule,$artdir,$money); } }//End Class ?>
zyyhong
trunk/jiaju001/news/include/inc_rss_view.php
PHP
asf20
6,317
<?php @set_time_limit(0); /*======================================= //织梦Http下载类V1.2版,本版增加了POST发送数据的方式 //把要POST的数据像GET一样跟在网址后,程序会自动处理,并用POST方式发送 //POST仅支持application/x-www-form-urlencoded方式 //最后修改日期:2006-6-22 =======================================*/ class DedeHttpDown { var $m_url = ""; var $m_urlpath = ""; var $m_scheme = "http"; var $m_host = ""; var $m_port = "80"; var $m_user = ""; var $m_pass = ""; var $m_path = "/"; var $m_query = ""; var $m_fp = ""; var $m_error = ""; var $m_httphead = "" ; var $m_html = ""; var $m_puthead = ""; var $BaseUrlPath = ""; var $HomeUrl = ""; var $reTry = 0; var $JumpCount = 0;//防止多重重定向陷入死循环 // //初始化系统 // function PrivateInit($url) { if($url=="") return ; $urls = ""; $urls = @parse_url($url); $this->m_url = $url; if(is_array($urls)) { $this->m_host = $urls["host"]; if(!empty($urls["scheme"])) $this->m_scheme = $urls["scheme"]; if(!empty($urls["user"])){ $this->m_user = $urls["user"]; } if(!empty($urls["pass"])){ $this->m_pass = $urls["pass"]; } if(!empty($urls["port"])){ $this->m_port = $urls["port"]; } if(!empty($urls["path"])) $this->m_path = $urls["path"]; $this->m_urlpath = $this->m_path; if(!empty($urls["query"])){ $this->m_query = $urls["query"]; $this->m_urlpath .= "?".$this->m_query; } $this->HomeUrl = $urls["host"]; $this->BaseUrlPath = $this->HomeUrl.$urls["path"]; $this->BaseUrlPath = preg_replace("/\/([^\/]*)\.(.*)$/","/",$this->BaseUrlPath); $this->BaseUrlPath = preg_replace("/\/$/","",$this->BaseUrlPath); } } function ResetAny() { //重设各参数 $this->m_url = ""; $this->m_urlpath = ""; $this->m_scheme = "http"; $this->m_host = ""; $this->m_port = "80"; $this->m_user = ""; $this->m_pass = ""; $this->m_path = "/"; $this->m_query = ""; $this->m_error = ""; } // //打开指定网址 // function OpenUrl($url,$requestType="GET") { $this->ResetAny(); $this->JumpCount = 0; $this->m_httphead = Array() ; $this->m_html = ''; $this->reTry = 0; $this->Close(); //初始化系统 $this->PrivateInit($url); $this->PrivateStartSession($requestType); } // //转到303重定向网址 // function JumpOpenUrl($url) { $this->ResetAny(); $this->JumpCount++; $this->m_httphead = Array() ; $this->m_html = ""; $this->Close(); //初始化系统 $this->PrivateInit($url); $this->PrivateStartSession('GET'); } // //获得某操作错误的原因 // function printError() { echo "错误信息:".$this->m_error; echo "<br/>具体返回头:<br/>"; foreach($this->m_httphead as $k=>$v){ echo "$k => $v <br/>\r\n"; } } // //判别用Get方法发送的头的应答结果是否正确 // function IsGetOK() { if( ereg("^2",$this->GetHead("http-state")) ){ return true; } else{ $this->m_error .= $this->GetHead("http-state")." - ".$this->GetHead("http-describe")."<br/>"; return false; } } // //看看返回的网页是否是text类型 // function IsText() { if( ereg("^2",$this->GetHead("http-state")) && eregi("text|xml",$this->GetHead("content-type")) ) { return true; } else { $this->m_error .= "内容为非文本类型或网址重定向<br/>"; return false; } } // //判断返回的网页是否是特定的类型 // function IsContentType($ctype) { if(ereg("^2",$this->GetHead("http-state")) && $this->GetHead("content-type")==strtolower($ctype)) { return true; } else { $this->m_error .= "类型不对 ".$this->GetHead("content-type")."<br/>"; return false; } } // //用Http协议下载文件 // function SaveToBin($savefilename) { if(!$this->IsGetOK()) return false; if(@feof($this->m_fp)) { $this->m_error = "连接已经关闭!"; return false; } $fp = fopen($savefilename,"w"); while(!feof($this->m_fp)){ fwrite($fp,fread($this->m_fp,1024)); } fclose($this->m_fp); fclose($fp); return true; } // //保存网页内容为Text文件 // function SaveToText($savefilename) { if($this->IsText()) $this->SaveBinFile($savefilename); else return ""; } // //用Http协议获得一个网页的内容 // function GetHtml() { if(!$this->IsText()) return ''; if($this->m_html!='') return $this->m_html; if(!$this->m_fp||@feof($this->m_fp)) return ''; while(!feof($this->m_fp)){ $this->m_html .= fgets($this->m_fp,256); } @fclose($this->m_fp); return $this->m_html; } // //开始HTTP会话 // function PrivateStartSession($requestType="GET") { if(!$this->PrivateOpenHost()){ $this->m_error .= "打开远程主机出错!"; return false; } $this->reTry++; if($this->GetHead("http-edition")=="HTTP/1.1") $httpv = "HTTP/1.1"; else $httpv = "HTTP/1.0"; $ps = explode('?',$this->m_urlpath); //发送固定的起始请求头GET、Host信息 if($requestType=="GET") fputs($this->m_fp,"GET ".$this->m_urlpath." $httpv\r\n"); else fputs($this->m_fp,"POST ".$ps[0]." $httpv\r\n"); $this->m_puthead["Host"] = $this->m_host; //发送用户自定义的请求头 if(!isset($this->m_puthead["Accept"])) { $this->m_puthead["Accept"] = "*/*"; } if(!isset($this->m_puthead["User-Agent"])) { $this->m_puthead["User-Agent"] = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2)"; } if(!isset($this->m_puthead["Refer"])) { $this->m_puthead["Refer"] = "http://".$this->m_puthead["Host"]; } foreach($this->m_puthead as $k=>$v){ $k = trim($k); $v = trim($v); if($k!=""&&$v!=""){ fputs($this->m_fp,"$k: $v\r\n"); } } if($requestType=="POST"){ $postdata = ""; if(count($ps)>1){ for($i=1;$i<count($ps);$i++) $postdata .= $ps[$i]; } else{ $postdata = "OK"; } $plen = strlen($postdata); fputs($this->m_fp,"Content-Type: application/x-www-form-urlencoded\r\n"); fputs($this->m_fp,"Content-Length: $plen\r\n"); } //发送固定的结束请求头 //HTTP1.1协议必须指定文档结束后关闭链接,否则读取文档时无法使用feof判断结束 if($httpv=="HTTP/1.1") fputs($this->m_fp,"Connection: Close\r\n\r\n"); else fputs($this->m_fp,"\r\n"); if($requestType=="POST"){ fputs($this->m_fp,$postdata); } //获取应答头状态信息 $httpstas = explode(" ",fgets($this->m_fp,256)); $this->m_httphead["http-edition"] = trim($httpstas[0]); $this->m_httphead["http-state"] = trim($httpstas[1]); $this->m_httphead["http-describe"] = ""; for($i=2;$i<count($httpstas);$i++){ $this->m_httphead["http-describe"] .= " ".trim($httpstas[$i]); } //获取详细应答头 while(!feof($this->m_fp)){ $line = trim(fgets($this->m_fp,256)); if($line == "") break; $hkey = ""; $hvalue = ""; $v = 0; for($i=0;$i<strlen($line);$i++){ if($v==1) $hvalue .= $line[$i]; if($line[$i]==":") $v = 1; if($v==0) $hkey .= $line[$i]; } $hkey = trim($hkey); if($hkey!="") $this->m_httphead[strtolower($hkey)] = trim($hvalue); } //如果连接被不正常关闭,重试 if(feof($this->m_fp)) { if($this->reTry > 10) return false; $this->PrivateStartSession($requestType); } //判断是否是3xx开头的应答 if(ereg("^3",$this->m_httphead["http-state"])) { if($this->JumpCount > 3) return; if(isset($this->m_httphead["location"])){ $newurl = $this->m_httphead["location"]; if(eregi("^http",$newurl)){ $this->JumpOpenUrl($newurl); } else{ $newurl = $this->FillUrl($newurl); $this->JumpOpenUrl($newurl); } } else { $this->m_error = "无法识别的答复!"; } }// } // //获得一个Http头的值 // function GetHead($headname) { $headname = strtolower($headname); if(isset($this->m_httphead[$headname])) return $this->m_httphead[$headname]; else return ""; } // //设置Http头的值 // function SetHead($skey,$svalue) { $this->m_puthead[$skey] = $svalue; } // //打开连接 // function PrivateOpenHost() { if($this->m_host=="") return false; $errno = ""; $errstr = ""; $this->m_fp = @fsockopen($this->m_host, $this->m_port, $errno, $errstr,10); if(!$this->m_fp){ $this->m_error = $errstr; return false; } else{ return true; } } // //关闭连接 // function Close(){ @fclose($this->m_fp); } // //补全相对网址 // function FillUrl($surl) { $i = 0; $dstr = ""; $pstr = ""; $okurl = ""; $pathStep = 0; $surl = trim($surl); if($surl=="") return ""; $pos = strpos($surl,"#"); if($pos>0) $surl = substr($surl,0,$pos); if($surl[0]=="/"){ $okurl = "http://".$this->HomeUrl.$surl; } else if($surl[0]==".") { if(strlen($surl)<=1) return ""; else if($surl[1]=="/") { $okurl = "http://".$this->BaseUrlPath."/".substr($surl,2,strlen($surl)-2); } else{ $urls = explode("/",$surl); foreach($urls as $u){ if($u=="..") $pathStep++; else if($i<count($urls)-1) $dstr .= $urls[$i]."/"; else $dstr .= $urls[$i]; $i++; } $urls = explode("/",$this->BaseUrlPath); if(count($urls) <= $pathStep) return ""; else{ $pstr = "http://"; for($i=0;$i<count($urls)-$pathStep;$i++) { $pstr .= $urls[$i]."/"; } $okurl = $pstr.$dstr; } } } else { if(strlen($surl)<7) $okurl = "http://".$this->BaseUrlPath."/".$surl; else if(strtolower(substr($surl,0,7))=="http://") $okurl = $surl; else $okurl = "http://".$this->BaseUrlPath."/".$surl; } $okurl = eregi_replace("^(http://)","",$okurl); $okurl = eregi_replace("/{1,}","/",$okurl); return "http://".$okurl; } } ?>
zyyhong
trunk/jiaju001/news/include/pub_httpdown.php
PHP
asf20
10,353
<div class="wrap"> <div class="logo"><a href="http://www.jiaju001.com" title="北京家居网">北京家居网</a></div> <div class="addfav"> <ul><li style="float:left;padding-left:0px;">城市分站:<a href="http://www.jiaju001.com">北京站</a>|<a href="http://shy.jiaju001.com" target='_blank'>沈阳站</a></li><li id="cart"><a href="http://www.jiaju001.com/member/cart.html">购物车</a></li><li id="my"><a href="http://www.jiaju001.com/member/">我的账户</a></li><!--<li id="card"><a href="http://www.jiaju001.com/page/card/">索取会员卡</a></li>--><li><span style="CURSOR: hand" onClick="var strHref=window.location.href;this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.jiaju001.com');" class="set_home">设为首页</span>&nbsp;<a href="javascript:viod(0)" title="北京家居网" onClick="window.external.addFavorite('http://www.jiaju001.com','北京家居网')">收藏</a></li> </ul></div> <div style="width:300px;" id="tbar"> <ul><li style="float:right;">您好,欢迎来北京家居网!&nbsp;&nbsp;[ <a href="http://www.jiaju001.com/member/login.html">登陆</a> ] &nbsp; [ <a href='http://www.jiaju001.com/member/reg.html'>免费注册</a> ]</li> </ul></div> </div> <div class="wrap"><div class="nav"> <div class="tl"></div><div class="tr"> <ul><li><a href="http://www.jiaju001.com/page/buy.html" title="购物流程">购物流程</a></li><li><a href="http://www.jiaju001.com/page/bao.html" title="购物保障">购物保障</a></li></ul></div><div class="tm"><div class="menu"><ul><li><a href="http://www.jiaju001.com/">商城首页</a></li><li class="cur"><a href="http://news.jiaju001.com">家居资讯</a></li> <li><a href="http://www.jiaju001.com/huodong/">活动专区</a></li> <li><a href="http://www.jiaju001.com/cuxiao/" target="_parent">促销专区</a></li><!--<li><a href="http://www.jiaju001.com/card/" target="_parent">家居龙卡</a><img style="position:absolute;top:51px;margin-left:20px;"src="http://www.jiaju001.com/images/v2/icon_new.gif" width="20" height="23" border="0" alt="全新上线"/></li>--> <li><a href="http://www.jiaju001.com/jifen/">积分换礼</a></li><li class="last"><a href="http://bbs.jiaju001.com">家居论坛</a></li></ul><div class="hack"></div></div> <div class="search-bar"><input name="search-key" value="商品名称,品牌,厂商" class="so-from" /> <input src="http://www.jiaju001.com/images/v2/inco_so.png" type="image" align="absmiddle" /><a href="http://www.jiaju001.com/list/diban.html">地板</a> <a href="http://www.jiaju001.com/list/cizhuan.html">瓷砖</a> <a href="http://www.jiaju001.com/list/bizhi.html">壁纸</a> <a href="http://www.jiaju001.com/list/weiyu.html">卫浴</a> <a href="http://www.jiaju001.com/list/men.html">门窗</a> <a href="http://www.jiaju001.com/list/chugui.html">橱柜</a> <a href="http://www.jiaju001.com/list/youqi.html">油漆涂料</a> <a href="http://www.jiaju001.com/list/jiaju.html">家具</a></div></div></div></div><div class="wrap">
zyyhong
trunk/jiaju001/news/include/header.html
HTML
asf20
3,149
<?php if(!defined('DEDEINC')) { exit("Request Error!"); } require_once(dirname(__FILE__)."/pub_dedetag.php"); ////////////////////////////////// //这个类用于管理投票 /////////////////////////////////// class DedeVote { var $VoteInfos; var $VoteNotes; var $VoteCount; var $VoteID; var $dsql; //------------------------------- //php5构造函数 //------------------------------- function __construct($aid) { $this->dsql = new DedeSql(false); $this->VoteInfos = $this->dsql->GetOne("Select * From #@__vote where aid='$aid'"); $this->VoteNotes = Array(); $this->VoteCount = 0; $this->VoteID = $aid; if(!is_array($this->VoteInfos)) return; $dtp = new DedeTagParse(); $dtp->SetNameSpace("v","<",">"); $dtp->LoadSource($this->VoteInfos['votenote']); if(is_array($dtp->CTags)){ foreach($dtp->CTags as $ctag){ $this->VoteNotes[$ctag->GetAtt('id')]['count'] = $ctag->GetAtt('count'); $this->VoteNotes[$ctag->GetAtt('id')]['name'] = trim($ctag->GetInnerText()); $this->VoteCount++; } } $dtp->Clear(); } function DedeVote($aid) { $this->__construct($aid); } function Close() { $this->dsql->Close(); } //--------------------------- //获得投票项目总投票次数 //--------------------------- function GetTotalCount() { if(!empty($this->VoteInfos["totalcount"])) return $this->VoteInfos["totalcount"]; else return 0; } //--------------------------- //增加指定的投票节点的票数 //--------------------------- function AddVoteCount($aid) { if(isset($this->VoteNotes[$aid])){ $this->VoteNotes[$aid]['count']++; } } //---------------------------- //获得项目的投票表单 //---------------------------- function GetVoteForm($lineheight=24,$tablewidth="100%",$titlebgcolor="#EDEDE2",$titlebackgroup="",$tablebg="#FFFFFF",$itembgcolor="#FFFFFF") { //省略参数 if($lineheight=="") $lineheight=24; if($tablewidth=="") $tablewidth="100%"; if($titlebgcolor=="") $titlebgcolor="#EDEDE2"; if($titlebackgroup!="") $titlebackgroup="background='$titlebackgroup'"; if($tablebg=="") $tablebg="#FFFFFF"; if($itembgcolor=="") $itembgcolor="#FFFFFF"; $items = "<table width='$tablewidth' border='0' cellspacing='1' cellpadding='1' bgcolor='$tablebg'>\r\n"; $items .= "<form name='voteform' method='post' action='".$GLOBALS['cfg_plus_dir']."/vote.php' target='_blank'>\r\n"; $items .= "<input type='hidden' name='dopost' value='send'>\r\n"; $items .= "<input type='hidden' name='aid' value='".$this->VoteID."'>\r\n"; $items .= "<input type='hidden' name='ismore' value='".$this->VoteInfos['ismore']."'>\r\n"; $items.="<tr align='center'><td height='$lineheight' bgcolor='$titlebgcolor' $titlebackgroup>".$this->VoteInfos['votename']."</td></tr>\r\n"; if($this->VoteCount > 0) { foreach($this->VoteNotes as $k=>$arr){ if($this->VoteInfos['ismore']==0) $items.="<tr><td height=$lineheight bgcolor=$itembgcolor><input type='radio' name='voteitem' value='$k'>".$arr['name']."</td></tr>\r\n"; else $items.="<tr><td height=$lineheight bgcolor=$itembgcolor><input type=checkbox name='voteitem[]' value='$k'>".$arr['name']."</td></tr>\r\n"; } $items .= "<tr><td height='$lineheight' bgcolor='#FFFFFF'>\r\n"; $items .= "<input type='submit' style='width:40;background-color:$titlebgcolor;border:1px soild #818279' name='vbt1' value='投票'>\r\n"; $items .= "<input type='button' style='width:80;background-color:$titlebgcolor;border:1px soild #818279' name='vbt2' "; $items .= "value='查看结果' onClick=\"window.open('".$GLOBALS['cfg_plus_dir']."/vote.php?dopost=view&aid=".$this->VoteID."');\"></td></tr>\r\n"; } $items.="</form>\r\n</table>\r\n"; return $items; } //------------------------------------ //保存投票数据 //请不要在输出任何内容之前使用SaveVote()方法! //------------------------------------- function SaveVote($voteitem) { if(empty($voteitem)) return "你没选中任何项目!"; $items=""; //检查投票是否已过期 $nowtime = time(); if($nowtime > $this->VoteInfos['endtime']) return "投票已经过期!"; if($nowtime < $this->VoteInfos['starttime']) return "投票还没有开始!"; //检查用户是否已投过票,cookie大约保存约十天 if(isset($_COOKIE["DEDE_VOTENAME_AAA"])){ if($_COOKIE["DEDE_VOTENAME_AAA"]==$this->VoteInfos['aid']) return "你已经投过票!"; else setcookie("DEDE_VOTENAME_AAA",$this->VoteInfos['aid'],time()+360000,"/"); } else{ setcookie("DEDE_VOTENAME_AAA",$this->VoteInfos['aid'],time()+360000,"/"); } //必须存在投票项目 if($this->VoteCount > 0) { foreach($this->VoteNotes as $k=>$v) { if($this->VoteInfos['ismore']==0){ //单选项 if($voteitem == $k){ $this->VoteNotes[$k]['count']++; break; } } else{ //多选项 if(is_array($voteitem) && in_array($k,$voteitem)){ $this->VoteNotes[$k]['count']++; } } } foreach($this->VoteNotes as $k=>$arr){ $items .= "<v:note id='$k' count='".$arr['count']."'>".$arr['name']."</v:note>\r\n"; } } $this->dsql->SetQuery("Update #@__vote set totalcount='".($this->VoteInfos['totalcount']+1)."',votenote='".addslashes($items)."' where aid='".$this->VoteID."'"); $this->dsql->ExecuteNoneQuery(); return "投票成功!"; } // //获得项目的投票结果 // function GetVoteResult() { $totalcount = $this->VoteInfos['totalcount']; if($totalcount==0) $totalcount=1; $i=1; $res = ""; foreach($this->VoteNotes as $k=>$arr){ $c = $arr['count']; $vtwidth =round(($c/$totalcount)*100)."%"; if($c/$totalcount>0.2){ $res .="<dl><dt>".$i."、".$arr['name']."</dt><dd><span style=\"width:".$vtwidth.";\"><strong>".round(($c/$totalcount)*100)."%</strong>($c)</span></dd></dl>\n\r"; }else{ $res .="<dl><dt>".$i."、".$arr['name']."</dt><dd><span style=\"width:".$vtwidth.";\"></span><strong>".round(($c/$totalcount)*100)."%</strong>($c)</dd></dl>\n\r"; } $i++; } return $res; } } ?>
zyyhong
trunk/jiaju001/news/include/inc_vote.php
PHP
asf20
6,167
<?php //Session保存路径 $sessSavePath = dirname(__FILE__)."/../data/sessions/"; if(is_writeable($sessSavePath) && is_readable($sessSavePath)){ session_save_path($sessSavePath); } //获取随机字符 $rndstring = ""; for($i=0;$i<4;$i++){ $rndstring .= chr(mt_rand(65,90)); } //如果支持GD,则绘图 if(function_exists("imagecreate")) { //PutCookie("dd_ckstr",strtolower($rndstring),1800,"/"); session_register('dd_ckstr'); $_SESSION['dd_ckstr'] = strtolower($rndstring); $rndcodelen = strlen($rndstring); //字体设置 $ffsize = 16; //字体大小 $ffpos = 8; //字间距 //图片大小 $iiwidth = 90; $iiheight = 35; $im = imagecreate($iiwidth,$iiheight); //字体 $font_type = dirname(__FILE__)."/data/ant".mt_rand(1,2).".ttf"; //背景颜色 $bgcolor = ImageColorAllocate($im, 225,245,255); //边框色 $iborder = ImageColorAllocate($im, 56,172,228); //字体色 $fontColor = ImageColorAllocate($im, 6,110,240); $fontColor1 = ImageColorAllocate($im, 166,213,248); $fontColor2 = ImageColorAllocate($im, 8,160,246); //杂点背景线 $lineColor1 = ImageColorAllocate($im, 130,220,245); $lineColor2 = ImageColorAllocate($im, 225,245,255); //背景线 for($j=3;$j<$iiheight-2;$j=$j+3) imageline($im,2,$j,$iiwidth-1,$j,$lineColor1); for($j=2;$j<$iiwidth;$j=$j+(mt_rand(3,6))) imageline($im,$j,2,$j-6,$iiheight-2,$lineColor2); //边框 imagerectangle($im, 0, 0, $iiwidth-1, $iiheight-1, $iborder); $strposs = array(); //文字 $m = 0; for($i=0;$i<$rndcodelen;$i++){ if(function_exists("imagettftext")){ $strposs[$i][0] = $i*10+10; $strposs[$i][1] = mt_rand($ffsize+5,$ffsize+10); imagettftext($im, $ffsize, 0, $strposs[$i][0]+1+$m, $strposs[$i][1]+1, $fontColor1, $font_type, $rndstring[$i]); $m = $m+$ffpos; } else{ imagestring($im, 5, $i*10+6, mt_rand(2,4), $rndstring[$i], $fontColor); } } //文字 $m = 0; for($i=0;$i<$rndcodelen;$i++){ if(function_exists("imagettftext")){ imagettftext($im, $ffsize,0, $strposs[$i][0]-1+$m, $strposs[$i][1]-1, $fontColor2, $font_type, $rndstring[$i]); $m = $m+$ffpos; } } header("Pragma:no-cache\r\n"); header("Cache-Control:no-cache\r\n"); header("Expires:0\r\n"); //输出特定类型的图片格式,优先级为 gif -> jpg ->png if(function_exists("imagejpeg")){ header("content-type:image/jpeg\r\n"); imagejpeg($im); }else{ header("content-type:image/png\r\n"); imagepng($im); } ImageDestroy($im); }else{ //不支持GD,只输出字母 ABCD //PutCookie("dd_ckstr","abcd",1800,"/"); session_register('dd_ckstr'); $_SESSION['dd_ckstr'] = "abcd"; header("content-type:image/jpeg\r\n"); header("Pragma:no-cache\r\n"); header("Cache-Control:no-cache\r\n"); header("Expires:0\r\n"); $fp = fopen("./vdcode.jpg","r"); echo fread($fp,filesize("./vdcode.jpg")); fclose($fp); } ?>
zyyhong
trunk/jiaju001/news/include/vdimgckBig.php
PHP
asf20
3,014
<?php $cfg_list_son = 'Y'; $cfg_websafe_open = 'N'; $cfg_mb_open = 'N'; $cfg_ftp_mkdir = 'N'; $cfg_dede_log = 'N'; $cfg_webname = '装修家居资讯、室内设计点评'; $cfg_dede_cache = 'Y'; $cfg_ftp_root = '/'; $cfg_basehost = 'http://news.homebjjj.com'; $cfg_al_cachetime = '1'; $cfg_member_regsta = 'N'; $cfg_cmspath = ''; $cfg_arc_all = 'Y'; $cfg_ftp_host = ''; $cfg_pwdtype = 'md5'; $cfg_ftp_port = '21'; $cfg_indexname = '主页'; $cfg_md5len = '32'; $cfg_indexurl = '/'; $cfg_arcsptitle = 'N'; $cfg_cookie_encode = 'TwFJr1383J'; $cfg_fck_xhtml = 'N'; $cfg_keywords = '装修资讯,施工技巧,装修方案,装修经验,装修指南,装修材料,装修效果图,室内装修 '; $cfg_ddsign = ''; $cfg_ftp_user = ''; $cfg_arcautosp = 'N'; $cfg_ftp_pwd = ''; $cfg_df_score = '1000'; $cfg_auot_description = '255'; $cfg_description = '北京家居网专业装修家居资讯 、 装修设计师点评、装修效果图指导'; $cfg_mb_sendall = 'Y'; $cfg_powerby = ''; $cfg_guest_send = 'N'; $cfg_send_score = '2'; $cfg_cat_seltype = '1'; $cfg_arcautosp_size = '5'; $cfg_keyword_like = 'Y'; $cfg_mb_mediatype = 'jpg|gif|png|bmp|swf|mp3|rmvb|wma|zip|rar|'; $cfg_ct_mode = '1'; $cfg_mb_max = '10'; $cfg_adminemail = 'admin@yourmail.com'; $cfg_beian = ''; $cfg_up_prenext = 'Y'; $cfg_html_editor = 'fck'; $cfg_mb_upload_size = '1024'; $cfg_specnote = '6'; $cfg_backup_dir = 'backup_data'; $cfg_makeindex = 'Y'; $cfg_updateperi = '15'; $cfg_mb_upload = 'N'; $cfg_mb_rmdown = 'N'; $cfg_medias_dir = '/uploads'; $cfg_baidunews_limit = '100'; $cfg_df_style = 'default'; $cfg_allsearch_limit = '1'; $cfg_search_maxlimit = '500'; $cfg_list_symbol = '-- > '; $cfg_mb_album = 'N'; $cfg_ddimg_width = '280'; $cfg_arcdir = ''; $cfg_ddimg_height = '220'; $cfg_search_cachetime = '1'; $cfg_book_ifcheck = 'N'; $cfg_album_width = '800'; $cfg_locked_day = '7'; $cfg_online_type = 'nps'; $cfg_mb_score2money = 'N'; $cfg_imgtype = 'jpg|gif|png'; $cfg_softtype = 'exe|zip|gz|rar|iso|doc|xsl|ppt|wps'; $cfg_score2money = '3'; $cfg_money2score = '3'; $cfg_mediatype = 'swf|mpg|dat|avi|mp3|rm|rmvb|wmv|asf|vob|wma|wav|mid|mov'; $cfg_mb_exiturl = '/'; $cfg_notallowstr = '#没设定#'; $cfg_replacestr = '她妈|它妈|他妈|你妈|fuck|去死|贱人|老母'; $cfg_feedbackcheck = 'N'; $cfg_keyword_replace = 'Y'; $cfg_multi_site = 'N'; $cfg_feedback_ck = 'N'; $cfg_cli_time = '+8'; $cfg_jpeg_query = '100'; $cfg_use_vdcode = 'N'; $cfg_sitehash = ''; $cfg_siteid = ''; $cfg_siteownerid = ''; $cfg_gif_wartermark = 'N'; $cfg_sendmail_bysmtp = 'Y'; $cfg_smtp_server = 'smtp.xinhuanet.com'; $cfg_smtp_port = '25'; $cfg_smtp_usermail = ''; $cfg_smtp_user = ''; $cfg_smtp_password = ''; $cfg_feedback_make = 'Y'; $cfg_ask = 'Y'; $cfg_ask_ifcheck = 'N'; $cfg_ask_dateformat = 'Y-n-j'; $cfg_ask_timeformat = 'H:i'; $cfg_ask_timeoffset = '8'; $cfg_ask_gzipcompress = '1'; $cfg_ask_authkey = 'AeN896fG'; $cfg_ask_cookiepre = 'deask_'; $cfg_answer_ifcheck = 'N'; $cfg_ask_expiredtime = '20'; $cfg_ask_tpp = '14'; $cfg_ask_sitename = '织梦问答'; $cfg_ask_symbols = '->'; $cfg_ask_answerscore = '2'; $cfg_ask_bestanswer = '20'; $cfg_ask_subtypenum = '10'; $cfg_group_creators = '1000'; $cfg_group_max = '0'; $cfg_group_maxuser = '0'; $cfg_group_click = '1'; $cfg_group_words = '1000'; $cfg_book_freenum = '6'; $cfg_book_pay = '1'; $cfg_book_money = '1'; $cfg_book_freerank = '100'; $cfg_safeurl = 'dedecms.commysite.com'; ?>
zyyhong
trunk/jiaju001/news/include/config_hand_bak.php
PHP
asf20
3,522
<?php /* // PHP ZIP压缩类,不需任何组件支持,本文件来自开国外开源代码 // Created by bouchon http://dev.maxg.info // It prato 2007-12-21 修改 // 主要用法 1、获得压缩包里的文件列表 $z = new zip(); $files = $z->get_List($zipfile); for($i=0;$i<count($files);$i++) print_r($files[$i])."<hr />"; 2、解压缩整个ZIP文件 $z->ExtractAll ( $zipfile, $todir); 3、解压压缩包里的某个或部份文件 $z->Extract( $zipfile, $todir, $indexArr); indexArr 为压缩文件的索引数组或单个索引值,即是 $files[index] 这个函数原来有点问题,只适合解压压缩包里根目录的文件,不能解压目录或目录里的文件 */ class zip { var $datasec, $ctrl_dir = array(); var $eof_ctrl_dir = "\x50\x4b\x05\x06\x00\x00\x00\x00"; var $old_offset = 0; var $dirs = Array("."); function get_List($zip_name) { $ret = ''; $zip = @fopen($zip_name, 'rb'); if(!$zip) return(0); $centd = $this->ReadCentralDir($zip,$zip_name); @rewind($zip); @fseek($zip, $centd['offset']); for ($i=0; $i<$centd['entries']; $i++) { $header = $this->ReadCentralFileHeaders($zip); $header['index'] = $i;$info['filename'] = $header['filename']; $info['stored_filename'] = $header['stored_filename']; $info['size'] = $header['size'];$info['compressed_size']=$header['compressed_size']; $info['crc'] = strtoupper(dechex( $header['crc'] )); $info['mtime'] = $header['mtime']; $info['comment'] = $header['comment']; $info['folder'] = ($header['external']==0x41FF0010||$header['external']==16)?1:0; $info['index'] = $header['index'];$info['status'] = $header['status']; $ret[]=$info; unset($header); } return $ret; } function Add($files,$compact) { if(!is_array($files[0])) $files=Array($files); for($i=0;$files[$i];$i++){ $fn = $files[$i]; if(!in_Array(dirname($fn[0]),$this->dirs)) $this->add_Dir(dirname($fn[0])); if(basename($fn[0])) $ret[basename($fn[0])]=$this->add_File($fn[1],$fn[0],$compact); } return $ret; } function get_file() { $data = implode('', $this -> datasec); $ctrldir = implode('', $this -> ctrl_dir); return $data . $ctrldir . $this -> eof_ctrl_dir . pack('v', sizeof($this -> ctrl_dir)).pack('v', sizeof($this -> ctrl_dir)). pack('V', strlen($ctrldir)) . pack('V', strlen($data)) . "\x00\x00"; } function add_dir($name) { $name = str_replace("\\", "/", $name); $fr = "\x50\x4b\x03\x04\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00"; $fr .= pack("V",0).pack("V",0).pack("V",0).pack("v", strlen($name) ); $fr .= pack("v", 0 ).$name.pack("V", 0).pack("V", 0).pack("V", 0); $this -> datasec[] = $fr; $new_offset = strlen(implode("", $this->datasec)); $cdrec = "\x50\x4b\x01\x02\x00\x00\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00"; $cdrec .= pack("V",0).pack("V",0).pack("V",0).pack("v", strlen($name) ); $cdrec .= pack("v", 0 ).pack("v", 0 ).pack("v", 0 ).pack("v", 0 ); $ext = "\xff\xff\xff\xff"; $cdrec .= pack("V", 16 ).pack("V", $this -> old_offset ).$name; $this -> ctrl_dir[] = $cdrec; $this -> old_offset = $new_offset; $this -> dirs[] = $name; } function add_File($data, $name, $compact = 1) { $name = str_replace('\\', '/', $name); $dtime = dechex($this->DosTime()); $hexdtime = '\x' . $dtime[6] . $dtime[7].'\x'.$dtime[4] . $dtime[5] . '\x' . $dtime[2] . $dtime[3].'\x'.$dtime[0].$dtime[1]; eval('$hexdtime = "' . $hexdtime . '";'); if($compact) $fr = "\x50\x4b\x03\x04\x14\x00\x00\x00\x08\x00".$hexdtime; else $fr = "\x50\x4b\x03\x04\x0a\x00\x00\x00\x00\x00".$hexdtime; $unc_len = strlen($data); $crc = crc32($data); if($compact){ $zdata = gzcompress($data); $c_len = strlen($zdata); $zdata = substr(substr($zdata, 0, strlen($zdata) - 4), 2); }else{ $zdata = $data; } $c_len=strlen($zdata); $fr .= pack('V', $crc).pack('V', $c_len).pack('V', $unc_len); $fr .= pack('v', strlen($name)).pack('v', 0).$name.$zdata; $fr .= pack('V', $crc).pack('V', $c_len).pack('V', $unc_len); $this -> datasec[] = $fr; $new_offset = strlen(implode('', $this->datasec)); if($compact) $cdrec = "\x50\x4b\x01\x02\x00\x00\x14\x00\x00\x00\x08\x00"; else $cdrec = "\x50\x4b\x01\x02\x14\x00\x0a\x00\x00\x00\x00\x00"; $cdrec .= $hexdtime.pack('V', $crc).pack('V', $c_len).pack('V', $unc_len); $cdrec .= pack('v', strlen($name) ).pack('v', 0 ).pack('v', 0 ); $cdrec .= pack('v', 0 ).pack('v', 0 ).pack('V', 32 ); $cdrec .= pack('V', $this -> old_offset ); $this -> old_offset = $new_offset; $cdrec .= $name; $this -> ctrl_dir[] = $cdrec; return true; } function DosTime() { $timearray = getdate(); if ($timearray['year'] < 1980) { $timearray['year'] = 1980; $timearray['mon'] = 1; $timearray['mday'] = 1; $timearray['hours'] = 0; $timearray['minutes'] = 0; $timearray['seconds'] = 0; } return (($timearray['year'] - 1980) << 25) | ($timearray['mon'] << 21) | ($timearray['mday'] << 16) | ($timearray['hours'] << 11) | ($timearray['minutes'] << 5) | ($timearray['seconds'] >> 1); } //解压整个压缩包 //直接用 Extract 会有路径问题,本函数先从列表中获得文件信息并创建好所有目录然后才运行 Extract function ExtractAll ( $zn, $to) { if(substr($to,-1)!="/") $to .= "/"; $files = $this->get_List($zn); $cn = count($files); if(is_array($files)) { for($i=0;$i<$cn;$i++) { if($files[$i]['folder']==1){ @mkdir($to.$files[$i]['filename'],$GLOBALS['cfg_dir_purview']); @chmod($to.$files[$i]['filename'],$GLOBALS['cfg_dir_purview']); } } } $this->Extract ($zn,$to); } function Extract ( $zn, $to, $index = Array(-1) ) { $ok = 0; $zip = @fopen($zn,'rb'); if(!$zip) return(-1); $cdir = $this->ReadCentralDir($zip,$zn); $pos_entry = $cdir['offset']; if(!is_array($index)){ $index = array($index); } for($i=0; isset($index[$i]);$i++){ if(intval($index[$i])!=$index[$i]||$index[$i]>$cdir['entries']) return(-1); } for ($i=0; $i<$cdir['entries']; $i++) { @fseek($zip, $pos_entry); $header = $this->ReadCentralFileHeaders($zip); $header['index'] = $i; $pos_entry = ftell($zip); @rewind($zip); fseek($zip, $header['offset']); if(in_array("-1",$index)||in_array($i,$index)) $stat[$header['filename']]=$this->ExtractFile($header, $to, $zip); } fclose($zip); return $stat; } function ReadFileHeader($zip) { $binary_data = fread($zip, 30); $data = unpack('vchk/vid/vversion/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len', $binary_data); $header['filename'] = fread($zip, $data['filename_len']); if ($data['extra_len'] != 0) { $header['extra'] = fread($zip, $data['extra_len']); } else { $header['extra'] = ''; } $header['compression'] = $data['compression'];$header['size'] = $data['size']; $header['compressed_size'] = $data['compressed_size']; $header['crc'] = $data['crc']; $header['flag'] = $data['flag']; $header['mdate'] = $data['mdate'];$header['mtime'] = $data['mtime']; if ($header['mdate'] && $header['mtime']){ $hour=($header['mtime']&0xF800)>>11;$minute=($header['mtime']&0x07E0)>>5; $seconde=($header['mtime']&0x001F)*2;$year=(($header['mdate']&0xFE00)>>9)+1980; $month=($header['mdate']&0x01E0)>>5;$day=$header['mdate']&0x001F; $header['mtime'] = mktime($hour, $minute, $seconde, $month, $day, $year); }else{$header['mtime'] = time();} $header['stored_filename'] = $header['filename']; $header['status'] = "ok"; return $header; } function ReadCentralFileHeaders($zip){ $binary_data = fread($zip, 46); $header = unpack('vchkid/vid/vversion/vversion_extracted/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len/vcomment_len/vdisk/vinternal/Vexternal/Voffset', $binary_data); if ($header['filename_len'] != 0) $header['filename'] = fread($zip,$header['filename_len']); else $header['filename'] = ''; if ($header['extra_len'] != 0) $header['extra'] = fread($zip, $header['extra_len']); else $header['extra'] = ''; if ($header['comment_len'] != 0) $header['comment'] = fread($zip, $header['comment_len']); else $header['comment'] = ''; if ($header['mdate'] && $header['mtime']) { $hour = ($header['mtime'] & 0xF800) >> 11; $minute = ($header['mtime'] & 0x07E0) >> 5; $seconde = ($header['mtime'] & 0x001F)*2; $year = (($header['mdate'] & 0xFE00) >> 9) + 1980; $month = ($header['mdate'] & 0x01E0) >> 5; $day = $header['mdate'] & 0x001F; $header['mtime'] = mktime($hour, $minute, $seconde, $month, $day, $year); } else { $header['mtime'] = time(); } $header['stored_filename'] = $header['filename']; $header['status'] = 'ok'; if (substr($header['filename'], -1) == '/') $header['external'] = 0x41FF0010; return $header; } function ReadCentralDir($zip,$zip_name) { $size = filesize($zip_name); if ($size < 277) $maximum_size = $size; else $maximum_size=277; @fseek($zip, $size-$maximum_size); $pos = ftell($zip); $bytes = 0x00000000; while ($pos < $size) { $byte = @fread($zip, 1); $bytes=($bytes << 8) | Ord($byte); if ($bytes == 0x504b0506){ $pos++; break; } $pos++; } $data = @unpack('vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size',fread($zip, 18)); if ($data['comment_size'] != 0) $centd['comment'] = fread($zip, $data['comment_size']); else $centd['comment'] = ''; $centd['entries'] = $data['entries']; $centd['disk_entries'] = $data['disk_entries']; $centd['offset'] = $data['offset'];$centd['disk_start'] = $data['disk_start']; $centd['size'] = $data['size']; $centd['disk'] = $data['disk']; return $centd; } function ExtractFile($header,$to,$zip) { $header = $this->readfileheader($zip); $header['external'] = (!isset($header['external']) ? 0 : $header['external']); if(substr($to,-1)!="/") $to.="/"; if(!@is_dir($to)) @mkdir($to,$GLOBALS['cfg_dir_purview']); if (!($header['external']==0x41FF0010)&&!($header['external']==16)) { if ($header['compression']==0) { $fp = @fopen($to.$header['filename'], 'wb'); if(!$fp) return(-1); $size = $header['compressed_size']; while ($size != 0) { $read_size = ($size < 2048 ? $size : 2048); $buffer = fread($zip, $read_size); $binary_data = pack('a'.$read_size, $buffer); @fwrite($fp, $binary_data, $read_size); $size -= $read_size; } fclose($fp); touch($to.$header['filename'], $header['mtime']); }else{ $fp = @fopen($to.$header['filename'].'.gz','wb'); if(!$fp) return(-1); $binary_data = pack('va1a1Va1a1', 0x8b1f, Chr($header['compression']), Chr(0x00), time(), Chr(0x00), Chr(3)); fwrite($fp, $binary_data, 10); $size = $header['compressed_size']; while ($size != 0) { $read_size = ($size < 1024 ? $size : 1024); $buffer = fread($zip, $read_size); $binary_data = pack('a'.$read_size, $buffer); @fwrite($fp, $binary_data, $read_size); $size -= $read_size; } $binary_data = pack('VV', $header['crc'], $header['size']); fwrite($fp, $binary_data,8); fclose($fp); $gzp = @gzopen($to.$header['filename'].'.gz','rb') or die("Cette archive est compress"); if(!$gzp) return(-2); $fp = @fopen($to.$header['filename'],'wb'); if(!$fp) return(-1); $size = $header['size']; while ($size != 0) { $read_size = ($size < 2048 ? $size : 2048); $buffer = gzread($gzp, $read_size); $binary_data = pack('a'.$read_size, $buffer); @fwrite($fp, $binary_data, $read_size); $size -= $read_size; } fclose($fp); gzclose($gzp); touch($to.$header['filename'], $header['mtime']); @unlink($to.$header['filename'].'.gz'); }} return true; } } ?>
zyyhong
trunk/jiaju001/news/include/zip.lib.php
PHP
asf20
12,407
<?php function GetBookText($cid) { global $cfg_cmspath,$cfg_basedir; $ipath = $cfg_cmspath."/data/textdata"; $tpath = ceil($cid/5000); $bookfile = $cfg_basedir."$ipath/$tpath/bk{$cid}.php"; if(!file_exists($bookfile)) return ''; else{ $alldata = ''; $fp = fopen($bookfile,'r'); $line = fgets($fp,64); $alldata = ''; while(!feof($fp)){ $alldata .= fread($fp,1024); } fclose($fp); return trim(substr($alldata,0,strlen($alldata)-2)); } } function WriteBookText($cid,$body) { global $cfg_cmspath,$cfg_basedir; $ipath = $cfg_cmspath."/data/textdata"; $tpath = ceil($cid/5000); if(!is_dir($cfg_basedir.$ipath)) MkdirAll($cfg_basedir.$ipath,$GLOBALS['cfg_dir_purview']); if(!is_dir($cfg_basedir.$ipath.'/'.$tpath)) MkdirAll($cfg_basedir.$ipath.'/'.$tpath,$GLOBALS['cfg_dir_purview']); $bookfile = $cfg_basedir.$ipath."/{$tpath}/bk{$cid}.php"; $body = "<"."?php exit();\r\n".$body."\r\n?".">"; @$fp = fopen($bookfile,'w'); @flock($fp); @fwrite($fp,$body); @fclose($fp); } ?>
zyyhong
trunk/jiaju001/news/include/inc_bookfunctions.php
PHP
asf20
1,046
<div class="fr col_l"> <div class="tit2"><div class="tl"><div>相关品牌</div></div><div class="tr"></div></div> <div class="tbox"> <a href="http://www.homebjjj.com/store/kenuosenghua.html" title="克诺森华"><img class="b4" src="http://www.homebjjj.com/images/store/b80ae1163d81ce1a9984c4af16a6f4b1.jpg" /></a> <a href="http://www.homebjjj.com/store/odian.html" title="欧典"><img class="b4" src="http://www.homebjjj.com/images/store/1c8aa9d105f567a744f6b1cce57cb013.jpg" /></a> <a href="http://www.homebjjj.com/store/shenghuojia.html" title="生活家"><img class="b4" src="http://www.homebjjj.com/images/store/3d0caddee141df79fca83b47ed452d5d.jpg" /></a> <a href="http://www.homebjjj.com/store/beiyake.html" title="贝亚克"><img class="b4" src="http://www.homebjjj.com/images/store/eebdb9e814568ff524ccf93b6a86a51c.jpg" /></a> <a href="http://www.homebjjj.com/store/shuxiangmendi.html" title="书香门地"><img class="b4" src="http://www.homebjjj.com/images/store/e5e2a11f4d321667592568206b518f3d.jpg" /></a> </div> <div class="tb"><div class="tbl"></div><div class="tbr"></div><div class="hack"></div></div> <div class="tit2"><div class="tl"><div>相关产品</div></div><div class="tr"></div></div> <div class="tbox"><a href="http://www.homebjjj.com/goods/382.html"><div class="r"><div class="fl">克诺森华美家系列</div><span class="ex">80</span>元/平米</div></a><a href="http://www.homebjjj.com/goods/393.html"><div class="r"><div class="fl">克诺森华金刚V型槽</div><span class="ex">118</span>元/平米</div></a><a href="http://www.homebjjj.com/goods/417.html"><div class="r"><div class="fl">克诺森华出口尾货</div><span class="ex">78</span>元/平米</div></a><a href="http://www.homebjjj.com/goods/420.html"><div class="r"><div class="fl">克诺森华出口尾货</div><span class="ex">78</span>元/平米</div></a><a href="http://www.homebjjj.com/goods/836.html"><div class="r"><div class="fl">欧典强化复合地板AB11</div><span class="ex">89</span>元/平米</div></a><a href="http://www.homebjjj.com/goods/842.html"><div class="r"><div class="fl">欧典强化复合地板XH66</div><span class="ex">128</span>元/平米</div></a><a href="http://www.homebjjj.com/goods/938.html"><div class="r"><div class="fl">生活家-仿实木系列黄</div><span class="ex">98</span>元/平米</div></a><a href="http://www.homebjjj.com/goods/880.html"><div class="r"><div class="fl">欧典强化复合地板BK88</div><span class="ex">100</span>元/平米</div></a><a href="http://www.homebjjj.com/goods/889.html"><div class="r"><div class="fl">欧典强化复合地板BK88</div><span class="ex">118</span>元/平米</div></a><a href="http://www.homebjjj.com/goods/908.html"><div class="r"><div class="fl">生活家-仿实木系列野</div><span class="ex">98</span>元/平米</div></a></div> <div class="tb"><div class="tbl"></div><div class="tbr"></div><div class="hack"></div></div> </div>
zyyhong
trunk/jiaju001/news/include/right.html
HTML
asf20
2,967
<?php function SpUpdateStat() { global $cfg_cookie_encode; $countCacheFile = dirname(__FILE__).'/../../data/'.md5($cfg_cookie_encode.'cc').'.txt'; if(!file_exists($countCacheFile)) { $fp = fopen($countCacheFile,'w'); fwrite($fp,1); fclose(); } $fp = fopen($countCacheFile,'r'); $cnums = fread($fp,10); fclose($fp); $cnums = @intval($cnums); $cnums++; $fp = fopen($countCacheFile,'w'); fwrite($fp,$cnums); fclose(); return $cnums; } ?>
zyyhong
trunk/jiaju001/news/include/inc/inc_stat.php
PHP
asf20
474
<?php $GLOBALS['__SpGetArcList'] = 1; //获取一个文档列表 //-------------------------------- function SpGetArcList(&$dsql,$templets,$typeid=0,$row=10,$col=1,$titlelen=30,$infolen=160, $imgwidth=120,$imgheight=90,$listtype="all",$orderby="default",$keyword="",$innertext="", $tablewidth="100",$arcid=0,$idlist="",$channelid=0,$limitv="",$att="",$order="desc", $subday=0,$ismember=0,$maintable='#@__archives',$ctag='',$isUpCache=true) { global $PubFields,$cfg_keyword_like,$cfg_arc_all,$cfg_needsontype,$cfg_maxsearch,$cfg_al_cachetime; $row = AttDef($row,10); $titlelen = AttDef($titlelen,30); $infolen = AttDef($infolen,160); $imgwidth = AttDef($imgwidth,120); $imgheight = AttDef($imgheight,120); $listtype = AttDef($listtype,"all"); $arcid = AttDef($arcid,0); //$att = AttDef($att,0); $channelid = AttDef($channelid,0); $ismember = AttDef($ismember,0); $orderby = AttDef($orderby,"default"); $orderWay = AttDef($order,"desc"); $maintable = AttDef($maintable,"#@__archives"); $subday = AttDef($subday,0); $line = $row; $orderby=strtolower($orderby); $tablewidth = str_replace("%","",$tablewidth); if($tablewidth=="") $tablewidth=100; if($col=="") $col = 1; $colWidth = ceil(100/$col); $tablewidth = $tablewidth."%"; $colWidth = $colWidth."%"; $keyword = trim($keyword); $innertext = trim($innertext); if($innertext=="") $innertext = GetSysTemplets("part_arclist.htm"); if(!empty($idlist) && ereg("[^0-9,]",$idlist)) $idlist = ''; $mintime = time() - ($cfg_al_cachetime * 3600); $orwhere = ''; //对于文章列表等地方的调用,限定为最新文档 $idlist = ereg_replace("[^,0-9]","",$idlist); if($idlist!='') $orwhere .= " arc.ID in ($idlist) And "; $t1 = ExecTime(); //按不同情况设定SQL条件 排序方式 $orwhere .= " arc.arcrank > -1 "; $addField = ""; $addJoin = ""; $channelinfos = ''; //获取主表 if(eregi('spec',$listtype)) $channelid = -1; if(!empty($typeid)) $reids = explode(',',$typeid); if(!empty($channelid)) { $channelinfos = $dsql->GetOne("Select ID,maintable,addtable,listadd From `#@__channeltype` where ID='$channelid' "); $maintable = $channelinfos['maintable']; }else if(!empty($typeid)) { $channelinfos = $dsql->GetOne("select c.ID,c.maintable,c.addtable,c.listadd from `#@__arctype` a left join #@__channeltype c on c.ID=a.channeltype where a.ID='".$reids[0]."' "); if(is_array($channelinfos)) { $maintable = $channelinfos['maintable']; $channelid = $channelinfos['ID']; } } if(trim($maintable)=='') $maintable = "#@__archives"; //时间限制(用于调用最近热门文章、热门评论之类) if($subday>0){ $limitvday = time() - ($subday * 24 * 3600); $orwhere .= " And arc.senddate > $limitvday "; } //文档的自定义属性 if($att!="") $orwhere .= " And arc.arcatt='$att' "; //文档的频道模型 if(!empty($channelid) && !eregi("spec",$listtype)) $orwhere .= " And arc.channel = '$channelid' "; //echo $orwhere.$channelid ; //是否为推荐文档 if(eregi("commend",$listtype)) $orwhere .= " And arc.iscommend > 10 "; //是否为带缩略图图片文档 if(eregi("image",$listtype)) $orwhere .= " And arc.litpic <> '' "; //是否为专题文档 if(eregi("spec",$listtype) || $channelid==-1) $orwhere .= " And arc.channel = -1 "; //是否指定相近ID if($arcid!=0) $orwhere .= " And arc.ID<>'$arcid' "; //是否为会员文档 if($ismember==1) $orwhere .= " And arc.memberid>0 "; if($cfg_keyword_like=='N'){ $keyword=""; } //类别ID的条件,如果用 "," 分开,可以指定特定类目 //------------------------------ if(!empty($typeid)) { $ridnum = count($reids); if($ridnum>1) { $sonids = ''; for($i=0;$i<$ridnum;$i++){ $sonids .= ($sonids=='' ? TypeGetSunID($reids[$i],$dsql,'arc',0,true) : ','.TypeGetSunID($reids[$i],$dsql,'arc',0,true)); } $orwhere .= " And arc.typeid in ($sonids) "; }else{ $sonids = TypeGetSunID($typeid,$dsql,'arc',0,true); $orwhere .= " And arc.typeid in ($sonids) "; } unset($reids); } //关键字条件 if($keyword!='') { $keywords = explode(",",$keyword); $ridnum = count($keywords); $rstr = trim($keywords[0]); if($ridnum>4) $ridnum = 4; for($i=0;$i<$ridnum;$i++){ $keywords[$i] = trim($keywords[$i]); if($keywords[$i]!="") $rstr .= "|".$keywords[$i]; } if($rstr!="") $orwhere .= " And CONCAT(arc.title,arc.keywords) REGEXP '$rstr' "; unset($keywords); } //获得附加表的相关信息 //----------------------------- if(is_array($channelinfos)) { $channelinfos['listadd'] = trim($channelinfos['listadd']); if($cfg_arc_all=='Y' && is_array($channelinfos) && $channelinfos['listadd']!='') { $addField = ''; $fields = explode(',',$channelinfos['listadd']); foreach($fields as $v) $addField .= ",addt.{$v}"; if($addField!='') $addJoin = " left join `{$channelinfos['addtable']}` addt on addt.aid = arc.ID "; } } //文档排序的方式 $ordersql = ""; if($orderby=='hot'||$orderby=='click') $ordersql = " order by arc.click $orderWay"; else if($orderby=='pubdate') $ordersql = " order by arc.pubdate $orderWay"; else if($orderby=='sortrank') $ordersql = " order by arc.sortrank $orderWay"; else if($orderby=='id') $ordersql = " order by arc.ID $orderWay"; else if($orderby=='near') $ordersql = " order by ABS(arc.ID - ".$arcid.")"; else if($orderby=='lastpost') $ordersql = " order by arc.lastpost $orderWay"; else if($orderby=='postnum') $ordersql = " order by arc.postnum $orderWay"; else if($orderby=='digg') $ordersql = " order by arc.digg $orderWay"; else if($orderby=='diggtime') $ordersql = " order by arc.diggtime $orderWay"; else if($orderby=='rand') $ordersql = " order by rand()"; else $ordersql=" order by arc.ID $orderWay"; if(!empty($limitv)) $limitvsql = " limit $limitv "; else $limitvsql = " limit 0,$line "; ////////////// $query = "Select arc.ID,arc.title,arc.iscommend,arc.color,arc.typeid,arc.channel, arc.ismake,arc.description,arc.pubdate,arc.senddate,arc.arcrank,arc.click,arc.digg,arc.diggtime, arc.money,arc.litpic,arc.writer,arc.shorttitle,arc.memberid,arc.postnum,arc.lastpost, tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule, tp.namerule2,tp.ispart,tp.moresite,tp.siteurl{$addField} from `$maintable` arc left join `#@__arctype` tp on arc.typeid=tp.ID $addJoin where $orwhere $ordersql $limitvsql "; //echo $query; //exit(); $md5hash = md5($query); $ids = ''; $needup = false; if($idlist=='' && $isUpCache && $cfg_al_cachetime>0) { $ids = SpGetArclistDateCache($dsql,$md5hash); if($ids=='-1') $needup = true; else if($ids!='') { $query = "Select arc.ID,arc.title,arc.iscommend,arc.color,arc.typeid,arc.channel, arc.ismake,arc.description,arc.pubdate,arc.senddate,arc.arcrank,arc.click,arc.digg,arc.diggtime, arc.money,arc.litpic,arc.writer,arc.shorttitle,arc.memberid,arc.postnum,arc.lastpost, tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule, tp.namerule2,tp.ispart,tp.moresite,tp.siteurl{$addField} from `$maintable` arc left join `#@__arctype` tp on arc.typeid=tp.ID $addJoin where arc.ID in($ids) $ordersql "; }else { return ''; } } $artlist = ""; $dsql->SetQuery($query); $dsql->Execute("al"); $dtp2 = new DedeTagParse(); $dtp2->SetNameSpace("field","[","]"); $dtp2->LoadString($innertext); $nids = array(); if($col>1) $artlist = "<table width='$tablewidth' border='0' cellspacing='0' cellpadding='0'>\r\n"; $GLOBALS['autoindex'] = 0; for($i=0;$i<$line;$i++) { if($col>1) $artlist .= "<tr>\r\n"; for($j=0;$j<$col;$j++) { if($col>1) $artlist .= " <td width='$colWidth'>\r\n"; if($row = $dsql->GetArray("al",MYSQL_ASSOC)) { //处理一些特殊字段 $row['description'] = cn_substr($row['description'],$infolen); $nids[] = $row['id'] = $row['ID']; $row['arcurl'] = GetFileUrl($row['id'],$row['typeid'],$row['senddate'], $row['title'],$row['ismake'],$row['arcrank'],$row['namerule'], $row['typedir'],$row['money'],true,$row['siteurl']); $row['typeurl'] = GetTypeUrl($row['typeid'],MfTypedir($row['typedir']),$row['isdefault'],$row['defaultname'],$row['ispart'],$row['namerule2'],$row['siteurl']); if($row['litpic']=="") $row['litpic'] = $PubFields['templeturl']."/img/default.gif"; $row['picname'] = $row['litpic']; if($GLOBALS['cfg_multi_site']=='Y'){ if($row['siteurl']=="") $row['siteurl'] = $GLOBALS['cfg_mainsite']; if(!eregi("^http://",$row['picname'])){ $row['litpic'] = $row['siteurl'].$row['litpic']; $row['picname'] = $row['litpic']; } } $row['info'] = $row['description']; $row['filename'] = $row['arcurl']; $row['stime'] = GetDateMK($row['pubdate']); $row['typelink'] = "<a href='".$row['typeurl']."'>".$row['typename']."</a>"; $row['image'] = "<img src='".$row['picname']."' border='0' width='$imgwidth' height='$imgheight' alt='".ereg_replace("['><]","",$row['title'])."'>"; $row['imglink'] = "<a href='".$row['filename']."'>".$row['image']."</a>"; $row['title'] = cn_substr($row['title'],$titlelen); $row['textlink'] = "<a href='".$row['filename']."'>".$row['title']."</a>"; if($row['color']!="") $row['title'] = "<font color='".$row['color']."'>".$row['title']."</font>"; if($row['iscommend']==5||$row['iscommend']==16) $row['title'] = "<b>".$row['title']."</b>"; $row['phpurl'] = $PubFields['phpurl']; $row['templeturl'] = $PubFields['templeturl']; foreach($dtp2->CTags as $k=>$ctag){ @$dtp2->Assign($k,$row[$ctag->GetName()]); } $GLOBALS['autoindex']++; $artlist .= $dtp2->GetResult(); }//if hasRow else{ $artlist .= ''; } if($col>1) $artlist .= " </td>\r\n"; }//Loop Col if($col>1) $i += $col - 1; if($col>1) $artlist .= " </tr>\r\n"; }//Loop Line if($col>1) $artlist .= " </table>\r\n"; $dsql->FreeResult("al"); if($needup) { $ids = join(',',$nids); $inquery = "INSERT INTO `#@__arccache`(`md5hash`,`uptime`,`cachedata`) VALUES ('".$md5hash."', '".time()."', '$ids'); "; $dsql->ExecuteNoneQuery("Delete From `#@__arccache` where md5hash='".$md5hash."' or uptime < $mintime "); $dsql->ExecuteNoneQuery($inquery); } $t2 = ExecTime(); //echo ($t2-$t1).$query; //$debug = trim($artlist).'<li>'.($t2-$t1)." $query</li>"; return trim($artlist); } //缓存查询ID function SpGetArclistDateCache($dsql,$md5hash) { global $cfg_al_cachetime; $mintime = time() - ($cfg_al_cachetime * 3600); $arr = $dsql->GetOne("Select cachedata,uptime From `#@__arccache` where md5hash = '$md5hash' and uptime > $mintime "); if(!is_array($arr)) return '-1'; else return $arr['cachedata']; } ?>
zyyhong
trunk/jiaju001/news/include/inc/inc_fun_SpGetArcList.php
PHP
asf20
11,712
<?php $GLOBALS['__SpGetFullList'] = 1; //------------------------------ //获取整站的文档列表 //本函数对应 arcfulllist 和 likeart 标记 //与 arclist 不同的地方是,本标记更自由(相当于旧版的arclist), //但不生成缓存,不能按各类不同形式排序,不能调用浏览数,性能稍低,灵活性也不如arclist //-------------------------------- function SpGetFullList(&$dsql,$typeid=0,$channelid=0,$row=10,$titlelen=30,$infolen=160, $keyword='',$innertext='',$idlist='',$limitv='',$ismember=0,$orderby='',$imgwidth=120,$imgheight=120) { global $cfg_maxsearch,$cfg_al_cachetime; $row = AttDef($row,10); $line = $row; $titlelen = AttDef($titlelen,30); $infolen = AttDef($infolen,160); $channelid = AttDef($channelid,0); $ismember = AttDef($ismember,0); $limitv = AttDef($limitv,''); $keyword = trim($keyword); $typeid = AttDef($typeid,''); $innertext = trim($innertext); $imgwidth = AttDef($imgwidth,120); $imgheight = AttDef($imgheight,120); $orderby = trim($orderby); if($innertext=="") $innertext = GetSysTemplets("part_arclist.htm"); if(empty($idlist)) $idlist = ''; else $idlist = ereg_replace("[^,0-9]","",$idlist); $orwhere = ''; $mintime = time() - ($cfg_al_cachetime * 3600); //指定的文档ID列表,通常是专题和相关文章,使用了idlist将不启用后面任何条件 $idlist = trim($idlist); if($idlist!='') { $orwhere .= " arcf.aid in ($idlist) And arcf.arcrank > -1 "; } //没使用idlist才启用这些条件 else { //按不同情况设定SQL条件 排序方式 $orwhere .= " arcf.arcrank > -1 "; //文档的频道模型 if(!empty($channelid)) $orwhere .= " And arcf.channelid = '$channelid' "; //是否为会员文档 if($ismember==1) $orwhere .= " And arcf.memberid>0 "; //指定栏目条件,如果用 "," 分开,可以指定特定类目 if(!empty($typeid) && empty($idlist)) { $reids = explode(",",$typeid); $ridnum = count($reids); if($ridnum>1){ $tpsql = ""; for($i=0;$i<$ridnum;$i++) { $sonids = TypeGetSunID($reids[$i],$dsql,'arc',0,true); $tpsql .= ($tpsql=='' ? $sonids : ','.$sonids); } $tpsql = " And arcf.typeid in ($tpsql) "; $orwhere .= $tpsql; unset($tpsql); }else{ $sonids = TypeGetSunID($typeid,$dsql,'arc',0,true); if(ereg(',',$sonids)) $orwhere .= " And arcf.typeid in ($sonids) "; else $orwhere .= " And arcf.typeid=$sonids "; } unset($reids); } //指定了关键字条件 if($keyword!="") { $keywords = explode(",",$keyword); $ridnum = count($keywords); $rstr = trim($keywords[0]); if($ridnum>4) $ridnum = 4; for($i=1;$i < $ridnum;$i++){ $keywords[$i] = trim($keywords[$i]); if($keywords[$i]!="") $rstr .= "|".$keywords[$i]; } if($rstr!="") $orwhere .= " And CONCAT(arcf.title,arcf.keywords) REGEXP '$rstr' "; unset($keywords); } }//没使用idlist才启用这些条件 //文档排序的方式 $ordersql = ""; if($orderby=='rand') $ordersql = " order by rand()"; else if($orderby=='click'||$orderby=='hot') $ordersql = " order by arcf.click desc"; else if($orderby=='digg') $ordersql = " order by arcf.digg desc"; else if($orderby=='diggtime') $ordersql = " order by arcf.diggtime desc"; else $ordersql=" order by arcf.aid desc"; //返回结果条数 if(!empty($limit)) $limitsql = " limit $limitv "; else $limitsql = " limit 0,$line "; //载入底层模板 $dtp2 = new DedeTagParse(); $dtp2->SetNameSpace("field","[","]"); $dtp2->LoadString($innertext); if(!is_array($dtp2->CTags)) return ''; //执行SQL查询 $query = "Select arcf.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl from `#@__full_search` arcf left join `#@__arctype` tp on arcf.typeid=tp.ID where $orwhere $ordersql $limitsql "; $md5hash = md5($query); $artlist = ''; $ids = ''; $needup = false; if($idlist=='' && $cfg_al_cachetime>0) { $ids = SpGetArclistDateCacheF($dsql,$md5hash); if($ids=='-1') $needup = true; else if($ids!='') { $query = "Select arcf.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl from `#@__full_search` arcf left join `#@__arctype` tp on arcf.typeid=tp.ID where arcf.aid in($ids) $ordersql $limitsql "; }else { return ''; } } $nids = array(); $t1 = ExecTime(); $dsql->SetQuery($query); $dsql->Execute("alf"); $GLOBALS['autoindex'] = 0; while($row = $dsql->GetArray("alf")) { //处理一些特殊字段 $row['description'] = cn_substr($row['addinfos'],$infolen); $nids[] = $row['id'] = $row['aid']; if(!isset($row['picname'])) $row['picname'] = ''; if($row['url']=='') $row['url'] = $GLOBALS['cfg_phpurl'].'/view.php?aid='.$row['aid']; $row['filename'] = $row['arcurl'] = $row['url']; $row['typeurl'] = GetTypeUrl($row['typeid'],MfTypedir($row['typedir']),$row['isdefault'],$row['defaultname'],$row['ispart'],$row['namerule2'],$row['siteurl']); if($row['litpic']=="") $row['litpic'] = $GLOBALS['PubFields']['templeturl']."/img/default.gif"; $row['picname'] = $row['litpic']; if($GLOBALS['cfg_multi_site']=='Y') { if($row['siteurl']=="") $row['siteurl'] = $GLOBALS['cfg_mainsite']; if(!eregi("^http://",$row['picname'])){ $row['litpic'] = $row['siteurl'].$row['litpic']; $row['picname'] = $row['litpic']; } } $row['stime'] = GetDateMK($row['uptime']); $row['typelink'] = "<a href='".$row['typeurl']."'>".$row['typename']."</a>"; $row['image'] = "<img src='".$row['picname']."' border='0' width='$imgwidth' height='$imgheight' alt='".ereg_replace("['><]","",$row['title'])."' />"; $row['imglink'] = "<a href='".$row['arcurl']."'>".$row['image']."</a>"; $row['fulltitle'] = $row['title']; $row['title'] = cn_substr($row['title'],$titlelen); $row['textlink'] = "<a href='".$row['arcurl']."'>".$row['title']."</a>"; foreach($dtp2->CTags as $k=>$ctag) { if(isset($row[$ctag->GetName()])){ $dtp2->Assign($k,$row[$ctag->GetName()]); } else $dtp2->Assign($k,''); } $GLOBALS['autoindex']++; $artlist .= $dtp2->GetResult(); }//Loop Line $dsql->FreeResult("alf"); if($needup) { $ids = join(',',$nids); $inquery = "INSERT INTO `#@__arccache_full`(`md5hash`,`uptime`,`cachedata`) VALUES ('".$md5hash."', '".time()."', '$ids'); "; $dsql->ExecuteNoneQuery("Delete From `#@__arccache_full` where md5hash='".$md5hash."' or uptime < $mintime "); $dsql->ExecuteNoneQuery($inquery); } $t2 = ExecTime(); //echo "<hr>".($t2-$t1)." $query<hr>"; return $artlist; } //只缓存查询的ID function SpGetArclistDateCacheF($dsql,$md5hash) { global $cfg_al_cachetime; $mintime = time() - ($cfg_al_cachetime * 3600); $arr = $dsql->GetOne("Select cachedata,uptime From `#@__arccache_full` where md5hash = '$md5hash' and uptime > $mintime "); if(!is_array($arr)) return '-1'; else return $arr['cachedata']; } ?>
zyyhong
trunk/jiaju001/news/include/inc/inc_fun_SpFullList.php
PHP
asf20
7,710
<?php $GLOBALS['__funAdmin'] = 1; function SpGetPinyin($str,$ishead=0,$isclose=1) { global $pinyins; $restr = ""; $str = trim($str); $slen = strlen($str); if($slen<2) return $str; if(count($pinyins)==0){ $fp = fopen(dirname(__FILE__)."/../data/pinyin.db","r"); while(!feof($fp)){ $line = trim(fgets($fp)); $pinyins[$line[0].$line[1]] = substr($line,3,strlen($line)-3); } fclose($fp); } for($i=0;$i<$slen;$i++){ if(ord($str[$i])>0x80) { $c = $str[$i].$str[$i+1]; $i++; if(isset($pinyins[$c])){ if($ishead==0) $restr .= $pinyins[$c]; else $restr .= $pinyins[$c][0]; }else $restr .= "-"; }else if( eregi("[a-z0-9]",$str[$i]) ){ $restr .= $str[$i]; } else{ $restr .= "-"; } } if($isclose==0) unset($pinyins); return $restr; } function SpCreateDir($spath,$siterefer='',$sitepath='') { if($spath=="") return true; global $cfg_dir_purview,$cfg_basedir,$cfg_ftp_mkdir; $flink = false; if($siterefer==1) $truepath = ereg_replace("/{1,}","/",$cfg_basedir."/".$sitepath); else if($siterefer==2){ $truepath = $sitepath; if($cfg_isSafeMode||$cfg_ftp_mkdir=='Y'){ echo "Not Suppot Safemode !"; exit(); } } else $truepath = $cfg_basedir; $spaths = explode("/",$spath); $spath = ""; foreach($spaths as $spath){ if($spath=="") continue; $spath = trim($spath); $truepath .= "/".$spath; $truepath = str_replace("\\","/",$truepath); $truepath = ereg_replace("/{1,}","/",$truepath); if(!is_dir($truepath) || !is_writeable($truepath)){ if(!is_dir($truepath)) $isok = MkdirAll($truepath,$GLOBALS['cfg_dir_purview']); else $isok = ChmodAll($truepath,$GLOBALS['cfg_dir_purview']); if(!$isok){ echo "Create dir ".$truepath." False!<br>"; CloseFtp(); return false; } } } CloseFtp(); return true; } function SpGetEditor($fname,$fvalue,$nheight="350",$etype="Basic",$gtype="print",$isfullpage="false") { if(!isset($GLOBALS['cfg_html_editor'])) $GLOBALS['cfg_html_editor']='fck'; if($gtype=="") $gtype = "print"; if($GLOBALS['cfg_html_editor']=='fck'){ require_once(dirname(__FILE__)."/../FCKeditor/fckeditor.php"); $fck = new FCKeditor($fname); $fck->BasePath = $GLOBALS['cfg_cmspath'].'/include/FCKeditor/' ; $fck->Width = '100%' ; $fck->Height = $nheight ; $fck->ToolbarSet = $etype ; $fck->Config['FullPage'] = $isfullpage; if($GLOBALS['cfg_fck_xhtml']=='Y'){ $fck->Config['EnableXHTML'] = 'true'; $fck->Config['EnableSourceXHTML'] = 'true'; } $fck->Value = $fvalue ; if($gtype=="print") $fck->Create(); else return $fck->CreateHtml(); }else{ require_once(dirname(__FILE__)."/../htmledit/dede_editor.php"); $ded = new DedeEditor($fname); $ded->BasePath = $GLOBALS['cfg_cmspath'].'/include/htmledit/' ; $ded->Width = '100%' ; $ded->Height = $nheight ; $ded->ToolbarSet = strtolower($etype); $ded->Value = $fvalue ; if($gtype=="print") $ded->Create(); else return $ded->CreateHtml(); } } function SpGetNewInfo() { global $cfg_version,$cfg_cookie_encode; $nurl = $_SERVER["HTTP_HOST"]; if( eregi("[a-z\-]{1,}\.[a-z]{2,}",$nurl) ){ $nurl = urlencode($nurl); } else{ $nurl = 'test'; } $countCacheFile = dirname(__FILE__).'/../../data/'.md5($cfg_cookie_encode.'cc').'.txt'; $cnums = 0; if(file_exists($countCacheFile)) { $fp = fopen($countCacheFile,'r'); $cnums = fread($fp,10); fclose($fp); $fp = fopen($countCacheFile,'w'); fwrite($fp,0); fclose($fp); } $gs = "<iframe name='stafrm' src='http://www.dedecms.com/newinfo.php?version=".urlencode($cfg_version)."&formurl=$nurl&cnums=$cnums' frameborder='0' id='stafrm' width='100%' height='50'></iframe>\r\n"; return $gs; } ?>
zyyhong
trunk/jiaju001/news/include/inc/inc_fun_funAdmin.php
PHP
asf20
3,768
<?php $GLOBALS['__funString'] = 1; function SpHtml2Text($str){ $str = preg_replace("/<sty(.*)\\/style>|<scr(.*)\\/script>|<!--(.*)-->/isU","",$str); $alltext = ''; $start = 1; for($i=0;$i<strlen($str);$i++){ if($start==0 && $str[$i]==">") $start = 1; else if($start==1){ if($str[$i]=="<"){ $start = 0; $alltext .= " "; } else if(ord($str[$i])>31) $alltext .= $str[$i]; } } $alltext = str_replace(" "," ",$alltext); $alltext = preg_replace("/&([^;&]*)(;|&)/","",$alltext); $alltext = preg_replace("/[ ]+/s"," ",$alltext); return $alltext; } function Spcnw_mid($str,$start,$slen){ $str_len = strlen($str); $strs = Array(); for($i=0;$i<$str_len;$i++){ if(ord($str[$i])>0x80){ if($str_len>$i+1) $strs[] = $str[$i].$str[$i+1]; else $strs[] = ''; $i++; } else{ $strs[] = $str[$i]; } } $wlen = count($strs); if($wlen < $start) return ""; $restr = ""; $startdd = $start; $enddd = $startdd + $slen; for($i=$startdd;$i<$enddd;$i++){ if(!isset($strs[$i])) break; $restr .= $strs[$i]; } return $restr; } ?>
zyyhong
trunk/jiaju001/news/include/inc/inc_fun_funString.php
PHP
asf20
1,143
<?php if(!defined('DEDEINC')) { exit("Request Error!"); } require_once(dirname(__FILE__)."/inc_arcpart_view.php"); require_once(dirname(__FILE__)."/inc_pubtag_make.php"); /****************************************************** //Copyright 2004-2006 by DedeCms.com itprato //本类的用途是对特定内容列表生成HTML ******************************************************/ @set_time_limit(0); class FreeList { var $dsql; var $dtp; var $TypeID; var $TypeLink; var $PageNo; var $TotalPage; var $TotalResult; var $PageSize; var $ChannelUnit; var $Fields; var $PartView; var $FLInfos; var $ListObj; var $TempletsFile; var $maintable; //------------------------------- //php5构造函数 //------------------------------- function __construct($fid) { $this->FreeID = $fid; $this->TypeLink = new TypeLink(0); $this->dsql = new DedeSql(false); $this->maintable = '#@__archives'; $this->TempletsFile = ''; $this->FLInfos = $this->dsql->GetOne("Select * From #@__freelist where aid='$fid' "); $liststr = $this->FLInfos['listtag']; //载入数据里保存的列表属性信息 $ndtp = new DedeTagParse(); $ndtp->SetNameSpace("dede","{","}"); $ndtp->LoadString($liststr); $this->ListObj = $ndtp->GetTag('list'); $this->PageSize = $this->ListObj->GetAtt('pagesize'); if(empty($this->PageSize)) $this->PageSize = 30; $channelid = $this->ListObj->GetAtt('channel'); if(empty($channelid)){ showmsg('必须指定频道','-1');exit(); }else{ $channelid = intval($channelid); $channelinfo = $this->dsql->getone("select maintable from #@__channeltype where ID='$channelid'"); $this->maintable = $channelinfo['maintable']; } //全局模板解析器 $this->dtp = new DedeTagParse(); $this->dtp->SetNameSpace("dede","{","}"); //设置一些全局参数的值 $this->Fields['aid'] = $this->FLInfos['aid']; $this->Fields['title'] = $this->FLInfos['title']; $this->Fields['position'] = $this->FLInfos['title']; $this->Fields['keywords'] = $this->FLInfos['keyword']; $this->Fields['description'] = $this->FLInfos['description']; $channelid = $this->ListObj->GetAtt('channel'); if(!empty($channelid)){ $this->Fields['channeltype'] = $channelid; $this->ChannelUnit = new ChannelUnit($channelid); }else{ $this->Fields['channeltype'] = 0; } foreach($GLOBALS['PubFields'] as $k=>$v) $this->Fields[$k] = $v; $this->PartView = new PartView(); $this->CountRecord(); } //php4构造函数 //--------------------------- function FreeList($fid){ $this->__construct($fid); } //--------------------------- //关闭相关资源 //--------------------------- function Close() { @$this->dsql->Close(); @$this->TypeLink->Close(); @$this->ChannelUnit->Close(); @$this->PartView->Close(); } //------------------ //统计列表里的记录 //------------------ function CountRecord() { global $cfg_list_son; //统计数据库记录 $this->TotalResult = -1; if(isset($GLOBALS['TotalResult'])) $this->TotalResult = $GLOBALS['TotalResult']; if(isset($GLOBALS['PageNo'])) $this->PageNo = $GLOBALS['PageNo']; else $this->PageNo = 1; //已经有总记录的值 if($this->TotalResult==-1) { $addSql = " arcrank > -1 And channel>-1 "; $typeid = $this->ListObj->GetAtt('typeid'); $subday = $this->ListObj->GetAtt('subday'); $listtype = $this->ListObj->GetAtt('type'); $att = $this->ListObj->GetAtt('att'); $channelid = $this->ListObj->GetAtt('channel'); if(empty($channelid)) $channelid = 0; //是否指定栏目条件 if(!empty($typeid)){ if($cfg_list_son=='N') $addSql .= " And (typeid='$typeid' or typeid2='$typeid') "; else $addSql .= " And (".$this->TypeLink->GetSunID($typeid,"{$this->maintable}",$this->Fields['channeltype'])." Or {$this->maintable}.typeid2='$typeid') "; } //自定义属性条件 if($att!="") $orwhere .= "And arcatt='$att' "; //文档的频道模型 if($channelid>0 && !eregi("spec",$listtype)) $addSql .= " And channel = '$channelid' "; //推荐文档 带缩略图 专题文档 if(eregi("commend",$listtype)) $addSql .= " And iscommend > 10 "; if(eregi("image",$listtype)) $addSql .= " And litpic <> '' "; if(eregi("spec",$listtype) || $channelid==-1) $addSql .= " And channel = -1 "; if(!empty($subday)){ $starttime = time() - $subday * 86400; $addSql .= " And senddate > $starttime "; } $keyword = $this->ListObj->GetAtt('keyword'); if(!empty($keyword)) $addSql .= " And CONCAT(title,keywords) REGEXP '$keyword' "; $cquery = "Select count(*) as dd From {$this->maintable} where $addSql"; $row = $this->dsql->GetOne($cquery); if(is_array($row)) $this->TotalResult = $row['dd']; else $this->TotalResult = 0; } $this->TotalPage = ceil($this->TotalResult/$this->PageSize); } //---------------------------- //载入模板 //-------------------------- function LoadTemplet(){ $tmpdir = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']; $tempfile = str_replace("{style}",$GLOBALS['cfg_df_style'],$this->FLInfos['templet']); $tempfile = $tmpdir."/".$tempfile; if(!file_exists($tempfile)){ $tempfile = $tmpdir."/".$GLOBALS['cfg_df_style']."/list_free.htm"; } $this->dtp->LoadTemplate($tempfile); $this->TempletsFile = ereg_replace("^".$GLOBALS['cfg_basedir'],'',$tempfile); } //------------------ //列表创建HTML //------------------ function MakeHtml($startpage=1,$makepagesize=0) { $this->LoadTemplet(); $murl = ""; if(empty($startpage)) $startpage = 1; $this->ParseTempletsFirst(); $totalpage = ceil($this->TotalResult/$this->PageSize); if($totalpage==0) $totalpage = 1; if($makepagesize>0) $endpage = $startpage+$makepagesize; else $endpage = ($totalpage+1); if($endpage>($totalpage+1)) $endpage = $totalpage; $firstFile = ''; for($this->PageNo=$startpage;$this->PageNo<$endpage;$this->PageNo++) { $this->ParseDMFields($this->PageNo,1); //文件名 $makeFile = $this->GetMakeFileRule(); if(!ereg("^/",$makeFile)) $makeFile = "/".$makeFile; $makeFile = str_replace('{page}',$this->PageNo,$makeFile); $murl = $makeFile; $makeFile = $GLOBALS['cfg_basedir'].$makeFile; $makeFile = ereg_replace("/{1,}","/",$makeFile); if($this->PageNo==1) $firstFile = $makeFile; //保存文件 $this->dtp->SaveTo($makeFile); echo "成功创建:<a href='$murl' target='_blank'>".ereg_replace("/{1,}","/",$murl)."</a><br/>"; } if($this->FLInfos['nodefault']==0) { $murl = '/'.str_replace('{cmspath}',$GLOBALS['cfg_cmspath'],$this->FLInfos['listdir']); $murl .= '/'.$this->FLInfos['defaultpage']; $indexfile = $GLOBALS['cfg_basedir'].$murl; $murl = ereg_replace("/{1,}","/",$murl); echo "复制:$firstFile 为 ".$this->FLInfos['defaultpage']." <br/>"; copy($firstFile,$indexfile); } $this->Close(); return $murl; } //------------------ //显示列表 //------------------ function Display() { $this->LoadTemplet(); $this->ParseTempletsFirst(); $this->ParseDMFields($this->PageNo,0); $this->Close(); $this->dtp->Display(); } //------------------ //显示单独模板页面 //------------------ function DisplayPartTemplets() { $nmfa = 0; $tmpdir = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']; if($this->Fields['ispart']==1) { $tempfile = str_replace("{tid}",$this->FreeID,$this->Fields['tempindex']); $tempfile = str_replace("{cid}",$this->ChannelUnit->ChannelInfos['nid'],$tempfile); $tempfile = $tmpdir."/".$tempfile; if(!file_exists($tempfile)){ $tempfile = $tmpdir."/".$GLOBALS['cfg_df_style']."/index_default.htm"; } $this->PartView->SetTemplet($tempfile); }else if($this->Fields['ispart']==2) { $tempfile = str_replace("{tid}",$this->FreeID,$this->Fields['tempone']); $tempfile = str_replace("{cid}",$this->ChannelUnit->ChannelInfos['nid'],$tempfile); if(is_file($tmpdir."/".$tempfile)) $this->PartView->SetTemplet($tmpdir."/".$tempfile); else{ $this->PartView->SetTemplet("这是没有使用模板的单独页!","string"); $nmfa = 1; } } CreateDir($this->Fields['typedir']); $makeUrl = $this->GetMakeFileRule($this->Fields['ID'],"index",$this->Fields['typedir'],$this->Fields['defaultname'],$this->Fields['namerule2']); $makeFile = $this->GetTruePath().$makeUrl; if($nmfa==0){ $this->PartView->Display(); }else{ if(!file_exists($makeFile)) $this->PartView->Display(); else include($makeFile); } $this->Close(); } //-------------------------------- //解析模板,对固定的标记进行初始给值 //-------------------------------- function ParseTempletsFirst() { //对公用标记的解析,这里对对象的调用均是用引用调用的,因此运算后会自动改变传递的对象的值 MakePublicTag($this,$this->dtp,$this->PartView,$this->TypeLink,0,0,0); } //-------------------------------- //解析模板,对内容里的变动进行赋值 //-------------------------------- function ParseDMFields($PageNo,$ismake=1) { foreach($this->dtp->CTags as $tagid=>$ctag){ if($ctag->GetName()=="freelist"){ $limitstart = ($this->PageNo-1) * $this->PageSize; $this->dtp->Assign($tagid,$this->GetList($limitstart,$ismake)); } else if($ctag->GetName()=="pagelist"){ $list_len = trim($ctag->GetAtt("listsize")); $ctag->GetAtt("listitem")=="" ? $listitem="info,index,pre,pageno,next,end,option" : $listitem=$ctag->GetAtt("listitem"); if($list_len=="") $list_len = 3; if($ismake==0) $this->dtp->Assign($tagid,$this->GetPageListDM($list_len,$listitem)); else $this->dtp->Assign($tagid,$this->GetPageListST($list_len,$listitem)); } else if($ctag->GetName()=="pageno"){ $this->dtp->Assign($tagid,$PageNo); } } } //---------------- //获得要创建的文件名称规则 //---------------- function GetMakeFileRule() { $okfile = ''; $namerule = $this->FLInfos['namerule']; $listdir = $this->FLInfos['listdir']; $listdir = str_replace('{cmspath}',$GLOBALS['cfg_cmspath'],$listdir); $okfile = str_replace('{listid}',$this->FLInfos['aid'],$namerule); $okfile = str_replace('{listdir}',$listdir,$okfile); $okfile = str_replace("\\","/",$okfile); $mdir = ereg_replace("/([^/]*)$","",$okfile); if(!ereg("/",$mdir) && ereg("\.",$mdir)){ return $okfile; }else{ CreateDir($mdir,'',''); return $okfile; } } //---------------------------------- //获得一个单列的文档列表 //--------------------------------- function GetList($limitstart,$ismake=1) { global $cfg_list_son; $col = $this->ListObj->GetAtt('col'); if(empty($col)) $col = 1; $titlelen = $this->ListObj->GetAtt('titlelen'); $infolen = $this->ListObj->GetAtt('infolen'); $imgwidth = $this->ListObj->GetAtt('imgwidth'); $imgheight = $this->ListObj->GetAtt('imgheight'); $titlelen = AttDef($titlelen,60); $infolen = AttDef($infolen,250); $imgwidth = AttDef($imgwidth,80); $imgheight = AttDef($imgheight,80); $innertext = trim($this->ListObj->GetInnerText()); if(empty($innertext)) $innertext = GetSysTemplets("list_fulllist.htm"); $tablewidth=100; if($col=="") $col=1; $colWidth = ceil(100/$col); $tablewidth = $tablewidth."%"; $colWidth = $colWidth."%"; //按不同情况设定SQL条件 $orwhere = " arc.arcrank > -1 And channel>-1 "; $typeid = $this->ListObj->GetAtt('typeid'); $subday = $this->ListObj->GetAtt('subday'); $listtype = $this->ListObj->GetAtt('type'); $att = $this->ListObj->GetAtt('att'); $channelid = $this->ListObj->GetAtt('channel'); if(empty($channelid)) $channelid = 0; //是否指定栏目条件 if(!empty($typeid)){ if($cfg_list_son=='N') $orwhere .= " And (arc.typeid='$typeid' or arc.typeid2='$typeid') "; else $orwhere .= " And (".$this->TypeLink->GetSunID($typeid,"arc",$this->Fields['channeltype'])." Or arc.typeid2='$typeid') "; } //自定义属性条件 if($att!="") $orwhere .= "And arc.arcatt='$att' "; //文档的频道模型 if($channelid>0 && !eregi("spec",$listtype)) $orwhere .= " And arc.channel = '$channelid' "; //推荐文档 带缩略图 专题文档 if(eregi("commend",$listtype)) $orwhere .= " And arc.iscommend > 10 "; if(eregi("image",$listtype)) $orwhere .= " And arc.litpic <> '' "; if(eregi("spec",$listtype) || $channelid==-1) $orwhere .= " And arc.channel = -1 "; if(!empty($subday)){ $starttime = time() - $subday; $orwhere .= " And arc.senddate > $starttime "; } $keyword = $this->ListObj->GetAtt('keyword'); if(!empty($keyword)) $orwhere .= " And CONCAT(arc.title,arc.keywords) REGEXP '$keyword' "; $orderby = $this->ListObj->GetAtt('orderby'); $orderWay = $this->ListObj->GetAtt('orderway'); //排序方式 $ordersql = ""; if($orderby=="senddate") $ordersql=" order by arc.senddate $orderWay"; else if($orderby=="pubdate") $ordersql=" order by arc.pubdate $orderWay"; else if($orderby=="id") $ordersql=" order by arc.ID $orderWay"; else if($orderby=="hot"||$orderby=="click") $ordersql = " order by arc.click $orderWay"; else if($orderby=="lastpost") $ordersql = " order by arc.lastpost $orderWay"; else if($orderby=="postnum") $ordersql = " order by arc.postnum $orderWay"; else if($orderby=="rand") $ordersql = " order by rand()"; else $ordersql=" order by arc.sortrank $orderWay"; //获得附加表的相关信息 //----------------------------- $addField = ""; $addJoin = ""; if(is_object($this->ChannelUnit)){ $addtable = $this->ChannelUnit->ChannelInfos['addtable']; if($addtable!=""){ $addJoin = " left join $addtable on arc.ID = ".$addtable.".aid "; $addField = ""; $fields = explode(",",$this->ChannelUnit->ChannelInfos['listadd']); foreach($fields as $k=>$v){ $nfields[$v] = $k; } foreach($this->ChannelUnit->ChannelFields as $k=>$arr){ if(isset($nfields[$k])){ if($arr['rename']!="") $addField .= ",".$addtable.".".$k." as ".$arr['rename']; else $addField .= ",".$addtable.".".$k; } } } } // //---------------------------- $query = "Select arc.ID,arc.title,arc.iscommend,arc.color, arc.typeid,arc.ismake,arc.money,arc.description,arc.shorttitle, arc.memberid,arc.writer,arc.postnum,arc.lastpost, arc.pubdate,arc.senddate,arc.arcrank,arc.click,arc.litpic, tp.typedir,tp.typename,tp.isdefault,tp.defaultname, tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl $addField from {$this->maintable} arc left join #@__arctype tp on arc.typeid=tp.ID $addJoin where $orwhere $ordersql limit $limitstart,".$this->PageSize; $this->dsql->SetQuery($query); $this->dsql->Execute("al"); $artlist = ""; if($col>1) $artlist = "<table width='$tablewidth' border='0' cellspacing='0' cellpadding='0'>\r\n"; $indtp = new DedeTagParse(); $indtp->SetNameSpace("field","[","]"); $indtp->LoadSource($innertext); $GLOBALS['autoindex'] = 0; for($i=0;$i<$this->PageSize;$i++) { if($col>1) $artlist .= "<tr>\r\n"; for($j=0;$j<$col;$j++) { if($col>1) $artlist .= "<td width='$colWidth'>\r\n"; if($row = $this->dsql->GetArray("al")) { $GLOBALS['autoindex']++; //处理一些特殊字段 $row['id'] = $row['ID']; $row['arcurl'] = $this->GetArcUrl($row['id'],$row['typeid'],$row['senddate'],$row['title'],$row['ismake'],$row['arcrank'],$row['namerule'],$row['typedir'],$row['money']); $row['typeurl'] = $this->GetListUrl($row['typeid'],$row['typedir'],$row['isdefault'],$row['defaultname'],$row['ispart'],$row['namerule2'],"abc"); if($ismake==0 && $GLOBALS['cfg_multi_site']=='Y'){ if($row["siteurl"]=="") $row["siteurl"] = $GLOBALS['cfg_mainsite']; if(!eregi("^http://",$row['picname'])){ $row['litpic'] = $row['siteurl'].$row['litpic']; $row['picname'] = $row['litpic']; } } $row['description'] = cnw_left($row['description'],$infolen); if($row['litpic']=="") $row['litpic'] = $GLOBALS['cfg_plus_dir']."/img/dfpic.gif"; $row['picname'] = $row['litpic']; $row['info'] = $row['description']; $row['filename'] = $row['arcurl']; $row['stime'] = GetDateMK($row['pubdate']); $row['textlink'] = "<a href='".$row['filename']."' title='".str_replace("'","",$row['title'])."'>".$row['title']."</a>"; $row['typelink'] = "<a href='".$row['typeurl']."'>[".$row['typename']."]</a>"; $row['imglink'] = "<a href='".$row['filename']."'><img src='".$row['picname']."' border='0' width='$imgwidth' height='$imgheight' alt='".str_replace("'","",$row['title'])."'></a>"; $row['image'] = "<img src='".$row['picname']."' border='0' width='$imgwidth' height='$imgheight' alt='".str_replace("'","",$row['title'])."'>"; $row['phpurl'] = $GLOBALS['cfg_plus_dir']; $row['plusurl'] = $GLOBALS['cfg_plus_dir']; $row['templeturl'] = $GLOBALS['cfg_templets_dir']; $row['memberurl'] = $GLOBALS['cfg_member_dir']; $row['title'] = cn_substr($row['title'],$titlelen); if($row['color']!="") $row['title'] = "<font color='".$row['color']."'>".$row['title']."</font>"; if($row['iscommend']==5||$row['iscommend']==16) $row['title'] = "<b>".$row['title']."</b>"; //编译附加表里的数据 if(is_object($this->ChannelUnit)){ foreach($row as $k=>$v){ if(ereg("[A-Z]",$k)) $row[strtolower($k)] = $v; } foreach($this->ChannelUnit->ChannelFields as $k=>$arr){ if(isset($row[$k])) $row[$k] = $this->ChannelUnit->MakeField($k,$row[$k]); } } //--------------------------- //解析单条记录 //------------------------- if(is_array($indtp->CTags)){ foreach($indtp->CTags as $k=>$ctag){ $_f = $ctag->GetName(); if(isset($row[$_f])) $indtp->Assign($k,$row[$_f]); else $indtp->Assign($k,""); } } $artlist .= $indtp->GetResult(); }//if hasRow else{ $artlist .= ""; } if($col>1) $artlist .= " </td>\r\n"; }//Loop Col if($col>1) $i += $col - 1; if($col>1) $artlist .= " </tr>\r\n"; }//Loop Line if($col>1) $artlist .= "</table>\r\n"; $this->dsql->FreeResult("al"); return $artlist; } //--------------------------------- //获取静态的分页列表 //--------------------------------- function GetPageListST($list_len,$listitem="info,index,end,pre,next,pageno") { $prepage=""; $nextpage=""; $prepagenum = $this->PageNo-1; $nextpagenum = $this->PageNo+1; if($list_len==""||ereg("[^0-9]",$list_len)) $list_len=3; $totalpage = ceil($this->TotalResult/$this->PageSize); if($totalpage<=1 && $this->TotalResult>0) return "共1页/".$this->TotalResult."条记录"; if($this->TotalResult == 0) return "共0页/".$this->TotalResult."条记录"; $maininfo = " 共{$totalpage}页/".$this->TotalResult."条记录 "; $purl = $this->GetCurUrl(); $tnamerule = $this->GetMakeFileRule(); $tnamerule = ereg_replace('^(.*)/','',$tnamerule); //获得上一页和主页的链接 if($this->PageNo != 1){ $prepage.="<a href='".str_replace("{page}",$prepagenum,$tnamerule)."'>上一页</a>\r\n"; $indexpage="<a href='".str_replace("{page}",1,$tnamerule)."'>首页</a>\r\n"; }else{ $indexpage="<a href='#'>首页</a>\r\n"; } //下一页,未页的链接 if($this->PageNo!=$totalpage && $totalpage>1){ $nextpage.="<a href='".str_replace("{page}",$nextpagenum,$tnamerule)."'>下一页</a>\r\n"; $endpage="<a href='".str_replace("{page}",$totalpage,$tnamerule)."'>末页</a>\r\n"; }else{ $endpage="<a href='#'>末页</a>\r\n"; } //option链接 $optionlen = strlen($totalpage); $optionlen = $optionlen*20+18; $optionlist = "<select name='sldd' style='width:$optionlen' onchange='location.href=this.options[this.selectedIndex].value;'>\r\n"; for($mjj=1;$mjj<=$totalpage;$mjj++){ if($mjj==$this->PageNo) $optionlist .= "<option value='".str_replace("{page}",$mjj,$tnamerule)."' selected>$mjj</option>\r\n"; else $optionlist .= "<option value='".str_replace("{page}",$mjj,$tnamerule)."'>$mjj</option>\r\n"; } $optionlist .= "</select>"; //获得数字链接 $listdd=""; $total_list = $list_len * 2 + 1; if($this->PageNo >= $total_list) { $j = $this->PageNo-$list_len; $total_list = $this->PageNo+$list_len; if($total_list>$totalpage) $total_list=$totalpage; } else{ $j=1; if($total_list>$totalpage) $total_list=$totalpage; } for($j;$j<=$total_list;$j++){ if($j==$this->PageNo) $listdd.= "<strong>{$j}</strong>\r\n"; else $listdd.="<a href='".str_replace("{page}",$j,$tnamerule)."'>".$j."</a>\r\n"; } $plist = ""; if(eregi('info',$listitem)) $plist .= $maininfo.' '; if(eregi('index',$listitem)) $plist .= $indexpage.' '; if(eregi('pre',$listitem)) $plist .= $prepage.' '; if(eregi('pageno',$listitem)) $plist .= $listdd.' '; if(eregi('next',$listitem)) $plist .= $nextpage.' '; if(eregi('end',$listitem)) $plist .= $endpage.' '; if(eregi('option',$listitem)) $plist .= $optionlist; return $plist; } //--------------------------------- //获取动态的分页列表 //--------------------------------- function GetPageListDM($list_len,$listitem="index,end,pre,next,pageno") { $prepage=""; $nextpage=""; $prepagenum = $this->PageNo-1; $nextpagenum = $this->PageNo+1; if($list_len==""||ereg("[^0-9]",$list_len)) $list_len=3; $totalpage = ceil($this->TotalResult/$this->PageSize); if($totalpage<=1 && $this->TotalResult>0) return "共1页/".$this->TotalResult."条记录"; if($this->TotalResult == 0) return "共0页/".$this->TotalResult."条记录"; $maininfo = "共{$totalpage}页/".$this->TotalResult."条记录"; $purl = $this->GetCurUrl(); $geturl = "lid=".$this->FreeID."&TotalResult=".$this->TotalResult."&"; $hidenform = "<input type='hidden' name='lid' value='".$this->FreeID."'>\r\n"; $hidenform .= "<input type='hidden' name='TotalResult' value='".$this->TotalResult."'>\r\n"; $purl .= "?".$geturl; //获得上一页和下一页的链接 if($this->PageNo != 1){ $prepage.="<a href='".$purl."PageNo=$prepagenum'>上一页</a>\r\n"; $indexpage="<a href='".$purl."PageNo=1'>首页</a>\r\n"; } else{ $indexpage="<a href='#'>首页</a>\r\n"; } if($this->PageNo!=$totalpage && $totalpage>1){ $nextpage.="<a href='".$purl."PageNo=$nextpagenum'>下一页</a>\r\n"; $endpage="<a href='".$purl."PageNo=$totalpage'>末页</a>\r\n"; } else{ $endpage="<a href='#'>末页</a>\r\n"; } //获得数字链接 $listdd=""; $total_list = $list_len * 2 + 1; if($this->PageNo >= $total_list) { $j = $this->PageNo-$list_len; $total_list = $this->PageNo+$list_len; if($total_list>$totalpage) $total_list=$totalpage; }else{ $j=1; if($total_list>$totalpage) $total_list=$totalpage; } for($j;$j<=$total_list;$j++){ if($j==$this->PageNo) $listdd.= "<a href='#'>.$j.</a>\r\n"; else $listdd.="<a href='".$purl."PageNo=$j'>".$j."</a>\r\n"; } $plist = "<form name='pagelist' action='".$this->GetCurUrl()."'>$hidenform"; $plist .= $maininfo.$indexpage.$prepage.$listdd.$nextpage.$endpage; if($totalpage>$total_list){ $plist.="<input type='text' name='PageNo' value='".$this->PageNo."'>\r\n"; $plist.="<input type='submit' name='plistgo' value='GO' >\r\n"; } $plist .= "</form>\r\n"; return $plist; } //-------------------------- //获得一个指定的频道的链接 //-------------------------- function GetListUrl($typeid,$typedir,$isdefault,$defaultname,$ispart,$namerule2,$siteurl=""){ return GetTypeUrl($typeid,MfTypedir($typedir),$isdefault,$defaultname,$ispart,$namerule2,$siteurl); } //-------------------------- //获得一个指定档案的链接 //-------------------------- function GetArcUrl($aid,$typeid,$timetag,$title,$ismake=0,$rank=0,$namerule="",$artdir="",$money=0){ return GetFileUrl($aid,$typeid,$timetag,$title,$ismake,$rank,$namerule,$artdir,$money); } //--------------- //获得当前的页面文件的url //---------------- function GetCurUrl() { if(!empty($_SERVER["REQUEST_URI"])){ $nowurl = $_SERVER["REQUEST_URI"]; $nowurls = explode("?",$nowurl); $nowurl = $nowurls[0]; }else{ $nowurl = $_SERVER["PHP_SELF"]; } return $nowurl; } }//End Class ?>
zyyhong
trunk/jiaju001/news/include/inc_freelist_view.php
PHP
asf20
25,672
<?php /******************************* //织梦HTML解析类V1.1 PHP版 //www.dedecms.com function c____DedeHtml2(); 这个类针对于采集程序,与DedeHtml类功能不尽相同 ********************************/ class DedeHtml2 { var $CAtt; var $SourceHtml; var $Title; var $Medias; var $MediaInfos; var $Links; var $CharSet; var $BaseUrl; var $BaseUrlPath; var $HomeUrl; var $IsHead; var $ImgHeight; var $ImgWidth; var $GetLinkType; //------------------------- //构造函数 //------------------------- function __construct() { $this->CAtt = ""; $this->SourceHtml = ""; $this->Title = ""; $this->Medias = Array(); $this->MediaInfos = Array(); $this->Links = Array(); $this->CharSet = ""; $this->BaseUrl = ""; $this->BaseUrlPath = ""; $this->HomeUrl = ""; $this->IsHead = false; $this->ImgHeight = 30; $this->ImgWidth = 50; $this->GetLinkType = "all"; } function DedeHtml2() { $this->__construct(); } //设置HTML的内容和来源网址 //gethead 是指是否要分析html头 //如果是局部HTML,此项必须设为false,否则无法分析网页 function SetSource(&$html,$url="",$gethead=false) { $this->__construct(); if($gethead) $this->IsHead = false; else $this->IsHead = true; $this->CAtt = new DedeAttribute2(); $url = trim($url); $this->SourceHtml = $html; $this->BaseUrl = $url; //判断文档相对于当前的路径 $urls = @parse_url($url); $this->HomeUrl = $urls["host"]; $this->BaseUrlPath = $this->HomeUrl.$urls["path"]; $this->BaseUrlPath = preg_replace("/\/([^\/]*)\.(.*)$/","/",$this->BaseUrlPath); $this->BaseUrlPath = preg_replace("/\/$/","",$this->BaseUrlPath); if($html!="") $this->Analyser(); } //----------------------- //解析HTML //----------------------- function Analyser() { $cAtt = new DedeAttribute2(); $cAtt->IsTagName = false; $c = ""; $i = 0; $startPos = 0; $endPos = 0; $wt = 0; $ht = 0; $scriptdd = 0; $attStr = ""; $tmpValue = ""; $tmpValue2 = ""; $tagName = ""; $hashead = 0; $slen = strlen($this->SourceHtml); if($this->GetLinkType=="link") { $needTag = "a|meta|title|/head|body"; } else if($this->GetLinkType=="media") { $needTag = "img|embed|a"; $this->IsHead = true; } else { $needTag = "img|embed|a|meta|title|/head|body"; } for(;$i < $slen; $i++) { $c = $this->SourceHtml[$i]; if($c=="<") { //这种情况一般是用于采集程序的模式 $tagName = ""; $j = 0; for($i=$i+1; $i < $slen; $i++){ if($j>10) break; $j++; if(!ereg("[ <>\r\n\t]",$this->SourceHtml[$i])) { $tagName .= $this->SourceHtml[$i]; } else{ break; } } $tagName = strtolower($tagName); if($tagName=="!--"){ $endPos = strpos($this->SourceHtml,"-->",$i); if($endPos!==false) $i=$endPos+3; continue; } if(ereg($needTag,$tagName)){ $startPos = $i; $endPos = strpos($this->SourceHtml,">",$i+1); if($endPos===false) break; $attStr = substr($this->SourceHtml,$i+1,$endPos-$startPos-1); $cAtt->SetSource($attStr); }else{ continue; } //检测HTML头信息 if(!$this->IsHead) { if($tagName=="meta"){ //分析name属性 $tmpValue = strtolower($cAtt->GetAtt("http-equiv")); if($tmpValue=="content-type"){ $this->CharSet = strtolower($cAtt->GetAtt("charset")); } } //End meta 分析 else if($tagName=="title"){ $this->Title = $this->GetInnerText($i,"title"); $i += strlen($this->Title)+12; } else if($tagName=="/head"||$tagName=="body"){ $this->IsHead = true; $i = $i+5; } } else { //小型分析的数据 //只获得内容里的多媒体资源链接,不获取text if($tagName=="img"){ //获取图片中的网址 $this->InsertMedia($cAtt->GetAtt("src"),"img"); } else if($tagName=="embed"){ //获得Flash或其它媒体的内容 $rurl = $this->InsertMedia($cAtt->GetAtt("src"),"embed"); if($rurl != ""){ $this->MediaInfos[$rurl][0] = $cAtt->GetAtt("width"); $this->MediaInfos[$rurl][1] = $cAtt->GetAtt("height"); } } else if($tagName=="a"){ //获得Flash或其它媒体的内容 $this->InsertLink($cAtt->GetAtt("href"),$this->GetInnerText($i,"a")); } }//结束解析body的内容 }//End if char }//End for if($this->Title=="") $this->Title = $this->BaseUrl; } // //重置资源 // function Clear() { $this->CAtt = ""; $this->SourceHtml = ""; $this->Title = ""; $this->Links = ""; $this->Medias = ""; $this->BaseUrl = ""; $this->BaseUrlPath = ""; } // //分析媒体链接 // function InsertMedia($url,$mtype) { if( ereg("^(javascript:|#|'|\")",$url) ) return ""; if($url=="") return ""; $this->Medias[$url]=$mtype; return $url; } function InsertLink($url,$atitle) { if( ereg("^(javascript:|#|'|\")",$url) ) return ""; if($url=="") return ""; $this->Links[$url]=$atitle; return $url; } // //分析content-type中的字符类型 // function ParCharSet($att) { $startdd=0; $taglen=0; $startdd = strpos($att,"="); if($startdd===false) return ""; else { $taglen = strlen($att)-$startdd-1; if($taglen<=0) return ""; return trim(substr($att,$startdd+1,$taglen)); } } // //分析refresh中的网址 // function ParRefresh($att) { return $this->ParCharSet($att); } // //补全相对网址 // function FillUrl($surl) { $i = 0; $dstr = ""; $pstr = ""; $okurl = ""; $pathStep = 0; $surl = trim($surl); if($surl=="") return ""; $pos = strpos($surl,"#"); if($pos>0) $surl = substr($surl,0,$pos); if($surl[0]=="/"){ $okurl = "http://".$this->HomeUrl."/".$surl; } else if($surl[0]==".") { if(strlen($surl)<=2) return ""; else if($surl[0]=="/") { $okurl = "http://".$this->BaseUrlPath."/".substr($surl,2,strlen($surl)-2); } else{ $urls = explode("/",$surl); foreach($urls as $u){ if($u=="..") $pathStep++; else if($i<count($urls)-1) $dstr .= $urls[$i]."/"; else $dstr .= $urls[$i]; $i++; } $urls = explode("/",$this->BaseUrlPath); if(count($urls) <= $pathStep) return ""; else{ $pstr = "http://"; for($i=0;$i<count($urls)-$pathStep;$i++) { $pstr .= $urls[$i]."/"; } $okurl = $pstr.$dstr; } } } else { if(strlen($surl)<7) $okurl = "http://".$this->BaseUrlPath."/".$surl; else if(strtolower(substr($surl,0,7))=="http://") $okurl = $surl; else $okurl = "http://".$this->BaseUrlPath."/".$surl; } $okurl = eregi_replace("^(http://)","",$okurl); $okurl = eregi_replace("/{1,}","/",$okurl); return "http://".$okurl; } // //获得和下一个标记之间的文本内容 // function GetInnerText($pos,$tagname) { $startPos=0; $endPos=0; $textLen=0; $str=""; $startPos = strpos($this->SourceHtml,'>',$pos); if($tagname=="title") $endPos = strpos($this->SourceHtml,'<',$startPos); else{ $endPos = strpos($this->SourceHtml,'</a',$startPos); if($endPos===false) $endPos = strpos($this->SourceHtml,'</A',$startPos); } if($endPos>$startPos){ $textLen = $endPos-$startPos; $str = substr($this->SourceHtml,$startPos+1,$textLen-1); } if($tagname=="title") return trim($str); else{ $str = eregi_replace("</(.*)$","",$str); $str = eregi_replace("^(.*)>","",$str); return trim($str); } } }//End class /******************************* //属性解析器 function c____DedeAttribute2(); ********************************/ class DedeAttribute2 { var $SourceString = ""; var $SourceMaxSize = 1024; var $CharToLow = FALSE; //属性值是否不分大小写(属性名统一为小写) var $IsTagName = TRUE; //是否解析标记名称 var $Count = -1; var $Items = ""; //属性元素的集合 //设置属性解析器源字符串 function SetSource($str="") { $this->Count = -1; $this->Items = ""; $strLen = 0; $this->SourceString = trim(preg_replace("/[ \t\r\n]{1,}/"," ",$str)); $strLen = strlen($this->SourceString); $this->SourceString .= " "; //增加一个空格结尾,以方便处理没有属性的标记 if($strLen>0&&$strLen<=$this->SourceMaxSize){ $this->PrivateAttParse(); } } //获得某个属性 function GetAtt($str){ if($str=="") return ""; $str = strtolower($str); if(isset($this->Items[$str])) return $this->Items[$str]; else return ""; } //判断属性是否存在 function IsAtt($str){ if($str=="") return false; $str = strtolower($str); if(isset($this->Items[$str])) return true; else return false; } //获得标记名称 function GetTagName(){ return $this->GetAtt("tagname"); } // 获得属性个数 function GetCount(){ return $this->Count+1; } //解析属性(仅给SetSource调用) function PrivateAttParse() { $d = ""; $tmpatt=""; $tmpvalue=""; $startdd=-1; $ddtag=""; $strLen = strlen($this->SourceString); $j = 0; //这里是获得标记的名称 if($this->IsTagName) { //如果属性是注解,不再解析里面的内容,直接返回 if(isset($this->SourceString[2])) { if($this->SourceString[0].$this->SourceString[1].$this->SourceString[2]=="!--") { $this->Items["tagname"] = "!--"; return ;} } // for($i=0;$i<$strLen;$i++){ $d = $this->SourceString[$i]; $j++; if(ereg("[ '\"\r\n\t]",$d)){ $this->Count++; $this->Items["tagname"]=strtolower(trim($tmpvalue)); $tmpvalue = ""; break; } else { $tmpvalue .= $d;} } if($j>0) $j = $j-1; } //遍历源字符串,获得各属性 for($i=$j;$i<$strLen;$i++) { $d = $this->SourceString[$i]; //获得属性的键 if($startdd==-1){ if($d!="=") $tmpatt .= $d; else{ $tmpatt = strtolower(trim($tmpatt)); $startdd=0; } } //检测属性值是用什么包围的,允许使用 '' "" 或空白 else if($startdd==0){ switch($d){ case ' ': continue; break; case '\'': $ddtag='\''; $startdd=1; break; case '"': $ddtag='"'; $startdd=1; break; default: $tmpvalue.=$d; $ddtag=' '; $startdd=1; break; } } //获得属性的值 else if($startdd==1) { if($d==$ddtag){ $this->Count++; if($this->CharToLow) $this->Items[$tmpatt] = strtolower(trim($tmpvalue)); else $this->Items[$tmpatt] = trim($tmpvalue); $tmpatt = ""; $tmpvalue = ""; $startdd=-1; } else $tmpvalue.=$d; } }//End for //处理没有值的属性(必须放在结尾才有效)如:"input type=radio name=t1 value=aaa checked" if($tmpatt!="") { $this->Items[$tmpatt] = "";} }//End Function PrivateAttParse }//End Class DedeAttribute2 ?>
zyyhong
trunk/jiaju001/news/include/pub_dedehtml2.php
PHP
asf20
11,465
<!-- //xmlhttp和xmldom对象 DedeXHTTP = null; DedeXDOM = null; DedeContainer = null; //获取指定ID的元素 //function $(eid){ // return document.getElementById(eid); //} function $DE(id) { return document.getElementById(id); } //参数 gcontainer 是保存下载完成的内容的容器 function DedeAjax(gcontainer){ DedeContainer = gcontainer; //post或get发送数据的键值对 this.keys = Array(); this.values = Array(); this.keyCount = -1; //http请求头 this.rkeys = Array(); this.rvalues = Array(); this.rkeyCount = -1; //请求头类型 this.rtype = 'text'; //初始化xmlhttp if(window.ActiveXObject) { try { DedeXHTTP = new ActiveXObject("Msxml2.XMLHTTP");} catch (e) { } if (DedeXHTTP == null) try { DedeXHTTP = new ActiveXObject("Microsoft.XMLHTTP");} catch (e) { } } else{ DedeXHTTP = new XMLHttpRequest(); } DedeXHTTP.onreadystatechange = function(){ if(DedeXHTTP.readyState == 4){ if(DedeXHTTP.status == 200){ DedeContainer.innerHTML = DedeXHTTP.responseText; DedeXHTTP = null; } else DedeContainer.innerHTML = "下载数据失败"; } else DedeContainer.innerHTML = "正在下载数据..."; }; //增加一个POST或GET键值对 this.AddKey = function(skey,svalue){ this.keyCount++; this.keys[this.keyCount] = skey; this.values[this.keyCount] = escape(svalue); }; //增加一个Http请求头键值对 this.AddHead = function(skey,svalue){ this.rkeyCount++; this.rkeys[this.rkeyCount] = skey; this.rvalues[this.rkeyCount] = svalue; }; //清除当前对象的哈希表参数 this.ClearSet = function(){ this.keyCount = -1; this.keys = Array(); this.values = Array(); this.rkeyCount = -1; this.rkeys = Array(); this.rvalues = Array(); }; //发送http请求头 this.SendHead = function(){ if(this.rkeyCount!=-1){ //发送用户自行设定的请求头 for(;i<=this.rkeyCount;i++){ DedeXHTTP.setRequestHeader(this.rkeys[i],this.rvalues[i]); } }  if(this.rtype=='binary'){ DedeXHTTP.setRequestHeader("Content-Type","multipart/form-data"); }else{ DedeXHTTP.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); } }; //用Post方式发送数据 this.SendPost = function(purl){ var pdata = ""; var i=0; this.state = 0; DedeXHTTP.open("POST", purl, true); this.SendHead(); if(this.keyCount!=-1) { for(;i<=this.keyCount;i++){ if(pdata=="") pdata = this.keys[i]+'='+this.values[i]; else pdata += "&"+this.keys[i]+'='+this.values[i]; } } DedeXHTTP.send(pdata); }; //用GET方式发送数据 this.SendGet = function(purl){ var gkey = ""; var i=0; this.state = 0; if(this.keyCount!=-1) { for(;i<=this.keyCount;i++){ if(gkey=="") gkey = this.keys[i]+'='+this.values[i]; else gkey += "&"+this.keys[i]+'='+this.values[i]; } if(purl.indexOf('?')==-1) purl = purl + '?' + gkey; else purl = purl + '&' + gkey; } DedeXHTTP.open("GET", purl, true); this.SendHead(); DedeXHTTP.send(null); }; } // End Class DedeAjax //初始化xmldom function InitXDom(){ if(DedeXDOM!=null) return; var obj = null; if (typeof(DOMParser) != "undefined") { var parser = new DOMParser(); obj = parser.parseFromString(xmlText, "text/xml"); } else { try { obj = new ActiveXObject("MSXML2.DOMDocument");} catch (e) { } if (obj == null) try { obj = new ActiveXObject("Microsoft.XMLDOM"); } catch (e) { } } DedeXDOM = obj; }; -->
zyyhong
trunk/jiaju001/news/include/dedeajax.js
JavaScript
asf20
3,560
<?php require_once(dirname(__FILE__)."/pub_dedetag.php"); class OxWindow { var $myWin = ''; var $myWinItem = ''; var $checkCode = ''; var $formName = ''; var $tmpCode = '//checkcode'; var $hasStart = false; var $mainTitle = ''; //--------------------------------- //初始化为含表单的页面 //--------------------------------- function Init($formaction="",$checkScript="js/blank.js",$formmethod="POST",$formname="myform") { $this->myWin .= "<script language='javascript'>\r\n"; if($checkScript!="" && file_exists($checkScript)){ $fp = fopen($checkScript,"r"); $this->myWin .= fread($fp,filesize($checkScript)); fclose($fp); } else{ $this->myWin .= "<!-- function CheckSubmit()\r\n{ return true; } -->"; } $this->myWin .= "</script>\r\n"; $this->formName = $formname; $isupload = ''; if($formmethod=='data') { $formmethod = 'post'; $isupload = " enctype='multipart/form-data' "; } $this->myWin .= "<form name='$formname' method='$formmethod'{$isupload} onSubmit='return CheckSubmit();' action='$formaction'>\r\n"; } //------------------------------- //增加隐藏域 //------------------------------- function AddHidden($iname,$ivalue){ $this->myWin .= "<input type='hidden' name='$iname' value='$ivalue'>\r\n"; } function StartWin() { $this->myWin .= "<table width='100%' border='0' cellpadding='1' cellspacing='1' align='center' class='tbtitle' style='background:#E2F5BC;'>\r\n"; } //----------------------------- //增加一个两列的行 //----------------------------- function AddItem($iname,$ivalue) { $this->myWinItem .= "<tr>\r\n"; $this->myWinItem .= "<td width='25%'>$iname</td>\r\n"; $this->myWinItem .= "<td width='75%'>$ivalue</td>\r\n"; $this->myWinItem .= "</tr>\r\n"; } //--------------------------- //增加一个单列的消息行 //--------------------------- function AddMsgItem($ivalue,$height="100",$col="2") { if($height!=""&&$height!="0") $height = " height='$height'"; else $height=""; if($col!=""&&$col!=0) $colspan="colspan='$col'"; else $colspan=""; $this->myWinItem .= "<tr>\r\n"; $this->myWinItem .= "<td $colspan $height> $ivalue </td>\r\n"; $this->myWinItem .= "</tr>\r\n"; } //------------------------------- //增加单列的标题行 //------------------------------- function AddTitle($title,$col="2") { if($col!=""&&$col!="0") $colspan="colspan='$col'"; else $colspan=""; $this->myWinItem .= "<tr>\r\n"; $this->myWinItem .= "<td $colspan ><font color='#666600'><b>$title</b></font></td>\r\n"; $this->myWinItem .= "</tr>\r\n"; } //---------------------- //结束Window //----------------------- function CloseWin($isform=true) { if(!$isform) $this->myWin .= "</table>\r\n"; else $this->myWin .= "</table></form>\r\n"; } //------------------------- //增加自定义JS脚本 //------------------------- function SetCheckScript($scripts) { $pos = strpos($this->myWin,$this->tmpCode); if($pos>0) $this->myWin = substr_replace($this->myWin,$scripts,$pos,strlen($this->tmpCode)); } //---------------------- //获取窗口 //----------------------- function GetWindow($wintype="save",$msg="",$isform=true) { $this->StartWin(); $this->myWin .= $this->myWinItem; if($wintype!="") { if($wintype=="okonly") { $this->myWin .= " <tr> <td colspan='2' > <table width='270' border='0' cellpadding='0' cellspacing='0'> <tr align='center'> <td width='90'><input name='imageField1' type='image' class='np' src='img/button_ok.gif' width='60' height='22' border='0' style='border:0px'></td> <td><a href='#'><img src='img/button_back.gif' width='60' height='22' border='0' onClick='history.go(-1);' style='border:0px'></a></td> </tr> </table> </td> </tr>"; } else if($wintype!="hand") { $this->myWin .= " <tr> <td colspan='2' > <table width='270' border='0' cellpadding='0' cellspacing='0'> <tr align='center'> <td width='90'><input name='imageField1' type='image' class='np' src='img/button_".$wintype.".gif' width='60' height='22' border='0' style='border:0px'></td> <td width='90'><a href='#'><img class='np' src='img/button_reset.gif' width='60' height='22' border='0' onClick='this.form.reset();return false;' style='border:0px'></a></td> <td><a href='#'><img src='img/button_back.gif' width='60' height='22' border='0' onClick='history.go(-1);' style='border:0px'></a></td> </tr> </table> </td> </tr>"; } else { $this->myWin .= " <tr> <td> $msg </td> </tr>"; } } $this->CloseWin($isform); return $this->myWin; } //---------------------- //显示页面 //---------------------- function Display($modfile="") { global $cfg_templets_dir,$cfg_basedir,$maintitle,$winform; if(empty($this->mainTitle)) $maintitle = '通用对话框'; else $maintitle = $this->mainTitle; if(empty($winform)) $winform = $this->myWin; if(empty($cfg_templets_dir)) $cfg_templets_dir = dirname(__FILE__)."/../templets"; else $cfg_templets_dir = $cfg_basedir.$cfg_templets_dir; $ctp = new DedeTagParse(); if($modfile=="") $ctp->LoadTemplate($cfg_templets_dir."/win_templet.htm"); else $ctp->LoadTemplate($modfile); $emnum = $ctp->Count; for($i=0;$i<=$emnum;$i++) { if(isset($GLOBALS[$ctp->CTags[$i]->GetTagName()])) { $ctp->Assign($i,$GLOBALS[$ctp->CTags[$i]->GetTagName()]); } } $ctp->Display(); $ctp->Clear(); } } /*------ 显示一个不带表单的普通提示 -------*/ function ShowMsgWin($msg,$title) { $win = new OxWindow(); $win->Init(); $win->mainTitle = "DeDeCms系统提示:"; $win->AddTitle($title); $win->AddMsgItem("<div style='padding-left:20px;line-height:150%'>$msg</div>"); $winform = $win->GetWindow("hand"); $win->Display(); } ?>
zyyhong
trunk/jiaju001/news/include/pub_oxwindow.php
PHP
asf20
5,911
<?php require_once(dirname(__FILE__)."/config.php"); CheckPurview('c_New'); if(empty($isdel1)) $isdel1 = 0; if(empty($isdel2)) $isdel2 = 0; //检查输入 //---------------------------- if(ereg("[^0-9-]",$ID)||$ID==""){ ShowMsg("<font color=red>'频道ID'</font>必须为数字!","-1"); exit(); } if(eregi("[^a-z0-9_-]",$nid)||$nid==""){ $nid = GetPinyin($typename); } if($addtable==""){ ShowMsg("附加表不能为空!","-1"); exit(); } $dsql = new DedeSql(false); $trueTable1 = str_replace("#@__",$cfg_dbprefix,$maintable); $trueTable2 = str_replace("#@__",$cfg_dbprefix,$addtable); //检查ID是否重复 //-------------------------- $row = $dsql->GetOne("Select * from #@__channeltype where ID='$ID' Or nid like '$nid' Or typename like '$typename' "); if(is_array($row)){ $dsql->Close(); ShowMsg("可能‘频道ID’、‘频道名称/标识’在数据库已存在,不能重复使用!","-1"); exit(); } $mysql_version = $dsql->GetVersion(); $mysql_versions = explode(".",trim($mysql_version)); $mysql_version = $mysql_versions[0].".".$mysql_versions[1]; //复制并创建索引表 //-------------------- $istb = $dsql->IsTable($trueTable1); if(!$istb || ($isdel1==1 && strtolower($trueTable1)!="{$cfg_dbprefix}archives") ) { $dsql->SetQuery("SHOW CREATE TABLE {$dsql->dbName}.#@__archives"); $dsql->Execute(); $row2 = $dsql->GetArray(); $dftable = $row2[1]; $dsql->ExecuteNoneQuery("DROP TABLE IF EXISTS `{$trueTable1}`;"); $dftable = str_replace("{$cfg_dbprefix}archives",$trueTable1,$dftable); $rs = $dsql->ExecuteNoneQuery($dftable); if(!$rs){ $dsql->Close(); ShowMsg("创建主索引表副本失败!","-1"); exit(); } } //创建附加表 //-------------------- if($trueTable2!='') { $istb = $dsql->IsTable($trueTable2); if(!$istb || $isdel2==1) { $dsql->ExecuteNoneQuery("DROP TABLE IF EXISTS `{$trueTable2}`;"); $tabsql = "CREATE TABLE `$trueTable2`( `aid` int(11) NOT NULL default '0', `typeid` int(11) NOT NULL default '0', "; if($mysql_version < 4.1) $tabsql .= " PRIMARY KEY (`aid`), KEY `".$trueTable2."_index` (`typeid`)\r\n) TYPE=MyISAM; "; else $tabsql .= " PRIMARY KEY (`aid`), KEY `".$trueTable2."_index` (`typeid`)\r\n) ENGINE=MyISAM DEFAULT CHARSET=".$cfg_db_language."; "; $rs = $dsql->ExecuteNoneQuery($tabsql); if(!$rs){ $dsql->Close(); ShowMsg("创建附加表失败!","-1"); exit(); } } } $inQuery = " INSERT INTO #@__channeltype(ID,nid,typename,maintable,addtable, addcon,mancon,editcon,useraddcon,usermancon,usereditcon, fieldset,listadd,issystem,issend,arcsta,sendrank,sendmember) VALUES ('$ID','$nid','$typename','$maintable','$addtable', '$addcon','$mancon','$editcon','$useraddcon','$usermancon','$usereditcon', '', '', '$issystem','$issend','$arcsta','$sendrank','$sendmember'); "; $rs = $dsql->ExecuteNoneQuery($inQuery); ClearAllLink(); ShowMsg("成功增加一个频道模型!","mychannel_edit.php?ID={$ID}&dopost=edit"); exit(); ?>
zyyhong
trunk/jiaju001/news/lic/mychannel_add_action.php
PHP
asf20
3,151
<?php require_once(dirname(__FILE__)."/config.php"); CheckPurview('sys_MakeHtml'); require_once(dirname(__FILE__)."/../include/inc_typelink.php"); $dsql = new DedeSql(false); $action = (empty($action) ? '' : $action); if($action=='') { $row = $dsql->GetOne("Select * From `#@__task`"); if(!is_array($row)) { $ks = explode(',','usermtools,rmpwd,tasks,typeid,startid,endid,nodes,dotime,degree'); foreach($ks as $k) $row[$k] = ''; $row['dotime'] = '02:30:00'; $row['usermtools'] = '1'; } require_once(dirname(__FILE__)."/templets/makehtml_task.htm"); $dsql->Close(); exit(); } else if($action=='save') { if(!is_array($tasks)){ ShowMsg("你没选择需要操作的任务!","-1"); exit(); } if(empty($rmpwd)){ ShowMsg("远程管理密码不能为空!","-1"); exit(); } if(eregi("[^0-9a-z@!]",$rmpwd)){ ShowMsg("远程管理密码只能由 a-z 0-9 ! @ # 几种字符组成!","-1"); exit(); } if(empty($startid)) $startid = 0; if(empty($endid)) $endid = 0; if(empty($typeid)) $typeid = 0; $dsql->ExecuteNoneQuery("Delete From `#@__task`"); $taskss = ''; if(is_array($tasks)) foreach($tasks as $v) $taskss .= ($taskss=='' ? $v : ','.$v); $inQuery = "Insert Into `#@__task` ( `id` , `usermtools` , `rmpwd` , `tasks` , `typeid` , `startid` , `endid` , `nodes` , `dotime` , `degree` ) VALUES ('1','$usermtools','$rmpwd','$taskss','$typeid','$startid','$endid','$nodes','$dotime','$degree' ) ; "; $dsql->ExecuteNoneQuery($inQuery); ShowMsg("成功更新计划任务配置!","makehtml_task.php"); exit(); } ?>
zyyhong
trunk/jiaju001/news/lic/makehtml_task.php
PHP
asf20
1,641
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>常用小功能</title> <link href="css_body.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="bodytitle"> <div class="bodytitleleft"></div> <div class="bodytitletxt">常用小功能</div> </div> <table width="96%" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" style=" background:#E2F5BC;"> <form action="doohickey.php" method="get" name="form1" target="main"> <tr> <td height="20" bgcolor="#EDF9D5">&nbsp;本插件将不断更新,请大家多多关注!</td> </tr> <tr> <td bgcolor="#FFFFFF"> <table width="100%" border="0" cellpadding="2" cellspacing="2"> <tr bgcolor="#EFFAFE"> <td width="18%" align="right" bgcolor="#FFFFFF">1.批量替换文档生成状态:</td> <td colspan="3" bgcolor="#FFFFFF"><p> <input name="ismake" type="radio" value="" checked="checked"/> 不操作 <input type="radio" name="ismake" value="1"/> 全部静态 <input type="radio" name="ismake" value="-1"/> 全部动态 <br /> </p></td> </tr> <tr> <td height="30" bgcolor="#EDF9D5">&nbsp;</td> <td colspan="3" bgcolor="#EDF9D5">&nbsp;</td> </tr> </table> </td> </tr> <tr> <td height="31" bgcolor="#F8FBFB" align="center"> <input type="submit" name="Submit" value="确定" class="inputbut"> </td> </tr> </form> </table> </body> </html>
zyyhong
trunk/jiaju001/news/lic/doohickey.html
HTML
asf20
1,836
<?php require(dirname(__FILE__)."/config.php"); CheckPurview('sys_Data'); if(empty($dopost)) $dopost = ""; AjaxHead(); $dsql = new DedeSql(false); echo "<a href='#' onclick='javascript:HideObj(\"_mydatainfo\")'>[<u>关闭</u>]</a>\r\n<xmp>"; if($dopost=="viewinfo") //查看表结构 { if(empty($tablename)) echo "没有指定表名!"; else{ $dsql->SetQuery("SHOW CREATE TABLE ".$dsql->dbName.".".$tablename); $dsql->Execute(); $row2 = $dsql->GetArray(); $ctinfo = $row2[1]; echo trim($ctinfo); } $dsql->Close(); exit(); } else if($dopost=="opimize") //优化表 { if(empty($tablename)) echo "没有指定表名!"; else{ $dsql->ExecuteNoneQuery("OPTIMIZE TABLE `$tablename` "); $dsql->Close(); echo "执行优化表: $tablename OK!"; } exit(); } else if($dopost=="repair") //修复表 { if(empty($tablename)) echo "没有指定表名!"; else{ $rs = $dsql->ExecuteNoneQuery("REPAIR TABLE `$tablename` "); $dsql->Close(); echo "修复表: $tablename OK!"; } exit(); } ClearAllLink(); echo "</xmp>"; ?>
zyyhong
trunk/jiaju001/news/lic/sys_sql_query_lit.php
PHP
asf20
1,108
<?php require_once(dirname(__FILE__)."/config.php"); setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/"); $dsql = new DedeSql(false); if(empty($pagesize)) $pagesize = 18; if(empty($pageno)) $pageno = 1; if(empty($dopost)) $dopost = ''; if(empty($orderby)) $orderby = 'aid'; if(empty($aid)) $aid = '0'; $aid = ereg_replace("[^0-9]","",$aid); //重载列表 if($dopost=='getlist'){ AjaxHead(); GetUserList($dsql,$pageno,$pagesize,$orderby); $dsql->Close(); exit(); } //更新字段 else if($dopost=='update') { $dsql->ExecuteNoneQuery("Update dedecms_users set url='$url',version='$version',rank='$rank',isok='$isok',ismember='$ismember' where aid='$aid';"); AjaxHead(); GetUserList($dsql,$pageno,$pagesize,$orderby); $dsql->Close(); exit(); } //删除字段 else if($dopost=='del') { $dsql->ExecuteNoneQuery("Delete From dedecms_users where aid='$aid';"); AjaxHead(); GetUserList($dsql,$pageno,$pagesize,$orderby); $dsql->Close(); exit(); } //第一次进入这个页面 if($dopost==''){ $row = $dsql->GetOne("Select count(*) as dd From dedecms_users"); $totalRow = $row['dd']; include(dirname(__FILE__)."/templets/dedecms_user_main.htm"); $dsql->Close(); } //获得列表 //--------------------------------- function GetUserList($dsql,$pageno,$pagesize,$orderby='aid'){ global $cfg_phpurl; $start = ($pageno-1) * $pagesize; $printhead ="<table width='99%' border='0' cellpadding='1' cellspacing='1' bgcolor='#333333' style='margin-bottom:3px'> <tr align='center' bgcolor='#E5F9FF' height='24'> <td width='8%' height='23'><a href='#' onclick=\"ReloadPage('aid')\"><u>ID</u></a></td> <td width='30%'>网址</td> <td width='6%'><a href='#' onclick=\"ReloadPage('version')\"><u>版本</u></a></td> <td width='6%'><a href='#' onclick=\"ReloadPage('rank')\"><u>等级</u></a></td> <td width='6%'><a href='#' onclick=\"ReloadPage('isok')\"><u>检验</u></a></td> <td width='6%'><a href='#' onclick=\"ReloadPage('ismember')\"><u>会员</u></a></td> <td width='16%'><a href='#' onclick=\"ReloadPage('logintime')\"><u>收录时间</u></a></td> <td>管理</td> </tr>\r\n"; echo $printhead; $dsql->SetQuery("Select * From dedecms_users order by $orderby desc limit $start,$pagesize "); $dsql->Execute(); while($row = $dsql->GetArray()){ $line = " <tr align='center' bgcolor='#FFFFFF' onMouseMove=\"javascript:this.bgColor='#FCFEDA';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\"> <td height='24'>{$row['aid']}</td> <td><input name='url' type='text' id='url{$row['aid']}' value='{$row['url']}' class='ininput'></td> <td><input name='version' type='text' id='version{$row['aid']}' value='{$row['version']}' class='ininput'></td> <td><input name='isok' type='text' id='isok{$row['aid']}' value='{$row['isok']}' class='ininput'></td> <td><input name='ismember' type='text' id='ismember{$row['aid']}' value='{$row['ismember']}' class='ininput'></td> <td><input name='rank' type='text' id='rank{$row['aid']}' value='{$row['rank']}' class='ininput'></td> <td>".strftime("%y-%m-%d %H:%M:%S",$row['logintime'])."</td> <td> <a href='/newinfo.php?feedback=".urlencode($row['url'])."' target='_blank'>浏览</a> | <a href='#' onclick='UpdateNote({$row['aid']})'>更新</a> | <a href='#' onclick='DelNote({$row['aid']})'>删除</a> </td> </tr>"; echo $line; } echo "</table>\r\n"; } ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/dedecms_user_main.php
PHP
asf20
3,577
<?php require_once(dirname(__FILE__)."/config.php"); $db = new DedeSql(false); if(empty($action)){ $sectors = $topsectors = $subsectors = array(); $sectorscache = ''; $sql = "select * from #@__sectors order by disorder asc, id asc"; $db->SetQuery($sql); $db->Execute(); while($row = $db->GetArray()) { if($row['reid'] == 0) { $topsectors[] = $row; }else { $subsectors[] = $row; } } foreach($topsectors as $topsector) { $sectors[] = $topsector; $sectorscache .= '<option value="'.$topsector['id'].'">|- '.$topsector['name'].'</option>'; foreach($subsectors as $subsector) { if($subsector['reid'] == $topsector['id']) { $sectors[] = $subsector; } } } include(dirname(__FILE__)."/templets/sectors.htm"); /* function add() */ }elseif($action == 'add') { $name = trim($name); if($name == '' ) { ShowMsg('行业名称不能为空,将返回行业管理页面','sectors.php'); exit; } $reid = intval($reid); $reid = max(0, $reid); $sql = "insert into #@__sectors (name, reid) values ('$name', $reid);"; $db->SetQuery($sql); if($db->ExecuteNoneQuery()) { ShowMsg('添加行业成功,将返回行业管理页面','sectors.php'); exit; }else { ShowMsg('更新行业失败,将返回行业管理页面','sectors.php'); exit; } /* function edit() */ }elseif($action == 'edit') { if($step != 2) { $sectorscache = '<option value="0">无(作为一级行业)</option>'; $sql = "select * from #@__sectors where id=$id"; $db->SetQuery($sql); $sector = $db->GetOne(); $sql = "select * from #@__sectors where reid=0 and id!=$id order by disorder asc, id asc"; $db->SetQuery($sql); $db->Execute(); while($topsector = $db->GetArray()) { $check = ''; if($sector['reid'] != 0 && $topsector['id'] == $sector['reid']) { $check = 'selected'; } $sectorscache .= '<option value="'.$topsector['id'].'" '. $check.'>'.$topsector['name'].'</option>'; } include(dirname(__FILE__)."/templets/sectors.htm"); }else{ $name = trim($name); if($name == '' ){ ShowMsg('行业名称不能为空,将返回行业管理页面','sectors.php'); exit; } $reid = intval($reid); $disorder = intval($disorder); $reid = max(0, $reid); $disorder = max(0, $disorder); $sql = "update #@__sectors set name='$name', reid=$reid, disorder=$disorder where id=$id"; $db->SetQuery($sql); if($db->ExecuteNoneQuery()) { ShowMsg('编辑行业成功,将返回行业管理页面','sectors.php'); exit; }else { ShowMsg('编辑行业成功,将返回行业管理页面','sectors.php'); exit; } } /* function update() */ }elseif($action == 'update') { $errinfo = ''; foreach($disorders as $key => $disorder) { $names[$key] = trim($names[$key]); if($names[$key] == '' ){ $errinfo .= "id为 $key 的行业名称为空,未更新该条记录<br>"; continue; } $sql = "update #@__sectors set disorder=$disorder, name='$names[$key]' where id=$key"; $db->SetQuery($sql); if(!$db->ExecuteNoneQuery()) { $errinfo .= $sql."\n"; } } if(trim($errinfo) != '' ) { ShowMsg($errinfo,'sectors.php'); exit; }else { ShowMsg('更新行业成功,将返回行业管理页面','sectors.php'); exit; } /* function delete() */ }elseif($action == 'delete') { if($step != 2) { include(dirname(__FILE__)."/templets/sectors.htm"); }else { $id = intval($id); if($id < 1) { ShowMsg('行业编号不正确,将返回行业管理页面','sectors.php'); exit; }else { $sql = "delete from #@__sectors where id=$id or reid=$id"; $db->SetQuery($sql); if($db->ExecuteNoneQuery()) { ShowMsg('删除行业成功,将返回行业管理页面', 'sectors.php'); exit; }else { ShowMsg('删除行业失败,将返回行业管理页面 ','sectors.php'); exit; } } } } ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/sectors.php
PHP
asf20
3,979
<?php require_once(dirname(__FILE__)."/config.php"); CheckPurview('sys_Group'); if(!empty($dopost)){ $dsql = new DedeSql(false); $row = $dsql->GetOne("Select * From #@__admintype where rank='".$rankid."'"); if(is_array($row)){ ShowMsg("你所创建的组别的级别值已存在,不允许重复!","-1"); $dsql->Close(); exit(); } $AllPurviews = ""; if(is_array($purviews)){ foreach($purviews as $pur){ $AllPurviews = $pur.' '; } $AllPurviews = trim($AllPurviews); } $dsql->ExecuteNoneQuery("INSERT INTO #@__admintype(rank,typename,system,purviews) VALUES ('$rankid','$groupname', 0, '$AllPurviews');"); ShowMsg("成功创建一个新的用户组!","sys_group.php"); $dsql->Close(); exit(); } require_once(dirname(__FILE__)."/templets/sys_group_add.htm"); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/sys_group_add.php
PHP
asf20
876
<?php require_once(dirname(__FILE__)."/config.php"); if(empty($dopost)) $dopost = ""; CheckPurview('sys_Att'); $dsql = new DedeSql(false); if($dopost=="save") { $startID = 1; $endID = $idend; for(;$startID<=$endID;$startID++) { $query = ""; $att = ${"att_".$startID}; $attname = ${"attname_".$startID}; if(isset(${"check_".$startID})){ $query = "update #@__arcatt set attname='$attname' where att='$att'"; } else{ $query = "Delete From #@__arcatt where att='$att'"; } if($query!=""){ $dsql->SetQuery($query); $dsql->ExecuteNoneQuery(); } } if(isset($check_new)) { if($att_new>0 && $attname_new!=""){ $dsql->SetQuery("Insert Into #@__arcatt(att,attname) Values('{$att_new}','{$attname_new}')"); $dsql->ExecuteNoneQuery(); } } //header("Content-Type: text/html; charset={$cfg_ver_lang}"); echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset={$cfg_ver_lang}\">\r\n"; echo "<script> alert('成功更新自定文档义属性表!'); </script>"; } require_once(dirname(__FILE__)."/templets/content_att.htm"); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/content_att.php
PHP
asf20
1,228
<?php require_once(dirname(__FILE__)."/config.php"); CheckPurview('co_AddNote'); ?>
zyyhong
trunk/jiaju001/news/lic/co_ruletest.php
PHP
asf20
93
<?php @ob_start(); @set_time_limit(3600); require_once(dirname(__FILE__)."/config.php"); CheckPurview('sys_description'); $tjnum = 0; if($action=='getfields') { AjaxHead(); $dsql = new DedeSql(false); if(!$dsql->linkID){ echo "<font color='red'>连接数据源的数据库失败!</font><br>"; echo $qbutton; exit(); } $channel = $dsql->getone("select addtable from #@__channeltype where ID=$channel"); $channel = str_replace('#@__',$cfg_dbprefix,$channel['addtable']); $dsql->GetTableFields($channel); echo "<div style='border:1px solid #ababab;background-color:#FEFFF0;margin-top:6px;padding:3px;line-height:160%'>"; echo "表(".$channel.")含有的字段:<br>"; while($row = $dsql->GetFieldObject()){ echo "<a href=\"javascript:pf('{$row->name}')\"><u>".$row->name."</u></a>\r\n"; } echo "<input type='hidden' name='addtable' value='$channel' />"; echo "</div>"; $dsql->Close(); exit(); }elseif($action == 'fetch') { header("Content-Type: text/html; charset={$cfg_ver_lang}"); $dsql = new DedeSql(false); if(empty($startdd)) $startdd = 0; if(empty($pagesize)) $pagesize = 100; if(empty($totalnum)) $totalnum = 0; if(empty($sid)) $sid = 0; if(empty($eid)) $eid = 0; if(empty($dojob)) $dojob = 'desc'; $addtable = urldecode($addtable); $addtable = ereg_replace("[^0-9a-zA-Z_#@]","",$addtable); $rpfield = ereg_replace("[^0-9a-zA-Z_\[\]]","",$rpfield); $channel = intval($channel); if($dsize>250) $dsize = 250; $channelinfo = $dsql->getone("select * from #@__channeltype where ID=$channel"); $maintable = $channelinfo['maintable']; if(empty($totalnum)){ $addquery = ""; if($sid!=0) $addquery = " And aid>='$sid' "; if($eid!=0) $addquery = " And aid<='$eid' "; $tjQuery = "Select count(*) as dd From #@__full_search where channelid='{$channel}' $addquery"; $row = $dsql->GetOne($tjQuery); $totalnum = $row['dd']; } if($totalnum > 0){ $addquery = ""; if($sid!=0) $addquery = " And maintable.ID>='$sid' "; if($eid!=0) $addquery = " And maintable.ID<='$eid' "; $fquery = " Select maintable.ID,maintable.title,maintable.description,addtable.{$rpfield} as body From $maintable maintable left join {$addtable} addtable on addtable.aid=maintable.ID where maintable.channel='{$channel}' $addquery limit $startdd,$pagesize ; "; $dsql->SetQuery($fquery); $dsql->Execute(); while($row=$dsql->GetArray()) { $body = $row['body']; $description = $row['description']; if(strlen($description)>10 || $description=='-') continue; $bodytext = preg_replace("/#p#|#e#|副标题|分页标题/isU","",Html2Text($body)); if(strlen($bodytext) < $msize) continue; $des = trim(addslashes(cn_substr($bodytext,$dsize))); if(strlen($des)<3) $des = "-"; $dsql->ExecuteNoneQuery("Update $maintable set description='{$des}' where ID='{$row['ID']}';"); $dsql->ExecuteNoneQuery("Update #@__full_search set addinfos='{$des}' where aid='{$row['ID']}';"); } //返回进度信息 $startdd = $startdd + $pagesize; if($totalnum > $startdd){ $tjlen = ceil( ($startdd/$totalnum) * 100 ); $dvlen = $tjlen * 2; $tjsta = "<div style='width:200;height:15;border:1px solid #898989;text-align:left'><div style='width:$dvlen;height:15;background-color:#829D83'></div></div>"; $tjsta .= "<br/>完成处理文档总数的:$tjlen %,继续执行任务..."; $nurl = "description_fetch_action.php?action=fetch&totalnum=$totalnum&startdd={$startdd}&pagesize=$pagesize&channel={$channel}&rpfield={$rpfield}&dsize={$dsize}&msize={$msize}&sid={$sid}&eid=$eid&addtable=".urlencode($addtable); $dsql->Close(); ShowMsg($tjsta,$nurl,0,500); exit(); }else{ $tjlen=100; $dsql->executenonequery("OPTIMIZE TABLE `#@__full_search`"); $dsql->executenonequery("OPTIMIZE TABLE `$maintable`"); $dsql->Close(); echo "完成所有任务!"; exit(); } }else{ $dsql->Close(); echo "完成所有任务!"; exit(); } ClearAllLink(); } ?>
zyyhong
trunk/jiaju001/news/lic/description_fetch_action.php
PHP
asf20
4,171
<?php require_once(dirname(__FILE__)."/config.php"); $dsql = new DedeSql(false); $row = $dsql->GetOne("Select * From #@__homepageset"); require_once(dirname(__FILE__)."/templets/makehtml_homepage.htm"); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/makehtml_homepage.php
PHP
asf20
233
<?php require_once(dirname(__FILE__)."/config.php"); require_once(dirname(__FILE__)."/../include/pub_oxwindow.php"); CheckPurview('plus_文件管理器'); $activepath = str_replace("..","",$activepath); $activepath = ereg_replace("^/{1,}","/",$activepath); if($activepath == "/") $activepath = ""; if($activepath == "") $inpath = $cfg_basedir; else $inpath = $cfg_basedir.$activepath; //显示控制层 //更改文件名 if($fmdo=="rename") { if($activepath=="") $ndirstring = "根目录"; $ndirstring = $activepath; $wintitle = "文件管理"; $wecome_info = "文件管理::更改文件名 [<a href='file_manage_main.php?activepath=$activepath'>文件浏览器</a>]</a>"; $win = new OxWindow(); $win->Init("file_manage_control.php","js/blank.js","POST"); $win->AddHidden("fmdo",$fmdo); $win->AddHidden("activepath",$activepath); $win->AddHidden("filename",$filename); $win->AddTitle("更改文件名,当前路径:$ndirstring"); $win->AddItem("旧名称:","<input name='oldfilename' type='input' id='oldfilename' size='40' value='$filename'>"); $win->AddItem("新名称:","<input name='newfilename' type='input' size='40' id='newfilename'>"); $winform = $win->GetWindow("ok"); $win->Display(); } //新建目录 else if($fmdo=="newdir") { if($activepath=="") $activepathname="根目录"; else $activepathname=$activepath; $wintitle = "文件管理"; $wecome_info = "文件管理::新建目录 [<a href='file_manage_main.php?activepath=$activepath'>文件浏览器</a>]</a>"; $win = new OxWindow(); $win->Init("file_manage_control.php","js/blank.js","POST"); $win->AddHidden("fmdo",$fmdo); $win->AddHidden("activepath",$activepath); //$win->AddHidden("filename",$filename); $win->AddTitle("当前目录 $activepathname "); $win->AddItem("新目录:","<input name='newpath' type='input' id='newpath'>"); $winform = $win->GetWindow("ok"); $win->Display(); } //移动文件 else if($fmdo=="move") { $wintitle = "文件管理"; $wecome_info = "文件管理::移动文件 [<a href='file_manage_main.php?activepath=$activepath'>文件浏览器</a>]</a>"; $win = new OxWindow(); $win->Init("file_manage_control.php","js/blank.js","POST"); $win->AddHidden("fmdo",$fmdo); $win->AddHidden("activepath",$activepath); $win->AddHidden("filename",$filename); $win->AddTitle("新位置前面不加'/'表示相对于当前位置,加'/'表示相对于根目录。"); $win->AddItem("被移动文件:",$filename); $win->AddItem("当前位置:",$activepath); $win->AddItem("新位置:","<input name='newpath' type='input' id='newpath' size='40'>"); $winform = $win->GetWindow("ok"); $win->Display(); } //删除文件 else if($fmdo=="del") { $wintitle = "文件管理"; $wecome_info = "文件管理::删除文件 [<a href='file_manage_main.php?activepath=$activepath'>文件浏览器</a>]</a>"; $win = new OxWindow(); $win->Init("file_manage_control.php","js/blank.js","POST"); $win->AddHidden("fmdo",$fmdo); $win->AddHidden("activepath",$activepath); $win->AddHidden("filename",$filename); if(@is_dir($cfg_basedir.$activepath."/$filename")) $wmsg = "你确信要删除目录:$filename 吗?"; else $wmsg = "你确信要删除文件:$filename 吗?"; $win->AddTitle("删除文件确认"); $win->AddMsgItem($wmsg,"50"); $winform = $win->GetWindow("ok"); $win->Display(); } //编辑文件 else if($fmdo=="edit") { if(!isset($backurl)) $backurl = ""; $activepath = str_replace("..","",$activepath); $filename = str_replace("..","",$filename); $file = "$cfg_basedir$activepath/$filename"; $content = ""; if(is_file($file)){ $fp = fopen($file,"r"); $content = fread($fp,filesize($file)); fclose($fp); $content = eregi_replace("<textarea","< textarea",$content); $content = eregi_replace("</textarea","< /textarea",$content); $content = eregi_replace("<form","< form",$content); $content = eregi_replace("</form","< /form",$content); } $contentView = "<textarea name='str' style='width:100%;height:400'>$content</textarea>\r\n"; $GLOBALS['filename'] = $filename; $ctp = new DedeTagParse(); $ctp->LoadTemplate(dirname(__FILE__)."/templets/file_edit.htm"); $ctp->display(); } //编辑文件,可视化模式 else if($fmdo=="editview") { if(!isset($backurl)) $backurl = ""; if(!isset($ishead)) $ishead = ""; $activepath = str_replace("..","",$activepath); $filename = str_replace("..","",$filename); $file = "$cfg_basedir$activepath/$filename"; $fp = fopen($file,"r"); @$content = fread($fp,filesize($file)); fclose($fp); if((eregi("<html",$content) && eregi("<body",$content)) || $ishead == "yes") { $contentView = GetEditor("str",$content,"500","Default","string","true"); } else { $contentView = GetEditor("str",$content,"500","Default","string","false"); } $GLOBALS['filename'] = $filename; $ctp = new DedeTagParse(); $ctp->LoadTemplate(dirname(__FILE__)."/templets/file_edit_view.htm"); $ctp->display(); } //新建文件 else if($fmdo=="newfile") { $content = ""; $GLOBALS['filename'] = "newfile.txt"; $contentView = "<textarea name='str' style='width:100%;height:400'></textarea>\r\n"; $ctp = new DedeTagParse(); $ctp->LoadTemplate(dirname(__FILE__)."/templets/file_edit.htm"); $ctp->display(); } //上传文件 else if($fmdo=="upload") { $ctp = new DedeTagParse(); $ctp->LoadTemplate(dirname(__FILE__)."/templets/file_upload.htm"); $ctp->display(); } ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/file_manage_view.php
PHP
asf20
5,531
<?php require_once(dirname(__FILE__)."/config.php"); if(!isset($cid)) $cid = 0; if(!isset($keyword)) $keyword = ""; if(!isset($channelid)) $channelid = 0; if(!isset($arcrank)) $arcrank = ""; if(!isset($adminid)) $adminid = 0; if(!isset($ismember)) $ismember = 0; if(!isset($USEListStyle)) $USEListStyle = ''; //检查权限许可,总权限 CheckPurview('a_List,a_AccList,a_MyList'); $cids = ''; //栏目浏览许可 if(TestPurview('a_List')){ ; } else if(TestPurview('a_AccList')) { if($cid==0) { $cids = MyCatalogInArr(); if(!empty($cids) && !ereg(',',$cids)){ $cid = $cids; $cids = ''; } } else{ CheckCatalog($cid,"你无权浏览非指定栏目的内容!"); } }else { $adminid = $cuserLogin->getUserID(); } require_once(dirname(__FILE__)."/../include/inc_typelink.php"); require_once(dirname(__FILE__)."/../include/pub_datalist_dm.php"); require_once(dirname(__FILE__)."/inc/inc_list_functions.php"); setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/"); //初始化频道信息 //------------------------------------ $seltypeids = 0; //if(empty($cid) && empty($channelid)) $channelid = 1; $tl = new TypeLink($cid); if($cid>0) $channelid = $tl->TypeInfos['channeltype']; $tables = GetChannelTable($tl->dsql,$channelid,'channel'); if($cid>0){ $positionname = str_replace($cfg_list_symbol,"&gt;",$tl->GetPositionName())."&gt;"; $seltypeids = $tl->dsql->GetOne("Select ID,typename,channeltype From #@__arctype where ID='$cid' ",MYSQL_ASSOC); } else if($channelid>0){ $row = $tl->dsql->GetOne(" Select typename From #@__channeltype where ID='$channelid' "); $positionname = '所有'.$row[0]."&gt;"; }else{ $positionname = ''; } //--------------------------------------- $opall=1; if(is_array($seltypeids)){ $optionarr = GetTypeidSel('form3','cid','selbt1',0,$seltypeids['ID'],$seltypeids['typename']); }else{ $optionarr = GetTypeidSel('form3','cid','selbt1',0,0,'请选择栏目...'); } if($channelid==0) $whereSql = " where a.channelid > 0 "; else $whereSql = " where a.channelid = '$channelid' "; if($ismember==1) $whereSql .= " And a.mid > 0 "; if(!empty($memberid)) $whereSql .= " And a.mid = '$memberid' "; else $memberid = 0; if(!empty($cids)){ $whereSql .= " And a.typeid in ($cids) "; } if($keyword!=""){ $whereSql .= " And a.title like '%$keyword%' "; } if($cid!=0){ $tlinkids = $tl->GetSunID($cid,'',0,true); if($tlinkids != -1){ $whereSql .= " And a.typeid in($tlinkids) "; } } if($adminid>0){ $whereSql .= " And a.adminid = '$adminid' "; } if($arcrank!=''){ $whereSql .= " And a.arcrank = '$arcrank' "; $CheckUserSend = "<input type='button' onClick=\"location='full_list.php?channelid=$channelid';\" value='所有文档' class='inputbut'>"; } else{ $whereSql .= " And a.arcrank >-1 "; $CheckUserSend = "<input type='button' onClick=\"location='full_list.php?arcrank=-1&channelid=$channelid';\" value='稿件审核' class='inputbut'>"; } if(empty($orderby)) $orderby = "aid"; $query = " select a.aid,a.adminid,a.typeid,a.uptime,a.channelid,a.arcrank,a.click,a.title,a.litpic,a.adminid,a.mid, t.typename,c.typename as channelname,adm.uname as adminname from `#@__full_search` a left join `#@__arctype` t on t.ID=a.typeid left join `#@__channeltype` c on c.ID=a.channelid left join `#@__admin` adm on adm.ID=a.adminid $whereSql order by a.aid desc "; $dsql = new DedeSql(false); $dlist = new DataList(); $dlist->pageSize = 20; $dlist->SetParameter("dopost","listArchives"); $dlist->SetParameter("keyword",$keyword); $dlist->SetParameter("adminid",$adminid); $dlist->SetParameter("memberid",$memberid); $dlist->SetParameter("cid",$cid); $dlist->SetParameter("arcrank",$arcrank); $dlist->SetParameter("channelid",$channelid); $dlist->SetParameter("ismember",$ismember); $dlist->SetParameter("orderby",$orderby); $dlist->SetSource($query); include_once(dirname(__FILE__)."/templets/full_list.htm"); $dlist->Close(); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/full_list.php
PHP
asf20
4,030
<?php require_once(dirname(__FILE__)."/config.php"); CheckPurview('temp_One'); require_once(dirname(__FILE__)."/../include/pub_datalist.php"); require_once(dirname(__FILE__)."/../include/inc_functions.php"); setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/"); function GetIsMake($im) { if($im==1) return "需编译"; else return "不编译"; } $sql = "Select aid,title,ismake,uptime,filename From #@__sgpage order by aid desc"; $dlist = new DataList(); $dlist->Init(); $dlist->SetSource($sql); $dlist->SetTemplet(dirname(__FILE__)."/templets/templets_one.htm"); $dlist->display(); $dlist->Close(); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/templets_one.php
PHP
asf20
652
<?php require_once(dirname(__FILE__)."/config.php"); CheckPurview('sys_StringMix'); if(empty($dopost)) $dopost = ""; if(empty($allsource)) $allsource = ""; else $allsource = stripslashes($allsource); $m_file = dirname(__FILE__)."/../include/data/downmix.php"; //保存 if($dopost=="save") { $fp = fopen($m_file,'w'); flock($fp,3); fwrite($fp,$allsource); fclose($fp); header("Content-Type: text/html; charset={$cfg_ver_lang}"); echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset={$cfg_ver_lang}\">\r\n"; echo "<script>alert('Save OK!');</script>"; } //读出 if(empty($allsource)&&filesize($m_file)>0){ $fp = fopen($m_file,'r'); $allsource = fread($fp,filesize($m_file)); fclose($fp); } require_once(dirname(__FILE__)."/templets/article_string_mix.htm"); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/article_string_mix.php
PHP
asf20
850
<?php require(dirname(__FILE__)."/config.php"); CheckPurview('co_NewRule'); if(empty($action)) $action = ""; if($action=="save") { $notes = " {dede:note rulename=\\'$rulename\\' etype=\\'$etype\\' tablename=\\'$tablename\\' autofield=\\'$autofield\\' synfield=\\'$synfield\\' channelid=\\'$channelid\\' /} "; for($i=1;$i<=50;$i++) { if( !isset(${"fieldname".$i}) ) break; $fieldname = ${"fieldname".$i}; $comment = ${"comment".$i}; $intable = ${"intable".$i}; $source = ${"source".$i}; $makevalue = ${"makevalue".$i}; $notes .= "{dede:field name=\\'$fieldname\\' comment=\\'$comment\\' intable=\\'$intable\\' source=\\'$source\\'}$makevalue{/dede:field}\r\n"; } $query = " Insert Into #@__co_exrule(channelid,rulename,etype,dtime,ruleset) Values('$channelid','$rulename','$etype','".time()."','$notes') "; $dsql = new DedeSql(false); $dsql->ExecuteNoneQuery($query); $dsql->Close(); ShowMsg("成功增加一个规则!","co_export_rule.php"); exit(); } else if($action=="hand") { if(empty($job)) $job=""; if($job=="") { require_once(dirname(__FILE__)."/../include/pub_oxwindow.php"); $wintitle = "数据导入规则"; $wecome_info = "<a href='co_export_rule.php'><u>数据导入规则</u></a>::导入文本配置"; $win = new OxWindow(); $win->Init("co_export_rule_add.php","js/blank.js","POST"); $win->AddHidden("job","yes"); $win->AddHidden("action",$action); $win->AddTitle("请在下面输入你要导入的文本配置:"); $win->AddMsgItem("<textarea name='notes' style='width:100%;height:300'></textarea>"); $winform = $win->GetWindow("ok"); $win->Display(); exit(); } else { require_once(dirname(__FILE__)."/../include/pub_dedetag.php"); $dtp = new DedeTagParse(); $dbnotes = $notes; $notes = stripslashes($notes); $dtp->LoadString($notes); if(!is_array($dtp->CTags)) { ShowMsg("该规则不合法,无法保存!","-1"); $dsql->Close(); exit(); } $noteinfos = $dtp->GetTagByName("note"); $query = " Insert Into #@__co_exrule(channelid,rulename,etype,dtime,ruleset) Values('".$noteinfos->GetAtt('channelid')."','".$noteinfos->GetAtt('rulename')."','".$noteinfos->GetAtt('etype')."','".time()."','$dbnotes') "; $dsql = new DedeSql(false); $dsql->ExecuteNoneQuery($query); $dsql->Close(); ShowMsg("成功导入一个规则!","co_export_rule.php"); exit(); } } require_once(dirname(__FILE__)."/templets/co_export_rule_add.htm"); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/co_export_rule_add.php
PHP
asf20
2,680
<?php require_once(dirname(__FILE__)."/config.php"); require_once(dirname(__FILE__)."/../include/pub_datalist_dm.php"); setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/"); function GetSta($sta) { if($sta==1) return "正常"; else return "<font color='red'>禁用</font>"; } function GetMan($sta) { if($sta==1) return "<u>禁用</u>"; else return "<u>启用</u>"; } if(empty($keywords)) $keywords = ""; $sql = "Select * from #@__keywords order by rank desc"; $dlist = new DataList(); $dlist->Init(); $dlist->pageSize = 300; $dlist->SetParameter("f",$f); $dlist->SetSource($sql); include(dirname(__FILE__)."/templets/article_keywords_select.htm"); $dlist->Close(); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/article_keywords_select.php
PHP
asf20
727
<?php require_once(dirname(__FILE__)."/config.php"); require_once(dirname(__FILE__)."/../include/inc_type_tree.php"); if(empty($c)) $c = 0; if(empty($opall)) $opall=false; else $opall = true; $userChannel = $cuserLogin->getUserChannel(); ?> <html> <head> <meta http-equiv='Content-Type' content='text/html; charset=utf-8'> <title>栏目选择</title> <link href='base.css' rel='stylesheet' type='text/css'> <script language="javascript" src="../include/dedeajax2.js"></script> <script language="javascript"> function LoadSuns(ctid,tid,c) { if($DE(ctid).innerHTML.length < 10){ var myajax = new DedeAjax($DE(ctid),true,true,'','没子栏目','...'); myajax.SendGet('catalog_do.php?opall=<?php echo $opall?>&dopost=GetSunListsTree&c='+c+'&cid='+tid); }else{ if(document.all) showHide(ctid); } } function showHide(objname) { if($DE(objname).style.display=="none") $DE(objname).style.display = "block"; else $DE(objname).style.display="none"; return false; } function ReSel(ctid,cname){ if($DE('selid'+ctid).checked){ window.opener.document.<?php echo $f; ?>.<?php echo $v; ?>.value=ctid; window.opener.document.<?php echo $f?>.<?php echo $bt?>.value=cname; if(document.all) window.opener=true; window.close(); } } </script> <style> div,dd{ margin:0px; padding:0px } .dlf { margin-right:3px; margin-left:6px; margin-top:2px; float:left } .dlr { float:left } .topcc{ margin-top:5px } .suncc{ margin-bottom:3px } dl{ clear:left; margin:0px; padding:0px } .sunct{ } #items1{ border-bottom: 1px solid #3885AC; border-left: 1px solid #2FA1DB; border-right: 1px solid #2FA1DB; } .sunlist{ width:100%; padding-left:0px; margin:0px; clear:left } .tdborder{ border-left: 1px solid #43938B; border-right: 1px solid #43938B; border-bottom: 1px solid #43938B; } .tdline-left{ border-bottom: 1px solid #656363; border-left: 1px solid #788C47; } .tdline-right{ border-bottom: 1px solid #656363; border-right: 1px solid #788C47; } .tdrl{ border-left: 1px solid #788C47; border-right: 1px solid #788C47; } .top{cursor: hand;} body { scrollbar-base-color:#bae87c; scrollbar-arrow-color:#FFFFFF; scrollbar-shadow-color:#c1ea8b } </style> </head> <base target="main"> <body leftmargin="0" bgcolor="#007400" topmargin="3" target="main"> <table width='98%' border='0' align='center' cellpadding='0' cellspacing='0'> <tr> <td height='24' background='img/mtbg1.gif' style='border-left: 1px solid #2FA1DB; border-right: 1px solid #2FA1DB;'>  <strong>√请在要选择的栏目打勾</strong> <input type='checkbox' name='nsel' id='selid0' class='np' onClick="ReSel(0,'请选择...')">不限栏目 </td> </tr> <tr bgcolor='#EEFAFE'> <td align='center' bgcolor="#eefef0" id='items1'> <?php $tu = new TypeTree($userChannel); $tu->ListAllType(0,$opall,$c); $tu->Close(); ?> </td> </tr> </table> </body> </html>
zyyhong
trunk/jiaju001/news/lic/catalog_tree.php
PHP
asf20
2,979
<?php require_once(dirname(__FILE__)."/config.php"); require_once(dirname(__FILE__)."/../include/inc_typeunit_admin.php"); $userChannel = $cuserLogin->getUserChannel(); require_once(dirname(__FILE__)."/templets/catalog_main.htm"); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/catalog_main.php
PHP
asf20
255
<?php require(dirname(__FILE__)."/config.php"); CheckPurview('plus_广告管理'); require_once(dirname(__FILE__)."/../include/inc_typelink.php"); if(empty($dopost)) $dopost = ""; $aid = ereg_replace("[^0-9]","",$aid); if( empty($_COOKIE['ENV_GOBACK_URL']) ) $ENV_GOBACK_URL = "ad_main.php"; else $ENV_GOBACK_URL = $_COOKIE['ENV_GOBACK_URL']; ////////////////////////////////////////// if($dopost=="delete") { $dsql = new DedeSql(false); $dsql->SetQuery("Delete From #@__myad where aid='$aid'"); $dsql->ExecuteNoneQuery(); $dsql->Close(); ShowMsg("成功删除一则广告代码!",$ENV_GOBACK_URL); exit(); } else if($dopost=="getjs") { require_once(dirname(__FILE__)."/../include/pub_oxwindow.php"); $jscode = "<script src='{$cfg_plus_dir}/ad_js.php?aid=$aid' language='javascript'></script>"; $showhtml = "<xmp style='color:#333333;background-color:#ffffff'>\r\n\r\n$jscode\r\n\r\n</xmp>"; $showhtml .= "预览:<iframe name='testfrm' frameborder='0' src='ad_edit.php?aid={$aid}&dopost=testjs' id='testfrm' width='100%' height='200'></iframe>"; $wintitle = "广告管理-获取JS"; $wecome_info = "<a href='ad_main.php'><u>广告管理</u></a>::获取JS"; $win = new OxWindow(); $win->Init(); $win->AddTitle("以下为选定广告的JS调用代码:"); $winform = $win->GetWindow("hand",$showhtml); $win->Display(); exit(); } else if($dopost=="testjs") { header("Content-Type: text/html; charset={$cfg_ver_lang}"); echo "<script src='{$cfg_plus_dir}/ad_js.php?aid=$aid' language='javascript'></script>"; exit(); } else if($dopost=="saveedit") { $dsql = new DedeSql(false); $starttime = GetMkTime($starttime); $endtime = GetMkTime($endtime); $query = " Update #@__myad set typeid='$typeid', adname='$adname', timeset='$timeset', starttime='$starttime', endtime='$endtime', normbody='$normbody', expbody='$expbody' where aid='$aid' "; $dsql->SetQuery($query); $dsql->ExecuteNoneQuery(); $dsql->Close(); ShowMsg("成功更改一则广告代码!",$ENV_GOBACK_URL); exit(); } $dsql = new DedeSql(false); $row = $dsql->GetOne("Select * From #@__myad where aid='$aid'"); ClearAllLink(); require_once(dirname(__FILE__)."/templets/ad_edit.htm"); ?>
zyyhong
trunk/jiaju001/news/lic/ad_edit.php
PHP
asf20
2,272
<?php require_once(dirname(__FILE__)."/config.php"); require_once(DEDEADMIN."/inc/inc_catalog_options.php"); require_once(DEDEADMIN."/inc/inc_archives_functions.php"); if(empty($channelid)) $channelid=1; if(empty($cid)) $cid = 0; $dsql = new DedeSql(false); if($cid>0) { $query = "Select t.typename as arctypename,c.* From #@__arctype t left join #@__channeltype c on c.ID=t.channeltype where t.ID='$cid' "; $cInfos = $dsql->GetOne($query); $channelid = $cInfos['ID']; $addtable = $cInfos['addtable']; } else if($channelid>0) { $query = " Select * From #@__channeltype where ID='$channelid'"; $cInfos = $dsql->GetOne($query); $channelid = $cInfos['ID']; $addtable = $cInfos['addtable']; } require_once(dirname(__FILE__)."/templets/article_add.htm"); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/article_add.php
PHP
asf20
816
<?php require_once(dirname(__FILE__)."/config.php"); require_once(dirname(__FILE__)."/templets/member_password.htm"); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/member_password.php
PHP
asf20
143
.nbt{ font:12px 宋体; padding: 1px 3px 0 3px ; vertical-align:middle ; margin-bottom:1px; border:3px double #5F93CD; background:#B5E8FB; height:21px ; } .htable{ border-bottom:1px solid #95D2F0 } .np{ border:none } .linerow{border-bottom: 1px solid #ACACAC;} .coolbg { padding:1px; border-right: 2px solid #548FCB; border-bottom: 2px solid #548FCB; background-color: #B5E8FB; } .coolbg2 { border: 1px solid #000000; background-color: #DFDDD2; height:18px } .bline {border-bottom: 1px solid #B9CEBA;background-color: #FFFFFF} .bline2 {border-bottom: 1px solid #BCBCBC;} .coolbt { border-left: 2px solid #EFEFEF; border-top: 2px solid #EFEFEF; border-right: 2px solid #ACACAC; border-bottom: 2px solid #ACACAC; background-color: #E4F7D7 } .coolbg3 { border: 1px solid #BDC5B4; background-color: #DFDDD2; height:20px; width:140px; text-align:right; } .coolbg4 { border-bottom: 1px solid #C9CFC1; background-color: #EDEBE5; height:20px; width:190px; text-align:right; } .coolbg5 { border-top: 1px solid #BDC5B4; background-color: #EDEBE5; font-size:1pt; height:6px; width:190px; } .dlg { border: 2px solid #B6C0B7; background-color: #F0FAEB; width:200px; padding-top:2px; padding-left:4px; } #_mysource{ z-index:5000; } #_mywriter{ z-index:6000; } .option1{ background-color: #DCECA6; } .option2{ background-color: #F7FBD2; } .option3{ background-color: #FFFFFF; } .ininput{ width:96%; height:20px; border:1px solid #ffffff; } .fl{ float:left; margin-right:6px; }
zyyhong
trunk/jiaju001/news/lic/form_new.css
CSS
asf20
1,615
<?php require(dirname(__FILE__)."/config.php"); CheckPurview('plus_投票模块'); require_once(dirname(__FILE__)."/../include/pub_dedetag.php"); if(empty($dopost)) $dopost=""; if(empty($aid)) $aid=""; $aid = trim(ereg_replace("[^0-9]","",$aid)); if($aid==""){ ShowMsg('你没有指定投票ID!','-1'); exit(); } if(!empty($_COOKIE['ENV_GOBACK_URL'])) $ENV_GOBACK_URL = $_COOKIE['ENV_GOBACK_URL']; else $ENV_GOBACK_URL = "vote_main.php"; /////////////////////////////////////// if($dopost=="delete") { $dsql = new DedeSql(false); $dsql->SetQuery("Delete From #@__vote where aid='$aid'"); $dsql->ExecuteNoneQuery(); $dsql->Close(); ShowMsg('成功删除一组投票!',$ENV_GOBACK_URL); exit(); } else if($dopost=="saveedit") { $dsql = new DedeSql(false); $starttime = GetMkTime($starttime); $endtime = GetMkTime($endtime); $query = "Update #@__vote set votename='$votename', starttime='$starttime', endtime='$endtime', totalcount='$totalcount', ismore='$ismore', votenote='$votenote' where aid='$aid'"; $dsql->SetQuery($query); $dsql->ExecuteNoneQuery(); $dsql->Close(); ShowMsg('成功更改一组投票!',$ENV_GOBACK_URL); exit(); } $dsql = new DedeSql(false); $row = $dsql->GetOne("Select * From #@__vote where aid='$aid'"); require_once(dirname(__FILE__)."/templets/vote_edit.htm"); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/vote_edit.php
PHP
asf20
1,377
<?php require_once(dirname(__FILE__)."/config.php"); require_once(dirname(__FILE__)."/../include/inc_typeunit_menu.php"); $userChannel = $cuserLogin->getUserChannel(); ?> <html> <head> <meta http-equiv='Content-Type' content='text/html; charset=utf-8'> <title>类别管理</title> <link href="css_menu.css" rel="stylesheet" type="text/css" /> <link href='base.css' rel='stylesheet' type='text/css'> <script language="javascript" src="js/context_menu.js"></script> <script language="javascript" src="js/ieemu.js"></script> <script language="javascript" src="../include/dedeajax2.js"></script> <script language="javascript"> function LoadSuns(ctid,tid) { if($DE(ctid).innerHTML.length < 10){ var myajax = new DedeAjax($DE(ctid),true,true,'','x','...'); myajax.SendGet('catalog_do.php?dopost=GetSunListsMenu&cid='+tid); } else{ if(document.all) showHide(ctid); } } function showHide(objname) { if($DE(objname).style.display=="none") $DE(objname).style.display = "block"; else $DE(objname).style.display="none"; return false; } if(moz) { extendEventObject(); extendElementModel(); emulateAttachEvent(); } //互动栏目 function CommonMenuWd(obj,tid,tname) { var eobj,popupoptions popupoptions = [ new ContextItem("增加内容",function(){top.document.frames['main'].location="catalog_do.php?cid="+tid+"&dopost=addArchives";}), new ContextItem("管理内容",function(){top.document.frames['main'].location="catalog_do.php?cid="+tid+"&dopost=listArchives";}), new ContextSeperator(), new ContextItem("预览分类",function(){ window.open("<?php echo $cfg_plus_dir?>/list.php?tid="+tid); }), new ContextItem("增加子类",function(){top.document.frames['main'].location="catalog_add.php?ID="+tid;}), new ContextItem("更改栏目",function(){top.document.frames['main'].location="catalog_edit.php?ID="+tid;}), new ContextSeperator(), new ContextItem("移动栏目",function(){top.document.frames['main'].location='catalog_move.php?job=movelist&typeid='+tid}), new ContextItem("删除栏目",function(){top.document.frames['main'].location="catalog_del.php?ID="+tid+"&typeoldname="+tname;}) ] ContextMenu.display(popupoptions) } //普通栏目 function CommonMenu(obj,tid,tname) { var eobj,popupoptions popupoptions = [ new ContextItem("增加内容",function(){top.document.frames['main'].location="catalog_do.php?cid="+tid+"&dopost=addArchives";}), new ContextItem("管理内容",function(){top.document.frames['main'].location="catalog_do.php?cid="+tid+"&dopost=listArchives";}), new ContextSeperator(), new ContextItem("预览分类",function(){ window.open("<?php echo $cfg_plus_dir?>/list.php?tid="+tid); }), new ContextItem("更新HTML",function(){ top.document.frames['main'].location="makehtml_list.php?cid="+tid; }), new ContextItem("获取JS文件",function(){ top.document.frames['main'].location="catalog_do.php?cid="+tid+"&dopost=GetJs"; }), new ContextSeperator(), new ContextItem("增加子类",function(){top.document.frames['main'].location="catalog_add.php?ID="+tid;}), new ContextItem("更改栏目",function(){top.document.frames['main'].location="catalog_edit.php?ID="+tid;}), new ContextSeperator(), new ContextItem("移动栏目",function(){top.document.frames['main'].location='catalog_move.php?job=movelist&typeid='+tid}), new ContextItem("删除栏目",function(){top.document.frames['main'].location="catalog_del.php?ID="+tid+"&typeoldname="+tname;}) ] ContextMenu.display(popupoptions) } //封面模板 function CommonMenuPart(obj,tid,tname) { var eobj,popupoptions popupoptions = [ new ContextItem("增加内容",function(){top.document.frames['main'].location="catalog_do.php?cid="+tid+"&dopost=addArchives";}), new ContextItem("管理内容",function(){top.document.frames['main'].location="catalog_do.php?cid="+tid+"&dopost=listArchives";}), new ContextSeperator(), new ContextItem("预览分类",function(){ window.open("<?php echo $cfg_plus_dir?>/list.php?tid="+tid); }), new ContextItem("更新HTML",function(){ top.document.frames['main'].location="makehtml_list.php?cid="+tid; }), new ContextItem("获取JS文件",function(){ top.document.frames['main'].location="catalog_do.php?cid="+tid+"&dopost=GetJs"; }), new ContextSeperator(), new ContextItem("增加子类",function(){top.document.frames['main'].location="catalog_add.php?ID="+tid;}), new ContextItem("更改栏目",function(){top.document.frames['main'].location="catalog_edit.php?ID="+tid;}), new ContextSeperator(), new ContextItem("移动栏目",function(){top.document.frames['main'].location='catalog_move.php?job=movelist&typeid='+tid}), new ContextItem("删除栏目",function(){top.document.frames['main'].location="catalog_del.php?ID="+tid+"&typeoldname="+tname;}) ] ContextMenu.display(popupoptions) } //单个页面 function SingleMenu(obj,tid,tname) { var eobj,popupoptions popupoptions = [ new ContextItem("预览页面",function(){ window.open("catalog_do.php?cid="+tid+"&dopost=viewSgPage"); }), new ContextItem("编辑页面",function(){ top.document.frames['main'].location="catalog_do.php?cid="+tid+"&dopost=editSgPage"; }), new ContextItem("编辑模板",function(){ top.document.frames['main'].location="catalog_do.php?cid="+tid+"&dopost=editSgTemplet"; }), new ContextSeperator(), new ContextItem("更改栏目",function(){top.document.frames['main'].location="catalog_edit.php?ID="+tid;}), new ContextSeperator(), new ContextItem("移动栏目",function(){top.document.frames['main'].location='catalog_move.php?job=movelist&typeid='+tid}), new ContextItem("删除栏目",function(){top.document.frames['main'].location="catalog_del.php?ID="+tid+"&typeoldname="+tname;}) ] ContextMenu.display(popupoptions) } </script> <style> div,dd{ margin:0px; padding:0px } .dlf { margin-right:3px; margin-left:6px; margin-top:2px; float:left } .dlr { float:left } .topcc{ margin-top:5px } .suncc{ margin-bottom:3px } dl{ clear:left; margin:0px; padding:0px } .sunct{ } #items1{ border-bottom: 1px solid #3885AC; border-left: 1px solid #74c63f; border-right: 1px solid #74c63f; } .sunlist{ width:100%; padding-left:0px; margin:0px; clear:left } .tdborder{ border-left: 1px solid #43938B; border-right: 1px solid #43938B; border-bottom: 1px solid #43938B; } .tdline-left{ border-bottom: 1px solid #656363; border-left: 1px solid #788C47; } .tdline-right{ border-bottom: 1px solid #656363; border-right: 1px solid #788C47; } .tdrl{ border-left: 1px solid #788C47; border-right: 1px solid #788C47; } .top{cursor: hand;} body { scrollbar-base-color:#bae87c; scrollbar-arrow-color:#FFFFFF; scrollbar-shadow-color:#c1ea8b } </style> </head> <base target="main"> <body leftmargin="0" bgcolor="#007400" topmargin="3" target="main" onLoad="ContextMenu.intializeContextMenu()"> <table width='152' border='0' align='center' cellpadding='0' cellspacing='0'> <tr> <td height='32' colspan="2" align='center'> <form name="form1" target="main" action="public_guide.php"> <input type='hidden' name='action' value='edit'> </form> <form name="form2" target="main" action="catalog_main.php"></form> <input type="button" name="sb2" value="栏目管理" class="nbt" style="width:60px" onClick="document.form2.submit();"> <input type="button" name="sb1" value="发布向导" class="nbt" style="width:60px" onClick="document.form1.submit();"> </td> </tr> <tr> <td width="23%" height='24' align='center' background='img/mtbg1.gif' style='border-left: 1px solid #74c63f;'><a href="#" onClick="showHide('items1')" target="_self"><img src="img/mtimg1.gif" width="21" height="24" border="0"></a></td> <td width="77%" height='24' background='img/mtbg1.gif' style='border-right: 1px solid #74c63f;'>站点目录树</td> </tr> <tr bgcolor='#eefef0'> <td colspan='2' id='items1' align='center'> <?php if(empty($opendir)) $opendir=-1; if($userChannel>0) $opendir=$userChannel; $tu = new TypeUnit($userChannel); $tu->ListAllType($userChannel,$opendir); $tu->Close(); ?> </td> </tr> </table> </body> </html>
zyyhong
trunk/jiaju001/news/lic/catalog_menu.php
PHP
asf20
8,343
<?php require_once(dirname(__FILE__)."/config.php"); require_once(dirname(__FILE__)."/templets/article_keywords_make.htm"); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/article_keywords_make.php
PHP
asf20
149
<?php //--------------------- //文件管理逻辑类 //--------------------- /* function __FileManagement() */ class FileManagement { var $baseDir=""; var $activeDir=""; //是否允许文件管理器删除目录; //默认为不允许 0 ,如果希望可能管理整个目录,请把值设为 1 ; var $allowDeleteDir=0; //初始化系统 function Init() { global $cfg_basedir; global $activepath; $this->baseDir = $cfg_basedir; $this->activeDir = $activepath; } //更改文件名 function RenameFile($oldname,$newname) { $oldname = $this->baseDir.$this->activeDir."/".$oldname; $newname = $this->baseDir.$this->activeDir."/".$newname; if(($newname!=$oldname) && is_writable($oldname)){ rename($oldname,$newname); } ShowMsg("成功更改一个文件名!","file_manage_main.php?activepath=".$this->activeDir); return 0; } //创建新目录 function NewDir($dirname) { $newdir = $dirname; $dirname = $this->baseDir.$this->activeDir."/".$dirname; if(is_writable($this->baseDir.$this->activeDir)){ MkdirAll($dirname,$GLOBALS['cfg_dir_purview']); CloseFtp(); ShowMsg("成功创建一个新目录!","file_manage_main.php?activepath=".$this->activeDir."/".$newdir); return 1; } else{ ShowMsg("创建新目录失败,因为这个位置不允许写入!","file_manage_main.php?activepath=".$this->activeDir); return 0; } } //移动文件 function MoveFile($mfile,$mpath) { if($mpath!="" && !ereg("\.\.",$mpath)) { $oldfile = $this->baseDir.$this->activeDir."/$mfile"; $mpath = str_replace("\\","/",$mpath); $mpath = ereg_replace("/{1,}","/",$mpath); if(!ereg("^/",$mpath)){ $mpath = $this->activeDir."/".$mpath; } $truepath = $this->baseDir.$mpath; if(is_readable($oldfile) && is_readable($truepath) && is_writable($truepath)) { if(is_dir($truepath)) copy($oldfile,$truepath."/$mfile"); else{ MkdirAll($truepath,$GLOBALS['cfg_dir_purview']); CloseFtp(); copy($oldfile,$truepath."/$mfile"); } unlink($oldfile); ShowMsg("成功移动文件!","file_manage_main.php?activepath=$mpath",0,1000); return 1; } else { ShowMsg("移动文件 $oldfile -&gt; $truepath/$mfile 失败,可能是某个位置权限不足!","file_manage_main.php?activepath=$mpath",0,1000); return 0; } } else{ ShowMsg("对不起,你移动的路径不合法!","-1",0,5000); return 0; } } //删除目录 function RmDirFiles($indir) { $dh = dir($indir); while($filename = $dh->read()) { if($filename == "." || $filename == "..") continue; else if(is_file("$indir/$filename")) @unlink("$indir/$filename"); else $this->RmDirFiles("$indir/$filename"); } $dh->close(); @rmdir($indir); } //获得某目录合符规则的文件 function GetMatchFiles($indir,$fileexp,&$filearr) { $dh = dir($indir); while($filename = $dh->read()) { $truefile = $indir.'/'.$filename; if($filename == "." || $filename == ".."){ continue; } else if(is_dir($truefile)){ $this->GetMatchFiles($truefile,$fileexp,$filearr); } else if(preg_match("/\.(".$fileexp.")/i",$filename)){ $filearr[] = $truefile; } } $dh->close(); } //删除文件 function DeleteFile($filename) { $filename = $this->baseDir.$this->activeDir."/$filename"; if(is_file($filename)){ @unlink($filename); $t="文件"; } else{ $t = "目录"; if($this->allowDeleteDir==1) $this->RmDirFiles($filename); } ShowMsg("成功删除一个".$t."!","file_manage_main.php?activepath=".$this->activeDir); return 0; } } // //目录文件大小检测类 // /* function __SpaceUse() */ class SpaceUse { var $totalsize=0; function checksize($indir) { $dh=dir($indir); while($filename=$dh->read()) { if(!ereg("^\.",$filename)) { if(is_dir("$indir/$filename")) $this->checksize("$indir/$filename"); else $this->totalsize=$this->totalsize + filesize("$indir/$filename"); } } } function setkb($size) { $size=$size/1024; //$size=ceil($size); if($size>0) { list($t1,$t2)=explode(".",$size); $size=$t1.".".substr($t2,0,1); } return $size; } function setmb($size) { $size=$size/1024/1024; if($size>0) { list($t1,$t2)=explode(".",$size); $size=$t1.".".substr($t2,0,2); } return $size; } } ?>
zyyhong
trunk/jiaju001/news/lic/file_class.php
PHP
asf20
4,584
<?php require_once(dirname(__FILE__)."/config.php"); CheckPurview('sys_MakeHtml'); require_once(dirname(__FILE__)."/../include/inc_arcpart_view.php"); header("Content-Type: text/html; charset={$cfg_ver_lang}"); if(empty($typeid)) $typeid = 0; if(empty($templet)) $templet = "plus/js.htm"; if(empty($uptype)) $uptype = "all"; if($uptype == "all"){ $dsql = new DedeSql(false); $row = $dsql->GetOne("Select ID From #@__arctype where ID>'$typeid' And ispart<2 order by ID asc limit 0,1;"); $dsql->Close(); if(!is_array($row)){ echo "完成所有文件更新!"; exit(); } else{ $pv = new PartView($row['ID']); $pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$templet); $pv->SaveToHtml($cfg_basedir."/data/js/".$row['ID'].".js"); $pv->Close(); $typeid = $row['ID']; ShowMsg("成功更新"."/data/js/".$row['ID'].".js,继续进行操作!","makehtml_js_action.php?typeid=$typeid",0,100); exit(); } } else { $pv = new PartView($typeid); $pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$templet); $pv->SaveToHtml($cfg_basedir."/data/js/".$typeid.".js"); $pv->Close(); echo "成功更新"."/data/js/".$typeid.".js!"; echo "预览:"; echo "<hr>"; echo "<script src='../data/js/".$typeid.".js'></script>"; exit(); } ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/makehtml_js_action.php
PHP
asf20
1,336
<?php require_once(dirname(__FILE__)."/config.php"); CheckPurview('sys_User'); require_once(dirname(__FILE__)."/../include/pub_datalist.php"); setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/"); if(empty($rank)) $rank=""; else $rank = " where #@__admin.usertype='$rank' "; $dsql = new DedeSql(false); $dsql->SetQuery("select rank,typename From #@__admintype"); $dsql->Execute(); while($row = $dsql->GetObject()){ $adminRanks[$row->rank] = $row->typename; } function GetUserType($trank) { global $adminRanks; if(isset($adminRanks[$trank])) return $adminRanks[$trank]; else return "错误类型"; } $query = "Select #@__admin.*,#@__arctype.typename From #@__admin left join #@__arctype on #@__admin.typeid=#@__arctype.ID $rank "; $dlist = new DataList(); $dlist->SetTemplet(dirname(__FILE__)."/templets/sys_admin_user.htm"); $dlist->SetSource($query); $dlist->Display(); $dlist->Close(); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/sys_admin_user.php
PHP
asf20
940
<?php require_once(dirname(__FILE__)."/config.php"); require_once(dirname(__FILE__)."/../include/inc_typelink.php"); require_once(dirname(__FILE__)."/inc/inc_batchup.php"); $squery = "select aid from #@__addonarticle where body like '%/plus/img/etag.gif%' "; $dsql = new DedeSql(false); $dsql->SetQuery($squery); $dsql->Execute(); while($row = $dsql->GetArray()){ $aid = $row['aid']; DelArc($aid); header("Content-Type: text/html; charset={$cfg_ver_lang}"); echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset={$cfg_ver_lang}\">\r\n"; echo "删除 $aid OK<br>"; } ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/del-error-file.php
PHP
asf20
641
<?php require_once(dirname(__FILE__)."/config.php"); CheckPurview('sys_Feedback'); $ID = ereg_replace("[^0-9]","",$ID); if(empty($dopost)) $dopost = ""; if(empty($_COOKIE['ENV_GOBACK_URL'])) $ENV_GOBACK_URL="feedback_main.php"; else $ENV_GOBACK_URL = $_COOKIE['ENV_GOBACK_URL']; $dsql = new DedeSql(false); if($dopost=="edit") { $msg = cn_substr($msg,1500); $adminmsg = trim($adminmsg); if($adminmsg!="") { $adminmsg = cn_substr($adminmsg,1500); $adminmsg = str_replace("<","&lt;",$adminmsg); $adminmsg = str_replace(">","&gt;",$adminmsg); $adminmsg = str_replace(" ","&nbsp;&nbsp;",$adminmsg); $adminmsg = str_replace("\r\n","<br/>\n",$adminmsg); $msg = $msg."<br/>\n"."<font color=red>管理员回复: $adminmsg</font>\n"; } $query = "update #@__feedback set username='$username',msg='$msg',ischeck=1 where ID=$ID"; $dsql->SetQuery($query); $dsql->ExecuteNoneQuery(); $dsql->Close(); ShowMsg("成功回复一则留言!",$ENV_GOBACK_URL); exit(); } $query = "select * from #@__feedback where ID=$ID"; $dsql->SetQuery($query); $dsql->Execute(); $row = $dsql->GetObject(); require_once(dirname(__FILE__)."/templets/feedback_edit.htm"); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/feedback_edit.php
PHP
asf20
1,256
<?php require_once(dirname(__FILE__)."/config.php"); CheckPurview('pic_view'); if(empty($activepath)) $activepath=$cfg_medias_dir; $activepath = ereg_replace("/{1,}","/",$activepath); $truePath = $cfg_basedir.$activepath; $listSize=5; function GetPrePath($nowPath) { if($nowPath==""||$nowPath=="/") echo("当前为根目录\n"); else { $dirs = split("/",$nowPath); $nowPath = ""; for($i=1;$i<count($dirs)-1;$i++) { $nowPath .= "/".$dirs[$i]; } echo("<a href=\"pic_view.php?activepath=".$nowPath."\">转到上级目录</a>\n"); } } function ListPic($truePath,$nowPath) { global $listSize; $col=0; $rowdd=0; $rowdd++; $imgfile=""; $truePath = ereg_replace("/$","",ereg_replace("\\{1,}","/",trim($truePath))); $nowPath = ereg_replace("/$","",ereg_replace("/{1,}","/",trim($nowPath))); $dh = dir($truePath); echo("<tr align='center'>\n"); while($filename=$dh->read()) { if(!ereg("\.$",$filename)) { $fullName = $truePath."/".$filename; $fileUrl = $nowPath."/".$filename; if(is_dir($fullName)) { if($col%$listSize==0&&$col!=0) { echo("</tr>\n<tr align='center'>\n"); for($i=$rowdd-$listSize;$i<$rowdd;$i++) { echo("<td>".$filelist[$i]."</td>\n"); } echo("</tr>\n<tr align='center'>\n"); } $line = " <td> <table width='106' height='106' border='0' cellpadding='0' cellspacing='1' bgcolor='#CCCCCC'> <tr><td align='center' bgcolor='#FFFFFF'> <a href='pic_view.php?activepath=".$fileUrl."'> <img src='img/pic_dir.gif' width='44' height='42' border='0'> </a></td></tr></table></td>"; $filelist[$rowdd] = $filename; $col++; $rowdd++; echo $line; } else if(IsImg($filename)) { if($col%$listSize==0&&$col!=0) { echo("</tr>\n<tr align='center'>\n"); for($i=$rowdd-$listSize;$i<$rowdd;$i++) { echo("<td>".$filelist[$i]."</td>\n"); } echo("</tr>\n<tr align='center'>\n"); } $line = " <td> <table width='106' height='106' border='0' cellpadding='0' cellspacing='1' bgcolor='#CCCCCC'> <tr> <td align='center' bgcolor='#FFFFFF'> ".GetImgFile($truePath,$nowPath,$filename)." </td> </tr></table></td>"; $filelist[$rowdd] = $filename; $col++; $rowdd++; echo $line; } } } echo("</tr>\n"); if(!empty($filelist)) { echo("<tr align='center'>\n"); $t = ($rowdd-1)%$listSize; if($t==0) $t=$listSize; for($i=$rowdd-$t;$i<$rowdd;$i++) { echo("<td>".$filelist[$i]."</td>\n"); } echo("</tr>\n"); } } function GetImgFile($truePath,$nowPath,$fileName) { $toW=102; $toH=102; $srcFile = $truePath."/".$fileName; $info = ""; $data = GetImageSize($srcFile,$info); $srcW=$data[0]; $srcH=$data[1]; if($toW>=$srcW&&$toH>=$srcH) { $ftoW=$srcW; $ftoH=$srcH; } else { $toWH=$toW/$toH; $srcWH=$srcW/$srcH; if($toWH<=$srcWH) { $ftoW=$toW; $ftoH=$ftoW*($srcH/$srcW); } else { $ftoH=$toH; $ftoW=$ftoH*($srcW/$srcH); } } return("<a href='".$nowPath."/".$fileName."' target='_blank'><img src='".$nowPath."/".$fileName."' width='".$ftoW."' height='".$ftoH."' border='0'></a>"); } function IsImg($fileName) { if(ereg("\.(jpg|gif|png)$",$fileName)) return 1; else return 0; } require_once(dirname(__FILE__)."/templets/file_pic_view.htm"); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/file_pic_view.php
PHP
asf20
3,619
<?php require_once(dirname(__FILE__)."/config.php"); if(empty($dopost)) $dopost = ""; if(empty($ID)) $ID="0"; $ID = ereg_replace("[^0-9]","",$ID); //检查权限许可 CheckPurview('t_Edit,t_AccEdit'); //检查栏目操作许可 CheckCatalog($ID,"你无权更改本栏目!"); $dsql = new DedeSql(false); //---------------------------------- //保存改动 Action Save //----------------------------------- if($dopost=="save") { $description = Html2Text($description); $keywords = Html2Text($keywords); if($cfg_cmspath!='') $typedir = ereg_replace("^".$cfg_cmspath,"{cmspath}",$typedir); //else if(!eregi("{cmspath}",$typedir) && $moresite==0) $typedir = "{cmspath}".$typedir; //子分类 $sonlists = (empty($sonlists) ? '' : $sonlists); $smalltypes = ""; if(is_array($sonlists) && isset($needson)){ $n = count($sonlists); for($i=0;$i<$n;$i++){ if($i==($n-1)) $smalltypes .= $sonlists[$i]; else $smalltypes .= $sonlists[$i].","; } } if(empty($siterefer)) $siterefer=1; $upquery = " Update #@__arctype set sortrank='$sortrank', typename='$typename', typedir='$typedir', isdefault='$isdefault', defaultname='$defaultname', issend='$issend', channeltype='$channeltype', tempindex='$tempindex', templist='$templist', temparticle='$temparticle', tempone='$tempone', namerule='$namerule', namerule2='$namerule2', ispart='$ispart', corank='$corank', description='$description', keywords='$keywords', moresite='$moresite', siterefer='$siterefer', sitepath='$sitepath', siteurl='$siteurl', ishidden='$ishidden', smalltypes='$smalltypes' where ID='$ID'"; if(!$dsql->ExecuteNoneQuery($upquery)){ ShowMsg("保存当前栏目更改时失败,请检查你的输入资料是否存在问题!","-1"); exit(); } //更改本栏目文档的权限 if($corank != $corank_old){ $dsql->ExecuteNoneQuery("Update #@__archives set arcrank='$corank' where typeid='$ID' "); } //如果选择子栏目可投稿,更新顶级栏目及频道模型为可投稿 if($issend==1){ if($topID>0) $dsql->ExecuteNoneQuery("Update `#@__arctype` set issend='1' where ID='$topID'; "); $dsql->ExecuteNoneQuery("Update `#@__channeltype` set issend='1' where ID='$channeltype'; "); } //更新树形菜单 $rndtime = time(); $rflwft = " <script language='javascript'> <!-- if(window.navigator.userAgent.indexOf('MSIE')>=1){ if(top.document.frames.menu.location.href.indexOf('catalog_menu.php')>=1) { top.document.frames.menu.location = 'catalog_menu.php?$rndtime'; } }else{ if(top.document.getElementById('menu').src.indexOf('catalog_menu.php')>=1) { top.document.getElementById('menu').src = 'catalog_menu.php?$rndtime'; } } --> </script> "; //"------------------------------- //更改子栏目属性 if(!empty($upnext)) { require_once(dirname(__FILE__)."/../include/inc_typelink.php"); $tl = new TypeLink($ID); $slinks = $tl->GetSunID($ID,'###',0); $slinks = str_replace("###.typeid","ID",$slinks); $upquery = " Update #@__arctype set issend='$issend', defaultname='$defaultname', channeltype='$channeltype', tempindex='$tempindex', templist='$templist', temparticle='$temparticle', namerule='$namerule', namerule2='$namerule2', moresite='$moresite', siterefer='$siterefer', sitepath='$sitepath', siteurl='$siteurl', ishidden='$ishidden', smalltypes='$smalltypes' where 1=1 And $slinks"; if(!$dsql->ExecuteNoneQuery($upquery)){ echo $rflwft; ShowMsg("更改当前栏目成功,但更改下级栏目属性时失败!","-1"); exit(); } } //更新缓存 UpDateCatCache($dsql); $dsql->Close(); echo $rflwft; ShowMsg("成功更改一个分类!","catalog_main.php"); exit(); }//End Save Action $dsql->SetQuery("Select #@__arctype.*,#@__channeltype.typename as ctypename From #@__arctype left join #@__channeltype on #@__channeltype.ID=#@__arctype.channeltype where #@__arctype.ID=$ID"); $myrow = $dsql->GetOne(); $topID = $myrow['topID']; if($topID>0) { $toprow = $dsql->GetOne("Select moresite,siterefer,sitepath,siteurl From #@__arctype where ID=$topID"); foreach($toprow as $k=>$v){ if(!ereg("[0-9]",$k)) $myrow[$k] = $v; } } //读取频道模型信息 $channelid = $myrow['channeltype']; $row = $dsql->GetOne("select * from #@__channeltype where ID='$channelid'"); $nid = $row['nid']; //读取所有模型资料 $dsql->SetQuery("select * from #@__channeltype where ID<>-1 And isshow=1 order by ID"); $dsql->Execute(); while($row=$dsql->GetObject()) { $channelArray[$row->ID]['typename'] = $row->typename; $channelArray[$row->ID]['nid'] = $row->nid; } //父栏目是否为二级站点 if(!empty($myrow['moresite'])){ $moresite = $myrow['moresite']; }else{ $moresite = 0; } if($myrow['topID']==0){ PutCookie('lastCid',$ID,3600*24,"/"); } require_once(dirname(__FILE__)."/templets/catalog_edit.htm"); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/catalog_edit.php
PHP
asf20
5,404
<?php require_once(dirname(__FILE__)."/config.php"); require_once(dirname(__FILE__)."/../include/pub_datalist.php"); require_once(dirname(__FILE__)."/../include/inc_functions.php"); setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/"); $sql = ""; $sql = "Select aid,votename,starttime,endtime,totalcount From #@__vote order by aid desc"; $dlist = new DataList(); $dlist->Init(); $dlist->SetSource($sql); $dlist->SetTemplet(dirname(__FILE__)."/templets/vote_main.htm"); $dlist->display(); $dlist->Close(); ?>
zyyhong
trunk/jiaju001/news/lic/vote_main.php
PHP
asf20
528
<!-- self.onError=null; currentX = currentY = 0; whichIt = null; lastScrollX = 0; lastScrollY = 0; NS = (document.layers) ? 1 : 0; IE = (document.all) ? 1: 0; function heartBeat() { if(IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; } if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; } if(diffY != lastScrollY) { percent = .1 * (diffY - lastScrollY); if(percent > 0) percent = Math.ceil(percent); else percent = Math.floor(percent); if(IE) document.all.floater.style.pixelTop += percent; if(NS) document.floater.top += percent; lastScrollY = lastScrollY + percent; } if(diffX != lastScrollX) { percent = .1 * (diffX - lastScrollX); if(percent > 0) percent = Math.ceil(percent); else percent = Math.floor(percent); if(IE) document.all.floater.style.pixelLeft += percent; if(NS) document.floater.left += percent; lastScrollX = lastScrollX + percent; } } function checkFocus(x,y) { stalkerx = document.floater.pageX; stalkery = document.floater.pageY; stalkerwidth = document.floater.clip.width; stalkerheight = document.floater.clip.height; if( (x > stalkerx && x < (stalkerx+stalkerwidth)) && (y > stalkery && y < (stalkery+stalkerheight))) return true; else return false; } function grabIt(e) { if(IE) { whichIt = event.srcElement; while (whichIt.id.indexOf("floater") == -1) { whichIt = whichIt.parentElement; if (whichIt == null) { return true; } } whichIt.style.pixelLeft = whichIt.offsetLeft; whichIt.style.pixelTop = whichIt.offsetTop; currentX = (event.clientX + document.body.scrollLeft); currentY = (event.clientY + document.body.scrollTop); } else { window.captureEvents(Event.MOUSEMOVE); if(checkFocus (e.pageX,e.pageY)) { whichIt = document.floater; StalkerTouchedX = e.pageX-document.floater.pageX; StalkerTouchedY = e.pageY-document.floater.pageY; } } return true; } function moveIt(e) { if (whichIt == null) { return false; } if(IE) { newX = (event.clientX + document.body.scrollLeft); newY = (event.clientY + document.body.scrollTop); distanceX = (newX - currentX); distanceY = (newY - currentY); currentX = newX; currentY = newY; whichIt.style.pixelLeft += distanceX; whichIt.style.pixelTop += distanceY; if(whichIt.style.pixelTop < document.body.scrollTop) whichIt.style.pixelTop = document.body.scrollTop; if(whichIt.style.pixelLeft < document.body.scrollLeft) whichIt.style.pixelLeft = document.body.scrollLeft; if(whichIt.style.pixelLeft > document.body.offsetWidth - document.body.scrollLeft - whichIt.style.pixelWidth - 20) whichIt.style.pixelLeft = document.body.offsetWidth - whichIt.style.pixelWidth - 20; if(whichIt.style.pixelTop > document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5) whichIt.style.pixelTop = document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5; event.returnValue = false; } else { whichIt.moveTo(e.pageX-StalkerTouchedX,e.pageY-StalkerTouchedY); if(whichIt.left < 0+self.pageXOffset) whichIt.left = 0+self.pageXOffset; if(whichIt.top < 0+self.pageYOffset) whichIt.top = 0+self.pageYOffset; if( (whichIt.left + whichIt.clip.width) >= (window.innerWidth+self.pageXOffset-17)) whichIt.left = ((window.innerWidth+self.pageXOffset)-whichIt.clip.width)-17; if( (whichIt.top + whichIt.clip.height) >= (window.innerHeight+self.pageYOffset+50)) whichIt.top = ((window.innerHeight+self.pageYOffset)-whichIt.clip.height)-17; return false; } return false; } function dropIt() { whichIt = null; if(NS) window.releaseEvents (Event.MOUSEMOVE); return true; } if(NS) { window.captureEvents(Event.MOUSEUPEvent.MOUSEDOWN); window.onmousedown = grabIt; window.onmousemove = moveIt; window.onmouseup = dropIt; } if(IE) { document.onmousedown = grabIt; document.onmousemove = moveIt; document.onmouseup = dropIt; } if(NS || IE) action = window.setInterval("heartBeat()",1); -->
zyyhong
trunk/jiaju001/news/lic/js/float.js
JavaScript
asf20
4,203
var ie = document.all != null; var moz = !ie && document.getElementById != null && document.layers == null; /* * Extends the event object with srcElement, cancelBubble, returnValue, * fromElement and toElement */ function extendEventObject() { Event.prototype.__defineSetter__("returnValue", function (b) { if (!b) this.preventDefault(); }); Event.prototype.__defineSetter__("cancelBubble", function (b) { if (b) this.stopPropagation(); }); Event.prototype.__defineGetter__("srcElement", function () { var node = this.target; while (node.nodeType != 1) node = node.parentNode; return node; }); Event.prototype.__defineGetter__("fromElement", function () { var node; if (this.type == "mouseover") node = this.relatedTarget; else if (this.type == "mouseout") node = this.target; if (!node) return; while (node.nodeType != 1) node = node.parentNode; return node; }); Event.prototype.__defineGetter__("toElement", function () { var node; if (this.type == "mouseout") node = this.relatedTarget; else if (this.type == "mouseover") node = this.target; if (!node) return; while (node.nodeType != 1) node = node.parentNode; return node; }); Event.prototype.__defineGetter__("offsetX", function () { return this.layerX; }); Event.prototype.__defineGetter__("offsetY", function () { return this.layerY; }); } /* * Emulates element.attachEvent as well as detachEvent */ function emulateAttachEvent() { HTMLDocument.prototype.attachEvent = HTMLElement.prototype.attachEvent = function (sType, fHandler) { var shortTypeName = sType.replace(/on/, ""); fHandler._ieEmuEventHandler = function (e) { window.event = e; return fHandler(); }; this.addEventListener(shortTypeName, fHandler._ieEmuEventHandler, false); }; HTMLDocument.prototype.detachEvent = HTMLElement.prototype.detachEvent = function (sType, fHandler) { var shortTypeName = sType.replace(/on/, ""); if (typeof fHandler._ieEmuEventHandler == "function") this.removeEventListener(shortTypeName, fHandler._ieEmuEventHandler, false); else this.removeEventListener(shortTypeName, fHandler, true); }; } /* * This function binds the event object passed along in an * event to window.event */ function emulateEventHandlers(eventNames) { for (var i = 0; i < eventNames.length; i++) { document.addEventListener(eventNames[i], function (e) { window.event = e; }, true); // using capture } } /* * Simple emulation of document.all * this one is far from complete. Be cautious */ function emulateAllModel() { var allGetter = function () { var a = this.getElementsByTagName("*"); var node = this; a.tags = function (sTagName) { return node.getElementsByTagName(sTagName); }; return a; }; HTMLDocument.prototype.__defineGetter__("all", allGetter); HTMLElement.prototype.__defineGetter__("all", allGetter); } function extendElementModel() { HTMLElement.prototype.__defineGetter__("parentElement", function () { if (this.parentNode == this.ownerDocument) return null; return this.parentNode; }); HTMLElement.prototype.__defineGetter__("children", function () { var tmp = []; var j = 0; var n; for (var i = 0; i < this.childNodes.length; i++) { n = this.childNodes[i]; if (n.nodeType == 1) { tmp[j++] = n; if (n.name) { // named children if (!tmp[n.name]) tmp[n.name] = []; tmp[n.name][tmp[n.name].length] = n; } if (n.id) // child with id tmp[n.id] = n } } return tmp; }); HTMLElement.prototype.contains = function (oEl) { if (oEl == this) return true; if (oEl == null) return false; return this.contains(oEl.parentNode); }; } /* document.defaultView.getComputedStyle(el1,<BR>null).getPropertyValue('top'); */ function emulateCurrentStyle(properties) { HTMLElement.prototype.__defineGetter__("currentStyle", function () { var cs = {}; var el = this; for (var i = 0; i < properties.length; i++) { //cs.__defineGetter__(properties[i], function () { // window.status = "i: " + i ; // return document.defaultView.getComputedStyle(el, null).getPropertyValue(properties[i]); //}); cs.__defineGetter__(properties[i], encapsulateObjects(el, properties[i])); } return cs; }); } // used internally for emualteCurrentStyle function encapsulateObjects(el, sProperty) { return function () { return document.defaultView.getComputedStyle(el, null).getPropertyValue(sProperty); }; } function emulateHTMLModel() { // This function is used to generate a html string for the text properties/methods // It replaces '\n' with "<BR"> as well as fixes consecutive white spaces // It also repalaces some special characters function convertTextToHTML(s) { s = s.replace(/\&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\n/g, "<BR>"); while (/\s\s/.test(s)) s = s.replace(/\s\s/, "&nbsp; "); return s.replace(/\s/g, " "); } HTMLElement.prototype.insertAdjacentHTML = function (sWhere, sHTML) { var df; // : DocumentFragment var r = this.ownerDocument.createRange(); switch (String(sWhere).toLowerCase()) { case "beforebegin": r.setStartBefore(this); df = r.createContextualFragment(sHTML); this.parentNode.insertBefore(df, this); break; case "afterbegin": r.selectNodeContents(this); r.collapse(true); df = r.createContextualFragment(sHTML); this.insertBefore(df, this.firstChild); break; case "beforeend": r.selectNodeContents(this); r.collapse(false); df = r.createContextualFragment(sHTML); this.appendChild(df); break; case "afterend": r.setStartAfter(this); df = r.createContextualFragment(sHTML); this.parentNode.insertBefore(df, this.nextSibling); break; } }; HTMLElement.prototype.__defineSetter__("outerHTML", function (sHTML) { var r = this.ownerDocument.createRange(); r.setStartBefore(this); var df = r.createContextualFragment(sHTML); this.parentNode.replaceChild(df, this); return sHTML; }); HTMLElement.prototype.__defineGetter__("canHaveChildren", function () { switch (this.tagName) { case "AREA": case "BASE": case "BASEFONT": case "COL": case "FRAME": case "HR": case "IMG": case "BR": case "INPUT": case "ISINDEX": case "LINK": case "META": case "PARAM": return false; } return true; }); HTMLElement.prototype.__defineGetter__("outerHTML", function () { var attr, attrs = this.attributes; var str = "<" + this.tagName; for (var i = 0; i < attrs.length; i++) { attr = attrs[i]; if (attr.specified) str += " " + attr.name + '="' + attr.value + '"'; } if (!this.canHaveChildren) return str + ">"; return str + ">" + this.innerHTML + "</" + this.tagName + ">"; }); HTMLElement.prototype.__defineSetter__("innerText", function (sText) { this.innerHTML = convertTextToHTML(sText); return sText; }); var tmpGet; HTMLElement.prototype.__defineGetter__("innerText", tmpGet = function () { var r = this.ownerDocument.createRange(); r.selectNodeContents(this); return r.toString(); }); HTMLElement.prototype.__defineSetter__("outerText", function (sText) { this.outerHTML = convertTextToHTML(sText); return sText; }); HTMLElement.prototype.__defineGetter__("outerText", tmpGet); HTMLElement.prototype.insertAdjacentText = function (sWhere, sText) { this.insertAdjacentHTML(sWhere, convertTextToHTML(sText)); }; }
zyyhong
trunk/jiaju001/news/lic/js/ieemu.js
JavaScript
asf20
7,763
<!-- function CheckSubmit() { return true; } -->
zyyhong
trunk/jiaju001/news/lic/js/blank.js
JavaScript
asf20
55
var MenuWidth = 120; var ItemHeight = 16; var ItemNumber = 0; //WebFX右键菜单程序被织梦修改的项为: //增加了默认宽度和菜单高度的定义 //这样可以修正原来第一次载入时显示不正确的情况 ContextMenu.intializeContextMenu=function() { document.body.insertAdjacentHTML("BeforeEnd", '<iframe src="#" scrolling="no" class="WebFX-ContextMenu" marginwidth="0" marginheight="0" frameborder="0" style="position:absolute;display:none;z-index:50000000;" id="WebFX_PopUp"></iframe>'); WebFX_PopUp = self.frames["WebFX_PopUp"] WebFX_PopUpcss = document.getElementById("WebFX_PopUp") document.body.attachEvent("onmousedown",function(){WebFX_PopUpcss.style.display="none"}) WebFX_PopUpcss.onfocus = function(){WebFX_PopUpcss.style.display="inline"}; WebFX_PopUpcss.onblur = function(){WebFX_PopUpcss.style.display="none"}; self.attachEvent("onblur",function(){WebFX_PopUpcss.style.display="none"}) } function ContextSeperator(){} function ContextMenu(){} ContextMenu.showPopup=function(x,y) { WebFX_PopUpcss.style.display = "block" } ContextMenu.display=function(popupoptions,h) { var eobj,x,y; eobj = window.event; x = eobj.x; y = eobj.y /* not really sure why I had to pass window here it appears that an iframe inside a frames page will think that its parent is the frameset as opposed to the page it was created in... */ ContextMenu.populatePopup(popupoptions,window) ContextMenu.showPopup(x,y); ContextMenu.fixSize(); ContextMenu.fixPos(x,y); eobj.cancelBubble = true; eobj.returnValue = false; } //TODO ContextMenu.getScrollTop=function() { return document.body.scrollTop; //window.pageXOffset and window.pageYOffset for moz } ContextMenu.getScrollLeft=function() { return document.body.scrollLeft; } ContextMenu.fixPos=function(x,y) { var docheight,docwidth,dh,dw; docheight = document.body.clientHeight; docwidth = document.body.clientWidth; dh = (WebFX_PopUpcss.offsetHeight+y) - docheight; dw = (WebFX_PopUpcss.offsetWidth+x) - docwidth; if(dw>0) { WebFX_PopUpcss.style.left = (x - dw) + ContextMenu.getScrollLeft() + "px"; } else { WebFX_PopUpcss.style.left = x + ContextMenu.getScrollLeft(); } // if(dh>0) { WebFX_PopUpcss.style.top = (y - dh) + ContextMenu.getScrollTop() + "px" } else { WebFX_PopUpcss.style.top = y + ContextMenu.getScrollTop(); } } ContextMenu.fixSize=function() { //这个方法是动态调整Iframe的宽度和高度,被织梦修改过 //var body; //WebFX_PopUpcss.style.width = "120px"; //body = WebFX_PopUp.document.body; //var dummy = WebFX_PopUpcss.offsetHeight + " dummy"; //h = body.scrollHeight + WebFX_PopUpcss.offsetHeight - body.clientHeight; //w = body.scrollWidth + WebFX_PopUpcss.offsetWidth - body.clientWidth; WebFX_PopUpcss.style.height = ItemHeight * ItemNember + "px"; WebFX_PopUpcss.style.width = MenuWidth + "px"; ItemNember = 0; } ContextMenu.populatePopup=function(arr,win) { var alen,i,tmpobj,doc,height,htmstr; alen = arr.length; ItemNember = alen; doc = WebFX_PopUp.document; doc.body.innerHTML = "" if (doc.getElementsByTagName("LINK").length == 0) { doc.open(); doc.write('<html><head><link rel="StyleSheet" type="text/css" href="js/contextmenu.css"></head><body></body></html>'); doc.close(); } for(i=0;i<alen;i++) { if(arr[i].constructor==ContextItem) { tmpobj=doc.createElement("DIV"); tmpobj.noWrap = true; tmpobj.className = "WebFX-ContextMenu-Item"; if(arr[i].disabled) { htmstr = '<span class="WebFX-ContextMenu-DisabledContainer">' htmstr += arr[i].text+'</span>' tmpobj.innerHTML = htmstr tmpobj.className = "WebFX-ContextMenu-Disabled"; tmpobj.onmouseover = function(){this.className="WebFX-ContextMenu-Disabled-Over"} tmpobj.onmouseout = function(){this.className="WebFX-ContextMenu-Disabled"} } else { tmpobj.innerHTML = arr[i].text; tmpobj.onclick = (function (f) { return function () { win.WebFX_PopUpcss.style.display='none' if (typeof(f)=="function"){ f(); } }; })(arr[i].action); tmpobj.onmouseover = function(){this.className="WebFX-ContextMenu-Over"} tmpobj.onmouseout = function(){this.className="WebFX-ContextMenu-Item"} } doc.body.appendChild(tmpobj); } else { doc.body.appendChild(doc.createElement("DIV")).className = "WebFX-ContextMenu-Separator"; } } doc.body.className = "WebFX-ContextMenu-Body" ; doc.body.onselectstart = function(){return false;} } function ContextItem(str,fnc,disabled) { this.text = str; this.action = fnc; this.disabled = disabled || false; }
zyyhong
trunk/jiaju001/news/lic/js/context_menu.js
JavaScript
asf20
4,804
.WebFX-ContextMenu { border: 0;/*2px outset;*/ width: 10px; } .WebFX-ContextMenu-Body { background-color: #EEFFEC; background-image:url('../img/mmenubg.gif?3'); margins: 0px; padding: 1px; border: 1px solid #E0E7C9; } .WebFX-ContextMenu-Separator { font-size: 0pt; border: 1px dotted #E0E7C9; height: 1px; overflow: hidden; margin: 3px 1px 3px 1px; } .WebFX-ContextMenu-Item { cursor: default; font: menu; color: MenuText; width: 100%; padding: 2px 20px 2px 16px; } .WebFX-ContextMenu-Over { cursor: default; background-color: highlight; font: menu; width: 100%; padding: 2px 20px 2px 16px; color: highlighttext; } .WebFX-ContextMenu-Disabled { cursor: default; font: menu; width: 100%; padding: 2px 20px 2px 16px; color:graytext; } .WebFX-ContextMenu-Disabled-Over { cursor: default; background-color: highlight; font: menu; width: 100%; padding: 2px 20px 2px 16px; color: graytext; } .WebFX-ContextMenu-Disabled-Over .WebFX-ContextMenu-DisabledContainer { display: block; width: 100%; vertical-align: center; } /*very nice hack by erik below */ .WebFX-ContextMenu-Disabled .WebFX-ContextMenu-DisabledContainer { display: block; background: GrayText; filter: chroma(color=#010101) dropshadow(color=ButtonHighlight, offx=1, offy=1); width: 100%; vertical-align: center; } .WebFX-ContextMenu-Disabled .WebFX-ContextMenu-DisabledContainer .WebFX-ContextMenu-DisabledContainer { background: Transparent; filter: gray() /* Remove all bright shades of gray */ chroma(color=#ffffff) chroma(color=#fefefe) chroma(color=#fdfdfd) chroma(color=#fcfcfc) chroma(color=#fbfbfb) chroma(color=#fafafa) chroma(color=#f9f9f9) chroma(color=#f8f8f8) chroma(color=#f7f7f7) chroma(color=#f6f6f6) chroma(color=#f5f5f5) chroma(color=#f4f4f4) chroma(color=#f3f3f3) mask(color=#010101); } .WebFX-ContextMenu-Disabled-Over .WebFX-ContextMenu-DisabledContainer .WebFX-ContextMenu-DisabledContainer { }
zyyhong
trunk/jiaju001/news/lic/js/contextmenu.css
CSS
asf20
2,113
<!-- function DedeAjax(WiteOKFunc){ //WiteOKFunc 为异步状态处理函数 //xmlhttp和xmldom对象 this.xhttp = null; this.xdom = null; //post或get发送数据的键值对 this.keys = Array(); this.values = Array(); this.keyCount = -1; //http请求头 this.rkeys = Array(); this.rvalues = Array(); this.rkeyCount = -1; //初始化xmlhttp if(window.XMLHttpRequest){//IE7, Mozilla ,Firefox 等浏览器内置该对象 this.xhttp = new XMLHttpRequest(); }else if(window.ActiveXObject){//IE6、IE5 try { this.xhttp = new ActiveXObject("Msxml2.XMLHTTP");} catch (e) { } if (this.xhttp == null) try { this.xhttp = new ActiveXObject("Microsoft.XMLHTTP");} catch (e) { } } this.xhttp.onreadystatechange = WiteOKFunc; //rs: responseBody、responseStream、responseXml、responseText //以下为成员函数 //-------------------------------- //初始化xmldom this.InitXDom = function(){ var obj = null; if (typeof(DOMParser) != "undefined") { // Gecko、Mozilla、Firefox var parser = new DOMParser(); obj = parser.parseFromString(xmlText, "text/xml"); } else { // IE try { obj = new ActiveXObject("MSXML2.DOMDocument");} catch (e) { } if (obj == null) try { obj = new ActiveXObject("Microsoft.XMLDOM"); } catch (e) { } } this.xdom = obj; }; //增加一个POST或GET键值 this.AddSendKey = function(skey,svalue){ this.keyCount++; this.keys[this.keyCount] = skey; this.values[this.keyCount] = escape(svalue); }; //增加一个Http请求头 this.AddHttpHead = function(skey,svalue){ this.rkeyCount++; this.rkeys[this.rkeyCount] = skey; this.rvalues[this.rkeyCount] = svalue; }; //清除当前对象的哈希表参数 this.ClearSet = function(){ this.keyCount = -1; this.keys = Array(); this.values = Array(); this.rkeyCount = -1; this.rkeys = Array(); this.rvalues = Array(); }; //用Post方式发送数据 this.SendPost = function(purl,ptype){ var pdata = ""; var httphead = ""; var i=0; this.state = 0; this.xhttp.open("POST", purl, true); if(this.rkeyCount!=-1){ //发送用户自行设定的请求头 for(;i<=this.rkeyCount;i++){ this.xhttp.setRequestHeader(this.rkeys[i],this.rvalues[i]); } }  if(ptype=="text") this.xhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");   if(this.keyCount!=-1){ //post数据 for(;i<=this.keyCount;i++){ if(pdata=="") pdata = this.keys[i]+'='+this.values[i]; else pdata += "&"+this.keys[i]+'='+this.values[i]; } } this.xhttp.send(pdata); }; } // End Class DedeAjax -->
zyyhong
trunk/jiaju001/news/lic/js/dedeajax.js
JavaScript
asf20
2,627
<?php require_once(dirname(__FILE__)."/config.php"); CheckPurview('sys_User'); require_once(dirname(__FILE__)."/../include/inc_typelink.php"); if(empty($dopost)) $dopost=""; if($dopost=="add") { if(ereg("[^0-9a-zA-Z_@!\.-]",$pwd)){ ShowMsg("用户密码不合法!","-1",0,300); exit(); } if(ereg("[^0-9a-zA-Z_@!\.-]",$userid)){ ShowMsg("用户名不合法!","-1",0,300); exit(); } $dsql = new DedeSql(false); $dsql->SetQuery("Select * from `#@__admin` where userid='$userid' Or uname='$uname'"); $dsql->Execute(); $ns = $dsql->GetTotalRow(); if($ns>0){ $dsql->Close(); ShowMsg("用户名或笔名已存在,不允许重复使用!","-1"); exit(); } $ks = Array(); foreach($typeid as $v){ $vs = explode('-',$v); if(isset($vs[1])) $t = $vs[1]; else $t = $vs[0]; if(!isset($ks[$vs[0]])) $ks[$t] = 1; } $typeid = ''; foreach($ks as $k=>$v){ if($k>0) $typeid .=($typeid=='' ? $k : ','.$k); } $inquery = " Insert Into #@__admin(usertype,userid,pwd,uname,typeid,tname,email) values('$usertype','$userid','".substr(md5($pwd),0,24)."','$uname','$typeid','$tname','$email') "; $dsql->ExecuteNoneQuery($inquery); $dsql->Close(); ShowMsg("成功增加一个用户!","sys_admin_user.php"); exit(); } $typeOptions = ""; $dsql = new DedeSql(false); require_once(dirname(__FILE__)."/templets/sys_admin_user_add.htm"); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/sys_admin_user_add.php
PHP
asf20
1,437
<?php require(dirname(__FILE__)."/config.php"); AjaxHead(); $t = $_GET['t']; if($t=='source') //来源列表 { $m_file = dirname(__FILE__)."/inc/source.txt"; $allsources = file($m_file); echo "<div class='coolbg4'>[<a href=\"javascript:OpenMyWin('article_source_edit.php')\">设置</a>]&nbsp;[<a href='#' onclick='javascript:HideObj(\"_mysource\")'>关闭</a>]</div>\r\n"; foreach($allsources as $v){ $v = trim($v); if($v!="") echo "<a href='#' onclick='javascript:PutSource(\"$v\")'>$v</a> | \r\n"; } echo "<span class='coolbg5'>&nbsp;</span>\r\n"; }else{ //作者列表 $m_file = dirname(__FILE__)."/inc/writer.txt"; echo "<div class='coolbg4'>[<a href=\"javascript:OpenMyWin('article_writer_edit.php')\">设置</a>]&nbsp;[<a href='#' onclick='javascript:HideObj(\"_mywriter\")'>关闭</a>]</div>\r\n"; if(filesize($m_file)>0){ $fp = fopen($m_file,'r'); $str = fread($fp,filesize($m_file)); fclose($fp); $strs = explode(',',$str); foreach($strs as $str){ $str = trim($str); if($str!="") echo "<a href='#' onclick='javascript:PutWriter(\"$str\")'>$str</a> | "; } } echo "<br><span class='coolbg5'>&nbsp;</span>\r\n"; } ?>
zyyhong
trunk/jiaju001/news/lic/article_select_sw.php
PHP
asf20
1,214
<?php require_once(dirname(__FILE__)."/config.php"); CheckPurview('c_FreeList'); if(!isset($types)) $types = ''; if(!isset($nodefault)) $nodefault = '0'; /*------------- function __AddNew() --------------*/ if($dopost=='addnew'){ $atts = " pagesize='$pagesize' col='$col' titlelen='$titlelen' orderby='$orderby' orderway='$order' "; $ntype = ''; $edtime = time(); if(empty($channel)) {showmsg('频道类型不能为空','-1');exit();} if(is_array($types)) foreach($types as $v) $ntype .= $v.' '; if($ntype!='') $atts .= " type='".trim($ntype)."' "; if(!empty($typeid)) $atts .= " typeid='$typeid' "; if(!empty($channel)) $atts .= " channel='$channel' "; if(!empty($subday)) $atts .= " subday='$subday' "; if(!empty($titlelen)) $atts .= " keyword='$keyword' "; if(!empty($att)) $atts .= " att='$att' "; $innertext = trim($innertext); if(!empty($innertext)) $innertext = stripslashes($innertext); $listTag = "{dede:list $atts}$innertext{/dede:list}"; $listTag = addslashes($listTag); $inquery = " INSERT INTO `#@__freelist`(`title` , `namerule` , `listdir` , `defaultpage` , `nodefault` , `templet` , `edtime` , `click` , `listtag` , `keyword` , `description`) VALUES ('$title','$namerule','$listdir','$defaultpage','$nodefault','$templet','$edtime','0','$listTag','$keyword','$description'); "; $dsql = new DedeSql(false); $dsql->ExecuteNoneQuery($inquery); $dsql->Close(); ShowMsg("成功增加一个自由列表!","freelist_main.php"); exit(); } /*------------- function __Edit() --------------*/ if($dopost=='edit'){ $atts = " pagesize='$pagesize' col='$col' titlelen='$titlelen' orderby='$orderby' orderway='$order' \r\n"; $ntype = ''; $edtime = time(); if(is_array($types)) foreach($types as $v) $ntype .= $v.' '; if($ntype!='') $atts .= " type='".trim($ntype)."' "; if(!empty($typeid)) $atts .= " typeid='$typeid' "; if(!empty($channel)) $atts .= " channel='$channel' "; if(!empty($subday)) $atts .= " subday='$subday' "; if(!empty($titlelen)) $atts .= " keyword='$keyword' "; if(!empty($att)) $atts .= " att='$att' "; $innertext = trim($innertext); if(!empty($innertext)) $innertext = stripslashes($innertext); $listTag = "{dede:list $atts}$innertext{/dede:list}"; $listTag = addslashes($listTag); $inquery = " Update `#@__freelist` set title='$title', namerule='$namerule', listdir='$listdir', defaultpage='$defaultpage', nodefault='$nodefault', templet='$templet', edtime='$edtime', listtag='$listTag', keyword='$keyword', description='$description' where aid='$aid'; "; $dsql = new DedeSql(false); $dsql->ExecuteNoneQuery($inquery); $dsql->Close(); ShowMsg("成功更改一个自由列表!","freelist_main.php"); exit(); } ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/freelist_action.php
PHP
asf20
2,897
<?php require_once(dirname(__FILE__)."/config.php"); CheckPurview('co_Export'); require_once(dirname(__FILE__)."/../include/pub_collection.php"); require_once(dirname(__FILE__)."/../include/pub_dedetag.php"); require_once(dirname(__FILE__)."/inc/inc_catalog_options.php"); $dsql = new DedeSql(false); $mrow = $dsql->GetOne("Select count(*) as dd From #@__courl where nid='$nid'"); $totalcc = $mrow['dd']; $rrow = $dsql->GetOne("Select typeid From #@__conote where nid='$nid'"); $ruleid = $rrow['typeid']; $rrow = $dsql->GetOne("Select channelid From #@__co_exrule where aid='$ruleid'"); $channelid = $rrow['channelid']; require_once(dirname(__FILE__)."/templets/co_export.htm"); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/co_export.php
PHP
asf20
717
<?php require_once(dirname(__FILE__)."/config.php"); require_once(dirname(__FILE__)."/../include/inc_channel_unit_functions.php"); $action = (empty($action) ? '' : $action); //优化数据 function OptimizeData($dsql) { global $cfg_dbprefix; $tptables = array("{$cfg_dbprefix}full_search","{$cfg_dbprefix}cache_tagindex","{$cfg_dbprefix}cache_value"); $dsql->SetQuery("Select maintable,addtable From `#@__channeltype` "); $dsql->Execute(); while($row = $dsql->GetObject()){ $maintable = str_replace('#@__',$cfg_dbprefix,$row->maintable); $addtable = str_replace('#@__',$cfg_dbprefix,$row->addtable); if($maintable!='' && !in_array($maintable,$tptables)) $tptables[] = $maintable; if($addtable!='' && !in_array($addtable,$tptables)) $tptables[] = $addtable; } $tptable = ''; foreach($tptables as $t){ $tptable .= ($tptable=='' ? "`{$t}`" : ",`{$t}`" ); } $dsql->ExecuteNoneQuery(" OPTIMIZE TABLE $tptable; "); } if($action==''){ require_once(dirname(__FILE__)."/templets/makehtml_all.htm"); ClearAllLink(); exit(); } /*----------- function _0_mskeStart() -----------*/ else if($action=='make') { //step = 1 更新主页、step = 2 更新内容、step = 3 更新栏目 if(empty($step)) $step = 1; //更新主页 /*------------------------- function _1_MakeHomePage() -------------------*/ if($step==1) { include_once(DEDEADMIN."/../include/inc_arcpart_view.php"); $starttime = GetMkTime($starttime); $mkvalue = ($uptype=='time' ? $starttime : $startid); $pv = new PartView(); $row = $pv->dsql->GetOne("Select * From #@__homepageset"); $templet = str_replace("{style}",$cfg_df_style,$row['templet']); $homeFile = dirname(__FILE__)."/".$row['position']; $homeFile = str_replace("\\","/",$homeFile); $homeFile = str_replace("//","/",$homeFile); $fp = fopen($homeFile,"w") or die("主页文件:{$homeFile} 没有写权限!"); fclose($fp); $pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$templet); $pv->SaveToHtml($homeFile); $pv->Close(); ShowMsg("更新主页成功,现在开始更新文档页!","makehtml_all.php?action=make&step=2&uptype={$uptype}&mkvalue={$mkvalue}"); ClearAllLink(); exit(); } //更新文档前优化数据 /*------------------- function _2_OptimizeData1() ---------------------*/ else if($step==2) { $dsql = new DedeSql(false); OptimizeData($dsql); ClearAllLink(); ShowMsg("完成数据优化,现在开始更新文档页!","makehtml_all.php?action=make&step=3&uptype={$uptype}&mkvalue={$mkvalue}"); exit(); } //更新文档 /*------------------- function _3_MakeArchives() ---------------------*/ else if($step==3) { include_once(dirname(__FILE__)."/makehtml_archives_action.php"); ClearAllLink(); exit(); } //更新栏目 /*------------------- function _4_MakeCatalog() --------------------*/ else if($step==4) { $dsql = new DedeSql(false); $mkvalue = intval($mkvalue); $typeids = array(); $adminID = $cuserLogin->getUserID(); $mkcachefile = DEDEADMIN."/../data/mkall_cache_{$adminID}.php"; if($mkvalue<=0) { $dsql->SetQuery("Select ID From `#@__arctype` "); $dsql->Execute(); while($row = $dsql->GetArray()) $typeids[] = $row['ID']; }else { if($uptype=='time') $query = "Select typeid From `#@__full_search` where uptime>='{$mkvalue}' group by typeid"; else $query = "Select typeid From `#@__full_search` where aid>='{$mkvalue}' group by typeid"; $dsql->SetQuery($query); $dsql->Execute(); while($row = $dsql->GetArray()){ if(!isset($typeids[$row['typeid']])) $typeids[$row['typeid']] = 1; } foreach($typeids as $v){ $vs = SpGetTopIDS($v); foreach($vs as $vv){ if(!isset($typeids[$vv])) $typeids[$row[$vv]] = 1; } } } $fp = fopen($mkcachefile,'w') or die("无法写入缓存文件:{$mkcachefile} 所以无法更新栏目!"); if(count($typeids)>0) { fwrite($fp,"<"."?php\r\n"); $i = -1; foreach($typeids as $k=>$t){ if($k!=''){ $i++; fwrite($fp,"\$idArray[$i]={$k};\r\n"); } } fwrite($fp,"?".">"); fclose($fp); ClearAllLink(); ShowMsg("完成栏目缓存处理,现转向更新栏目!","makehtml_list_action.php?gotype=mkall"); exit(); }else{ fclose($fp); ClearAllLink(); ShowMsg("没有可更新的栏目,现在作最后数据优化!","makehtml_all.php?action=make&step=10"); exit(); } } //成功状态 /*------------------- function _10_MakeAllOK() --------------------*/ else if($step==10) { $adminID = $cuserLogin->getUserID(); $mkcachefile = DEDEADMIN."/../data/mkall_cache_{$adminID}.php"; @unlink($mkcachefile); $dsql = new DedeSql(false); OptimizeData($dsql); ClearAllLink(); ShowMsg("完成所有文件的更新!","javascript:;"); exit(); }//make step } //action=='make' ClearAllLink(); exit(); ?>
zyyhong
trunk/jiaju001/news/lic/makehtml_all.php
PHP
asf20
4,856
<?php require(dirname(__FILE__)."/config.php"); CheckPurview('temp_Other'); require_once(dirname(__FILE__)."/../include/inc_typelink.php"); if(empty($dopost)) $dopost = ""; $aid = ereg_replace("[^0-9]","",$aid); if( empty($_COOKIE['ENV_GOBACK_URL']) ) $ENV_GOBACK_URL = "mytag_main.php"; else $ENV_GOBACK_URL = $_COOKIE['ENV_GOBACK_URL']; ////////////////////////////////////////// if($dopost=="delete") { $dsql = new DedeSql(false); $dsql->SetQuery("Delete From #@__mytag where aid='$aid'"); $dsql->ExecuteNoneQuery(); $dsql->Close(); ShowMsg("成功删除一个自定义标记!",$ENV_GOBACK_URL); exit(); } else if($dopost=="saveedit") { $dsql = new DedeSql(false); $starttime = GetMkTime($starttime); $endtime = GetMkTime($endtime); $query = " Update #@__mytag set typeid='$typeid', timeset='$timeset', starttime='$starttime', endtime='$endtime', normbody='$normbody', expbody='$expbody' where aid='$aid' "; $dsql->SetQuery($query); $dsql->ExecuteNoneQuery(); $dsql->Close(); ShowMsg("成功更改一个自定义标记!",$ENV_GOBACK_URL); exit(); } else if($dopost=="getjs") { require_once(dirname(__FILE__)."/../include/pub_oxwindow.php"); $jscode = "<script src='{$cfg_plus_dir}/mytag_js.php?aid=$aid' language='javascript'></script>"; $showhtml = "<xmp style='color:#333333;background-color:#ffffff'>\r\n\r\n$jscode\r\n\r\n</xmp>"; $showhtml .= "预览:<iframe name='testfrm' frameborder='0' src='mytag_edit.php?aid={$aid}&dopost=testjs' id='testfrm' width='100%' height='200'></iframe>"; $wintitle = "宏标记定义-获取JS"; $wecome_info = "<a href='ad_main.php'><u>宏标记定义</u></a>::获取JS"; $win = new OxWindow(); $win->Init(); $win->AddTitle("以下为选定宏标记的JS调用代码:"); $winform = $win->GetWindow("hand",$showhtml); $win->Display(); exit(); } else if($dopost=="testjs") { header("Content-Type: text/html; charset={$cfg_ver_lang}"); echo "<script src='{$cfg_plus_dir}/mytag_js.php?aid=$aid' language='javascript'></script>"; exit(); } $dsql = new DedeSql(false); $row = $dsql->GetOne("Select * From #@__mytag where aid='$aid'"); require_once(dirname(__FILE__)."/templets/mytag_edit.htm"); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/mytag_edit.php
PHP
asf20
2,281
<?php require_once(dirname(__FILE__)."/config.php"); CheckPurview('temp_Other'); //根据条件生成标记 $attlist = ""; $attlist .= ' row='.$row; $attlist .= ' titlelen='.$titlelen; if($orderby!='senddate') $attlist .= ' orderby='.$orderby; if($order!='desc') $attlist .= ' order='.$order; if($typeid>0) $attlist .= ' typeid='.$typeid; if($channel>0) $attlist .= ' channelid='.$channel; if($att>0) $attlist .= ' att='.$att; if($col>1) $attlist .= ' col='.$col; if($subday>0) $attlist .= ' subday='.$subday; if(!empty($types)){ $attlist .= " type='"; foreach($types as $v) $attlist .= $v.'.'; $attlist .= "'"; } $innertext = stripslashes($innertext); if($keyword!="") $attlist .= " keyword='$keyword'"; $fulltag = "{dede:arclist$attlist} $innertext {/dede:arclist}\r\n"; if($dopost=='savetag') { $dsql = new DedeSql(false); $fulltag = addslashes($fulltag); $tagname = "auto"; $inQuery = " Insert Into #@__mytag(typeid,tagname,timeset,starttime,endtime,normbody,expbody) Values('0','$tagname','0','0','0','$fulltag',''); "; $dsql->ExecuteNoneQuery($inQuery); $id = $dsql->GetLastID(); $dsql->ExecuteNoneQuery("Update #@__mytag set tagname='{$tagname}_{$id}' where aid='$id'"); $dsql->Close(); $fulltag = "{dede:mytag name='{$tagname}_{$id}' ismake='yes'/}"; } require_once(dirname(__FILE__)."/templets/mytag_tag_guide_ok.htm"); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/mytag_tag_guide_ok.php
PHP
asf20
1,415
<?php require_once(dirname(__FILE__)."/config.php"); require_once(dirname(__FILE__)."/../include/pub_datalist.php"); require_once(dirname(__FILE__)."/../include/inc_functions.php"); setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/"); function TestType($tname) { if($tname=="") return "所有栏目"; else return $tname; } function TimeSetValue($ts) { if($ts==0) return "不限时间"; else return "限时标记"; } $sql = "Select #@__myad.aid,#@__myad.tagname,#@__arctype.typename,#@__myad.adname,#@__myad.timeset,#@__myad.endtime From #@__myad left join #@__arctype on #@__arctype.ID=#@__myad.typeid order by #@__myad.aid desc "; $dlist = new DataList(); $dlist->Init(); $dlist->SetSource($sql); $dlist->SetTemplet(dirname(__FILE__)."/templets/ad_main.htm"); $dlist->display(); $dlist->Close(); ?>
zyyhong
trunk/jiaju001/news/lic/ad_main.php
PHP
asf20
844
<?php require_once(dirname(__FILE__)."/config.php"); require_once(dirname(__FILE__)."/../include/pub_datalist.php"); require_once(dirname(__FILE__)."/../include/inc_functions.php"); setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/"); function GetDatePage($mktime) { if($mktime=="0") return "从未采集过"; return strftime("%Y-%m-%d",$mktime); } $dsql = new DedeSql(false); $untjs = array(); function GetTJ($nid) { global $dsql; global $untjs; if(!isset($untjs[$nid])) { $dsql->SetSql("Select count(aid) as kk From #@__courl where nid='$nid'"); $dsql->Execute(); $row = $dsql->GetObject(); $kk = $row->kk; $untjs[$nid] = $kk." "; } return $untjs[$nid]; } $where = ""; if(!isset($typeid)) $typeid=""; if(!empty($typeid)) $where = " where #@__conote.typeid='$typeid' "; $sql = "Select #@__conote.nid,#@__conote.typeid,#@__conote.gathername,#@__conote.language,"; $sql .= "#@__conote.savetime,#@__conote.lasttime,#@__co_exrule.rulename as typename From #@__conote "; $sql .= "left join #@__co_exrule on #@__co_exrule.aid=#@__conote.typeid "; $sql .= " $where order by nid desc"; $dlist = new DataList(); $dlist->Init(); $dlist->SetParameter("typeid",$typeid); $dlist->SetSource($sql); $dlist->SetTemplet(dirname(__FILE__)."/templets/co_main.htm"); $dlist->display(); $dlist->Close(); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/co_main.php
PHP
asf20
1,376
<?php require_once(dirname(__FILE__)."/config.php"); CheckPurview('sys_Log'); require_once(dirname(__FILE__)."/../include/pub_datalist_dm.php"); require_once(dirname(__FILE__)."/../include/inc_functions.php"); setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/"); $where = ""; $sql = ""; $where = ""; if(empty($adminid)) $adminid = 0; if(empty($cip)) $cip = ""; if(empty($dtime)) $dtime = 0; if($adminid>0) $where .= " And #@__log.adminid='$adminid' "; if($cip!="") $where .= " And #@__log.cip like '%$cip%' "; if($dtime>0){ $nowtime = time(); $starttime = $nowtime - ($dtime*24*3600); $where .= " And #@__log.dtime>'$starttime' "; } $sql = "Select #@__log.*,#@__admin.userid From #@__log left join #@__admin on #@__admin.ID=#@__log.adminid where 1=1 $where order by #@__log.lid desc"; $adminlist = ""; $dsql = new DedeSql(false); $dsql->SetQuery("Select ID,uname From #@__admin"); $dsql->Execute('admin'); while($myrow = $dsql->GetObject('admin')){ $adminlist .="<option value='{$myrow->ID}'>{$myrow->uname}</option>\r\n"; } $dsql->Close(); $dlist = new DataList(); $dlist->Init(); $dlist->pageSize = 20; $dlist->SetParameter("adminid",$adminid); $dlist->SetParameter("cip",$cip); $dlist->SetParameter("dtime",$dtime); $dlist->SetSource($sql); include(dirname(__FILE__)."/templets/log_list.htm"); $dlist->Close(); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/log_list.php
PHP
asf20
1,412
<?php require(dirname(__FILE__)."/config.php"); CheckPurview('co_AddNote'); if(empty($job)) $job=""; if($job=="") { require_once(dirname(__FILE__)."/../include/pub_oxwindow.php"); $wintitle = "导入采集规则"; $wecome_info = "<a href='co_main.php'><u>采集点管理</u></a>::导入采集规则"; $win = new OxWindow(); $win->Init("co_get_corule.php","js/blank.js","POST"); $win->AddHidden("job","yes"); $win->AddTitle("请在下面输入你要导入的文本配置:"); $win->AddMsgItem("<textarea name='notes' style='width:100%;height:300px'></textarea>"); $winform = $win->GetWindow("ok"); $win->Display(); exit(); } else { CheckPurview('co_AddNote'); require_once(dirname(__FILE__)."/../include/pub_dedetag.php"); $dtp = new DedeTagParse(); $dbnotes = $notes; $notes = stripslashes($notes); $dtp->LoadString($notes); if(!is_array($dtp->CTags)) { ShowMsg("该规则不合法,无法保存!","-1"); $dsql->Close(); exit(); } $ctag = $dtp->GetTagByName("item"); $query = " INSERT INTO #@__conote(typeid,gathername,language,lasttime,savetime,noteinfo) VALUES('".$ctag->GetAtt('typeid')."', '".$ctag->GetAtt('name')."', '".$ctag->GetAtt('language')."', '0','".time()."', '".$dbnotes."'); "; $dsql = new DedeSql(false); $rs = $dsql->ExecuteNoneQuery($query); $dsql->Close(); ShowMsg("成功导入一个规则!","co_main.php"); exit(); } ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/co_get_corule.php
PHP
asf20
1,600
<?php require_once(dirname(__FILE__)."/config.php"); CheckPurview('member_List'); require_once(dirname(__FILE__)."/../include/pub_datalist.php"); require_once(dirname(__FILE__)."/../include/inc_functions.php"); setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/"); if(!isset($sex)) $sex = "0"; if($sex=="0") $sexform = "<option value='0'>性别</option>\r\n"; else $sexform = "<option value='$sex'>$sex</option>\r\n"; if(!isset($keyword)) $keyword = ""; else $keyword = trim($keyword); if(empty($sortkey)) $sortkey = "ID"; else $sortkey = eregi_replace("[^a-z]","",$sortkey); if($sortkey=="ID") $sortform = "<option value='ID'>ID/注册时间</option>\r\n"; else if($sortkey=="spaceshow") $sortform = "<option value='spaceshow'>空间访问量</option>\r\n"; else if($sortkey=="pageshow") $sortform = "<option value='pageshow'>文档总点击量</option>\r\n"; else $sortform = "<option value='logintime'>登录时间</option>\r\n"; $dsql = new DedeSql(false); $whereSql = 'where type=1'; if($sex=="0") $whereSql .= " and sex like '%%' "; else $whereSql .= " and sex like '$sex' "; if($keyword!=""){ $whereSql .= " And (userid like '%$keyword%' Or uname like '%$keyword%') "; } $attform = ""; if(!empty($att)){ if($att=="ad"){ $attform = "<option value='ad'>被推荐会员</option>\r\n"; $whereSql .= " And matt=1 "; } } $MemberTypes = ""; $dsql->SetQuery("Select rank,membername From #@__arcrank where rank>0"); $dsql->Execute(); $MemberTypes[0] = '未审核会员'; while($row = $dsql->GetObject()){ $MemberTypes[$row->rank] = $row->membername; } $dsql->SetQuery("Select id,name From #@__area"); $dsql->Execute(); while($row = $dsql->GetObject()){ $Areas[$row->id] = $row->name; } function GetMemberName($rank) { global $MemberTypes; if(isset($MemberTypes[$rank])){ return $MemberTypes[$rank]; }else{ return ""; } } function GetAreaName($e,$df) { global $Areas; if(isset($Areas[$e])) return $Areas[$e]; else return $df; } function GetMAtt($m){ if($m<1) return ""; else return "<img src='img/adminuserico.gif' width='16' height='15'><font color='red'>(荐)</font>"; } $sql = "select ID,userid,pwd,uname,email,sex,money,c1,c2,c3,matt,logintime,loginip,membertype,scores,spaceshow,pageshow From #@__member $whereSql order by $sortkey desc "; $dlist = new DataList(); $dlist->Init(); $dlist->SetParameter("sex",$sex); $dlist->SetParameter("keyword",$keyword); $dlist->SetSource($sql); $dlist->SetTemplet(dirname(__FILE__)."/templets/company_main.htm"); $dlist->display(); $dlist->Close(); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/company_main.php
PHP
asf20
2,638
<?php require_once(dirname(__FILE__)."/config.php"); require_once(DEDEADMIN."/inc/inc_catalog_options.php"); require_once(DEDEADMIN."/inc/inc_archives_functions.php"); if(empty($channelid)) $channelid=3; if(empty($cid)) $cid = 0; $dsql = new DedeSql(false); if($cid>0) { $query = "Select t.typename as arctypename,c.* From #@__arctype t left join #@__channeltype c on c.ID=t.channeltype where t.ID='$cid' "; $cInfos = $dsql->GetOne($query); $channelid = $cInfos['ID']; $addtable = $cInfos['addtable']; } else if($channelid>0) { $query = " Select * From #@__channeltype where ID='$channelid'"; $cInfos = $dsql->GetOne($query); $channelid = $cInfos['ID']; $addtable = $cInfos['addtable']; } require_once(dirname(__FILE__)."/templets/soft_add.htm"); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/soft_add.php
PHP
asf20
815
<?php require_once(dirname(__FILE__)."/config.php"); CheckPurview('sys_Group'); $dsql = new DedeSql(false); if(empty($dopost)) $dopost = ""; if($dopost=='save') { if($rank==10){ ShowMsg("超级管理员的权限不允许更改!","sys_group.php"); $dsql->Close(); exit(); } $purview = ""; if(is_array($purviews)){ foreach($purviews as $p){ $purview .= "$p "; } $purview = trim($purview); } $dsql->ExecuteNoneQuery("Update #@__admintype set typename='$typename',purviews='$purview' where rank='$rank'"); $dsql->Close(); ShowMsg("成功更改用户组的权限!","sys_group.php"); exit(); } else if($dopost=='del') { $dsql->ExecuteNoneQuery("Delete From #@__admintype where rank='$rank' And system='0';"); ShowMsg("成功删除一个用户组!","sys_group.php"); $dsql->Close(); exit(); } $groupRanks = Array(); $groupSet = $dsql->GetOne("Select * From #@__admintype where rank='".$rank."'"); $groupRanks = explode(' ',$groupSet['purviews']); //检查是否已经有此权限 function CRank($n){ global $groupRanks; if(in_array($n,$groupRanks)) return ' checked'; else return ''; } require_once(dirname(__FILE__)."/templets/sys_group_edit.htm"); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/sys_group_edit.php
PHP
asf20
1,252
<?php require_once(dirname(__FILE__)."/config.php"); CheckPurview('sys_ArcTj'); $dsql = new DedeSql(false); $row1 = $dsql->GetOne("Select count(*) as dd From `#@__full_search`"); $row2 = $dsql->GetOne("Select count(*) as dd From `#@__feedback`"); $row3 = $dsql->GetOne("Select count(*) as dd From `#@__member`"); require_once(dirname(__FILE__)."/templets/content_tj.htm"); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/content_tj.php
PHP
asf20
407
<?php require_once(dirname(__FILE__)."/config.php"); CheckPurview('sys_module'); require_once(dirname(__FILE__)."/../include/inc_modules.php"); require_once(dirname(__FILE__)."/../include/pub_oxwindow.php"); if(empty($action)) $action = ''; $mdir = dirname(__FILE__).'/module'; if($action=='upload') { if( !is_uploaded_file($upfile) ) { ShowMsg("貌似你什么都没有上传哦!","javascript:;"); exit(); } else { include_once(dirname(__FILE__)."/../include/zip.lib.php"); $tmpfilename = $mdir.'/'.ExecTime().mt_rand(10000,50000).'.tmp'; move_uploaded_file($upfile,$tmpfilename) or die("把上传的文件移动到{$tmpfilename}时失败,请检查{$mdir}目录是否有写入权限!"); //ZIP格式的文件 if($filetype==1){ $z = new zip(); $files = $z->get_List($tmpfilename); $dedefileindex = -1; //为了节省资源,系统仅以.dev作为扩展名识别ZIP包里了dede模块格式文件 if(is_array($files)){ for($i=0;$i<count($files);$i++) { if( eregi( "\.dev",$files[$i]['filename']) ){ $dedefile = $files[$i]['filename']; $dedefileindex = $i; break; } }} if($dedefileindex==-1) { unlink($tmpfilename); ShowMsg("对不起,你上传的压缩包中不存在dede模块文件!<br /><br /><a href='javascript:history.go(-1);'>&gt;&gt;返回重新上传&gt;&gt;</a>","javascript:;"); exit(); } $ziptmp = $mdir.'/ziptmp'; $z->Extract($tmpfilename,$ziptmp,$dedefileindex); unlink($tmpfilename); $tmpfilename = $mdir."/ziptmp/".$dedefile; } $dm = new DedeModule($mdir); $infos = $dm->GetModuleInfo($tmpfilename,'file'); if(empty($infos['hash'])) { unlink($tmpfilename); $dm->Clear(); ShowMsg("对不起,你上传的文件可能不是织梦模块的标准格式文件!<br /><br /><a href='javascript:history.go(-1);'>&gt;&gt;返回重新上传&gt;&gt;</a>","javascript:;"); exit(); } $okfile = $mdir.'/'.$infos['hash'].'.dev'; if($dm->HasModule($infos['hash']) && empty($delhas)) { unlink($tmpfilename); $dm->Clear(); ShowMsg("对不起,你上传的模块已经存在,<br />如果要覆盖请先删除原来版本或选择强制删除的选项!<br /><br /><a href='javascript:history.go(-1);'>&gt;&gt;返回重新上传&gt;&gt;</a>","javascript:;"); exit(); } @unlink($okfile); copy($tmpfilename,$okfile); @unlink($tmpfilename); $dm->Clear(); ShowMsg("成功上传一个新的模块!","module_main.php?action=view&hash={$infos['hash']}"); exit(); } } else { $win = new OxWindow(); $win->Init("module_upload.php","js/blank.js","data"); $win->mainTitle = "模块管理"; $win->AddTitle("<a href='module_main.php'>模块管理</a> &gt;&gt; 上传模块"); $win->AddHidden("action",'upload'); $msg = " <table width='600' border='0' cellspacing='0' cellpadding='0'> <tr> <td height='30'>文件格式:</td> <td> <input name='filetype' type='radio' value='0' checked='checked' /> 正常的模块包 <input type='radio' name='filetype' value='1' /> 经过 zip 压缩的模块包 </td> </tr> <tr> <td height='30'>已有模块:</td> <td> <input name='delhas' type='checkbox' id='delhas' value='1' /> 强制删除同名模块(这可能导致已经安装的模块无法卸载) </td> </tr> <tr> <td width='96' height='60'>请选择文件:</td> <td width='504'> <input name='upfile' type='file' id='upfile' style='width:300px' /> </td> </tr> </table> "; $win->AddMsgItem("<div style='padding-left:20px;line-height:150%'>$msg</div>"); $winform = $win->GetWindow("okonly",""); $win->Display(); exit(); } ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/module_upload.php
PHP
asf20
3,817
<?php require_once(dirname(__FILE__)."/config.php"); require_once(dirname(__FILE__)."/templets/bbs_addons.htm"); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/bbs_addons.php
PHP
asf20
136
<?php require_once(dirname(__FILE__)."/config.php"); setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/"); $dsql = new DedeSql(false); if(empty($pagesize)) $pagesize = 18; if(empty($pageno)) $pageno = 1; if(empty($dopost)) $dopost = ''; if(empty($orderby)) $orderby = 'tid'; if(empty($keyword)){ $keyword = ''; $addget = ''; $addsql = ''; }else{ $addget = '&keyword='.urlencode($keyword); $addsql = " where tagname like '%$keyword%' "; } //重载列表 if($dopost=='getlist'){ AjaxHead(); GetTagList($dsql,$pageno,$pagesize,$orderby); $dsql->Close(); exit(); } //更新字段 else if($dopost=='update') { $tid = ereg_replace("[^0-9]","",$tid); $tagcc = ereg_replace("[^0-9]","",$tagcc); $cc = ereg_replace("[^0-9]","",$cc); $tagname = trim($tagname); $dsql->ExecuteNoneQuery("Update #@__tags set tagname='$tagname',tagcc='$tagcc',cc='$cc' where tid='$tid';"); AjaxHead(); GetTagList($dsql,$pageno,$pagesize,$orderby); $dsql->Close(); exit(); } //删除字段 else if($dopost=='del') { $tid = ereg_replace("[^0-9]","",$tid); $dsql->ExecuteNoneQuery("Delete From #@__tags_archives where tid='$tid'; "); //$dsql->ExecuteNoneQuery("Delete From #@__tags_user where tid='$tid'; "); $dsql->ExecuteNoneQuery("Delete From #@__tags where tid='$tid'; "); AjaxHead(); GetTagList($dsql,$pageno,$pagesize,$orderby); $dsql->Close(); exit(); } //第一次进入这个页面 if($dopost==''){ $row = $dsql->GetOne("Select count(*) as dd From #@__tags $addsql "); $totalRow = $row['dd']; include(dirname(__FILE__)."/templets/tag_main.htm"); $dsql->Close(); } //获得特定的Tag列表 //--------------------------------- function GetTagList($dsql,$pageno,$pagesize,$orderby='aid'){ global $cfg_phpurl,$addsql; $start = ($pageno-1) * $pagesize; $printhead ="<table width='99%' border='0' cellpadding='1' cellspacing='1' bgcolor='#333333' style='margin-bottom:3px'> <tr align='center' bgcolor='#E5F9FF' height='24'> <td width='8%'><a href='#' onclick=\"ReloadPage('tid')\"><u>ID</u></a></td> <td width='32%'>TAG名称</td> <td width='10%'><a href='#' onclick=\"ReloadPage('tagcc')\"><u>使用率</u></a></td> <td width='10%'><a href='#' onclick=\"ReloadPage('cc')\"><u>浏览量</u></a></td> <td width='10%'><a href='#' onclick=\"ReloadPage('arcnum')\"><u>文档数</u></a></td> <td width='10%'>创建时间</td> <td>管理</td> </tr>\r\n"; echo $printhead; $dsql->SetQuery("Select * From #@__tags $addsql order by $orderby desc limit $start,$pagesize "); $dsql->Execute(); while($row = $dsql->GetArray()){ $line = " <tr align='center' bgcolor='#FFFFFF' onMouseMove=\"javascript:this.bgColor='#FCFEDA';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\"> <td height='24'>{$row['aid']}</td> <td><input name='tagname' type='text' id='tagname{$row['tid']}' value='{$row['tagname']}' class='ininput'></td> <td><input name='tagcc' type='text' id='tagcc{$row['tagcc']}' value='{$row['tagcc']}' class='ininput'></td> <td><input name='cc' type='text' id='cc{$row['cc']}' value='{$row['cc']}' class='ininput'></td> <td> {$row['arcnum']} </td> <td>".strftime("%y-%m-%d",$row['stime'])."</td> <td> <a href='#' onclick='UpdateNote({$row['tid']})'>更新</a> | <a href='#' onclick='DelNote({$row['tid']})'>删除</a> </td> </tr>"; echo $line; } echo "</table>\r\n"; } ?>
zyyhong
trunk/jiaju001/news/lic/tag_main.php
PHP
asf20
3,532
<?php require_once(dirname(__FILE__)."/../config.php"); CheckPurview('a_Edit,a_AccEdit,a_MyEdit'); require_once(DEDEADMIN."/inc/inc_archives_functions.php"); if(!isset($iscommend)) $iscommend = 0; if(!isset($isjump)) $isjump = 0; if(!isset($isbold)) $isbold = 0; if(!isset($autokey)) $autokey = 0; if(!isset($remote)) $remote = 0; if(!isset($autolitpic)) $autolitpic = 0; if(!isset($smalltypeid)) $smalltypeid = 0; if(!isset($sectorchange)){ $sectorid = $oldsectorid; $sectorid2 = $oldsectorid2; } if(!isset($areachange)){ $areaid = $oldareaid; $areaid2 = $oldareaid2; } if($typeid==0){ ShowMsg("请指定文档的栏目!","-1"); exit(); } if(empty($channelid)){ ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!","-1"); exit(); } if(!CheckChannel($typeid,$channelid) || !CheckChannel($typeid2,$channelid)){ ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!","-1"); exit(); } if(!TestPurview('a_Edit')) { if(TestPurview('a_AccEdit')) CheckCatalog($typeid,"对不起,你没有操作栏目 {$typeid} 的文档权限!"); else CheckArcAdmin($ID,$cuserLogin->getUserID()); } $arcrank = GetCoRank($arcrank,$typeid); //对保存的内容进行处理 //-------------------------------- $iscommend = $iscommend + $isbold; $pubdate = GetMkTime($pubdate); $sortrank = AddDay($senddate,$sortup); $endtime = $senddate + 3600 * 24 * $endtime; $title = cn_substr($title,80); if($keywords!="") $keywords = trim(cn_substr($keywords,60))." "; //处理上传的缩略图 if(empty($ddisremote)) $ddisremote = 0; $litpic = GetDDImage('none',$picname,$ddisremote); $body = stripslashes($body); //自动摘要 if($description=="" && $cfg_auot_description>0){ $description = stripslashes(cn_substr(html2text($body),$cfg_auot_description)); $description = trim(preg_replace("/#p#|#e#/","",$description)); $description = addslashes($description); } //把内容中远程的图片资源本地化 //------------------------------------ if($cfg_isUrlOpen && $remote==1){ $body = GetCurContent($body); } //自动获取关键字 //---------------------------------- if($autokey==1){ require_once(DEDEADMIN."/../include/pub_splitword_www.php"); $keywords = ""; $sp = new SplitWord(); $titleindexs = explode(" ",trim($sp->GetIndexText($sp->SplitRMM($title)))); $allindexs = explode(" ",trim($sp->GetIndexText($sp->SplitRMM(Html2Text($body)),200))); if(is_array($allindexs) && is_array($titleindexs)){ foreach($titleindexs as $k){ if(strlen($keywords)>=50) break; else $keywords .= $k." "; } foreach($allindexs as $k){ if(strlen($keywords)>=50) break; else if(!in_array($k,$titleindexs)) $keywords .= $k." "; } } $sp->Clear(); unset($sp); $keywords = preg_replace("/#p#|#e#/","",$keywords); $keywords = addslashes($keywords); } //自动获取缩略图 if($autolitpic==1 && $litpic==''){ $litpic = GetDDImgFromBody($body); } $message = addslashes($body); $dsql = new DedeSql(false); $cts = GetChannelTable($dsql,$channelid); //更新数据库的SQL语句 //---------------------------------- $inQuery = " update `{$cts['maintable']}` set typeid=$typeid, smalltypeid=$smalltypeid, areaid=$areaid, areaid2=$areaid2, sectorid=$sectorid, sectorid2=$sectorid2, sortrank=$sortrank, pubdate=$pubdate, endtime=$endtime, title='$title', iscommend='$iscommend', keywords='$keywords', litpic='$litpic', description='$description', arcatt='$arcatt' where ID='$ID'; "; if(!$dsql->ExecuteNoneQuery($inQuery)){ $gerr = $dsql->GetError(); $dsql->Close(); ShowMsg("更新数据库主表 `{$cts['maintable']}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;"); exit(); } //---------------------------------- //分析处理附加表数据 //---------------------------------- $inadd_f = ''; if(!empty($dede_addonfields)) { $addonfields = explode(";",$dede_addonfields); $inadd_f = ""; if(is_array($addonfields)) { foreach($addonfields as $v) { if($v=="") continue; $vs = explode(",",$v); //HTML文本特殊处理 if($vs[1]=="htmltext"||$vs[1]=="textdata") { include_once(DEDEADMIN.'/inc/inc_arc_makeauto.php'); }else{ ${$vs[0]} = GetFieldValueA(${$vs[0]},$vs[1],$arcID); } $inadd_f .= ",`{$vs[0]}` = '".${$vs[0]}."'"; } } } $addQuery = "Update `{$cts['addtable']}` set typeid='$typeid', message='$message',contact='$contact',phone='$phone', fax='$fax',email='$email',qq='$qq',msn='$msn',address='$address'{$inadd_f} where aid='{$ID}' "; if(!$dsql->ExecuteNoneQuery($addQuery)){ $gerr = $dsql->GetError(); $dsql->Close(); ShowMsg("更新数据库附加表 `{$cts['addtable']}` 时出错,请把相关信息提交给DedeCms官方。".$gerr,"javascript:;"); exit(); } //生成HTML //--------------------------------- $artUrl = MakeArt($ID,true,true); if($artUrl=="") $artUrl = $cfg_plus_dir."/view.php?aid=$ID"; //更新全站搜索索引 $datas = array('aid'=>$ID,'typeid'=>$typeid,'channelid'=>$channelid,'adminid'=>$edadminid,'att'=>$arcatt, 'title'=>$title,'url'=>$artUrl,'litpic'=>$litpic,'keywords'=>$keywords,'pubdate'=>$pubdate, 'addinfos'=>$description,'uptime'=>time(),'arcrank'=>0); UpSearchIndex($dsql,$datas); unset($datas); //更新Tag索引 UpTags($dsql,$tag,$ID,0,$typeid,$arcrank); //--------------------------------- //返回成功信息 //---------------------------------- $msg = "   请选择你的后续操作: <a href='../archives_do.php?aid=".$ID."&dopost=editArchives&channelid=-2'><u>查看更改</u></a> &nbsp;&nbsp; <a href='$artUrl' target='_blank'><u>预览文档</u></a> &nbsp;&nbsp; <a href='../catalog_do.php?cid=$typeid&dopost=listArchives'><u>管理信息</u></a> &nbsp;&nbsp; <a href='../catalog_main.php'><u>网站栏目管理</u></a> "; $wintitle = "成功更改信息!"; $wecome_info = "文章管理::更改信息"; $win = new OxWindow(); $win->AddTitle("成功更改信息:"); $win->AddMsgItem($msg); $winform = $win->GetWindow("hand","&nbsp;",false); $win->Display(); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/info_edit_action.php
PHP
asf20
6,305
<?php require_once(dirname(__FILE__)."/config.php"); require_once(dirname(__FILE__)."/../include/pub_datalist_dm.php"); setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/"); $bgcolor = ""; if(!isset($keyword)) $keyword=""; if(!isset($typeid)) $typeid="0"; function IsCheck($st) { if($st==1) return "[已审核]"; else return "<font color='red'>[未审核]</font>"; } $querystring = "select * from #@__feedback where CONCAT(#@__feedback.msg,#@__feedback.arctitle) like '%$keyword%' order by dtime desc"; $dlist = new DataList(); $dlist->pageSize = 10; $dlist->Init(); $dlist->SetParameter("typeid",$typeid); $dlist->SetParameter("keyword",$keyword); $dlist->SetSource($querystring); include(dirname(__FILE__)."/templets/feedback_main.htm"); $dlist->Close(); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/feedback_main.php
PHP
asf20
813
<?php require_once(dirname(__FILE__)."/config.php"); CheckPurview('sys_Source'); if(empty($dopost)) $dopost = ""; if(empty($allsource)) $allsource = ""; else $allsource = stripslashes($allsource); $m_file = dirname(__FILE__)."/inc/source.txt"; //保存 if($dopost=="save") { $fp = fopen($m_file,'w'); flock($fp,3); fwrite($fp,$allsource); fclose($fp); header("Content-Type: text/html; charset={$cfg_ver_lang}"); echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset={$cfg_ver_lang}\">\r\n"; echo "<script>alert('Save OK!');</script>"; } //读出 if(empty($allsource)&&filesize($m_file)>0){ $fp = fopen($m_file,'r'); $allsource = fread($fp,filesize($m_file)); fclose($fp); } require_once(dirname(__FILE__)."/templets/article_source_edit.htm"); ClearAllLink(); ?>
zyyhong
trunk/jiaju001/news/lic/article_source_edit.php
PHP
asf20
835
<!-- Ap=new Array(); Ap[1]="1~北京市"; B1=new Array(); B1[0]="101~东城区"; B1[1]="102~西城区"; B1[2]="103~崇文区"; B1[3]="104~宣武区"; B1[4]="105~朝阳区"; B1[5]="106~海淀区"; B1[6]="107~丰台区"; B1[7]="108~石景山区"; B1[8]="109~门头沟区"; B1[9]="110~房山区"; B1[10]="111~通州区"; B1[11]="112~顺义区"; B1[12]="113~昌平区"; B1[13]="114~大兴区"; B1[14]="115~平谷县"; B1[15]="116~怀柔县"; B1[16]="117~密云县"; B1[17]="118~延庆县"; Ap[2]="2~上海市"; B2=new Array(); B2[0]="201~黄浦区"; B2[1]="202~卢湾区"; B2[2]="203~徐汇区"; B2[3]="204~长宁区"; B2[4]="205~静安区"; B2[5]="206~普陀区"; B2[6]="207~闸北区"; B2[7]="208~虹口区"; B2[8]="209~杨浦区"; B2[9]="210~宝山区"; B2[10]="211~闵行区"; B2[11]="212~嘉定区"; B2[12]="213~浦东新区"; B2[13]="214~松江区"; B2[14]="215~金山区"; B2[15]="216~青浦区"; B2[16]="217~南汇区"; B2[17]="218~奉贤区"; B2[18]="219~崇明县"; Ap[3]="3~天津市"; B3=new Array(); B3[0]="301~和平区"; B3[1]="302~河东区"; B3[2]="303~河西区"; B3[3]="304~南开区"; B3[4]="305~河北区"; B3[5]="306~红桥区"; B3[6]="307~塘沽区"; B3[7]="308~汉沽区"; B3[8]="309~大港区"; B3[9]="310~东丽区"; B3[10]="311~西青区"; B3[11]="312~北辰区"; B3[12]="313~津南区"; B3[13]="314~武清区"; B3[14]="315~宝坻区"; B3[15]="316~静海县"; B3[16]="317~宁河县"; B3[17]="318~蓟县"; Ap[4]="4~重庆市"; B4=new Array(); B4[0]="401~渝中区"; B4[1]="402~大渡口区"; B4[2]="403~江北区"; B4[3]="404~沙坪坝区"; B4[4]="405~九龙坡区"; B4[5]="406~南岸区"; B4[6]="407~北碚区"; B4[7]="408~万盛区"; B4[8]="409~双桥区"; B4[9]="410~渝北区"; B4[10]="411~巴南区"; B4[11]="412~万州区"; B4[12]="413~涪陵区"; B4[13]="414~黔江区"; B4[14]="415~永川市"; B4[15]="416~合川市"; B4[16]="417~江津市"; B4[17]="418~南川市"; B4[18]="419~长寿县"; B4[19]="420~綦江县"; B4[20]="421~潼南县"; B4[21]="422~荣昌县"; B4[22]="423~璧山县"; B4[23]="424~大足县"; B4[24]="425~铜梁县"; B4[25]="426~梁平县"; B4[26]="427~城口县"; B4[27]="428~垫江县"; B4[28]="429~武隆县"; B4[29]="430~丰都县"; B4[30]="431~奉节县"; B4[31]="432~开县"; B4[32]="433~云阳县"; B4[33]="434~忠县"; B4[34]="435~巫溪县"; B4[35]="436~巫山县"; B4[36]="437~石柱县"; B4[37]="438~秀山县"; B4[38]="439~酉阳县"; B4[39]="440~彭水县"; Ap[5]="5~广东省"; B5=new Array(); B5[0]="501~广州市"; B5[1]="502~深圳市"; B5[2]="503~珠海市"; B5[3]="504~汕头市"; B5[4]="505~韶关市"; B5[5]="506~河源市"; B5[6]="507~梅州市"; B5[7]="508~惠州市"; B5[8]="509~汕尾市"; B5[9]="510~东莞市"; B5[10]="511~中山市"; B5[11]="512~江门市"; B5[12]="513~佛山市"; B5[13]="514~阳江市"; B5[14]="515~湛江市"; B5[15]="516~茂名市"; B5[16]="517~肇庆市"; B5[17]="518~清远市"; B5[18]="519~潮州市"; B5[19]="520~揭阳市"; B5[20]="521~云浮市"; Ap[6]="6~福建省"; B6=new Array(); B6[0]="601~福州市"; B6[1]="602~厦门市"; B6[2]="603~三明市"; B6[3]="604~莆田市"; B6[4]="605~泉州市"; B6[5]="606~漳州市"; B6[6]="607~南平市"; B6[7]="608~龙岩市"; B6[8]="609~宁德市"; Ap[7]="7~浙江省"; B7=new Array(); B7[0]="701~杭州市"; B7[1]="702~宁波市"; B7[2]="703~温州市"; B7[3]="704~嘉兴市"; B7[4]="705~湖州市"; B7[5]="706~绍兴市"; B7[6]="707~金华市"; B7[7]="708~衢州市"; B7[8]="709~舟山市"; B7[9]="710~台州市"; B7[10]="711~丽水市"; Ap[8]="8~江苏省"; B8=new Array(); B8[0]="801~南京市"; B8[1]="802~徐州市"; B8[2]="803~连云港市"; B8[3]="804~淮安市"; B8[4]="805~宿迁市"; B8[5]="806~盐城市"; B8[6]="807~扬州市"; B8[7]="808~泰州市"; B8[8]="809~南通市"; B8[9]="810~镇江市"; B8[10]="811~常州市"; B8[11]="812~无锡市"; B8[12]="813~苏州市"; Ap[9]="9~山东省"; B9=new Array(); B9[0]="901~济南市"; B9[1]="902~青岛市"; B9[2]="903~淄博市"; B9[3]="904~枣庄市"; B9[4]="905~东营市"; B9[5]="906~潍坊市"; B9[6]="907~烟台市"; B9[7]="908~威海市"; B9[8]="909~济宁市"; B9[9]="910~泰安市"; B9[10]="911~日照市"; B9[11]="912~莱芜市"; B9[12]="913~德州市"; B9[13]="914~临沂市"; B9[14]="915~聊城市"; B9[15]="916~滨州市"; B9[16]="917~菏泽市"; Ap[10]="10~辽宁省"; B10=new Array(); B10[0]="1001~沈阳市"; B10[1]="1002~大连市"; B10[2]="1003~鞍山市"; B10[3]="1004~抚顺市"; B10[4]="1005~本溪市"; B10[5]="1006~丹东市"; B10[6]="1007~锦州市"; B10[7]="1008~葫芦岛市"; B10[8]="1009~营口市"; B10[9]="1010~盘锦市"; B10[10]="1011~阜新市"; B10[11]="1012~辽阳市"; B10[12]="1013~铁岭市"; B10[13]="1014~朝阳市"; Ap[11]="11~江西省"; B11=new Array(); B11[0]="1101~南昌市"; B11[1]="1102~景德镇市"; B11[2]="1103~萍乡市"; B11[3]="1104~新余市"; B11[4]="1105~九江市"; B11[5]="1106~鹰潭市"; B11[6]="1107~赣州市"; B11[7]="1108~吉安市"; B11[8]="1109~宜春市"; B11[9]="1110~抚州市"; B11[10]="1111~上饶市"; Ap[12]="12~四川省"; B12=new Array(); B12[0]="1201~成都市"; B12[1]="1202~自贡市"; B12[2]="1203~攀枝花市"; B12[3]="1204~泸州市"; B12[4]="1205~德阳市"; B12[5]="1206~绵阳市"; B12[6]="1207~广元市"; B12[7]="1208~遂宁市"; B12[8]="1209~内江市"; B12[9]="1210~乐山市"; B12[10]="1211~南充市"; B12[11]="1212~宜宾市"; B12[12]="1213~广安市"; B12[13]="1214~达州市"; B12[14]="1215~巴中市"; B12[15]="1216~雅安市"; B12[16]="1217~眉山市"; B12[17]="1218~资阳市"; B12[18]="1219~阿坝州"; B12[19]="1220~甘孜州"; B12[20]="1221~凉山州"; Ap[13]="13~陕西省"; B13=new Array(); B13[0]="1301~西安市"; B13[1]="1302~铜川市"; B13[2]="1303~宝鸡市"; B13[3]="1304~咸阳市"; B13[4]="1305~渭南市"; B13[5]="1306~延安市"; B13[6]="1307~汉中市"; B13[7]="1308~榆林市"; B13[8]="1309~安康市"; B13[9]="1310~商洛地区"; Ap[14]="14~湖北省"; B14=new Array(); B14[0]="1401~武汉市"; B14[1]="1402~黄石市"; B14[2]="1403~襄樊市"; B14[3]="1404~十堰市"; B14[4]="1405~荆州市"; B14[5]="1406~宜昌市"; B14[6]="1407~荆门市"; B14[7]="1408~鄂州市"; B14[8]="1409~孝感市"; B14[9]="1410~黄冈市"; B14[10]="1411~咸宁市"; B14[11]="1412~随州市"; B14[12]="1413~仙桃市"; B14[13]="1414~天门市"; B14[14]="1415~潜江市"; B14[15]="1416~神农架"; B14[16]="1417~恩施州"; Ap[15]="15~河南省"; B15=new Array(); B15[0]="1501~郑州市"; B15[1]="1502~开封市"; B15[2]="1503~洛阳市"; B15[3]="1504~平顶山市"; B15[4]="1505~焦作市"; B15[5]="1506~鹤壁市"; B15[6]="1507~新乡市"; B15[7]="1508~安阳市"; B15[8]="1509~濮阳市"; B15[9]="1510~许昌市"; B15[10]="1511~漯河市"; B15[11]="1512~三门峡市"; B15[12]="1513~南阳市"; B15[13]="1514~商丘市"; B15[14]="1515~信阳市"; B15[15]="1516~周口市"; B15[16]="1517~驻马店市"; B15[17]="1518~济源市"; Ap[16]="16~河北省"; B16=new Array(); B16[0]="1601~石家庄市"; B16[1]="1602~唐山市"; B16[2]="1603~秦皇岛市"; B16[3]="1604~邯郸市"; B16[4]="1605~邢台市"; B16[5]="1606~保定市"; B16[6]="1607~张家口市"; B16[7]="1608~承德市"; B16[8]="1609~沧州市"; B16[9]="1610~廊坊市"; B16[10]="1611~衡水市"; Ap[17]="17~山西省"; B17=new Array(); B17[0]="1701~太原市"; B17[1]="1702~大同市"; B17[2]="1703~阳泉市"; B17[3]="1704~长治市"; B17[4]="1705~晋城市"; B17[5]="1706~朔州市"; B17[6]="1707~晋中市"; B17[7]="1708~忻州市"; B17[8]="1709~临汾市"; B17[9]="1710~运城市"; B17[10]="1711~吕梁地区"; Ap[18]="18~内蒙古"; B18=new Array(); B18[0]="1801~呼和浩特"; B18[1]="1802~包头市"; B18[2]="1803~乌海市"; B18[3]="1804~赤峰市"; B18[4]="1805~通辽市"; B18[5]="1806~鄂尔多斯"; B18[6]="1807~乌兰察布"; B18[7]="1808~锡林郭勒"; B18[8]="1809~呼伦贝尔"; B18[9]="1810~巴彦淖尔"; B18[10]="1811~阿拉善盟"; B18[11]="1812~兴安盟"; Ap[19]="19~吉林省"; B19=new Array(); B19[0]="1901~长春市"; B19[1]="1902~吉林市"; B19[2]="1903~四平市"; B19[3]="1904~辽源市"; B19[4]="1905~通化市"; B19[5]="1906~白山市"; B19[6]="1907~松原市"; B19[7]="1908~白城市"; B19[8]="1909~延边州"; Ap[20]="20~黑龙江"; B20=new Array(); B20[0]="2001~哈尔滨市"; B20[1]="2002~齐齐哈尔"; B20[2]="2003~鹤岗市"; B20[3]="2004~双鸭山市"; B20[4]="2005~鸡西市"; B20[5]="2006~大庆市"; B20[6]="2007~伊春市"; B20[7]="2008~牡丹江市"; B20[8]="2009~佳木斯市"; B20[9]="2010~七台河市"; B20[10]="2011~黑河市"; B20[11]="2012~绥化市"; B20[12]="2013~大兴安岭"; Ap[21]="21~安徽省"; B21=new Array(); B21[0]="2101~合肥市"; B21[1]="2102~芜湖市"; B21[2]="2103~蚌埠市"; B21[3]="2104~淮南市"; B21[4]="2105~马鞍山市"; B21[5]="2106~淮北市"; B21[6]="2107~铜陵市"; B21[7]="2108~安庆市"; B21[8]="2109~黄山市"; B21[9]="2110~滁州市"; B21[10]="2111~阜阳市"; B21[11]="2112~宿州市"; B21[12]="2113~巢湖市"; B21[13]="2114~六安市"; B21[14]="2115~亳州市"; B21[15]="2116~宣城市"; B21[16]="2117~池州市"; Ap[22]="22~湖南省"; B22=new Array(); B22[0]="2201~长沙市"; B22[1]="2202~株州市"; B22[2]="2203~湘潭市"; B22[3]="2204~衡阳市"; B22[4]="2205~邵阳市"; B22[5]="2206~岳阳市"; B22[6]="2207~常德市"; B22[7]="2208~张家界市"; B22[8]="2209~益阳市"; B22[9]="2210~郴州市"; B22[10]="2211~永州市"; B22[11]="2212~怀化市"; B22[12]="2213~娄底市"; B22[13]="2214~湘西州"; Ap[23]="23~广西区"; B23=new Array(); B23[0]="2301~南宁市"; B23[1]="2302~柳州市"; B23[2]="2303~桂林市"; B23[3]="2304~梧州市"; B23[4]="2305~北海市"; B23[5]="2306~防城港市"; B23[6]="2307~钦州市"; B23[7]="2308~贵港市"; B23[8]="2309~玉林市"; B23[9]="2310~南宁地区"; B23[10]="2311~柳州地区"; B23[11]="2312~贺州地区"; B23[12]="2313~百色地区"; B23[13]="2314~河池地区"; Ap[24]="24~海南省"; B24=new Array(); B24[0]="2401~海口市"; B24[1]="2402~三亚市"; B24[2]="2403~五指山市"; B24[3]="2404~琼海市"; B24[4]="2405~儋州市"; B24[5]="2406~琼山市"; B24[6]="2407~文昌市"; B24[7]="2408~万宁市"; B24[8]="2409~东方市"; B24[9]="2410~澄迈县"; B24[10]="2411~定安县"; B24[11]="2412~屯昌县"; B24[12]="2413~临高县"; B24[13]="2414~白沙县"; B24[14]="2415~昌江县"; B24[15]="2416~乐东县"; B24[16]="2417~陵水县"; B24[17]="2418~保亭县"; B24[18]="2419~琼中县"; Ap[25]="25~云南省"; B25=new Array(); B25[0]="2501~昆明市"; B25[1]="2502~曲靖市"; B25[2]="2503~玉溪市"; B25[3]="2504~保山市"; B25[4]="2505~昭通市"; B25[5]="2506~思茅地区"; B25[6]="2507~临沧地区"; B25[7]="2508~丽江地区"; B25[8]="2509~文山州"; B25[9]="2510~红河州"; B25[10]="2511~西双版纳"; B25[11]="2512~楚雄州"; B25[12]="2513~大理州"; B25[13]="2514~德宏州"; B25[14]="2515~怒江州"; B25[15]="2516~迪庆州"; Ap[26]="26~贵州省"; B26=new Array(); B26[0]="2601~贵阳市"; B26[1]="2602~六盘水市"; B26[2]="2603~遵义市"; B26[3]="2604~安顺市"; B26[4]="2605~铜仁地区"; B26[5]="2606~毕节地区"; B26[6]="2607~黔西南州"; B26[7]="2608~黔东南州"; B26[8]="2609~黔南州"; Ap[27]="27~西藏区"; B27=new Array(); B27[0]="2701~拉萨市"; B27[1]="2702~那曲地区"; B27[2]="2703~昌都地区"; B27[3]="2704~山南地区"; B27[4]="2705~日喀则"; B27[5]="2706~阿里地区"; B27[6]="2707~林芝地区"; Ap[28]="28~甘肃省"; B28=new Array(); B28[0]="2801~兰州市"; B28[1]="2802~金昌市"; B28[2]="2803~白银市"; B28[3]="2804~天水市"; B28[4]="2805~嘉峪关市"; B28[5]="2806~武威市"; B28[6]="2807~定西地区"; B28[7]="2808~平凉地区"; B28[8]="2809~庆阳地区"; B28[9]="2810~陇南地区"; B28[10]="2811~张掖地区"; B28[11]="2812~酒泉地区"; B28[12]="2813~甘南州"; B28[13]="2814~临夏州"; Ap[29]="29~宁夏区"; B29=new Array(); B29[0]="2901~银川市"; B29[1]="2902~石嘴山市"; B29[2]="2903~吴忠市"; B29[3]="2904~固原市"; Ap[30]="30~青海省"; B30=new Array(); B30[0]="3001~西宁市"; B30[1]="3002~海东地区"; B30[2]="3003~海北州"; B30[3]="3004~黄南州"; B30[4]="3005~海南州"; B30[5]="3006~果洛州"; B30[6]="3007~玉树州"; B30[7]="3008~海西州"; Ap[31]="31~新疆区"; B31=new Array(); B31[0]="3101~乌鲁木齐"; B31[1]="3102~克拉玛依"; B31[2]="3103~石河子市"; B31[3]="3104~吐鲁番"; B31[4]="3105~哈密地区"; B31[5]="3106~和田地区"; B31[6]="3107~阿克苏"; B31[7]="3108~喀什地区"; B31[8]="3109~克孜勒苏"; B31[9]="3110~巴音郭楞"; B31[10]="3111~昌吉州"; B31[11]="3112~博尔塔拉"; B31[12]="3113~伊犁州"; Ap[32]="32~香港区"; B32=new Array(); Ap[33]="33~澳门区"; B33=new Array(); //选择城市 function selNext(oj,v) { newonj = oj.options; while(newonj.length>0) { newonj.remove(0); } clear(oj); if(v==0) { aOption = document.createElement("OPTION"); aOption.text="请选择1"; aOption.value="0"; oj.options.add(aOption); return; } else { aOption = document.createElement("OPTION"); aOption.text="-不限-"; aOption.value="0"; oj.options.add(aOption); } cityarr = barr=eval("B"+v); for(i=0;i<cityarr.length;i++) { tlines = cityarr[i].split("~"); aOption = document.createElement("OPTION"); aOption.text=tlines[1]; aOption.value=tlines[0]; oj.options.add(aOption); } } //设置省份选项 function selTop(oj) { clear(oj); for(i=1;i<Ap.length;i++) { itvalue = Ap[i]; tlines = itvalue.split("~"); aOption = document.createElement("OPTION"); aOption.text=tlines[1]; aOption.value=tlines[0]; oj.options.add(aOption); } } //清除旧对象 function clear(o) { l=o.length; for (i = 0; i< l; i++){ o.options[1]=null; } } //selTop('province'); -->
zyyhong
trunk/jiaju001/news/lic/area.js
JavaScript
asf20
15,104
<?php require_once(dirname(__FILE__)."/config.php"); CheckPurview('sys_MakeHtml'); $t1 = ExecTime(); require_once(dirname(__FILE__)."/../include/inc_archives_view.php"); if(empty($startid)) $startid = 0;//起始ID号 if(empty($endid)) $endid = 0;//结束ID号 if(empty($startdd)) $startdd = 0;//结果集起始记录值 if(empty($pagesize)) $pagesize = 20; if(empty($totalnum)) $totalnum = 0; if(empty($typeid)) $typeid = 0; if(empty($sss)) $sss = time(); if(empty($mkvalue)) $mkvalue = ''; //一键更新传递的参数 if(!empty($uptype)){ if($uptype!='time') $startid = $mkvalue; }else{ $uptype = ''; } header("Content-Type: text/html; charset={$cfg_ver_lang}"); $dsql = new DedeSql(false); //获取条件 //------------------------ $gwhere = " where arcrank=0 "; if($startid>0) $gwhere .= " And aid >= $startid "; if($endid > $startid) $gwhere .= " And aid <= $endid "; /* if(!empty($onlymake)){ $gwhere .= " and ismake=0 "; } */ if($typeid!=0){ $typeids = TypeGetSunID($typeid,$dsql,"",0,true); $gwhere .= " And typeid in ($typeids)"; } if($uptype=='time'){ $gwhere .= " And uptime >= '$mkvalue' "; } //统计记录总数 //------------------------ if($totalnum==0) { $row = $dsql->GetOne("Select count(*) as dd From `#@__full_search` $gwhere"); $totalnum = $row['dd']; } //获取记录,并生成HTML $nlimit = $totalnum - $startdd; if($totalnum > $startdd+$pagesize){ $limitSql = " limit $startdd,$pagesize"; $nlimit = 1; }else{ $limitSql = " limit $startdd,{$nlimit}"; } $tjnum = $startdd; if($nlimit>0) { $dsql->SetQuery("Select aid as ID From `#@__full_search` $gwhere $limitSql"); $dsql->Execute(); while($row=$dsql->GetObject()) { $tjnum++; $ID = $row->ID; $ac = new Archives($ID); if(!$ac->IsError){ $rurl = $ac->MakeHtml(); }else{ echo "文档: $ID 错误!<br />\r\n"; $rurl = ''; } } } $t2 = ExecTime(); $t2 = ($t2 - $t1); //返回提示信息 if($totalnum>0) $tjlen = ceil( ($tjnum/$totalnum) * 100 ); else $tjlen=100; $dvlen = $tjlen * 2; $nntime = time(); $utime = $nntime - $sss; if($utime>0){ $utime = number_format(($utime/60),2); } $tjsta = "<div style='width:200;height:15;border:1px solid #898989;text-align:left'><div style='width:$dvlen;height:15;background-color:#829D83'></div></div>"; $tjsta .= "<br>本次用时:".number_format($t2,2)." 到达位置:".($startdd+$pagesize)."<br/>完成创建文件总数的:$tjlen %,<br> 总用时: {$utime} 分钟, 继续执行任务..."; if($tjnum < $totalnum) { $nurl = "makehtml_archives_action.php?sss=$sss&endid=$endid&startid=$startid&typeid=$typeid"; $nurl .= "&totalnum=$totalnum&startdd=".($startdd+$pagesize)."&pagesize=$pagesize&uptype={$uptype}&mkvalue={$mkvalue}"; ShowMsg($tjsta,$nurl,0,100); ClearAllLink(); exit(); }else { if($uptype==''){ echo "完成所有创建任务,总用时: {$utime} 分钟 。"; ClearAllLink(); exit(); }else{ ShowMsg("完成所有文档更新,现在重新优化数据!","makehtml_all.php?action=make&step=4&uptype={$uptype}&mkvalue={$mkvalue}"); ClearAllLink(); exit(); } } ?>
zyyhong
trunk/jiaju001/news/lic/makehtml_archives_action.php
PHP
asf20
3,226