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

  • peterr

  • Just can't stay away

  • Posts: 518

  • Since: 2004/8/5 9


Quote:

Ace_Armstrong wrote:
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.


I usually use 'echo' to debug what is happening, but it may get very messy to read, and besides, a good chance of getting a PHP 'headers already sent' msg,etc.

1. Take a backup of /modules/piCal/class/piCal.php

2. Use the PHP mail() function to tell you what is happening, and especially the values of certain variables. For example, in function get_middle_dhi() - add the following _before_ the return statement (before line 2652)

//send me the values of the vars
$my_time $time;
$my_is_over24 $is_over24;
$my_$hour_offset $hour_offset;
$my_$hour4disp $hour4disp;
$my_sprintfop sprintf(
        
_PICAL_FMT_DHI ,
        
$this->date_short_namesdate'j' $time ) ] , // D
        
$hour4disp // H
        
date_PICAL_DTFMT_MINUTE $time // I
    
) ;

$to "Ace_Armstrong@example.com";  //your email address
$from "Ace_Armstrong@example.com";
$subject "Values from function get_middle_dhi";

$message "Var my_time = " $my_time "n";
$message .= "Var my_is_over24 = " $my_is_over24 "n";
$message .= "Var my_$hour_offset = " $my_$hour_offset "n";
$message .= "Var my_$hour4disp = " $my_$hour4disp "n";
$message .= "Var my_sprintfop = " $my_sprintfop "n";

mail$to$subject$message$from );


I haven't tested the above code, but it is a handy method to see what is going on.

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

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

Quote:

peterr wrote:
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.



No, the line that was highlighted was simply XOOPS activating a hyperlink in my message; the actual problem is the way there are several lines that specify the width of the table and the width of the various cells to be 640 and 630. This is nowhere within my theme, and none of the other modules create this table. In fact, piCal didn't do it until I upgraded to 0.84. That table simply doesn't appear anywhere within the code, unless it's in the parts that are written in Japanese.

