New Plugin: Permalinks 1.00 Released (Feb 19)

13 posts by 3 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: March 12, 2013   (RSS)

  • Archived  

By Dave - February 25, 2013

Tim & Djulia, I just wanted to let you know we're working on incorporating some of your suggestions and will have an update soon.  

Dave Edis - Senior Developer
interactivetools.com
  • Archived  

By Toledoh - March 12, 2013

Looking great!

This seems to produce a valid sitemap, but someone who knows more about this stuff - please comment!

http://fibreking.com/sampleSiteMap.xml.php

<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */
  
  // load viewer library
  $libraryPath = 'cmsAdmin/lib/viewer_functions.php';
  $dirsToCheck = array('/XXX/XXX/XXX/','','../','../../','../../../');
  foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
  if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }

  // load records from '_permalinks'
  list($_permalinksRecords, $_permalinksMetaData) = getRecords(array(
    'tableName'   => '_permalinks',
    'orderBy'     => '',   // use default database order
    'loadUploads' => false,
    'allowSearch' => false,
  ));

?>
<?php header('Content-type: application/xml; charset=utf-8'); ?><?php echo '<'.'?xml version="1.0" encoding="UTF-8"?>'; ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

    <?php foreach ($_permalinksRecords as $record): ?>
   <url>

    <loc>http://<?php echo $_SERVER['HTTP_HOST']; ?>/<?php echo $record['_link'] ?></loc>
    
    <lastmod><?php echo date('Y-m-d', strtotime($record['updatedDate'])) ?></lastmod>
    
    <?php if ($record['old']): ?><changefreq>never</changefreq>  
    <?php else: ?><changefreq>weekly</changefreq>  
    <?php endif ?> 
    
    <priority>0.5</priority>

   </url>
    <?php endforeach ?>

</urlset> 

Cheers,

Tim (toledoh.com.au)