1
Ace_Armstrong
PiCal 0.7 -- Remove GMT from detailed event view?

Is there a way to remove the GMT time display from the events detail page and just display the local time? I've pored through the code and I can't find it. (Of course, what I know about PHP could fit on the point of a needle, so that's not really saying much.)

Thanks!
Ace Armstrong
The Man. The Myth. The Mammal.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Intelligent, informed debate good. Innuendo bad. See for yourself!
www.GLOAMING.us

2
Ace_Armstrong
Re: PiCal 0.7 -- Remove GMT from detailed event view?

I also need to change the dates to American format if possible ("May 21" instead of "21 May") throughout the blocks and content.

Anyone know how to do this?
Ace Armstrong
The Man. The Myth. The Mammal.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Intelligent, informed debate good. Innuendo bad. See for yourself!
www.GLOAMING.us

3
mactoeknee
Re: PiCal 0.7 -- Remove GMT from detailed event view?
  • 2005/11/14 19:43

  • mactoeknee

  • Just popping in

  • Posts: 75

  • Since: 2005/2/26


I am not sure what's going on, but piCal support is dying around here. My recent post on the piCal author's forums also went unanswered. It's the best calendar program for Xoops, as far as I can see, but now it seems to have a time zone error with the latest version of Xoops.
In any case, piCal is great but does not conform to all of Xoops' standards, so finding the right files to edit has been difficult for me (a non-programmer). I'll see if I can find the file for you. In the meantime, you might try the developer's own forum:
http://www.peak.ne.jp/xoops/md/xhnewbb/viewforum.php?forum=1

4
peterr
Re: PiCal 0.7 -- Remove GMT from detailed event view?
  • 2005/11/15 3:33

  • peterr

  • Just can't stay away

  • Posts: 518

  • Since: 2004/8/5 9


It seems version 0.84 of piCal has just been released.

There is also eXtCal, but I do not know of any sites using it.

Certainly piCal is more widely known, and in fact included in one of the official XOOPS module packages. I do not know what the support is like for piCal though.
NO to the Microsoft Office format as an ISO standard.
Sign the petition

5
peterr
Re: PiCal 0.7 -- Remove GMT from detailed event view?
  • 2005/11/15 6:12

  • peterr

  • Just can't stay away

  • Posts: 518

  • Since: 2004/8/5 9


Hi,

Quote:

Ace_Armstrong wrote:
Is there a way to remove the GMT time display from the events detail page and just display the local time?


Looking at the release that just came out (vers 0.84), it would appear the file is /modules/piCal/class/piCal.php , the following lines (1734 - 1752)

if( $event->allday ) {
        
// 
        
$tzoffset ;
        
$event->end -= 300 ;
        
$start_time_str "("._PICAL_MB_ALLDAY_EVENT.")" ;
        
$end_time_str "" ;
    } else {
        
// 
        
$tzoffset intval( ( $this->user_TZ $this->server_TZ ) * 3600 ) ;
        
$disp_user_tz $this->get_tz_for_display$this->user_TZ ) ;
        
$start_time_str $this->get_middle_hi$event->start $tzoffset ) . $disp_user_tz;
        
$end_time_str $this->get_middle_hi$event->end $tzoffset ) . $disp_user_tz;
        if( 
$this->user_TZ != $event->event_tz ) {
            
$tzoffset_s2e intval( ( $event->event_tz $this->server_TZ ) * 3600 ) ;
            
$disp_event_tz $this->get_tz_for_display$event->event_tz ) ;
            
$start_time_str .= " &nbsp; &nbsp; <small>" $this->get_middle_dhi$event->start $tzoffset_s2e ) . $disp_event_tz</small>" ;
            
$end_time_str .= " &nbsp; &nbsp; <small>" $this->get_middle_dhi$event->end $tzoffset_s2e ) . $disp_event_tz</small>" ;
        }
    }


and a very quick hack would be to change line 1743

$disp_user_tz $this->get_tz_for_display$this->user_TZ ) ;


to ..........

$disp_user_tz '';


but that isn't a good long term solution, it would be better to modify the admin side of things to display the user time zone or not.

HTH
NO to the Microsoft Office format as an ISO standard.
Sign the petition

6
peterr
Re: PiCal 0.7 -- Remove GMT from detailed event view?
  • 2005/11/15 6:33

  • peterr

  • Just can't stay away

  • Posts: 518

  • Since: 2004/8/5 9


Quote:

Ace_Armstrong wrote:
I also need to change the dates to American format if possible ("May 21" instead of "21 May") throughout the blocks and content.


The same file (/modules/piCal/class/piCal.php ) has functions called 'get_middle_dhi' and 'get_middle_dh', lines 2646 to 2674 as follows:

function get_middle_dhi$time $is_over24 false )
{
    
$hour_offset $is_over24 24 ;

    
$hour4disp $this->use24 $this->hour_names_24date'G' $time ) + $hour_offset ] : $this->hour_names_12date'G' $time ) + $hour_offset ] ;

    return 
sprintf(
        
_PICAL_FMT_DHI ,
        
$this->date_short_namesdate'j' $time ) ] , // D
        
$hour4disp // H
        
date_PICAL_DTFMT_MINUTE $time // I
    
) ;
}



// unixtimestamp
function get_middle_hi$time $is_over24 false )
{
    
$hour_offset $is_over24 24 ;

    
$hour4disp $this->use24 $this->hour_names_24date'G' $time ) + $hour_offset ] : $this->hour_names_12date'G' $time ) + $hour_offset ] ;

    return 
