SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: Site Maps

  1. #1
    SitePoint Evangelist on_way_to_fame's Avatar
    Join Date
    Jun 2004
    Location
    UK
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Site Maps

    Are there scripts, which automatically create site maps for dynamic websites? If yes, how do they work.


    Also for a website, is there a way to find out all the pages on a website, (accept doing it manually), so that they can be linked through the site map page?

    Ash

  2. #2
    SitePoint Addict CrabbyX's Avatar
    Join Date
    Aug 2004
    Location
    England, UK
    Posts
    249
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    #1. No.

    #2. You could do... you could loop through all the files in your www directory for your site with a server-side script, checking whether the extension is .html (or .shtml, etc), regexing out the <title> tag. However, this just wouldn't be practical if you had dynamic pages, as page.php could be in fact 100 pages, because of the query string.

    I'd strongly advise on doing it manually. Mine are all manual, except for example categories on a dynamic site are listed via a database call, etc.
    michael.Crabbe

  3. #3
    SitePoint Evangelist on_way_to_fame's Avatar
    Join Date
    Jun 2004
    Location
    UK
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cheers...some more about how to do it on a dynamic site would be helpful.

  4. #4
    SitePoint Addict CrabbyX's Avatar
    Join Date
    Aug 2004
    Location
    England, UK
    Posts
    249
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've just said, you can't. You have to do it manually.

    If you know enough about your dynamic site, then you'll understand that the only bit you can do with dynamic sites is for example, selecting items from the database that have a page each. Otherwise, there's not much I can help you with, and you need to just do it manually.
    michael.Crabbe

  5. #5
    SitePoint Evangelist on_way_to_fame's Avatar
    Join Date
    Jun 2004
    Location
    UK
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    except for example categories on a dynamic site are listed via a database call, etc.
    I was actually talking about this, can you elaborate.

  6. #6
    SitePoint Addict CrabbyX's Avatar
    Join Date
    Aug 2004
    Location
    England, UK
    Posts
    249
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, example:

    First, your manual links:
    PHP Code:
    <a href="/index.html">Home</a><br />
    <
    a href="/articles.html">Articles</a><br /> 
    Now to list all the articles from the database:
    PHP Code:
    <?php
    $result 
    mysql_query"SELECT * FROM articles" );
    while ( 
    $r mysql_fetch_array$result ) )
    {
         print 
    "- <a href=\"/viewarticle.php?id=".$r["id"]."\">".htmlentities$r["title"] )."</a><br />"// Print a link to the article, prepended with "- " for indentation...
    }
    ?>
    The above can be repeated for anything, but you really need to understand your dynamic site.

    Then you can just continue the links, etc:

    PHP Code:
    <a href="otherpage.html">Other Page</a><br />
    etc... 
    I hope this helps
    michael.Crabbe

  7. #7
    SitePoint Evangelist on_way_to_fame's Avatar
    Join Date
    Jun 2004
    Location
    UK
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It did..thanks


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •