Changeset 11885
- Timestamp:
- 08/30/07 16:51:08 (1 year ago)
- Files:
-
- trunk/midcom/net.nehmer.blog/admin.php (deleted)
- trunk/midcom/net.nehmer.blog/handler/index.php (modified) (2 diffs)
- trunk/midcom/net.nehmer.blog/handler/view.php (modified) (1 diff)
- trunk/midcom/net.nehmer.blog/midcom/interfaces.php (modified) (1 diff)
- trunk/midcom/net.nehmer.blog/navigation.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/net.nehmer.blog/handler/index.php
r11665 r11885 124 124 switch ($handler_id) 125 125 { 126 case 'index': 127 case 'index-category': 128 $qb->set_limit($this->_config->get('index_entries')); 129 break; 130 126 131 case 'latest': 127 132 $qb->set_limit((int) $args[0]); … … 132 137 break; 133 138 134 case 'index':135 case 'index-category':136 139 default: 137 140 $qb->set_limit($this->_config->get('index_entries')); trunk/midcom/net.nehmer.blog/handler/view.php
r11149 r11885 93 93 function _can_handle_view ($handler_id, $args, &$data) 94 94 { 95 debug_add('mgd_version: ' . mgd_version()); 96 if (version_compare(mgd_version(), '1.8.0alpha1', '>=')) 97 { 98 debug_add('1.8.x detected, doing with single QB'); 99 // 1.8 allows us to do this the easy way 100 $qb = midcom_db_article::new_query_builder(); 101 $qb->add_constraint('topic', '=', $this->_content_topic->id); 102 $qb->add_constraint('up', '=', 0); 103 $qb->begin_group('OR'); 104 $qb->add_constraint('name', '=', $args[0]); 105 $qb->add_constraint('guid', '=', $args[0]); 106 $qb->end_group(); 107 $articles = $qb->execute(); 108 if (count($articles) > 0) 109 { 110 $this->_article = $articles[0]; 111 } 112 } 113 else 114 { 115 debug_add('1.7.x detected, doing separate checks'); 116 // 1.7 requires that we check for guid and name separately 117 debug_add('Trying to fetch with name'); 118 $qb = midcom_db_article::new_query_builder(); 119 $qb->add_constraint('topic', '=', $this->_content_topic->id); 120 $qb->add_constraint('up', '=', 0); 95 $qb = midcom_db_article::new_query_builder(); 96 $qb->add_constraint('topic', '=', $this->_content_topic->id); 97 $qb->add_constraint('up', '=', 0); 98 $qb->begin_group('OR'); 121 99 $qb->add_constraint('name', '=', $args[0]); 122 $articles = $qb->execute(); 123 if (count($articles) > 0) 124 { 125 $this->_article = $articles[0]; 126 } 127 elseif (mgd_is_guid($args[0])) 128 { 129 debug_add('mgd_is_guid returned true, trying to fetch with guid'); 130 $article = new midcom_db_article($args[0]); 131 if ( is_object($article) 132 && is_a($article, 'midcom_db_article') 133 && $article->up == 0 134 && $article->topic == $this->_content_topic->id) 135 { 136 $this->_article = $article; 137 } 138 } 100 $qb->add_constraint('guid', '=', $args[0]); 101 $qb->end_group(); 102 $articles = $qb->execute(); 103 if (count($articles) > 0) 104 { 105 $this->_article = $articles[0]; 139 106 } 140 107 trunk/midcom/net.nehmer.blog/midcom/interfaces.php
r11665 r11885 37 37 38 38 $this->_component = 'net.nehmer.blog'; 39 $this->_autoload_files = Array('viewer.php', 'admin.php', 'navigation.php'); 39 $this->_autoload_files = array 40 ( 41 'viewer.php', 42 'navigation.php' 43 ); 44 40 45 $this->_autoload_libraries = array 41 46 ( trunk/midcom/net.nehmer.blog/navigation.php
r11665 r11885 73 73 $leaves[NET_NEHMER_BLOG_LEAFID_FEEDS] = array 74 74 ( 75 MIDCOM_NAV_SITE => Array 76 ( 77 MIDCOM_NAV_URL => "feeds.html", 78 MIDCOM_NAV_NAME => $this->_l10n->get('available feeds'), 79 ), 80 MIDCOM_NAV_ADMIN => null, 75 MIDCOM_NAV_URL => "feeds.html", 76 MIDCOM_NAV_NAME => $this->_l10n->get('available feeds'), 81 77 MIDCOM_META_CREATOR => $this->_content_topic->metadata->creator, 82 78 MIDCOM_META_EDITOR => $this->_content_topic->metadata->revisor, … … 114 110 $leaves[$article->id] = array 115 111 ( 116 MIDCOM_NAV_SITE => array 117 ( 118 MIDCOM_NAV_URL => "{$prefix}{$article->name}.html", 119 MIDCOM_NAV_NAME => ($article->title != '') ? $article->title : $article->name, 120 ), 121 MIDCOM_NAV_ADMIN => null, 112 MIDCOM_NAV_URL => "{$prefix}{$article->name}.html", 113 MIDCOM_NAV_NAME => ($article->title != '') ? $article->title : $article->name, 122 114 MIDCOM_NAV_GUID => $article->guid, 123 115 MIDCOM_NAV_OBJECT => $article,
