Bottom
Making code XHTML 1.1 Compliant
  • Posted: 19.08.2004, 23:30
    Invité
    rank:
    1
    registered:
     December 2003
    Status:
    offline
    last visit:
    06.03.05
    Posts:
    0
    I am using version 1.31 of this module with PostNuke.726. My page is at
    Code
    http://www.letsmakescotlandgreen.org
    I need to get access to the bit of code that sets the table properties, so that the following:
    Code
    <strong><a title="forecast" href="http://www.letsmakescotlandgreen.org/index.php?module=weather&func=forecast&city=UKXX0061">Glasgow, United Kingdom</a></strong><table border="0" width="100%" cellpadding="0" cellspacing="0">
    <tr><td>
    <table border="0" width="100%"><tr align="left" valign="middle"><td><a href="http://www.letsmakescotlandgreen.org/index.php?module=weather&func=forecast&city=UKXX0061"><img src="modules/weather/pnimages/52intl/26.gif" border="0"></a></td><td><strong>Temp.</strong>: 15°C</td></tr></table></td></tr></table>
    Becomes this:
    Code
    <a title="forecast" href="http://www.letsmakescotlandgreen.org/index.php?module=weather&func=forecast&city=UKXX0061">Glasgow, United Kingdom</a>
    <table style="border: 0; width: 100%;">
    <tr><td>
    <table style="border: 0; width: 100%;">
    <tr style="text-align: left;">
    <td>
    <a href="http://www.letsmakescotlandgreen.org/index.php?module=weather&func=forecast&city=UKXX0061">
    <img src="modules/weather/pnimages/52intl/26.gif"></a>
    </td>
    <td>Temp: 15°C
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
  • Posted: 20.08.2004, 10:39
       
    vedrine
    rank:
    Site Admin Site Admin
    registered:
     December 2003
    Status:
    offline
    last visit:
    09.10.08
    Posts:
    266
    Hello,
    As I'm on holidays with just my small laptop I don't have the full module's sources with me. But you can look in pnuser.php in the forecast function, all the code for this screen is here. The definite solution for this problem will be in the next version (1.4) of the module because as it use pnRender and is fully templated, you will be able to modify the .html template to suit your needs. In the meantime if you succed in improving the module's compliancy I wouldf be more than happy to release a 1.33 version with your changes. Thanks a lot for your interest in the weather module.
  • Posted: 20.08.2004, 15:08
    Invité
    rank:
    1
    registered:
     December 2003
    Status:
    offline
    last visit:
    06.03.05
    Posts:
    0
    I still cannot locate where the code is coming from. All I can see is lines like
    Code
    $output->TableRowStart('left');
    as opposed to
    Code
    echo "<td align=\"left\">\n";
    I am not familiar with this method of coding. But I assume there is a file somewhere that when the script when one file says "output" a table row it does it by corresponding to the code in a specific doument but I cannot work out where that may be?
  • Posted: 23.08.2004, 10:21
       
    vedrine
    rank:
    Site Admin Site Admin
    registered:
     December 2003
    Status:
    offline
    last visit:
    09.10.08
    Posts:
    266
    In fact the weather module is using calls to functions in includes/pnHTML.php to construct tables.
    I think it would be very dangerous to modify pnHTML.php as it is a core file.
    One possible solution is to replace a line like :
    $output->TableRowStart('left');
    with
    $output->Text('<td align="left">');
    but for it to work you must be in verbatim mode and not in parse mode so you have to add the line
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    to change mode to verbatim before
    and reset mode to parse after with a line
    $output->SetInputMode(_PNH_PARSEINPUT);
    after
    in fact the best solution is to stay in verbatim mode all the time and output all code with
    $output->Text('put all your html here');
    In the same way to suppress some bolding you can replace the $output->BoldText with $output->Text

    Another way should be to look in PostNuke .750 because I'm nearly sure that pnHTML.php have been modified to output XHTML compliant pages. I'm not quite sure of that but I will chack as soon as I come back home (sadly holidays are nearly finshed :(
Quick reply
 
  • Options
Code:
Font color:  
Font size: