Salta al contenuto
  • CATEGORIES
  • La Community Connect.gt
  • Presentati alla Community
  • News Ufficiali da Connect.gt
  • Internet News
  • A Scuola Di
  • Digital Marketing
  • Intelligenza Artificiale
  • SEO & GEO
  • Web Marketing e Content
  • Google Analytics e Web Analytics
  • Google Ads & Advertising
  • YouTube
  • TikTok, Instagram e altri Social
  • Google Adsense, Affiliazioni e Guadagno
  • E-Commerce
  • Coding e Sistemistica
  • Help Center: consigli per il tuo progetto
  • Hosting e Cloud
  • Coding
  • CMS & Piattaforme Self-Hosted
  • Annunci e Collaborazioni
  • Annunci Vendita e Acquisto: Pubblicità, Domini, Link e altro
  • Collaborazioni WEB e Lavoro: offro e cerco
  • Impresa, Fisco e Leggi
  • Consulenza Legale e Professioni Web
  • Consulenza Fiscale, Imprese, Startup e P.Iva
  • Gli Off Topic
  • PC, Smartphone e altri Hardware
  • Tutti i Software
  • GT Fetish Cafè
  • Discussioni
  • 0 Non letti 0
  • Recenti
  • Hashtag
  • Popolare
  • Utenti
  • Privacy
  • Termini e condizioni
  • © 2026 Search On Media Group S.r.l.
Collassa
Connect.gt
Il network Search On
Connect.gt WMF AI Festival Accademia Advanced SEO Tool AgentCy Social Media Strategies Search Tech
Registrati Accedi
Connect.gt
Stream Interest Categorie Hashtag
  1. La community italiana di SEO, marketing digitale e AI
  2. Categorie
  3. Coding e Sistemistica
  4. Coding
  5. Calendario eventi

Calendario eventi

Pianificato Fissato Bloccato Spostato Coding
6 Post 3 Autori 609 Visualizzazioni 1 Seguito
  • Da Vecchi a Nuovi
  • Da Nuovi a Vecchi
  • Più Voti
Rispondi
  • Risposta alla discussione