sprintf(
        
_PICAL_FMT_HI ,
        
$hour4disp // H
        
date_PICAL_DTFMT_MINUTE $time // I
    
) ;
}


and the method in which the date is represented, is by the 'date' function. If you checkout:

http://php.planetmirror.com/manual/en/function.date.php

there are plenty of examples. To get the format you want it is

$today date("M j");              // May 21


HTH
NO to the Microsoft Office format as an ISO standard.
Sign the petition

7
Ace_Armstrong
Re: PiCal 0.7 -- Remove GMT from detailed event view?

I understood most of that. Thanks for the help. Now I've got a new problem. I upgrade to 084, and it broke my design because SOMEWHERE in the code it's hard coded to create a table that is 640 pixels wide. This is the offending code, as seen from the source of a page that is displayed broken (the very first line is from my theme.html file as a reference; the rest is generated by the module):

Quote:

<td id="CenterMainContent">

<table border='0' cellspacing='0' cellpadding='0' width='640'>
<tr>
<td width='640' class='calframe'>
<!-- header -->

<table border='0' cellspacing='0' cellpadding='0' style='width:640px;border-collapse:collapse;'>
<tr>
<td><img src='http://www.SITENAME.com/modules/piCal/images/default/spacer.gif' alt='' width='10' height='30' /></td>
<td nowrap='nowrap' colspan='7' align='center' bgcolor='74BAFF'>
<table border='0' cellspacing='0' cellpadding='0' width='630' class='pical-categoryform'>


I can't find any reference to "640" or "630" anywhere in the code. I have gone through literally every file in the module and every file in the "common" directory. NOTHING.

If someone could give me a clue on this, that would be great. *grumble grumble*
Ace Armstrong
The Man. The Myth. The Mammal.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Intelligent, informed debate good. Innuendo bad. See for yourself!
www.GLOAMING.us

8
Ace_Armstrong
Re: PiCal 0.7 -- Remove GMT from detailed event view?

Quote:

peterr wrote:
Quote:

Ace_Armstrong wrote:
I also need to change the dates to American format if possible ("May 21" instead of "21 May") throughout the blocks and content.


The same file (/modules/piCal/class/piCal.php ) has functions called 'get_middle_dhi' and 'get_middle_dh', lines 2646 to 2674 as follows:

function get_middle_dhi$time $is_over24 false )
{
    
$hour_offset $is_over24 24 ;

    
$hour4disp $this->use24 $this->hour_names_24date'G' $time ) + $hour_offset ] : $this->hour_names_12date'G' $time ) + $hour_offset ] ;

    return 
sprintf(
        
_PICAL_FMT_DHI ,
        
$this->date_short_namesdate'j' $time ) ] , // D
        
$hour4disp // H
        
date_PICAL_DTFMT_MINUTE $time // I
    
) ;
}



// unixtimestamp
function get_middle_hi$time $is_over24 false )
{
    
$hour_offset $is_over24 24 ;

    
$hour4disp $this->use24 $this->hour_names_24date'G' $time ) + $hour_offset ] : $this->hour_names_12date'G' $time ) + $hour_offset ] ;

    return 
sprintf(
        
_PICAL_FMT_HI ,
        
$hour4disp // H
        
date_PICAL_DTFMT_MINUTE $time // I
    
) ;
}


and the method in which the date is represented, is by the 'date' function. If you checkout:

http://php.planetmirror.com/manual/en/function.date.php

there are plenty of examples. To get the format you want it is

$today date("M j");              // May 21



Okay....I understand how to get the right format from PHP. What I don't get is where in the piCal code to make the change to that format.
Ace Armstrong
The Man. The Myth. The Mammal.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Intelligent, informed debate good. Innuendo bad. See for yourself!
www.GLOAMING.us

9
peterr
Re: PiCal 0.7 -- Remove GMT from detailed event view?
  • 2005/11/17 0:30

  • peterr

  • Just can't stay away

  • Posts: 518

  • Since: 2004/8/5 9


Quote:

Ace_Armstrong wrote:

I can't find any reference to "640" or "630" anywhere in the code. I have gone through literally every file in the module and every file in the "common" directory. NOTHING.
[/quote]

If I understand the problem, as you had '/spacer.gif' highlighted, that is your concern.

Because the td/cell code for that is within a row which is within a table defined as 640 px wide, that is why it appears as 640 wide. In fact, _that_ table is within another table of 640 px wide.

I didn't install the common directory, because with XOOPS 2.2.x, all that code is already defined in a standard XOOPS path, ....... found that out after stumbling upon some piCal code.

HTH
NO to the Microsoft Office format as an ISO standard.
Sign the petition

10
peterr
Re: PiCal 0.7 -- Remove GMT from detailed event view?
  • 2005/11/17 0:34

  • peterr

  • Just can't stay away

  • Posts: 518

  • Since: 2004/8/5 9


Quote:

Ace_Armstrong wrote:
I can't find any reference to "640" or "630" anywhere in the code. I have gone through literally every file in the module and every file in the "common" directory. NOTHING.


If I understand the problem, as you had '/spacer.gif' highlighted, that is your concern.

Because the td/cell code for that is within a row which is within a table defined as 640 px wide, that is why it appears as 640 wide. In fact, _that_ table is within another table of 640 px wide.

I didn't install the common directory, because with XOOPS 2.2.x, all that code is already defined in a standard XOOPS path, ....... found that out after stumbling upon some piCal code.

HTH
NO to the Microsoft Office format as an ISO standard.
Sign the petition

Login

Who's Online

58 user(s) are online (31 user(s) are browsing Support Forums)


Members: 0


Guests: 58


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Aug 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits