公告板
预览模式: 普通 | 列表

paipai.com可以自动上传缩略图的商品发布模块

用户定制的。暂时就不发布出来了,附件带密码不知道的朋友就不要下载了
下载文件paipai.com可以自动上传缩略图的商品发布模块.rar (706.82 KB , 下载:32次)

宝宝的新相片出来了(百日照)

赶紧夸夸吧

幻灯模式:

 



组图模式:

attachments/200903/6367524146.jpg attachments/200903/5734374083.jpg attachments/200903/9824348012.jpg

attachments/200903/2679965581.jpg attachments/200903/0995340954.jpg attachments/200903/7666559253.jpg

attachments/200903/2238335844.jpg attachments/200903/0993216923.jpg attachments/200903/6147018879.jpg

attachments/200903/4230741844.jpg attachments/200903/1024376118.jpg attachments/200903/6845870619.jpg

attachments/200903/9042323812.jpg attachments/200903/3830025759.jpg attachments/200903/7453850674.jpg

attachments/200903/7822320102.jpg attachments/200903/3775733924.jpg attachments/200903/7782995784.jpg

attachments/200903/6342574158.jpg attachments/200903/4388575039.jpg attachments/200903/4921091324.jpg

attachments/200903/2213621192.jpg attachments/200903/5622730221.jpg attachments/200903/5826354286.jpg

attachments/200903/9527374141.jpg attachments/200903/1176782623.jpg attachments/200903/6286369457.jpg

attachments/200903/7224179272.jpg attachments/200903/4599428746.jpg attachments/200903/9097303782.jpg

attachments/200903/1873175295.jpg attachments/200903/3109196197.jpg attachments/200903/1338332855.jpg


attachments/200903/4292518561.jpg attachments/200903/5350501966.jpg attachments/200903/1175914366.jpg


attachments/200903/6060724961.jpg attachments/200903/0140594319.jpg attachments/200903/2426609841.jpg


attachments/200903/2178229509.jpg attachments/200903/7768041366.jpg attachments/200903/5524116025.jpg


attachments/200903/5381681047.jpg attachments/200903/5293885245.jpg attachments/200903/4388290432.jpg


attachments/200903/2336977062.jpg attachments/200903/6869933982.jpg attachments/200903/3424535001.jpg


attachments/200903/9583090863.jpg attachments/200903/0459942874.jpg attachments/200903/9392178936.jpg


attachments/200903/4720440661.jpg attachments/200903/2125336300.jpg attachments/200903/7704139709.jpg


attachments/200903/8914283273.jpg attachments/200903/2008483331.jpg attachments/200903/2915216568.jpg


attachments/200903/8471907839.jpg attachments/200903/2354523159.jpg attachments/200903/5011767826.jpg

attachments/200903/6418352519.jpg attachments/200903/8418750946.jpg

html实体转换[转]

Html entity encoder/decoder Detail refer to http://andrewu.co.uk/clj/entityencode/.


  1. function TextToEntities(strPlainText, blnPartialEncodeOnly) {
  2.  var strPartial = [];
  3.  var strFull = [];
  4.  var intP = 0;
  5.  var intF = 0;
  6.  var objPartialRegExp = (new RegExp).compile("[\\w\\s]");
  7.  
  8.  for (var intI=0; intI<strPlainText.length; ++intI) {
  9.  var strChar = strPlainText.charAt(intI);
  10.  var intChar = strChar.charCodeAt(0);
  11.  
  12.  if (isNaN(intChar)) {
  13.  // IF CHAR FAILED TO DECODE, LEAVE AS CHAR
  14.  strPartial.push(strFull.push(strChar));
  15.  }
  16.  else {
  17.  var strEntity = "&#" + intChar + ";";
  18.  strFull.push(strEntity);
  19.  // IF CHAR WAS [a-zA-Z0-9_ \t] LEAVE AS CHAR, ELSE REPLACE WITH ENTITY
  20.  strPartial.push(objPartialRegExp.test(strChar) ? strChar : strEntity);
  21.  }
  22.  }
  23.  return (blnPartialEncodeOnly ? strPartial.join("") : strFull.join(""));
  24.  }
  25.  
  26.  function EntitiesToText(strEncodedText) {
  27.  var strData = String(strEncodedText);
  28.  var objRegExp = (new RegExp).compile("&#(\\d+);", "ig");
  29.  
  30.  /**//* FOR EACH MATCH TO ANY ENTITY, REPLACE THAT
  31.  ENTITY GLOBALLY WITH ITS SINGLE CHAR EQUIVALENT */
  32.  while(strData.match(objRegExp)) {
  33.  var strCharMatch = RegExp.$1;
  34.  var objRegExpMatch = new RegExp("&#" + strCharMatch + ";", "ig");
  35.  strData = strData.replace(objRegExpMatch, String.fromCharCode(strCharMatch));
  36.  }
  37.  return strData;
  38.  }


最近在解析一个天气预报的xml文件时,发现它里面所有的汉字都转化为了html实体(十进制表示的Unicode编码),这样做的好处就是不管网页的编码是什么,都可以正常的显示汉字,而不会出现乱码,当然也适用于其他字符集。在php中我们可以用mbstring的mb_convert_encoding函数实现这个正向及反向的转化。
如:

mb_convert_encoding ("你好""HTML-ENTITIES""gb2312");    //输出:&#20320;&#22909;
mb_convert_encoding ("&#20320;&#22909;""gb2312""HTML-ENTITIES");    //输出:你好 

可以查看这个页面:htmlentities.html, 不管选择什么网页编码,网页都能正常显示。

如果需要对整个页面转化,则只需要在php文件的头部加上这三行代码:

mb_internal_encoding("gb2312");  // 这里的gb2312是你网站原来的编码
mb_http_output("HTML-ENTITIES");
ob_start('mb_output_handler'); 

如果没有打开mbstring扩展,可以参考coolcode.cn上的这两篇文章:
在任意字符集下正常显示网页的方法
在任意字符集下正常显示网页的方法(续)

在asp中我们可以用下面这个函数来实现这个转化:

Function htmlentities(str)
    For 
1 to Len(str)
        
char mid(stri1)
        If 
AscW(char) > 0 then
            htmlentities 
htmlentities "&#" Ascw(char) & ";"
        
Else
            
htmlentities htmlentities "&#" & (65536 ascW(char)) & ";"
        
End if
    
Next
End 
Function 
·此地為某只的個人YY之地,言論僅代表自己的個人觀點,和現實、社會、政治完全沒關係,沒事請不要在此惹事生非。
·若要轉載本blog内容請註明轉載地址和作者名字,禁止無權轉載/盜鏈等無恥行爲。
·如有轉載侵權請聯系刪除。
·謝謝合作。^_^