banner.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. function PCMSAD(PID) {
  2. this.ID = PID;
  3. this.PosID = 0;
  4. this.ADID = 0;
  5. this.ADType = "";
  6. this.ADName = "";
  7. this.ADContent = "";
  8. this.PaddingLeft = 0;
  9. this.PaddingTop = 0;
  10. this.Wspaceidth = 0;
  11. this.Height = 0;
  12. this.IsHitCount = "N";
  13. this.UploadFilePath = "";
  14. this.URL = "";
  15. this.SiteID = 0;
  16. this.ShowAD = showADContent;
  17. this.Stat = statAD;
  18. }
  19. function statAD() {
  20. var new_element = document.createElement("script");
  21. new_element.type = "text/javascript";
  22. new_element.src="{APP_PATH}index.php?m=poster&c=index&a=show&siteid="+this.SiteID+"&id="+this.ADID+"&spaceid="+this.PosID;
  23. document.body.appendChild(new_element);
  24. }
  25. function showADContent() {
  26. var content = this.ADContent;
  27. var str = "";
  28. var AD = eval('('+content+')');
  29. if (this.ADType == "images") {
  30. if (AD.Images[0].imgADLinkUrl) str += "<a href='"+this.URL+'&a=poster_click&sitespaceid='+this.SiteID+"&id="+this.ADID+"&url="+AD.Images[0].imgADLinkUrl+"' target='_blank'>";
  31. str += "<img title='"+AD.Images[0].imgADAlt+"' src='"+this.UploadFilePath+AD.Images[0].ImgPath+"' width='"+this.Width+"' height='"+this.Height+"' style='border:0px;'>";
  32. if (AD.Images[0].imgADLinkUrl) str += "</a>";
  33. }else if(this.ADType == "flash"){
  34. str += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='"+this.Width+"' height='"+this.Height+"' id='FlashAD_"+this.ADID+"' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'>";
  35. str += "<param name='movie' value='"+this.UploadFilePath+AD.Images[0].ImgPath+"' />";
  36. str += "<param name='quality' value='autohigh' />";
  37. str += "<param name='wmode' value='opaque'/>";
  38. str += "<embed src='"+this.UploadFilePath+AD.Images[0].ImgPath+"' quality='autohigh' wmode='opaque' name='flashad' swliveconnect='TRUE' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='"+this.Width+"' height='"+this.Height+"'></embed>";
  39. str += "</object>";
  40. }
  41. str += "";
  42. document.write(str);
  43. }
  44. var cmsAD_{$spaceid} = new PCMSAD('cmsAD_{$spaceid}');
  45. cmsAD_{$spaceid}.PosID = {$spaceid};
  46. cmsAD_{$spaceid}.ADID = {$p_id};
  47. cmsAD_{$spaceid}.ADType = "{$p_type}";
  48. cmsAD_{$spaceid}.ADName = "{$p_name}";
  49. cmsAD_{$spaceid}.ADContent = "{'Images':[{'imgADLinkUrl':'{urlencode($p_setting[1]['linkurl'])}','imgADAlt':'{$p_setting[1]['alt']}','ImgPath':'<?php echo $p_type=='images' ? $p_setting[1]['imageurl'] : $p_setting[1]['flashurl'];?>'}],'imgADLinkTarget':'New','Count':'1','showAlt':'Y'}";
  50. cmsAD_{$spaceid}.URL = "{APP_PATH}index.php?m=poster&c=index";
  51. cmsAD_{$spaceid}.SiteID = {$siteid};
  52. cmsAD_{$spaceid}.Width = {$width};
  53. cmsAD_{$spaceid}.Height = {$height};
  54. cmsAD_{$spaceid}.UploadFilePath = '';
  55. cmsAD_{$spaceid}.ShowAD();
  56. var isIE=!!window.ActiveXObject;
  57. if (isIE){
  58. if (document.readyState=="complete"){
  59. cmsAD_{$spaceid}.Stat();
  60. } else {
  61. document.onreadystatechange=function(){
  62. if(document.readyState=="complete") cmsAD_{$spaceid}.Stat();
  63. }
  64. }
  65. } else {
  66. cmsAD_{$spaceid}.Stat();
  67. }