I have literally been through every line of code from piCal and the js calendar and cannot find a single mention of 640 pixels of width. (Well, there was ONE, but it was unrelated and I changed it to 570. Didn't do the trick.)

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

13
peterr
Re: PiCal 0.7 -- Remove GMT from detailed event view?
  • 2005/11/17 2:58

  • peterr

  • Just can't stay away

  • Posts: 518

  • Since: 2004/8/5 9


Quote:

Ace_Armstrong wrote:
the actual problem is the way there are several lines that specify the width of the table and the width of the various cells to be 640 and 630. This is nowhere within my theme, and none of the other modules create this table. In fact, piCal didn't do it until I upgraded to 0.84. That table simply doesn't appear anywhere within the code, unless it's in the parts that are written in Japanese.


I can see the problem, but there is little point trying to find out where the 630 or 640 is coming from, there are so many embedded functions and classes within XOOPS, ...well, there will be no hair left.

If I examine one theme and the code generated by PiCal (I can see the same problem on another site, btw), notice the code _before_ the piCal table, something like:

<!-- End left blocks loop -->

</
td>
<
td style="padding: 0px 5px 0px;">

<!-- 
Display center blocks if any -->


<!-- 
End display center blocks -->

<
div id="content">  <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>


The left blocks have finished, and as any std template, the center block code begins, ..... BUT, it ends straight away.

If I then look at the template for the theme file (called theme.html), I see this

<!-- End display center blocks -->

<
div id="content"><{$xoops_contents}></div></td>


.. then end of the center block display has happened already, the "div" tag, and in fact if you checkout the generated html, the var $xoops_contents is of course where the value '640' and all the rest of the code comes from, right through to the (end) 'div' tag.

So, it is a problem with piCal, for some reason, there are is fact no html code generated for the 'center' blocks, and back to the theme.html, the code that generates it is

<!-- Display center blocks if any -->

<{if 
$xoops_showcblock == 1}>
<
table cellspacing="0">
<
tr><td width="100%" colspan="2">

<!-- 
Start center-center blocks loop -->


.... so, with piCal, the var $xoops_showcblock is not set to '1', and the generated html code is not positioned correctly.

I don't have time today, but I'd suggest you go into admin, and see what the (center) block settings are, I'd say 'piCal' would not be showing there.

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

14
peterr
Re: PiCal 0.7 -- Remove GMT from detailed event view?
  • 2005/11/17 5:21

  • peterr

  • Just can't stay away

  • Posts: 518

  • Since: 2004/8/5 9


Hmm, ... it seems most XOOPS modules display the centre content outside of the control structure sourced from the theme.html code. Here is some generated code from a forum display

<!-- End left blocks loop -->

</
td>
<
td style="padding: 0px 5px 0px;">

<!-- 
Display center blocks if any -->


<!-- 
End display center blocks -->

<
div id="content"><div id="index_welcome">
    <
div class="title"><a href="http://example.com/modules/newbb/">Welcome to the ..... Forum.</a></div>

    <
div class="desc">To start viewing messagesselect the forum that you want to visit from the list below.</div>
    <
div class="visit">The time now is 2005/11/17 10:14
        
<br />You last visited2005/11/16 16:12:54
        
<br />Total Topics: <strong>0</strong> | Total Posts: <strong>0</strong>
    </
div>
</
div>


however the table positioning is aligned perfectly, whereas piCal is not. For example, the forums module code uses a percentage width for the table, rather than pixels:

<!-- start forum categories -->
<
table class="index_category" cellspacing="0" width="100%">
    <
tr class="head">
        <
td width="3%" valign="middle" align="center"><img onclick="ToggleBlock2('cat_2', this)" src="images/minus.png" alt="" /></td>
                <
td align="left">
            <
a href="http://example.com/modules/newbb/index.php?cat=2">Some Forum Category description</a>
            <
class="desc">... some more description</p>
        </
td>
                <
td width="15%" nowrap="nowrap" align="right">
        <
class="desc"><a href="https://xoops.org" title="XOOPS" target="_blank">XOOPS</a></p>
        </
td>
            </
tr>
</
table>


... so no doubt the piCal module should do the same, use percentages for the table widths.

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

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

Quote:

peterr wrote:
Hmm, ... it seems most XOOPS modules display the centre content outside of the control structure sourced from the theme.html code. Here is some generated code from a forum display

[snip]

however the table positioning is aligned perfectly, whereas piCal is not. For example, the forums module code uses a percentage width for the table, rather than pixels:
[snip]

... so no doubt the piCal module should do the same, use percentages for the table widths.

HTH


Right. Which is the problem. I can't find where in the code it's specifying the pixel width so I can change it to percentages (or at least a smaller pixel width). My main objective at this point is to find that portion of the code so I can make the edits, but like I said: I can't find it anywhere, and I've been through the code line by line.

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

16
peterr
Re: PiCal 0.7 -- Remove GMT from detailed event view?
  • 2005/11/19 0:46

  • peterr

  • Just can't stay away

  • Posts: 518

  • Since: 2004/8/5 9


Quote:

Ace_Armstrong wrote:
Right. Which is the problem. I can't find where in the code it's specifying the pixel width so I can change it to percentages (or at least a smaller pixel width). My main objective at this point is to find that portion of the code so I can make the edits, but like I said: I can't find it anywhere, and I've been through the code line by line.


It is the one thing I don't like about 'web programming' in general, ...... not easy to debug. Coming from an application programming background, it was always _so_ nice to use a debugger, problem solved very quickly. But, with web programming languages, for the mere fact that pages are processed by the server (not local), it does make it a bit hard, for sure.

1. I downloaded Gubed PHP Debugger, which certainly seems to be a good tool, set breakpoints, and step through code, but of course, the PHP code needs to be on a 'local' server, an IP on your LAN somewhere.

2. You could try using
PHPXref, which is a very good cross-ref utility, it is open source, and to see a demo of how it works, there is a site that has all the osCommerce source code, as a demo for PHPXref, see http://www.oscdox.com/crossx/nav.html?index.html

I have loaded that locally in the past, takes up a bit of space, because it creates a load of html pages, but it is a very handy tool for finding out where functions and variables are used.

3. The only suggestion I can make to find out _where_ to change the code, is to walk down a path I _may_ take. With the use of Gubed, I'm chewing on loading something like 'phpdev', which is a bundled Apache, PHP, Mysql,etc, and run it on an old Win95b box I have, then I start up the web server locally, run XOOPS, and then look at using Gubed to debug piCal.

Stepping through the source code is really the only way to find how the value '640' got there, I suspect it is in some of the XOOPS functions that handle all the html side of things.

Of course having a (local) Linux box would be easier, but I have been able to get phpdev 4.23 going before, and it was nice to just install everything in one hit, fire it up, and then there is an Apache server running.

We are in the 'same boat', I don't like the way piCal has messed up the table width, it looks messy, and is not in keeping with the rest of the site.

HTH

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

17
peterr
Re: PiCal 0.7 -- Remove GMT from detailed event view?
  • 2005/11/22 6:01

  • 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.


Have a look at the db, the table name is "xoops_tplsource", and there are several occurances of '640' there. If I look in the corresponding table called "xoops_tplfile", the template files that have those values (in the db) are:

* pical_print.html
* pical_event_list.html

Sometimes the template row in the db is not the same as the template sitting in a path on the server.

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

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

Quote:

peterr wrote:
1. I downloaded Gubed PHP Debugger, which certainly seems to be a good tool, set breakpoints, and step through code, but of course, the PHP code needs to be on a 'local' server, an IP on your LAN somewhere.

2. You could try using
PHPXref, which is a very good cross-ref utility, it is open source, and to see a demo of how it works, there is a site that has all the osCommerce source code, as a demo for PHPXref, see http://www.oscdox.com/crossx/nav.html?index.html

I have loaded that locally in the past, takes up a bit of space, because it creates a load of html pages, but it is a very handy tool for finding out where functions and variables are used.

3. The only suggestion I can make to find out _where_ to change the code, is to walk down a path I _may_ take. With the use of Gubed, I'm chewing on loading something like 'phpdev', which is a bundled Apache, PHP, Mysql,etc, and run it on an old Win95b box I have, then I start up the web server locally, run XOOPS, and then look at using Gubed to debug piCal.


I have no idea how to do any of that. I'm a design guy, not a programmer.
Ace Armstrong
The Man. The Myth. The Mammal.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Intelligent, informed debate good. Innuendo bad. See for yourself!
www.GLOAMING.us

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

Quote:

peterr wrote:
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.


Have a look at the db, the table name is "xoops_tplsource", and there are several occurances of '640' there. If I look in the corresponding table called "xoops_tplfile", the template files that have those values (in the db) are:

* pical_print.html
* pical_event_list.html

Sometimes the template row in the db is not the same as the template sitting in a path on the server.


Actually, I had alrady found those when I posted and changed them. It did not affect the output.

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

20
peterr
Re: PiCal 0.7 -- Remove GMT from detailed event view?
  • 2005/11/23 0:06

  • peterr

  • Just can't stay away

  • Posts: 518

  • Since: 2004/8/5 9


Quote:

Ace_Armstrong wrote:
I have no idea how to do any of that. I'm a design guy, not a programmer.


Then you may have to possibly hire someone to debug it and fix it ?
NO to the Microsoft Office format as an ISO standard.
Sign the petition

Login

Who's Online

79 user(s) are online (44 user(s) are browsing Support Forums)


Members: 0


Guests: 79


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