Просмотр файла themes/vista/foot.php

Размер файла: 5.84Kb
  1. <?php
  2. echo'<table align="center"><tr><td><br>';
  3. require_once BASEDIR."template/session.php";
  4. require_once BASEDIR."template/counters.php";
  5. require_once BASEDIR."template/gzip_foot.php";
  6. require_once BASEDIR."template/generic.php";
  7. require_once BASEDIR."template/traffic.php";
  8. echo'</td></tr></table>';
  9. echo'</td><tr><td background="../themes/vista/img/3.png" height="17"></td>';
  10. echo'</tr></table>';
  11. echo'</td><td width="20%" valign="top">';
  12. echo '<table cellpadding="5" cellspacing="0" width="100%"><tr><td>';
  13. if (!defined("BASEDIR")) { header("Location:../index.php"); exit; }
  14.  
  15. $nfile=file(BASEDIR."local/news.dat");
  16. $nfile=array_reverse($nfile);
  17. for($ni=0;$ni<31;$ni++){
  18. $ndata=explode('|',$nfile[$ni]);
  19. if($ndata[2]!==""){
  20. if(substr($ndata[2], 0, 1)=="0"){$ndata[2]=substr($ndata[2],1); }
  21. $array_news[]=$ndata[2];
  22. $array_komm[$ndata[2]]=$ndata[5];
  23. }
  24. }
  25.  
  26. $now=getdate();
  27. $cal=makeCal ($now['year'], $now['mon']);
  28.  
  29. echo '<table>
  30. <tr>
  31. <td style="color:#FFFFFF">Пн</td>
  32. <td style="color:#FFFFFF">Вт</td>
  33. <td style="color:#FFFFFF">Ср</td>
  34. <td style="color:#FFFFFF">Чт</td>
  35. <td style="color:#FFFFFF">Пт</td>
  36. <td style="color:#FF0000">Сб</td>
  37. <td style="color:#FF0000">Вс</td>
  38. </tr>';
  39.  
  40. foreach ($cal as $row) {
  41. echo '<tr>';
  42. foreach ($row as $i=>$v) {
  43.  
  44. if($i==5 || $i==6){
  45. $tdcal='<td align="center" style="padding: 3px; background-color:#f4efef; color:#FF0000;">';
  46. }else{
  47. $tdcal='<td align="center" style="padding: 3px; background-color:#f4efef; color:#666666;">';}
  48.  
  49. if($v!=""){
  50. $cal_date=$v.'.'.date("m").'.'.date("y");
  51. $cal_den=date("j");
  52.  
  53. if($cal_den==$v){
  54. $tdcal='<td align="center" style="padding: 3px; background-color:#ffcccc; color:#FF0000;">';}
  55.  
  56. if(in_array($cal_date,$array_news)){
  57. $tdcal='<td align="center" style="padding: 3px; background-color:#e7dfdf; color:#FF0000;">';
  58.  
  59. echo $tdcal.'<b><a href="'.BASEDIR.'news/komm.php?id='.$array_komm[$cal_date].'&amp;'.SID.'"><font color="#FF0000">'.$v.'</font></a></b></td>';
  60.  
  61. }else{echo $tdcal.$v.'</td>';}
  62.  
  63. }else{echo $tdcal.'&nbsp;</td>';}
  64.  
  65. }
  66. echo '</tr>';
  67. }
  68. echo '</table>';
  69. echo'</td>
  70. <tr><td background="../themes/vista/img/clock2.png" width="122px" height="130">';
  71.  
  72. ?>
  73. <script>
  74.  
  75. if ((document.getElementById) &&
  76. window.addEventListener || window.attachEvent){
  77.  
  78. (function(){
  79.  
  80. var fCol="black"; //face colour.
  81. var dCol="black"; //dots colour.
  82. var hCol="black"; //hours colour.
  83. var mCol="black"; //minutes colour.
  84. var sCol="black"; //seconds colour.
  85.  
  86. var dial = "3 4 5 6 7 8 9 10 11 12 1 2";
  87. dial = dial.split(" ");
  88. var e = 360/dial.length;
  89. var h = 3;
  90. var m = 4;
  91. var s = 5;
  92. var y = 50;
  93. var x = 60;
  94. var cyx = 30/4;
  95. var theDial = [];
  96. var theDots = [];
  97. var theHours = [];
  98. var theMinutes = [];
  99. var theSeconds = [];
  100. var idx = document.getElementsByTagName('div').length;
  101. var pix = "px";
  102.  
  103. document.write('<div style="position:relative;width:'+(x*2)+'px;height:'+(y*2)+'px">');
  104.  
  105. for (i=0; i < dial.length; i++){
  106. document.write('<div id="F'+(idx+i)+'" style="position:absolute;top:0px;left:0px;width:15px;height:15px;'
  107. +'font-family:arial,sans-serif;font-size:10px;color:'+fCol+';text-align:center">'+dial[i]+'<\/div>');
  108.  
  109. document.write('<div id="D'+(idx+i)+'" style="position:absolute;top:0px;left:0px;'
  110. +'width:2px;height:2px;font-size:2px;background-color:'+dCol+'"><\/div>');
  111. }
  112.  
  113. for (i=0; i < h; i++){
  114. document.write('<div id="H'+(idx+i)+'" style="position:absolute;top:0px;left:0px;'
  115. +'width:2px;height:2px;font-size:2px;background-color:'+hCol+'"><\/div>');
  116. }
  117.  
  118. for (i=0; i < m; i++){
  119. document.write('<div id="M'+(idx+i)+'" style="position:absolute;top:0px;left:0px;'
  120. +'width:2px;height:2px;font-size:2px;background-color:'+mCol+'"><\/div>');
  121. }
  122.  
  123. for (i=0; i < s; i++){
  124. document.write('<div id="S'+(idx+i)+'" style="position:absolute;top:0px;left:0px;'
  125. +'width:2px;height:2px;font-size:2px;background-color:'+sCol+'"><\/div>');
  126. }
  127.  
  128. document.write('<\/div>');
  129.  
  130.  
  131. function clock(){
  132. var time = new Date();
  133.  
  134. var secs = time.getSeconds();
  135. var secOffSet = secs - 15;
  136. if (secs < 15){
  137. secOffSet = secs+45;
  138. }
  139. var sec = Math.PI * (secOffSet/30);
  140.  
  141. var mins = time.getMinutes();
  142. var minOffSet = mins - 15;
  143. if (mins < 15){
  144. minOffSet = mins+45;
  145. }
  146. var min = Math.PI * (minOffSet/30);
  147.  
  148. var hrs = time.getHours();
  149. if (hrs > 12){
  150. hrs -= 12;
  151. }
  152. var hrOffSet = hrs - 3;
  153. if (hrs < 3){
  154. hrOffSet = hrs+9;
  155. }
  156. var hr = Math.PI * (hrOffSet/6) + Math.PI * time.getMinutes()/360;
  157.  
  158. for (i=0; i < s; i++){
  159. theSeconds[i].top = y + (i*cyx) * Math.sin(sec) + pix;
  160. theSeconds[i].left = x + (i*cyx) * Math.cos(sec) + pix;
  161. }
  162. for (i=0; i < m; i++){
  163. theMinutes[i].top = y + (i*cyx) * Math.sin(min) + pix;
  164. theMinutes[i].left = x + (i*cyx) * Math.cos(min) + pix;
  165. }
  166. for (i=0; i < h; i++){
  167. theHours[i].top = y + (i*cyx) * Math.sin(hr) + pix;
  168. theHours[i].left = x + (i*cyx) * Math.cos(hr) + pix;
  169. }
  170. setTimeout(clock,100);
  171. }
  172.  
  173. function init(){
  174. for (i=0; i < dial.length; i++){
  175. theDial[i] = document.getElementById("F"+(idx+i)).style;
  176. theDial[i].top = y-6 + 30 * 1.4 * Math.sin(i*e*Math.PI/180) + pix;
  177. theDial[i].left = x-6 + 30 * 1.4 * Math.cos(i*e*Math.PI/180) + pix;
  178. theDots[i] = document.getElementById("D"+(idx+i)).style;
  179. theDots[i].top = y + 30 * Math.sin(e*i*Math.PI/180) + pix;
  180. theDots[i].left= x + 30 * Math.cos(e*i*Math.PI/180) + pix;
  181. }
  182. for (i=0; i < h; i++){
  183. theHours[i] = document.getElementById("H"+(idx+i)).style;
  184. }
  185. for (i=0; i < m; i++){
  186. theMinutes[i] = document.getElementById("M"+(idx+i)).style;
  187. }
  188. for (i=0; i < s; i++){
  189. theSeconds[i] = document.getElementById("S"+(idx+i)).style;
  190. }
  191. clock();
  192. }
  193.  
  194. if (window.addEventListener){
  195. window.addEventListener("load",init,false);
  196. }
  197. else if (window.attachEvent){
  198. window.attachEvent("onload",init);
  199. }
  200. })();
  201. }
  202.  
  203. </script>
  204. <?php
  205. echo '</td></tr></table>';
  206. echo'</td></tr></table>';
  207. echo'<table align="center"><tr><td>';
  208. echo'</body></html>';
  209. echo'</td></tr></table>';
  210. ?>