Effettua l'accesso per rispondere
Questa discussione è stata eliminata. Solo gli utenti con diritti di gestione possono vederla.
  • A
    A
    ale90
    scritto su ultima modifica di
    User Attivo 5
    #1
    Calendario eventi

    Ciao ragazzi, ho trovato questo script su internet

    <?php
    
    
    
    if (empty($_GET['month'])) {
        $month = date('n');
    } else {
        $month = $_GET['month'];
    }
    
    if (empty($_GET['year'])) {
        $year = date('Y');
    } else {
        $year = $_GET['year'];
    }
    
    
    
    $nomemese = array (1 => "Gennaio", "Febbraio", "Marzo", "Aprile",
    "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre");
    
    
    
    
    $theday = date('w', mktime(0, 0, 0, $month, 1, $year));
    
    $daysinmonth = date("t", mktime(0, 0, 0, $month, 1, $year));
    ?>
    
    <table cellspacing="1" cellpadding="0" border="0" class="mainTable">
        <tr>
            <td align="center" colspan="7" class="monthRow">
                <a href="<?php echo $_SERVER['PHP_SELF']; if ($month == '01') { $prevmonth = '12'; $prevyear = $year - 1; echo '?month=' . $prevmonth; echo '&year=' . $prevyear; } else { $prevmonth = $month - 1; echo '?month=' . $prevmonth; echo '&year=' . $year; } ?>">&laquo;</a>
                <?php
                    $monthName = date('F', mktime(0, 0, 0, $month, 1, $year));
                    $yearName = date('Y', mktime(0, 0, 0, $month, 1, $year));
                    echo $nomemese[$month] . ' ' . $yearName;
                ?>
                <a href="<?php echo $_SERVER['PHP_SELF']; if ($month == '12') { $nextmonth = '01'; $nextyear = $year + 1; echo '?month=' . $nextmonth; echo '&year=' . $nextyear; } else { $nextmonth = $month + 1; echo '?month=' . $nextmonth; echo '&year=' . $year; } ?>">&raquo;</a>
            </td>
        </tr>
        <tr class="dayNamesText">
            <td class="dayNamesRow" width="25" align="center">L</td>
            <td class="dayNamesRow" width="25" align="center">M</td>
            <td class="dayNamesRow" width="25" align="center">M</td>
            <td class="dayNamesRow" width="25" align="center">G</td>
            <td class="dayNamesRow" width="25" align="center">V</td>
            <td class="dayNamesRow" width="25" align="center">S</td>
            <td class="dayNamesRow" width="25" align="center">D</td>
        </tr>
    
        <tr class="rows">
        <?php
        for ($i = 0; $i < $theday; $i++) {
        ?>
            <td>&nbsp;</td>
        <?php
        }
        for ($list_day = 2; $list_day <= $daysinmonth; $list_day++) {
            $tm = date("U", mktime(0, 0, 0, $month, $list_day, $year)) - 86400; // Bir gün önce
            $tn = date("U", mktime(0, 0, 0, $month, $list_day, $year)); // O gün ...
            $tp = date("U", mktime(0, 0, 0, $month, $list_day, $year)) + 86400; // Bir gün sonra
            $Q = sprintf("SELECT * FROM `events` WHERE `date` > '%s' AND `date` < '%s' AND `day` = '%s';", $tm, $tp, $list_day);
            $R = mysql_query($Q);
            $D = mysql_fetch_assoc($R);
            $S = mysql_num_rows($R);
            $Y = $D['date'];
            $TheDay = date('d', $Y);
            $TheMon = date('F', $Y);
            $TheYea = date('Y', $Y);
            mysql_free_result($R);
            if ($S) {
            ?>
                <td align="center" onClick="eventipopup(<?php echo $D['day']; ?>, <?php echo $D['month']; ?>, <?php echo $D['year']; ?>, 600, 520)" style="background-color: #CCFF00; color: #333333; cursor: pointer;" onMouseOver="return overlib('&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; class=&quot;popupDateTable&quot;&gt;&lt;tr&gt;&lt;td align=&quot;center&quot; class=&quot;popupDate&quot;&gt;<?php echo $TheDay; ?> <?php echo $nomemese[$month]; ?> <?php echo $TheYea; ?>&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;div class=&quot;popupEventTitle s23&quot;&gt;<?php echo $S; ?> Evento(i) &lt;/div&gt;');" onMouseOut="return nd();" title="">
            <?php
            } elseif ($tn > $tm AND $tn < $tp AND date('j') == $list_day AND date('m') == $month AND date('Y') == $year) {
            ?>
                <td align="center" style="background-color: #FFC18A; color: #CF0000; cursor: pointer;" onMouseOver="return overlib('&lt;div style=&quot;background-color: #FFC18A; color: #CF0000; padding: 4px;&quot;&gt;Oggi&lt;/div&gt;');" onMouseOut="return nd();">
            <?php
            } elseif ($theday == 6 or $theday == 0) {
            ?>
                <td align="center" style="background-color: #EEEEEE; color: #666666;">
            <?php
            } else {
            ?>
                <td align="center" style="background-color: #CCCCCC; color: #333333;">
            <?php
            }
            
            echo $list_day;
    
            echo '</td>';
    
            if ($theday == 6) {
                echo '</tr>';
                echo '<tr class="rows">';
                $theday = -1;
            }
        $theday++;
    }
    ?>
    

    Serve esattamente a creare un calendario online, però mi comincia a contare ogni volta dal giorno 2 al 30 o 31 (in base al mese)

    E non capisco come far apparire anche il primo del mese..

    Avete qualche idea??

    1 Risposta Ultima Risposta
    Miglior risposta 0
    0
    • P
      P
      patatrac
      scritto su ultima modifica di
      User Attivo 0
      #2

      ti allego calendario da me modificato per eventi con db

      htt.:..w14.easy-share.co_/1701083031.html

      1 Risposta Ultima Risposta
      Miglior risposta 0
      0
      • A
        A
        ale90
        scritto su ultima modifica di
        User Attivo 5
        #3

        Adesso lo provo 😉

        Zau e grazie

        1 Risposta Ultima Risposta
        Miglior risposta 0
        0
        • A
          A
          ale90
          scritto su ultima modifica di
          User Attivo 5
          #4

          Perfetto grazie mille 😉

          Sei stato gentilissimo....

          Zau zau

          1 Risposta Ultima Risposta
          Miglior risposta 0
          0
          • O
            O
            olaola
            scritto su ultima modifica di
            User Attivo 5
            #5

            Ciao ragazzi,

            per la cronaca, penso che la "colpa" fosse di questa riga di codice

            for ($list_day = 2; $list_day <= $daysinmonth; $list_day++)
            

            Come si puo' vedere $list_day parte dal valore 2.

            Ciao ciao

            1 Risposta Ultima Risposta
            Miglior risposta 0
            0
            • A
              A
              ale90
              scritto su ultima modifica di
              User Attivo 5
              #6

              Ciao ragazzi, grazie a tutti per l'aiuto, adesso avrei questo problemino vorrei che quando insersco una news aggiungo un campo dal giorno al giorno in modo che se io metto dal 10 agosto 2008 al 21 agosto 2008 mi si aggiunta in ogni giorno lo stesso evento..

              E' possibile fare una cosa del genere?? Avete qualche idea su come potrei fare questa cosa?? ⭕o

              1 Risposta Ultima Risposta
              Miglior risposta 0
              0

              Ciao! Sembra che tu sia interessato a questa conversazione, ma non hai ancora un account.

              Stanco di dover scorrere gli stessi post a ogni visita? Quando registri un account, tornerai sempre esattamente dove eri rimasto e potrai scegliere di essere avvisato delle nuove risposte (tramite email o notifica push). Potrai anche salvare segnalibri e votare i post per mostrare il tuo apprezzamento agli altri membri della comunità.

              Con il tuo contributo, questo post potrebbe essere ancora migliore 💗

              Registrati Accedi
              Rispondi
              • Risposta alla discussione
              Effettua l'accesso per rispondere
              • Da Vecchi a Nuovi
              • Da Nuovi a Vecchi
              • Più Voti


              • Accedi

              • Non hai un account? Registrati

              • Accedi o registrati per effettuare la ricerca.
              • Primo post
                Ultimo post
              Home Accedi Registrati
              Menu
              • CATEGORIES
              • La Community Connect.gt
              • Presentati alla Community
              • News Ufficiali da Connect.gt
              • Internet News
              • A Scuola Di
              • Digital Marketing
              • Intelligenza Artificiale
              • SEO & GEO
              • Web Marketing e Content
              • Google Analytics e Web Analytics
              • Google Ads & Advertising
              • YouTube
              • TikTok, Instagram e altri Social
              • Google Adsense, Affiliazioni e Guadagno
              • E-Commerce
              • Coding e Sistemistica
              • Help Center: consigli per il tuo progetto
              • Hosting e Cloud
              • Coding
              • CMS & Piattaforme Self-Hosted
              • Annunci e Collaborazioni
              • Annunci Vendita e Acquisto: Pubblicità, Domini, Link e altro
              • Collaborazioni WEB e Lavoro: offro e cerco
              • Impresa, Fisco e Leggi
              • Consulenza Legale e Professioni Web
              • Consulenza Fiscale, Imprese, Startup e P.Iva
              • Gli Off Topic
              • PC, Smartphone e altri Hardware
              • Tutti i Software
              • GT Fetish Cafè
              • Discussioni
              • Non letti 0
              • Recenti
              • Hashtag
              • Popolare
              • Utenti
              • Privacy
              • Termini e condizioni
              • © 2026 Search On Media Group S.r.l.