示例#1
0
 function get_image($num)
 {
     // used variables
     $url = false;
     $output = '';
     // select the proper image function
     if ($this->mode == 'com_content') {
         // load necessary com_content View class
         if (!class_exists('NSP_GK5_com_content_View')) {
             require_once JModuleHelper::getLayoutPath('mod_news_pro_gk5', 'com_content/view');
         }
         // generate the com_content image URL only
         $url = NSP_GK5_com_content_View::image($this->parent->config, $this->parent->content[$num], true, true);
     } else {
         if ($this->mode == 'com_k2') {
             // load necessary k2 View class
             if (!class_exists('NSP_GK5_com_k2_View')) {
                 require_once JModuleHelper::getLayoutPath('mod_news_pro_gk5', 'com_k2/view');
             }
             // generate the K2 image URL only
             $url = NSP_GK5_com_k2_View::image($this->parent->config, $this->parent->content[$num], true, true);
         }
     }
     // check if the URL exists
     if ($url === FALSE) {
         return false;
     } else {
         // if URL isn't blank - return it!
         if ($url != '') {
             return $url;
         } else {
             return false;
         }
     }
 }
示例#2
0
 function get_link($num)
 {
     if ($this->mode == 'com_content') {
         // load necessary com_content View class
         if (!class_exists('NSP_GK5_com_content_View')) {
             require_once JModuleHelper::getLayoutPath('mod_news_pro_gk5', 'com_content/view');
         }
         return NSP_GK5_com_content_View::itemLink($this->parent->content[$num], $this->parent->config);
     } else {
         if ($this->mode == 'com_k2') {
             // load necessary k2 View class
             if (!class_exists('NSP_GK5_com_k2_View')) {
                 require_once JModuleHelper::getLayoutPath('mod_news_pro_gk5', 'com_k2/view');
             }
             return NSP_GK5_com_k2_View::itemLink($this->parent->content[$num], $this->parent->config);
         } else {
             return false;
         }
     }
 }
示例#3
0
 function get_link($num)
 {
     if ($this->mode == 'com_content') {
         // load necessary com_content View class
         if (!class_exists('NSP_GK5_com_content_View')) {
             require_once JModuleHelper::getLayoutPath('mod_news_pro_gk5', 'com_content/view');
         }
         return NSP_GK5_com_content_View::itemLink($this->parent->content[$num], $this->parent->config);
     } else {
         if ($this->mode == 'com_k2') {
             // load necessary k2 View class
             if (!class_exists('NSP_GK5_com_k2_View')) {
                 require_once JModuleHelper::getLayoutPath('mod_news_pro_gk5', 'com_k2/view');
             }
             return NSP_GK5_com_k2_View::itemLink($this->parent->content[$num], $this->parent->config);
         } else {
             if ($this->mode == 'com_easyblog') {
                 return urldecode(JRoute::_('index.php?option=com_easyblog&view=entry&id=' . $this->parent->content[$num]['id']));
             } else {
                 return false;
             }
         }
     }
 }
