Sitemap

Discussion in 'Software' started by jratcliffe, Oct 30, 2009.

  1. jratcliffe

    jratcliffe Private E-2

    hi i have loads of things to change and update (some i done) for my site need to refresh the sitemap but have heard there is a way to do this dynamically anyone heard similar/ know how to do so and can guide me thou..?:cool
     
  2. SWario

    SWario Sergeant

    In any dynamic web language (PHP, ASP, ColdFusion, etc.), you can read the web directory (or directories) and generate a list of files that way. You can use that list to make a Site Map. You weren't very specific about your circumstances. Do you usually make sites in PHP, ASP, or ColdFusion, or do you usually just write pure HTML? Does your site have PHP or an alternative available?
     
  3. jratcliffe

    jratcliffe Private E-2

    i use php css and xtml mostly so can understand most things
     
  4. SWario

    SWario Sergeant

    In PHP:
    PHP:
    <?php
    // Assign the current directory to $dir
    $dir getcwd();
    // Store the contents of the directory in the Array $dirContents
    $dirContents scandir($dir);
    ?>
    <ul>
    <?php
    foreach($dirContents as $value)
    {
      echo 
    " <li><a href=\"$value\">$value</a>\n";
    }
    ?>
    </ul>
    That will scan the current directory, store its contents in the array $dirContents, and display an Unordered List of every file as a hyperlink. You can get fancier with it, and you can also recursively check subdirectories (using is_dir() to check if a returned filename is a directory and then scanning it with perhaps scandir()). Hope that helps!
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds