Not signed in ( Sign In)

Categories

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    •  
      CommentAuthorDavidB
    • CommentTimeSep 11th 2008
     permalink
    Flatpress sitemap generator by Vincent L'Ecluse does not work with the new web address format for FlatPress v.804 Vivace. To fix it.

    Edit flatpress-sitemap-generator.php

    change line 46
    from
    "loc" => $website_url."index.php?entry=".$id,
    to
    "loc" => $website_url."?x=".$id,
    •  
      CommentAuthorvincent
    • CommentTimeOct 1st 2008
     permalink
    Thanks for the fix David.
    •  
      CommentAuthorMartin
    • CommentTimeJan 3rd 2009
     permalink
    Hello,

    when running sitemap-generator, the script stopps with following message:

    Fatal error: Class 'entry_indexer' not found in /mnt/web5/41/86/51071086/htdocs/hintertuxingen/flatpress-sitemap-generator.php on line 28

    Can someone help me to find out the problem ?

    thx Martin
    •  
      CommentAuthorNoWhereMan
    • CommentTimeJan 3rd 2009 edited
     permalink
    Hi Martin,

    core has changed, and btw entry_indexer was not really supposed to be used in the first place :p

    Vincent should fix this script to use
    $o = new FPDB_Query(array('start'=>0, 'count'=>-1, fullparse=>0));
    while($o->hasmore()) {
    list($id, $entry) = $q->getEntry();
    $link = get_permalink($id);
    // $entry['subject'] etc etc;
    // notice that with fullparse = 0 you'll get only subject, date, id;
    // set it to =1 if you want categories and author as well
    }


    also, better than hardcoding URLs, use get_permalink($id) and the like (they're all defined in fp-includes/core/core.theme.php)

    for a sample code, see plugin.lastentries.php :)

    HTH
    •  
      CommentAuthorMartin
    • CommentTimeJan 3rd 2009
     permalink
    hmm...

    I think i understand, what you want to tell me, but i´m not really able to create working code... ;)

    I´m good for beta-testing and asking silly questions - but unfortunatelly not for more ;)

    Would it be worth a try to ask you to rewrite the code for me (us) ?
    •  
      CommentAuthorNoWhereMan
    • CommentTimeJan 3rd 2009 edited
     permalink
    I can't at the moment, but you can try contacting David or Vincent
    •  
      CommentAuthorvincent
    • CommentTimeJan 3rd 2009 edited
     permalink
    Hi Martin, I have done the necessary changes to the sitemap generator and test it on the latest flatpress.
    It is working perfectly without any error.

    To NoWhereMan,While working on it, I have develop a sitemap plugin. I have been using the add_actions('publish_post'). The only problem is that the sitemap file get generated before the post is publish. Is there a turn around for this (ie another actions that can be used instead of the 'publish_post' ) rather than hardcoding the stuff?
    •  
      CommentAuthorMartin
    • CommentTimeJan 3rd 2009 edited
     permalink
    @vincent:

    Thank you for the fast reaction... !!
    •  
      CommentAuthorNoWhereMan
    • CommentTimeJan 4th 2009
     permalink
    cool, vincent; no that's the only way to do it right; btw you're right that the hook is called before the file is actually created, but that's what WordPress does (it's called before the post is inserted into the DB), so I left it that way for compatibility in terms of behavior :)
    •  
      CommentAuthorvincent
    • CommentTimeJan 4th 2009
     permalink
    Is there a way to know the link that will be displayed before the hook is called?
    •  
      CommentAuthorNoWhereMan
    • CommentTimeJan 4th 2009
     permalink
    the $id is passed to the hook function, so you can call get_permalink($id) from there :)
    •  
      CommentAuthorvincent
    • CommentTimeJan 4th 2009
     permalink
    Done. you can now have the plugin for the sitemap still at http://www.vincentlecluse.com/flatpress-sitemap-generator/
    •  
      CommentAuthorMartin
    • CommentTimeJan 4th 2009 edited
     permalink
    Thank you Vincent for your work...

    I downloaded and acitvated to plugin and wrote a new post... When klicking the "Publish" Button, i got the following Message:


    Notice: A session had already been started - ignoring session_start() in /mnt/web5/41/86/51071086/htdocs/hintertuxingen/fp-includes/core/core.session.php on line 11
    Ping to Google Sitemaps successful. Status code: 200.
    Warning: Cannot modify header information - headers already sent by (output started at /mnt/web5/41/86/51071086/htdocs/hintertuxingen/fp-includes/core/core.session.php:11) in /mnt/web5/41/86/51071086/htdocs/hintertuxingen/fp-includes/core/core.wp-pluggable-funcs.php on line 273


    After that, i klicked on the "Back"-Button of my browser and klicked on "Save and go on"... The layout of the admin-panel was destroyed temporarelly, but my post was saved. After visiting the frontend again, everything was ok...

    Maybe there is some finetuning needed ?

    Regards, Martin

    EDIT: I bet, NWM is sitting at his computer, reading this post and thinking: "Oh my god, the man with the stupid server-notices again ;)
    •  
      CommentAuthorNoWhereMan
    • CommentTimeJan 4th 2009
     permalink
    @vincent: it is partially broken, since, in order for get_permalink() to work properly when prettyurls is enabled, you need to add this code in your hook as well:


    function my_hook($id, $entry_content) {
    global $post;
    $post = array_change_key_case($entry_content, CASE_LOWER);

    // blah blah
    $link = get_permalink($id);
    // etc etc
    }


    I didn't think of it; I'll fix it in SVN

    as for the notices, remove the part calling session_start() (don't use system_init(), if you are!), and suppress the output for the ping

    HTH
    •  
      CommentAuthorNoWhereMan
    • CommentTimeJan 4th 2009 edited
     permalink
    FYI, here's how I would do the sitemap thing; new /sitemap.php file, a sitemap.tpl in fp-interfaces/sharedtpls/ with the file structure (as in rss.tpl)

    (or if you want it self contained in a plugin you may want to have a look at server.php : I want to move that hookable-page functionality to index.php, though, but I want to think it right!)

    sitemap.php to point to (o eventually server.php?x=sitemap:xml or something like that: you can then add 'sitemap.xml' rewrite rule to your htaccess, if you want)
    --------------

    // include stuff
    system_init();

    function foo() {
    global $fpdb, $smarty, $fp_config;

    header('Content-Type: text/xml; charset='.$fp_config['locale']['charset']);

    $fpdb->query(array('start'=>0, 'count'=>-1, 'fullparse'=>false)); // prepare to use in the template (this way {entry} and the like will work)

    $smarty->caching = 1; // let smarty handle caching!
    $smarty->display('shared:sitemap.tpl');

    }

    foo();




    sitemap.tpl:

    --------------


    <?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="fp-plugins/sitemap/style/sitemap.xsl"?>

    <urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/09/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

    <url>
    <loc>{$flatpress.www}</loc>
    <changefreq>daily</changefreq>
    <priority>0.8</priority>
    </url>


    {entry_block}

    {entry}

    <url>
    <loc>{$id|link:the_permalink}</loc>
    <changefreq>daily</changefreq>
    <priority>0.8</priority>
    </url>

    {/entry}


    {/entry_block}

    </urlset>



    as you can see it's not really hard, but it's complicated to do it right, that's why I haven't worked on it so far (priority and chagefreq are also parameters must be considered carefully as well, or the sitemap would be merely a placebo ;) )

    AND! it would still lack the static_list ( {static_block} ) which works - I have to admit it - in a hackish way :/

    bye

    HTH
    •  
      CommentAuthorMartin
    • CommentTimeJan 4th 2009
     permalink
    so for an unknowing user:

    better to deactivate the plugin and wait what you two will create ?
    •  
      CommentAuthorNoWhereMan
    • CommentTimeJan 4th 2009
     permalink
    well, if vincent will "fix" (actually he'll be working around the bug) the way I've explained above, it will work; better than nothing probably

    bye
    •  
      CommentAuthorvincent
    • CommentTimeJan 7th 2009
     permalink
    A version 1.1 has been released with those bug corrected.
    •  
      CommentAuthorMartin
    • CommentTimeJan 11th 2009
     permalink
    Thank you, Vincent...
    •  
      CommentAuthorsyates
    • CommentTimeAug 12th 2009 edited
     permalink
    1. For some reason I cannot get the sitemap generator to show up in the available plugins. I uploaded the flatpress_sitemap_generator directory to /flapress/fp-plugis folder where the other plugin folders but it does not show up. Am probably making a simple error but can't see what. Any ideas anyone ?

    2. As I ended up with newcheese.eu/flatpress as my starting page, I presume the sitemap.xml goes in the flatpress directory and not the site root directory

    TIA

    Steve
    (Just tried to add it to a 2nd site, same result)
    •  
      CommentAuthorgiulio
    • CommentTimeAug 13th 2009
     permalink
    Hi Steve, these are the instructions to install the sitemap generator from vincent's site (http://www.vincentlecluse.com/flatpress-sitemap-generator/)

    1. Unzip the content to the root of your flatpress
    2. Create a file and name it sitemap.xml and CHMOD it to ‘777?
    3. Open the flatpress sitemap generator page in your browser
    4. When completed you can check to see if the pages has been generated in the sitemap.xml file

    Sitemap generator doesn't seems to be properly a flatpress plugin, cause it has to be installed into the root directory, not in /fp-plugins.
    Anyway, I followed the instructions and sitemap-generator doesn't appears in my plugin list but I can generate a sitemap simply typing:

    http://mysite/flatpress-sitemap-generator.php

    I don't know if this is the right way, but sure it works.
    Bye.
    •  
      CommentAuthorsyates
    • CommentTimeAug 14th 2009
     permalink
    Giulio

    Thanks, that works

    Steve
    •  
      CommentAuthordmo
    • CommentTimeApr 5th 2010
     permalink
    Installed V 1.1 today. Works fine.

    Thank you, Vincent