示例#4
0
 function initialize($config, $content)
 {
     // tables which will be used in generated content
     $output = array('arts' => array(), 'list' => array(), 'featured' => array());
     // Generating content
     $counter = 0;
     //
     for ($i = 0; $i < count($content); $i++) {
         if ($i < $config['news_column'] * $config['news_rows'] * $config['news_full_pages']) {
             // GENERATING NEWS CONTENT
             if ($config['use_own_article_format'] == 1) {
                 $generated_content = NSP_GK5_Article_Format::generateLayout($config, $content[$i]);
             } else {
                 // GENERATING HEADER
                 $news_header = NSP_GK5_com_content_View::header($config, $content[$i]);
                 // GENERATING IMAGE
                 $news_image = NSP_GK5_com_content_View::image($config, $content[$i]);
                 // GENERATING READMORE
                 $news_readmore = NSP_GK5_com_content_View::readMore($config, $content[$i]);
                 // GENERATING TEXT
                 $news_text = NSP_GK5_com_content_View::text($config, $content[$i], $news_readmore);
                 // GENERATE NEWS INFO
                 $news_info = NSP_GK5_com_content_View::info($config, $content[$i]);
                 // GENERATE NEWS INFO2
                 $news_info2 = NSP_GK5_com_content_View::info($config, $content[$i], 2);
                 // PARSING PLUGINS
                 if ($config['parse_plugins'] == TRUE) {
                     $news_text = JHtml::_('content.prepare', $news_text);
                 }
                 // CLEANING PLUGINS
                 if ($config['clean_plugins'] == TRUE) {
                     $news_text = preg_replace("/(\\{.+?\\}.+?\\{.+?})|(\\{.+?\\})/", "", $news_text);
                 }
                 // GENERATE CONTENT FOR TAB
                 $generated_content = '';
                 // initialize variable
                 //
                 for ($j = 1; $j < 10; $j++) {
                     //
                     if ($config['wrap_content'] == 1 && $config['news_image_order'] == 1) {
                         if ($j == 2) {
                             $generated_content .= '<div class="gkArtContentWrap">';
                         }
                     }
                     //
                     if ($config['news_header_order'] == $j) {
                         $generated_content .= $news_header;
                     }
                     if ($config['news_image_order'] == $j) {
                         $generated_content .= $news_image;
                     }
                     if ($config['news_text_order'] == $j) {
                         $generated_content .= $news_text;
                     }
                     if ($config['news_info_order'] == $j) {
                         $generated_content .= $news_info;
                     }
                     if ($config['news_info2_order'] == $j) {
                         $generated_content .= $news_info2;
                     }
                 }
                 //
                 if ($config['news_content_readmore_pos'] != 'after') {
                     $generated_content .= $news_readmore;
                 }
                 //
                 if ($config['wrap_content'] == 1 && $config['news_image_order'] == 1) {
                     $generated_content .= '</div>';
                 }
             }
             // creating table with news content
             array_push($output['arts'], $generated_content);
             array_push($output['featured'], $content[$i]['featured']);
         } else {
             array_push($output['list'], NSP_GK5_com_content_View::lists($config, $content[$i], $counter));
             //
             $counter++;
         }
     }
     // return the results array
     return $output;
 }
示例#5
0
文件: view.php 项目: pwfir/klzm1
 static function originalImage($config, $item)
 {
     $images = json_decode($item['images']);
     $IMG_SOURCE = '';
     if ($config['thumb_image_type'] == 'full' && (isset($images) && $images->image_fulltext != '')) {
         $IMG_SOURCE = $images->image_fulltext;
     } elseif ($config['thumb_image_type'] == 'intro' && (isset($images) && $images->image_intro != '')) {
         $IMG_SOURCE = $images->image_intro;
     } else {
         // set image to first in article content
         $IMG_SOURCE = NSP_GK5_com_content_View::getImageFromText($item['text']);
     }
     return $IMG_SOURCE;
 }
示例#6
0
	static function lists($config, $item, $num) {
		$odd = $num % 2;
		
		if($config['news_short_pages'] > 0) {
	        $text = '';
	        $title = '';
	        $image = '';
	        
	        if($config['list_text_limit'] > 0) {
	            $text = NSP_GK5_Utils::cutText(strip_tags(preg_replace("/\{.+?\}/", "", $item['text'])), $config, 'list_text_limit', '&hellip;');
	            $text = preg_replace("/\{.+?\}/", "", $text);
	            
	            if(JString::strlen($text) > 0) {
	            	$text = '<p>'.$text.'</p>';
	            }
			}
			
			if($config['list_title_limit'] > 0) {
				$title = htmlspecialchars($item['title']);
				$title = NSP_GK5_Utils::cutText($title, $config, 'list_title_limit', '&hellip;');
				$title = str_replace('"', "&quot;", $title);
				$link = NSP_GK5_com_content_View::itemLink($item);
			
				if(JString::strlen($title) > 0) {
					$title = '<h4><a href="'.$link.'" title="'.htmlspecialchars($item['title']).'">'.$title.'</a></h4>';
				}
			}
			
			if($config['links_image'] == 1) {
				$image = NSP_GK5_com_content_View::image($config, $item, false, false, true);
			}
			// creating rest news list
			return '<li class="'.(($odd == 1) ? 'odd' : 'even').'">' . $image . (($image != '') ? '<div>' . $title . $text . '</div>' : ($title . $text)) . '</li>';	
		} else {
			return '';
		}
	}