Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Thursday, November 12, 2026

Diff for Metafox/functions.inc.php between version 1.111 and 1.112

version 1.111, 2013/09/02 09:30:56 version 1.112, 2013/09/02 12:46:38
Line 17 
Line 17 
  * http://platon.sk/projects/Metafox/   * http://platon.sk/projects/Metafox/
  */   */
   
 /* $Platon: Metafox/functions.inc.php,v 1.110 2013-08-29 13:01:11 igor Exp $ */  /* $Platon: Metafox/functions.inc.php,v 1.111 2013-09-02 09:30:56 igor Exp $ */
   
 function ezin_eval($evalcode) /* {{{ */  function ezin_eval($evalcode) /* {{{ */
 {  {
Line 1214  function ezin_load_template($template_ke
Line 1214  function ezin_load_template($template_ke
                         }                          }
                         return ezin_get_section_page($_GET['section_id'], $_GET['page']);                          return ezin_get_section_page($_GET['section_id'], $_GET['page']);
                 }                  }
                   else if ($template_key == 'section.sitemap') {
                           ob_clean();
                           header("content-type: text/xml; charset=utf-8");
                           return ezin_get_sitemap();
                   }
                   else if ($template_key == 'section.htmlmap') {
                           ob_clean();
                           return ezin_get_htmlmap();
                   }
                 if (($pos = strrpos($template_key, '.')) === false) {                  if (($pos = strrpos($template_key, '.')) === false) {
                         break;                          break;
                 }                  }
Line 2318  function ezin_redirect_auto($ar) {
Line 2327  function ezin_redirect_auto($ar) {
         }          }
 }  }
   
   /*
    * Miscellaneous Site Maps
    */
   
   /* Implementation http://www.sitemaps.org/protocol.html */
   function ezin_get_sitemap() {
           $cache_id = 'ezin_sitemap';
           $cache_ar = ezin_cache_load($cache_id);
           if (intval($cache_ar['timestamp']) <= 0) {
                   $host = 'http://'.$_SERVER['HTTP_HOST'];
                   $ret = '<| "<" |>?xml version="1.0" encoding="<|$ezin_encoding|>" ?<| ">\n" |>
                           <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'."\n";
                   $sections = ezin_get_section_list();
                   foreach($sections as $section) {
                           ezin_section_link_process($section);
                           $ret .= '
                                   <url>
                                           <loc>'.$host.$section['section_link'].'</loc>
                                           <lastmod>'.date("Y-m-d", strtotime($section['section_changed_dt'])).'</lastmod>
                                   </url>'."\n";
                   }
                   $articles = ezin_get_article_list(0,0,0);
                   foreach($articles as $article) {
                           ezin_article_link_process($article);
                           $ret .= '
                                   <url>
                                           <loc>'.$host.$article['article_link'].'</loc>
                                           <lastmod>'.date("Y-m-d", strtotime($article['article_changed_dt'])).'</lastmod>
                                   </url>'."\n";
                   }
                   $ret .= '</urlset>'."\n";
                   ezin_cache_save($cache_id, $ret);
                   $cache_ar['content'] = $ret;
           }
           return $cache_ar['content'];
   }
   
   /* Basic HTML list of all section and articles */
   function ezin_get_htmlmap() {
           $cache_id = 'ezin_htmlmap';
           $cache_ar = ezin_cache_load($cache_id);
           if (intval($cache_ar['timestamp']) <= 0) {
                   $host = 'http://'.$_SERVER['HTTP_HOST'];
                   $ret = '<ul class="htmlmap-root">'."\n";
                   $articles = ezin_get_article_list(0,0,0);
                   function compare_article($a, $b) {
                           if ($a['article_access_key'] == $b['article_access_key']) {
                                   return strcmp($a['article_title'], $b['article_title']);
                           } else {
                                   return strcmp($a['article_access_key'], $b['article_access_key']);
                           }
                   }
                   usort($articles, "compare_article");
                   $articles_html = '';
                   foreach($articles as $article) {
                           ezin_article_link_process($article);
                           $articles_html[$article['article_section_id']] .=
                                   "\t\t\t".'<li class="htmlmap-branch-item">'."\n"
                                   ."\t\t\t\t".'<a href="'.$host.$article['article_link'].'" class="htmlmap-branch-link">'.$article['article_title'].'</a>'."\n"
                                   ."\t\t\t".'</li>'."\n";
                   }
                   $sections = ezin_get_section_list();
                   foreach($sections as $section) {
                           ezin_section_link_process($section);
                           $ret .=
                           "\t".'<li class="htmlmap-root-item">'."\n"
                           ."\t\t".'<a href="'.$host.$section['section_link'].'" class="htmlmap-root-link">'.$section['section_name'].'</a>'."\n";
                           if (isset($articles_html[$section['section_id']])
                                   && strlen($articles_html[$section['section_id']]) > 0)
                           {
                                   $ret .=
                                           "\t\t".'<ul class="htmlmap-branch">'."\n".$articles_html[$section['section_id']]
                                           ."\t\t".'</ul>'."\n";
                           }
                           $ret .= "\t".'</li>'."\n";
                   }
                   $ret .= '</ul>'."\n";
                   ezin_cache_save($cache_id, $ret);
                   $cache_ar['content'] = $ret;
           }
           return $cache_ar['content'];
   }
   
 /* Modeline for ViM {{{  /* Modeline for ViM {{{
  * vim: set ts=4:   * vim: set ts=4:
  * vim600: fdm=marker fdl=0 fdc=0:   * vim600: fdm=marker fdl=0 fdc=0:

Legend:
Removed from v.1.111  
changed lines
  Added in v.1.112

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top