Visualizzazione dei risultati da 1 a 6 su 6
  1. #1
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    21

    Calendario eventi Calendarix Errore

    Salve stò usando con soddisfazione lo script Calendarix molto ben fatto, volevo integrare anche la parte di mini calendario da inserire sul sito ma ricevo un errore non capisco il motivo, ecco il link:
    http://www.comune.castellina.pi.it/p...ix/minical.php

    appena passo sull'evento mi da un errore e non capisco il motivo, dovrebbe dare il le info sull'evento.

    ed il codice:
    <?php
    require_once "cal_config.inc.php";
    include_once ($calpath."cal_utils.php");
    $urlpathtocal = "http://localhost/calendarix/demo/";
    //require_once $urlpathtocal."themes/".$theme.".css";

    // Ensures overlib javascript lib only included once so IE can render
    $included_files = get_included_files();
    $gotHeader = false;
    foreach ($included_files as $filename) {
    $pos = strpos($filename,'cal_header.inc.php');
    if ($pos===false) echo "";
    else $gotHeader = true;
    }
    if (!$gotHeader) {
    echo "<link href=\"themes/".$theme.".css\" rel=\"stylesheet\" type=\"text/css\" />\n";
    echo "\n\n";
    echo "\n<div id=\"overDiv\" style=\"position:absolute; visibility:hidden; z-index:1000;\"></div>\n";
    echo "<script language=\"JavaScript\" src=\"".$urlpathtocal."overlib.js\"></script>\n";
    echo "\n\n";
    }
    /*

    <div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
    <script language="JavaScript" src="<?php echo $urlpathtocal.'overlib.js'?>" type="text/JavaScript"></script>
    */

    ################################################## ########################
    # Please refer to the README file for licensing and contact information.
    #
    # This file has been updated for version 0.8.20080808
    #
    # If you like this application, do support me in its development
    # by sending any contributions at www.calendarix.com.
    #
    # This is file is identical to one in admin section of same name.
    #
    # Copyright © 2004-2008 Vincent Hor
    ################################################## ########################

    if (!isset($_GET['date']))
    $date = date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))) ;
    else
    $date = $_GET['date'];

    if (!isset($uname))
    if (($userview==1)&&($userlogin==1)) EXIT(); // user view user specific events only
    else $uname = ""; // for public view permitted.

    $smyear = substr($date,0,4) ;
    $smmonth = substr($date,5,2) ;
    if (substr($smmonth,0,1) == "0")
    $smmonth = str_replace("0","",$smmonth);

    $showeventcount = true;
    $showyear = true;

    // Set today's date corrected by timezone
    $um = date("n");
    $uy = date("Y");
    $ud = date("j");

    if ((date("G")+$timezone)>24) {
    $ud = date("j",mktime(0,0,0,$um,date("j")+1,$uy)) ;
    $um = date("n",mktime(0,0,0,$um,date("j")+1,$uy)) ;
    $uy = date("Y",mktime(0,0,0,$um,date("j")+1,$uy)) ;
    }

    if ((date("G")+$timezone)<0) {
    $ud = date("j",mktime(0,0,0,$um,date("j")-1,$uy)) ;
    $um = date("n",mktime(0,0,0,$um,date("j")-1,$uy)) ;
    $uy = date("Y",mktime(0,0,0,$um,date("j")-1,$uy)) ;
    }

    // number of days in month
    $firstday = date ("w", mktime(12,0,0,$smmonth,1,$smyear));
    $nr = date("t",mktime(12,0,0,$smmonth,1,$smyear));
    echo "\n\n<table class='smallcalmth' align='center' >";
    echo "<tr><td align='center' valign='middle' width='100%'><div class='smallcalmth'>";

    $pdate = date("Y-m-d",mktime(0,0,0,$smmonth-1,1,$smyear)) ;
    if (date("Y",mktime(0,0,0,$smmonth-1,1,$smyear))>=$calstartyear)
    echo "&lt;&lt;";

    echo " ";
    if ($viewcalok==1) {
    echo "<a class=\"smallcalmth\" href=\"".$urlpathtocal."calendar.php?op=cal&month= ".$smmonth."&year=".$smyear."\" target=\"_BASE\" >" ;
    }
    echo $mth[$smmonth] ;
    if ($viewcalok==1) echo "</a> " ;
    if ($showyear) echo " ".$smyear;

    echo " ";
    $pdate = date("Y-m-d",mktime(0,0,0,$smmonth+1,1,$smyear)) ;
    if (date("Y",mktime(0,0,0,$smmonth+1,1,$smyear))<=dat e("Y")+$caladvanceyear)
    echo "&gt;&gt;";
    echo "</div></td></tr></table>\n\n";

    echo "<table align='center' class='smallcalmth'>";
    echo "<tr>";

    // make the header days of week
    for ($i=intval($weekstartday)+1;$i<=(intval($weekstart day) + 7);$i++){
    echo "<td align='center' ";
    if (($i<>1)&&($i<>7)) echo "width='14%'>" ;
    else echo "width='15%'>" ;
    if (dayinweek($i) == 1)
    echo "<div class='dayfont'>".substr($week[dayinweek($i)],0,3)."</div></td>"; // sunday
    else
    echo "<div class='dayfont'>".substr($week[dayinweek($i)],0,3)."</div></td>"; // rest of week
    }
    echo "</tr>\n\n<tr>";

    // print initial blank squares
    for ($i=1;$i<=blankdays(intval($weekstartday),$firstda y);$i++) echo "<td></td>";
    $a=0;
    for ($i=1;$i<=$nr;$i++){
    // now get eventual events on $i
    $query = "select id,user,title,starttime,endtime from ".$EVENTS_TB." left join ".$CAT_TB." on ".$EVENTS_TB.".cat=".$CAT_TB.".cat_id where day='$i' and month='$smmonth' and year='$smyear' and approved='1' " ;

    $query = $query." order by day,month,year,starttime,title ASC";
    $result = mysql_query($query);
    $devtcnt = mysql_num_rows($result) ;

    echo "<td align=center ";
    if ($i == $ud && $smmonth == $um && $smyear == $uy) // highlight today's day
    echo "class=todayclr ";
    elseif ($devtcnt!=0)
    echo "class=smallcalmth ";
    echo "valign=top>\n\n";

    if ($devtcnt!=0) {
    // overlib line
    echo "<a href=\"javascript:void(0);\" onmouseover=\"return overlib('";
    echo "<table border=0 cellspacing=0 cellpadding=0 width=100%>" ;
    while ($row = mysql_fetch_object($result)){
    echo "<tr><td align=center valign=top>" ;
    echo "<table class=eventborder cellspacing=0 cellpadding=0 width=100%><tr>";
    if ($notimeentry==0) {
    echo "<td align=center class=eventtimeborder valign=top>" ;
    echo "<div class=smallcalevtime>";
    if ($row->starttime=='') echo " " ;
    else showtime($row->starttime,$row->endtime,1);
    echo "</div>" ;
    echo "</td>" ;
    }
    echo "<td align=left valign=top width=80% class=eventborder>" ;
    echo "<div class=smallcalev>";
    echo subquot(stripslashes($row->title));
    echo "</div>" ;

    echo "</td></tr>" ;
    echo "</table>" ;
    }
    echo "</table>" ;
    // overlib line
    echo "',FGCOLOR,'$overlibbgclr',TEXTSIZE,'1',WIDTH,'120 ',VAUTO,HAUTO);\" onmouseout=\"return nd();\">";
    }

    echo "<div class='datenumfont'>".$i."</div>" ;
    if ($devtcnt!=0) echo "</a>";
    echo "</td>\n\n";
    $a++;
    if (blankdays(intval($weekstartday),date("w",mktime(0 ,0,0,$smmonth,$i,$smyear))) == 6) {
    echo "</tr>\n\n<tr>";
    $a = 0;
    }
    }
    if ($a!=0) {
    for ($i=$a;$i<7;$i++) {
    echo "<td></td>";
    }
    }
    echo "</tr>";
    if ($showeventcount) {
    echo "<tr><td align='center' valign='top' colspan='7'>" ;
    // get total number of events for month
    $tquery = "select id from ".$EVENTS_TB." where ".$EVENTS_TB.".month='".$smmonth."' and ".$EVENTS_TB.".year='".$smyear."' and ".$EVENTS_TB.".approved='1' " ;
    $normuser = false ;
    if (($userview==1)&&($userlogin==1)&&($uname!="")) { // view user specific events only
    $uquery = "select group_id from ".$USER_TB." where ".$USER_TB.".user_id=".$userid ;
    $uresult = mysql_query($uquery) ;
    $urow = mysql_fetch_object($uresult);
    if ($urow->group_id!=0) {
    $normuser = true ;
    $tquery = "select * from ".$EVENTS_TB.",".$USER_TB." where ".$EVENTS_TB.".month='".$smmonth."' and ".$EVENTS_TB.".year='".$smyear."' and ".$EVENTS_TB.".approved='1' and ".$EVENTS_TB.".user=".$USER_TB.".username and ".$USER_TB.".user_id=".$userid ;
    }
    }
    $tresult = mysql_query($tquery);
    $trows = mysql_num_rows($tresult) ;
    echo "<table class='txtbox' cellspacing='0' cellpadding='0'><tr><td align='center'><div class='normalfont'> ";

    echo "<a class='normalfont' href='#' onmouseover=\"return overlib('Calendarix version ".$version."\\nCopyright © 2002-2008 Vincent Hor',FGCOLOR,'#FFFFFF',TEXTSIZE,'1',WIDTH,'225',VA UTO,HAUTO,CAPTION,'".translate("About Calendarix")." [Basic] ');\" onmouseout=\"return nd();\">";

    echo $trows." ".translate("events")."</a>
    </div></td></tr></table>" ;
    echo "</td></tr>" ;
    }
    echo "</table>";


    ?>

    Ciao e grazie

  2. #2
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    21
    Ma l'errore ve lo da anche a voi???

  3. #3
    Utente di HTML.it L'avatar di dottwatson
    Registrato dal
    Feb 2007
    Messaggi
    3,012
    non trova la libreria javascript overlib.js

    Non sempre essere l'ultimo è un male... almeno non devi guardarti le spalle

    il mio profilo su PHPClasses e il mio blog laboweb

  4. #4
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    21
    intanto grazie per la risposta!

    senti ho guardato sul server e nella stessa cartella del file c'è anche overlib.js, non è che allora c'è un'eerore di sintassi?

    Ciao e grazie

  5. #5
    Utente di HTML.it L'avatar di dottwatson
    Registrato dal
    Feb 2007
    Messaggi
    3,012
    è questa riga che è sbagliata

    Codice PHP:
    $urlpathtocal "http://localhost/calendarix/demo/"
    cambiala con il dominio in cui provi lo script

    Non sempre essere l'ultimo è un male... almeno non devi guardarti le spalle

    il mio profilo su PHPClasses e il mio blog laboweb

  6. #6
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    21
    Perfetto, mi hai risolto il problema sei un grande, Grazie mille!!!

    Se ora provi il link è tutto ok, gia che ci sono ti faccio un'altra domanda, secondo te è complicato oltre che vedere l'evento come mi succede in questo caso, creare il link all'evento stesso e aprirlo nel popup, come posso fare quì?

    http://www.comune.castellina.pi.it/p...x/calendar.php

    Grazie ancora!!!!!!!

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.