diff --git a/e107_files/shortcode/sitelinks_alt.php b/e107_files/shortcode/sitelinks_alt.php index d82117882..034fa95e1 100644 --- a/e107_files/shortcode/sitelinks_alt.php +++ b/e107_files/shortcode/sitelinks_alt.php @@ -4,9 +4,9 @@ | e107 website system | | $Source: /cvs_backup/e107_0.8/e107_files/shortcode/sitelinks_alt.php,v $ - | $Revision: 1.1 $ - | $Date: 2009-09-14 21:53:38 $ - | $Author: secretr $ + | $Revision: 1.2 $ + | $Date: 2009-11-21 11:36:04 $ + | $Author: e107coders $ +----------------------------------------------------------------------------+ */ function sitelinks_alt_shortcode($parm) @@ -168,23 +168,17 @@ function sitelinks_alt_shortcode($parm) // Setup Parent/Child Arrays ----> - $link_total = $sql->db_Select("links", "*", "link_class IN (".USERCLASS_LIST.") AND link_category=1 ORDER BY link_order ASC"); - while ($row = $sql->db_Fetch()) - { - if ($row['link_parent'] == 0) - { - $linklist['head_menu'][] = $row; - $parents[] = $row['link_id']; - } - else - { - $pid = $row['link_parent']; - $linklist['sub_'.$pid][] = $row; - } - } + $lnk = e107::getSitelinks(); + $lnk->getlinks(1); + $linklist = $lnk->getLinkArray(); - // Loops thru parents.---------> - global $tp; + $tp = e107::getParser(); + + + // Loops thru parents. + + + foreach ($linklist['head_menu'] as $lk) { $lk['link_url'] = $tp->replaceConstants($lk['link_url'], TRUE, TRUE); diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index 5f8d6c32b..c63df6471 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -9,9 +9,9 @@ * e107 Main * * $Source: /cvs_backup/e107_0.8/e107_handlers/e107_class.php,v $ - * $Revision: 1.79 $ - * $Date: 2009-11-20 23:27:25 $ - * $Author: secretr $ + * $Revision: 1.80 $ + * $Date: 2009-11-21 11:36:10 $ + * $Author: e107coders $ */ if (!defined('e107_INIT')) { exit; } @@ -140,6 +140,7 @@ class e107 'comment' => '{e_HANDLER}comment_class.php', 'e107_user_extended' => '{e_HANDLER}user_extended_class.php', 'e_userperms' => '{e_HANDLER}user_handler.php', + 'sitelinks' => '{e_HANDLER}sitelinks_class.php' ); /** @@ -698,6 +699,19 @@ class e107 return self::getSingleton('user_class', true); } + + + /** + * Retrieve sitelinks singleton object + * + * @return user_class + */ + public static function getSitelinks() + { + return self::getSingleton('sitelinks', true); + } + + /** * Retrieve render singleton object * diff --git a/e107_handlers/sitelinks_class.php b/e107_handlers/sitelinks_class.php index 8e161cc42..853919fc8 100644 --- a/e107_handlers/sitelinks_class.php +++ b/e107_handlers/sitelinks_class.php @@ -9,8 +9,8 @@ * * * $Source: /cvs_backup/e107_0.8/e107_handlers/sitelinks_class.php,v $ - * $Revision: 1.23 $ - * $Date: 2009-11-20 05:01:31 $ + * $Revision: 1.24 $ + * $Date: 2009-11-21 11:36:10 $ * $Author: e107coders $ */ @@ -62,6 +62,12 @@ class sitelinks } } + + function getLinkArray() + { + return $this->eLinkList; + } + function get($cat=1, $style='', $css_class = false) {