Fork me on GitHub

Statics_Docs and w3c validation  Bottom

  • Hi all,

    i've got 2 problems with Static_Docs,
    it's a great module, but i can't seem to solve 2 problems

    1. the w3c validation doesn't like & chars it suggests to replace them with &
    Static docs has a cool feature (which isn't so cool right now :) ) that it replaces all simple HTML hrefs with entire cgi links. like href="bar.html" -> href="http://test.linuxbusiness.it/html/index.php?module=Static_Docs&func=viewf=/bar.html"
    The problem is it uses plain & chars, how can i replace them with & ?

    2. inserted HTML pages usually contain a tag(it's the same with the example welcome.html page), but i end up with having more tags in the final document. How can i get rid of that?

    thanks
    :D
  • for 1: I assume you mean the prefix index.php?module=Static_Docs&type=user etc? This is set once during installation time. Open pninit.php, search for

    Code

    $parse_url = 'index.php?module=Static_Docs&type=user&func=view&f=';
    and replace it with

    Code

    $parse_url = pnModURL('Static_Docs', 'user', 'view', array('f'=>''));



    for 2:

    open inc/parser.class.php, locate function _removeArroundBody and replace

    Code

    $this->_sParsedContent =  ereg_replace( "</[Bb][Oo][Dd][Yy][^>]>.*",
    with

    Code

    $this->_sParsedContent =  ereg_replace( "</[Bb][Oo][Dd][Yy][^>]*>.*",
  • jn

    for 1: I assume you mean the prefix index.php?module=Static_Docs&type=user etc? This is set once during installation time. Open pninit.php, search for

    Code

    $parse_url = 'index.php?module=Static_Docs&type=user&func=view&f=';
    and replace it with

    Code

    $parse_url = pnModURL('Static_Docs', 'user', 'view', array('f'=>''));



    for 2:

    open inc/parser.class.php, locate function _removeArroundBody and replace

    Code

    $this->_sParsedContent =  ereg_replace( "</[Bb][Oo][Dd][Yy][^>]>.*",
    with

    Code

    $this->_sParsedContent =  ereg_replace( "</[Bb][Oo][Dd][Yy][^>]*>.*",


    for1: seems like it didn't solve the problem, any other ideas?

    for2: thanks, that worked :)
  • I even tried this:
    $parse_url = 'index.php?module=Static_Docs&type=user&func=view&f=';

    something seems to remove the &s :?
  • You're right; I will have a look at it later.

    BTW: The changes above are in CVS already.


    Jörg
  • misc2000, as you mentioned, pnModURL puts in & instead of & as well. BUT: With the line you posted, all works well. Of course, you have to re-initialize the module for this change to take effect.

    If you have a lot of data (i.e. desriptions of files etc) you do not want to lose (which would happen re-initializing), I would suggest to edit the vaule directly in the table <prefix>_module_vars; have a look at the entry with pn_modname = Static_Docs and pn_name = mime_html_parse_url and change pn_value to include &

    Jörg</prefix>
  • pnModURL does indeed generate links with a & only. This is becuase internal functions like pnRedirect need this format of URL. To generate a URL in the correct format use pnVarPrepForDisplay(pnModURL(.......)).

    So the correct line becomes

    Code

    $parse_url = pnVarPrepForDisplay(pnModURL('Static_Docs', 'user', 'view', array('f'=>'')));


    -Mark

    --
    Visit My homepage and Zikula themes.
  • which is the way it is in CVS now. Thank you Mark for clarifying this.
  • Thanks jn & markwest, that helped :D

    BTW i find static_docs to be a great module, any chance it will included in PN?

    thanks
  • Static docs is a 3rd party module and not part of the core installation and should (IMO) remain that way. Static docs is only one among a number of modules taking different approaches to the problem of existing content. To select one and include it in PN could potentially stifle development of others.

    PN's goal always has been a lean core with a good architecture for 3rd party developers.

    -Mark

    --
    Visit My homepage and Zikula themes.

This list is based on users active over the last 60 minutes.