Ignore:
Timestamp:
Jan 14, 2009, 7:38:30 PM (15 years ago)
Author:
george
Message:
  • Přidáno: Ikony odkazů a soubor stylů a javaskriptů.
  • Přidáno: .htaccess pro přímé spouštění CGI z jiné složky web serveru.
  • Opraveno: Validace některých stránek na XHTML 1.0 strict.
  • Přidáno: Funkce pro pěkné formátování výstupního HTML kódu.
  • Přidáno: Zobrazení aktualit.
Location:
devel/web
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • devel/web

    • Property svn:ignore
      •  

        old new  
        44backup
        55
        6 index
         6index.cgi
         7
         8index.compiled
  • devel/web/UMainPage.pas

    r134 r137  
    2020  II: Integer;
    2121  Enclosures: TArrayOfString;
     22  Content: string;
    2223const
    2324  NewsCountPerCategory = 3;
    24   UploadedFilesFolder = 'aktuality/uploads/'; 
     25//  UploadedFilesFolder = 'aktuality/uploads/';
    2526begin
    2627//  global $NewsCategoryNames, $NewsCountPerCategory, $UploadedFilesFolder;
     
    2829  DbRows := Database.Select('news_category', '*', 'id=' + IntToStr(Category));
    2930
    30   Result := '<table cellspacing="0" cellpadding="0" border="0" width="100%" style="font-size: small; padding-bottom: 5px;"><tr>'+
    31     '<td width="40%">' + DbRows[0].Values['caption'] + '</td><td width="80%" align="right">'+
    32     '<a href="aktuality/index.php?category=' + IntToStr(Category) + '">Zobrazit všechny aktuality</a>&nbsp;';
    33   if StrToInt(DbRows[0].Values['permission']) = 1 then Result := Result + '<a href="aktuality/index.php?action=add&amp;category=' + IntToStr(Category) + '">Přidat aktualitu</a>&nbsp;';
     31  Result := '<table class="MainTable"><tr>' +
     32    '<td>' + DbRows[0].Values['caption'] + '</td><td align="right">'+
     33    '<a href="?p=news-list&amp;category=' + IntToStr(Category) + '">Zobrazit všechny aktuality</a>&nbsp;';
     34  if StrToInt(DbRows[0].Values['permission']) = 1 then
     35    Result := Result + '<a href="aktuality/index.php?action=add&amp;category=' + IntToStr(Category) + '">Přidat aktualitu</a>&nbsp;';
    3436  Result := Result + '</td></tr><tr><td colspan="2">'+
    35     '<table cellspacing="0" width="100%" style="padding: 2px 2px 2px 2px; font-size: small; border-style: solid; border-color: red; border-width: 1; background-color: #FFF0F0;">';
     37    '<table>';
    3638  Index := 0;
    3739  FontSize := 12;
    3840  DbRows := Database.Select('news', '*', 'category=' + IntToStr(Category) + ' ORDER BY date DESC LIMIT 0,' + IntToStr(NewsCountPerCategory));
    3941  for I := 0 to DbRows.Count - 1 do with DbRows[I] do begin
    40     Result := Result + '<tr><td onmouseover="zobraz(''."''new".$Category.$Index."''".'')" style="cursor: pointer; margin: 0px;"><table cellspacing="0" cellpadding="0" style="padding: 0px; margin: 0px; font-size: small; color: red;" width="100%">'+
     42    Content := Values['content'];
     43    Content := StringReplace(Content, '<br>', '<br />', [rfReplaceAll]);
     44    Result := Result + '<tr><td onmouseover="zobraz(''new' + IntToStr(Category) + '_' + IntToStr(I) + ''')" style="cursor: pointer; margin: 0px;"><table cellspacing="0" cellpadding="0" style="padding: 0px; margin: 0px; font-size: small; color: red;" width="100%">'+
    4145      '<tr><td style="font-size: ' + IntToStr(FontSize) + 'pt"><strong>' + Values['title'] + '</strong></td>'+
    4246      '<td align="right" style="font-size: ' + IntToStr(FontSize) + 'pt">' + Values['author'] + ' (' + HumanDate(Values['date']) + ')</td></tr></table>'+
    43       '<div id="new' + IntToStr(Category) + IntToStr(Index) + '" class="skryty" style="display: none; border-width: 1; border-style: solid; border-color: blue; padding: 3px; font-size: 9pt;">' + Values['content'];
     47      '<div id="new' + IntToStr(Category) + '_' + IntToStr(Index) + '" class="skryty" style="display: none; border-width: 1; border-style: solid; border-color: blue; padding: 3px; font-size: 9pt;">' + Content;
    4448
    4549    if Values['enclosure'] <> '' then begin
    46       Result := Result + '<br>Přílohy: ';
     50      Result := Result + '<br />Přílohy: ';
    4751      Enclosures := Explode(';', Values['enclosure']);
    4852            for II := 0 to High(Enclosures) do begin
     
    6468begin
    6569  Output := ShowHeader('<strong>ZděchovNET</strong> - komunitní počítačová síť', 'Rozcestní­k');
    66   Output := Output + '<script type="text/javascript">'+
    67     '<!--'+
    68     'function openClient(client_type)'+
    69     '{'+
    70     'if(client_type=="java")clientWindow = window.open("http://go.icq.com/icq2go/web.html","ICQ2Go","left=20,top=20,width=156,height=446,toolbar=0,resizable=0");'+
    71     'else clientWindow = window.open("http://go.icq.com/icq2go/flicq.html","ICQ2Go","left=20,top=20,width=176,height=441,toolbar=0,resizable=0");'+
    72     '}'+
     70  Output := Output + '<table width="100%"><tr><td valign="top">' +
     71'<div class="Panel">' +
     72'<strong>Důležité odkazy:</strong><br />' +
     73InsertIcon('money.gif') + ' <a href="?p=finance">Finance</a><br />' +
     74InsertIcon('chart.gif') + ' <a href="?p=statistic">Statistika</a><br />' +
     75InsertIcon('prohledavac_sdileni.gif') + ' <a href="/share">Prohledat sdílení</a><br />' +
     76InsertIcon('comp.gif') + ' <a href="/userlist.php">Seznam uživatelů</a><br />' +
     77InsertIcon('comp.gif') + ' <a href="/hostlist.php">Seznam počítačů</a><br />' +
     78InsertIcon('sunrisechat.gif') + ' <a href="/sunrisechat/history.php">Historie SunriseChatu</a><br />' +
     79InsertIcon('sunrisechat.gif') + ' <a href="/sunrisechat/webchat.php">Webový SunriseChatu</a><br />' +
     80InsertIcon('discus.gif') + ' <a href="/forum">Diskusní fórum</a><br />' +
     81InsertIcon('openwebmail.gif') + ' <a href="https://centrala.zdechov.net/cgi-bin/openwebmail/openwebmail.pl">WebMail</a><br />' +
     82InsertIcon('apple.gif') + ' <a href="/jidelna">Jídelníček</a><br />' +
     83InsertIcon('clear.gif') + ' <a href="http://tv.zdechov.net/">Televize</a><br />' +
     84InsertIcon('cube.gif') + ' <a href="http://game-server.zdechov.net/">Herní server</a><br />' +
     85InsertIcon('cfix.gif') + ' <a href="/farnost">Rozpis mší</a><br />' +
     86InsertIcon('tel.gif') + ' <a href="/telseznam.php">Telefonní seznam</a><br />' +
     87InsertIcon('pripoj.gif') + ' <a href="/nabidky_pripojeni.php">Nabídky připojení</a><br />' +
     88InsertIcon('zapisy.gif') + ' <a href="/docs/zapisy/zapisy.php">Zápisy ze schůzí</a><br />' +
     89InsertIcon('lear.gif') + ' <a href="/mapy/mapa.php">Mapa Zděchova</a><br />' +
     90InsertIcon('otv_doby.gif') + '<a href="/otevreno.php">Otvírací doby</a><br />' +
     91InsertIcon('topologie.gif') + ' <a href="/is/topologie.php">Topologie sítě</a><br />' +
     92InsertIcon('satellite.gif') + ' <a href="/is/dostupnost.php">Dostupnost sítě</a><br />' +
     93InsertIcon('tech.gif') + ' <a href="/network.php">Technické informace</a><br />' +
     94InsertIcon('socer.gif') + ' <a href="http://fotbal.zdechov.net/">Fotbal Sokol Zděchov</a><br />' +
     95'</div><div class="Panel">' +
     96'<strong>Další odkazy:</strong><br />' +
     97InsertIcon('tv.gif') + ' <a href="/tkr.php">Kanály kabelovky</a><br />' +
     98InsertIcon('clear.gif') + ' <a href="/mapy/mapa_nabidka.php">Nabídka mapy</a><br />' +
     99InsertIcon('clear.gif') + ' <a href="/history.php">Historie sítě</a><br />' +
     100InsertIcon('electric.gif') + ' <a href="/merak.php">Měřič spotřeby</a><br />' +
     101InsertIcon('clear.gif') + ' <a href="/ukoly.php">Plány do budoucna</a><br />' +
     102InsertIcon('clear.gif') + ' <a href="/navody.php">Návody</a><br />' +
     103InsertIcon('info.gif') + ' <a href="/infokanal/index.htm">Infokanál</a><br />' +
     104InsertIcon('progman.gif') + ' <a href="/manualy.php">Programátorské manuály</a><br />' +
     105'</div></td><td valign="top">' +
     106'<div class="Panel">' +
     107'<strong>Vyhledávání:</strong><br />'+
     108InsertIcon('www_google_com.gif') + ' <a href="http://www.google.cz/">Google</a><br />' +
     109InsertIcon('morfeo.png') + ' <a href="http://morfeo.centrum.cz">Morfeo</a><br />' +
     110InsertIcon('www_centrum_cz.gif') + '<a href="http://www.centrum.cz">Centrum</a><br />' +
     111InsertIcon('www_seznam_cz.gif') + ' <a href="http://www.seznam.cz">Seznam</a><br />' +
     112InsertIcon('www_atlas_cz.gif') + ' <a href="http://www.atlas.cz">Atlas</a><br />' +
     113InsertIcon('www_tiscali_cz.gif') + ' <a href="http://www.tiscali.cz">Tiscali</a><br />' +
     114'</div><div class="Panel">' +
     115'<strong>Užitečné:</strong><br />'+
     116InsertIcon('clear.gif') + ' <a href="http://www.zdechov.net">Stránky naší sítě</a><br />' +
     117InsertIcon('www_tvinfo_cz.gif') + ' <a href="http://www.tvinfo.cz/live/televize/cz">Online TV</a><br />' +
     118InsertIcon('www_idos_cz.gif') + ' <a href="http://www.idos.cz/ConnForm.asp?tt=c">Jízdní řády</a><br />' +
     119InsertIcon('www_atlas_cz.gif') + ' <a href="http://tv.atlas.cz">TV programy</a><br />' +
     120InsertIcon('www_icq_com.gif') + ' Web ICQ <a href="javascript:openClient(''flash'')">Flash</a>&nbsp;<a href="javascript:openClient(''java'')">Java</a><br />' +
     121InsertIcon('www_centrum_cz.gif') + ' <a href="http://slovniky.centrum.cz">Slovníky</a><br />' +
     122InsertIcon('pocasi.gif') + ' <a href="http://www.meteopress.cz/">Počasí</a><br />' +
     123InsertIcon('www_tzones_cz.gif') + ' <a href="http://www.tzones.cz/">T-Mobile SMS</a><br />' +
     124InsertIcon('www_mvk_cz.png') + ' <a href="http://www.mvk.cz/">Knihovna&nbsp;Vsetín</a><br />' +
     125'</div><div class="Panel">' +
     126'<strong>Prodej počítačů:</strong><br />'+
     127InsertIcon('www_computershop_cz.png') + ' <a href="http://shop.computershop.cz/eshop/">SOFTCOM</a><br />' +
     128InsertIcon('www_alfacomp_cz.gif') + ' <a href="http://www.alfacomp.cz/php/zbozi.php?akc=2">Alfacomp</a><br />' +
     129InsertIcon('www_petracomp_cz.png') + ' <a href="http://www.petracomp.cz/">Petracomp</a><br />' +
     130InsertIcon('www_tsbohemia_cz.png') + ' <a href="http://interlink.tsbohemia.cz/">TS Bohemia</a><br />' +
     131'</div></td><td valign="top">' +
     132'<div class="Panel">';
    73133
    74 'var predchozi = ''first'';'+
    75 ''+
    76 'function zobraz(idecko)'+
    77 '{'+
    78 '  skryj(predchozi);'+
    79   'el=document.getElementById(idecko).style;'+
    80   '  el.display=''block'';'+
    81   'predchozi = idecko;'+
    82   '}'+
    83 ''+
    84 'function skryj(idecko)'+
    85 '{'+
    86   'if(idecko != ''first'')'+
    87   '{'+
    88   '  el=document.getElementById(idecko).style;'+
    89   '  el.display=''none'';'+
    90   '}'+
    91 '}'+
    92 '//-->'+
    93 '</script>'+
    94 ''+
    95 '<table width="100%"><tr><td valign="top">' +
    96 '<table width="100%">' +
    97 '<tr><td width="20%" valign="top">' +
    98 '<strong>Důležité odkazy:</strong><br>' +
    99 InsertIcon('money.gif') + ' <a href="?p=finance">Finance</a><br>' +
    100 InsertIcon('chart.gif') + ' <a href="?p=statistic">Statistika</a><br>' +
    101 InsertIcon('prohledavac_sdileni.gif') + ' <a href="/share">Prohledat sdílení</a><br>' +
    102 InsertIcon('comp.gif') + ' <a href="/userlist.php">Seznam uživatelů</a><br>' +
    103 InsertIcon('comp.gif') + ' <a href="/hostlist.php">Seznam počítačù</a><br>' +
    104 InsertIcon('sunrisechat.gif') + ' <a href="/sunrisechat/history.php">Historie SunriseChatu</a><br>' +
    105 InsertIcon('sunrisechat.gif') + ' <a href="/sunrisechat/webchat.php">Webový SunriseChatu</a><br>' +
    106 InsertIcon('discus.gif') + ' <a href="/forum">Diskusní fórum</a><br>' +
    107 InsertIcon('openwebmail.gif') + ' <a href="https://centrala.zdechov.net/cgi-bin/openwebmail/openwebmail.pl">WebMail</a><br>' +
    108 InsertIcon('apple.gif') + ' <a href="/jidelna">Jídelníček</a><br>' +
    109 InsertIcon('clear.gif') + ' <a href="http://tv.zdechov.net/">Televize</a><br>' +
    110 InsertIcon('cube.gif') + ' <a href="http://game-server.zdechov.net/">Herní server</a><br>' +
    111 InsertIcon('cfix.gif') + ' <a href="/farnost">Rozpis mší</a><br>' +
    112 InsertIcon('tel.gif') + ' <a href="/telseznam.php">Telefonní seznam</a><br>' +
    113 InsertIcon('pripoj.gif') + ' <a href="/nabidky_pripojeni.php">Nabídky připojení</a><br>' +
    114 InsertIcon('zapisy.gif') + ' <a href="/docs/zapisy/zapisy.php">Zápisy ze schůzí</a><br>' +
    115 InsertIcon('lear.gif') + ' <a href="/mapy/mapa.php">Mapa Zděchova</a><br>' +
    116 InsertIcon('otv_doby.gif') + '<a href="/otevreno.php">Otvírací doby</a><br>' +
    117 InsertIcon('topologie.gif') + ' <a href="/is/topologie.php">Topologie sítě</a><br>' +
    118 InsertIcon('satellite.gif') + ' <a href="/is/dostupnost.php">Dostupnost sítě</a><br>' +
    119 InsertIcon('tech.gif') + ' <a href="/network.php">Technické informace</a><br>' +
    120 InsertIcon('socer.gif') + ' <a href="http://fotbal.zdechov.net/">Fotbal Sokol Zděchov</a><br>' +
    121 '<br>' +
    122 '<strong>Další odkazy:</strong><br>' +
    123 InsertIcon('tv.gif') + ' <a href="/tkr.php">Kanály kabelovky</a><br>'+
    124 InsertIcon('clear.gif') + ' <a href="/mapy/mapa_nabidka.php">Nabídka mapy</a><br>'+
    125 InsertIcon('clear.gif') + ' <a href="/history.php">Historie sítě</a><br>'+
    126 InsertIcon('electric.gif') + ' <a href="/merak.php">Měřič spotřeby</a><br>'+
    127 InsertIcon('clear.gif') + ' <a href="/sluzby.php">Seznam služeb</a><br>'+
    128 InsertIcon('clear.gif') + ' <a href="/ukoly.php">Plány do budoucna</a><br>'+
    129 InsertIcon('clear.gif') + ' <a href="/navody.php">Návody</a><br>'+
    130 InsertIcon('info.gif') + ' <a href="/infokanal/index.htm">Infokanál</a><br>'+
    131 InsertIcon('progman.gif') + ' <a href="/manualy.php">Programátorské manuály</a><br>'+
    132 '<br>'+
    133 '</td><td width="13%" valign="top">'+
    134 '<strong>Vyhledávání:</strong><br>'+
    135 InsertIcon('www_google_com.gif') + ' <a href="http://www.google.cz/">Google</a><br>'+
    136 InsertIcon('morfeo.png') + ' <a href="http://morfeo.centrum.cz">Morfeo</a><br>'+
    137 InsertIcon('www_centrum_cz.gif"') + '<a href="http://www.centrum.cz">Centrum</a><br>'+
    138 InsertIcon('www_seznam_cz.gif') + ' <a href="http://www.seznam.cz">Seznam</a><br>'+
    139 InsertIcon('www_atlas_cz.gif') + ' <a href="http://www.atlas.cz">Atlas</a><br>'+
    140 InsertIcon('www_tiscali_cz.gif') + ' <a href="http://www.tiscali.cz">Tiscali</a><br>'+
    141 '<br>'+
    142 '<strong>Užitečné:</strong><br>'+
    143 InsertIcon('clear.gif') + ' <a href="http://www.zdechov.net">Stránky naší sítě</a><br>'+
    144 InsertIcon('www_tvinfo_cz.gif') + ' <a href="http://www.tvinfo.cz/live/televize/cz">Online TV</a><br>'+
    145 InsertIcon('www_idos_cz.gif') + ' <a href="http://www.idos.cz/ConnForm.asp?tt=c">Jízdní řády</a><br>'+
    146 InsertIcon('www_atlas_cz.gif') + ' <a href="http://tv.atlas.cz">TV programy</a><br>'+
    147 InsertIcon('www_icq_com.gif') + ' Web ICQ <a href="javascript:openClient(''flash'')">Flash</a>&nbsp;<a href="javascript:openClient(''java'')">Java</a><br>'+
    148 InsertIcon('www_centrum_cz.gif') + ' <a href="http://slovniky.centrum.cz">Slovníky</a><br>'+
    149 InsertIcon('pocasi.gif') + ' <a href="http://www.meteopress.cz/">Počasí</a><br>'+
    150 InsertIcon('www_tzones_cz.gif') + ' <a href="http://www.tzones.cz/">T-Mobile SMS</a><br>'+
    151 InsertIcon('www_mvk_cz.png') + ' <a href="http://www.mvk.cz/">Knihovna&nbsp;Vsetín</a><br>'+
    152 '<br>'+
    153 '<strong>Prodej počítačů:</strong><br>'+
    154 InsertIcon('www_computershop_cz.png') + ' <a href="http://shop.computershop.cz/eshop/">SOFTCOM</a><br>'+
    155 InsertIcon('www_alfacomp_cz.gif') + ' <a href="http://www.alfacomp.cz/php/zbozi.php?akc=2">Alfacomp</a><br>'+
    156 InsertIcon('www_petracomp_cz.png') + ' <a href="http://www.petracomp.cz/">Petracomp</a><br>'+
    157 InsertIcon('www_tsbohemia_cz.png') + ' <a href="http://interlink.tsbohemia.cz/">TS Bohemia</a><br>'+
    158 '<br>' +
    159 '</td>' +
    160 '<td width="15%" valign="top">';
    161134  // Zobrazení seznamu online poèítaèù
    162   Output := Output + '<strong>Online počítače:</strong><br><span style="font-size: smaller;">';
     135  Output := Output + '<strong>Online počítače:</strong><br /><span style="font-size: smaller;">';
    163136  DbRows := Database.Select('hosts', 'name', 'online=1 AND show_online=1 ORDER BY name');
    164137  for I := 0 to DbRows.Count - 1 do with DbRows[I] do begin
    165     Output := Output + Values['name'] + '<br>';
     138    Output := Output + Values['name'] + '<br />';
    166139  end;
    167140  DbRows.Free;
    168   Output := Output + '</span><br>';
     141  Output := Output + '</span><br />';
    169142
    170   // Zobrazení seznamu dlu¾níkù
    171   Output := Output + '<strong>Dlužníci:</strong><br><span style="font-size: smaller;">';
     143  (*
     144  // Zobrazení seznamu dlužníkù
     145  Output := Output + '<strong>Dlužníci:</strong><br /><span style="font-size: smaller;">';
    172146  DbRows := Database.Select('users', 'fullname', 'cash<0 ORDER BY cash');
    173147  for I := 0 to DbRows.Count - 1 do with DbRows[I] do begin
    174     Output := Output + Values['fullname'] + '<br>';
     148    Output := Output + Values['fullname'] + '<br />';
    175149  end;
    176150  DbRows.Free;
    177151  Output := Output + '</span>';
    178152  Output := Output + '</td></tr></table>';
    179 
    180  (*
     153  *)
     154 
     155  (*
    181156  // Zobrazení èasu bìhu poèítaèe
    182157  Data = explode(' ', exec('uptime'));
     
    196171echo('Server bì¾í '.$Uptime);
    197172*)
    198   Output := Output + '</td><td width="50%" valign="top" style="font-size: smaller;">';
     173  Output := Output + '</div></td><td valign="top">';
    199174 
    200175(* 
     
    208183*)
    209184
    210   Output := Output + '<div onmouseout="skryj(predchozi)">'+ ShowNews(5) + ShowNews(3) + ShowNews(1) + ShowNews(2) + ShowNews(4) + ShowNews(6) + ShowNews(8) + ShowNews(9) + ShowNews(10);
     185  Output := Output + '<div onmouseout="skryj(predchozi)">' + ShowNews(5) + ShowNews(3) + ShowNews(1) + ShowNews(2) + ShowNews(4) + ShowNews(6) + ShowNews(8) + ShowNews(9) + ShowNews(10);
    211186
    212   Output := Output + '<a href="aktuality/subscription.php"><img style="margin: 0px 0px 0px 0px;" border="0" src="images/rss20.png" alt="Aktuality pøes RSS"></a>  <a href="aktuality/subscription.php">Automatické sledování novinek</a>'+
     187  Output := Output + '<a href="aktuality/subscription.php"><img src="images/rss20.png" alt="Aktuality přes RSS" /></a>  <a href="aktuality/subscription.php">Automatické sledování novinek</a>'+
    213188  '</div></td></tr></table>';
    214189  Output := Output + ShowFooter;
Note: See TracChangeset for help on using the changeset viewer.