I wonder if someone could or would help with the old SiteMap snippet for etomite 0.5.3...
First, I would like it to print the page description with the page title.
Second, I would like it to print the sitemap according to some css..how do I do this?
Thanks,
Visa79
Here is the code
$sql = "SELECT id,parent,pagetitle,alias FROM $dbase.".$table_prefix."site_content WHERE published = 1 AND deleted = 0 ORDER BY parent,id";
$rs = $db->Execute($sql);
$limit = $rs->RecordCount();
for($i = 0; $i < $limit; $i++)
 $resultarr[$i] = $rs->FetchRow();
$parentid = $resultarr[$i]['id'];
//blank out return variable
$SiteMap = "";
$depth = 1;
$startSeed = 1;
find_child($parentid, $startSeed, $depth, $resultarr, $limit);
//function to print indentations
//replace SiteMap = statement contents with whatever you want to use for indentation
function depth($depth) {
  global $SiteMap;
  for ($i=1; $i<= $depth; ++$i) {
    $SiteMap .="   ";
  }
}
function step_up ($parentID, $startSeed, $depth, $result_array, $arr_size) {
  global $SiteMap;
  if ($startSeed > $arr_size) {
    return;
  } else {
    if ($result_array[$startSeed-1]['parent'] ==
     $result_array[$startSeed]['parent']) {
       $depth--;
       return find_child($result_array[$startSeed-1]['parent'],
          $startSeed, $depth, $result_array, $arr_size);
    } else {
      if ($result_array[$startSeed-1]['parent'] == "" &&
        $result_array[$startSeed]['parent'] == 1) {
        return;
      }
      for ($j = 0; $j <= $arr_size; ++$j) {
        if ($result_array[$j]['id'] ==
         $result_array[$startSeed-1]['parent']) {
          $depth--;
          return
          step_up($result_array[$j+1]['id'], $j+1, $depth, $result_array, $arr_size);
        }
      }
      return;
    }
 Â
}
}
function find_child ($parentID, $startSeed, $depth, $result_array, $arr_size) {
  global $SiteMap;
  for ($k = $startSeed; $k <= $arr_size; ++$k) {
    if ($result_array[$k]['parent'] == $parentID) {
      depth($depth);  Â
if($result_array[$k]['alias'] !='')
 $SiteMap .="<a href='" . $result_array[$k]['alias'] . ".html'>";  //change .html to whatever extension you use
else
 $SiteMap .="<a href='index.php?id=" . $result_array[$k]['id'] ."'>";     Â
$SiteMap .= $result_array[$k]['pagetitle'] . "</a><br>\n";
      $parentID = $result_array[$k]['id'];
      $startSeed = ++$k;
      $depth++;
      return find_child($parentID, $startSeed, $depth, $result_array, $arr_size);
     Â
    } elseif ($result_array[$k]['parent'] > $parentID) {
      break;  Â
    }
  }
  step_up ($parentID, $startSeed, $depth,$result_array,$arr_size);
}











