Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Wysokość i szerokość banera... JAK?, Mam jedno małe pytanko...
-DeMiEn-
post
Post #1





Goście







Mam jedno małe pytanko:
Kod
<table border=1>
<tr>
<td>R E K L A M A</td>
</tr>
<tr>
<td width="x" height="x"><?php include "adsrv/ad.php"; ?></td>
</tr>
</table>

Powiedzmy ze tak wygląda miejsce w którym wstawiłem skrypt rotatora.
Pytanie
brzmi: Jak wstawić w miejsca "x" szerokość i wysokość banera który
został wylosowany do wyświetlenia, biorąc pod uwagę, że każdy baner
może mieć inne rozmiary.

Jest mi to potrzebne do skryptu JS gdzie muszę wstawić dokładne wymiary.

Z góry dziękuję za pomoc. (IMG:http://forum.php.pl/style_emoticons/default/rolleyes.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
-DeMiEn-
post
Post #2





Goście







(IMG:http://forum.php.pl/style_emoticons/default/sadsmiley02.gif)
please pomóżcie! mi nic nie wychodzi! (IMG:http://forum.php.pl/style_emoticons/default/sad.gif)

mój ad.php:

prosze powiedzcie co mam źle siedze nad tym i dziedze i nic... wywala błąd:
Cytat
Parse error: parse error, unexpected T_ELSE in /home/accounts_d/damgad/public_html/adsrv/ad.php on line 44


  1. <?
  2. $datafile=&#092;"adsrv/data/baner.dat\";
  3. require &#092;"adsrv/config.php\";
  4. if(!file_exists($datafile)){
  5. $baner = &#092;"Nie odnaleziono pliku zawierającego dane bannerów!\";
  6. } else {
  7. $table=file($datafile);
  8.  
  9. $all=count($table);
  10. $last=$all-1;
  11. rsort($table, SORT_NUMERIC);
  12. reset($table);
  13. while($banner_found!=&#092;"1\"){
  14. $data=explode(&#092;"*|*\", $table[$last]);
  15. $data[14]=trim($data[14]);
  16. if($data[4]==&& $data[6]==&#092;"1\"){
  17. if($data[5]==|| $data[5]>$data[3]){
  18. $banner_found=&#092;"1\";
  19. break;
  20. }
  21. }
  22. if($data[4]>$data[2] && $data[6]==&#092;"1\"){
  23. if($data[5]==|| $data[5]>$data[3]){
  24. $banner_found=&#092;"1\";
  25. break;
  26. }
  27. }
  28. if($data[6]!=&#092;"1\" || $data[4]<=$data[2] || $data[5]<=$data[3] && $data[4]!=0){
  29. $last--;
  30. }
  31. if($last<0){
  32. $empty=&#092;"1\";
  33. $banner_found=&#092;"1\";
  34. }
  35. }
  36. if($empty==&#092;"1\"){
  37. if($default_baner!=&#092;"\"){
  38. if($default_url!=&#092;"\" && !eregi(\"@\", $default_url)){
  39. $baner = &#092;"<a href=\"$default_url\" target=_blank>\";
  40. }elseif($default_url!=&#092;"\" && eregi(\"@\", $default_url)){
  41. $baner = &#092;"<a href=\"mailto:$default_url\">\";
  42. }
  43. if(stristr($default_baner,&#092;"swf\") !== FALSE)
  44. list($width, $height, $type, $attr) = getimagesize($default_baner);
  45. $baner = &#092;"<embed src=\"$default_baner\" width=400 height=50></a>\";
  46. else
  47. list($width, $height, $type, $attr) = getimagesize($default_baner);
  48. $baner = &#092;"<img src=\"$default_baner\" border=\"0\"></a>\";
  49. }else {
  50. $baner = &#092;"<b>Brak bannerów!</b>\";
  51. }
  52. } else {
  53. $id=$data[10];
  54.  
  55. if(stristr($data[12],&#092;"swf\") !== FALSE)
  56.  
  57. list($width, $height, $type, $attr) = getimagesize($data[12]);
  58. $baner = &#092;"<embed src=\"$data[12]\" width=\"$data[8]\" height=\"$data[9]\">\";
  59.  
  60. else
  61.  
  62. list($width, $height, $type, $attr) = getimagesize($data[12]);
  63. $baner = &#092;"<a href=\"adsrv/go.php?id=$id\" target=_blank><img src=\"$data[12]\" width=\"$data[8]\" height=\"$data[9]\" alt=\"$data[13]\" border=\"0\"></a>\";
  64.  
  65.  
  66. $table=file($datafile);
  67. $f=fopen($datafile, &#092;"w\");
  68. flock($f, 2);
  69. for($i=0; $i<$all; $i++){
  70. $data=explode(&#092;"*|*\", $table[$i]);
  71. $data[14]=trim($data[14]);
  72. if($data[10]==$id && $banner_found==&#092;"1\"){
  73. $data[0]++;
  74. $data[2]++;
  75. }
  76. $write_str=&#092;"$data[0]*|*$data[1]*|*$data[2]*|*$data[3]*|*$data[4]*|*$data[5]*|*$data[6]*
    |*$data[7]*|*$data[8]*|*$data[9]*|*$data[10]*|*$data[11]*|*$data[12]*|*$data[13]*
    |*$data[14]n\";
  77. if($data[10]!=&#092;"\"){
  78. fputs($f, $write_str);
  79. }
  80. }
  81. flock($f, 3);
  82. fclose($f);
  83. }
  84. }
  85. ?>


a miejsce gdzie wklejam kod banera:

  1. <!-- Rotaror Banerów poczatek-->
  2. <?php
  3. include &#092;"adsrv/ad.php\";
  4. echo &#092;"<table width=$width cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr><td height=$height align=\"center\" valign=\"middle\">
  5. <script language=&#092;"javascript\">
  6. <!--
  7. var IE=navigator.userAgent,IEi=IE.indexOf(&#092;"MSIE\");IE=(IE.indexOf(\"Opera\")<0 && IEi>=0 && IE.charAt(IEi+5)>4);
  8. function adgora(){
  9. clearTimeout(ada);
  10. eval('document.all.'+adid+'.style.top='+adstart);
  11. };
  12. if(IE) {
  13.  
  14.  
  15. document.write(unescape('%3cscript language=JavaScript src=\"http://reklama.onet.pl/_js/sc_top04.js\"%3e%3c/script%3e'));
  16. adid = 'adi';
  17. document.write('<TABLE $attr border=0 cellpadding=0 cellspacing=0 valign=top><TR><TD valign=top><DIV id=\"adi\" name=\"adi\" style=\"position: absolute; z-index:5;\">');
  18. document.write('<DIV id=ad_layer><TABLE width=100% align=center border=0 cellspacing=0 cellpadding=0 bgcolor=white><TR><TD align=left valign=middle style=\"FONT-SIZE: 10px; COLOR: #BBBBBB; FONT-FAMILY: Verdana,Helvetica,Tahoma\">R&nbsp;E&nbsp;K&nbsp;L&nbsp;A&nbsp;M&nbsp;A</TD><TD align=right valign=middle style=\"FONT-SIZE: 10px; COLOR: #BBBBBB; FONT-FAMILY: Verdana,Helvetica,Tahoma\"><A href=\"javascript:adgora()\">X</A></TD></TR><TR><TD colspan=2 height=$height align=center valign=middle>$baner</TD></TR></TABLE></DIV>');
  19. document.write('</DIV></TD></TR></TABLE>');
  20. onet(&#092;"onPageLoad\", \"adsc(adid);\");
  21. }
  22.  
  23. else {
  24. document.write('<br><center>$baner</center><br>')}
  25. // -->
  26. </SCRIPT>
  27. </td>
  28. </tr>
  29. </table>\";
  30. ?>
  31. <!-- Rotaror Banerów koniec-->


znajdzie się ktoś kto mi to poprawi? ew. naprowadzi...
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 7.10.2025 - 09:41