-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmod_b_related_content.php
48 lines (36 loc) · 1.23 KB
/
mod_b_related_content.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
* @package Module B Related Content
* @version $Id:
* @author Yair Lahav
* @copyright (C) 2014 - Yair Lahav
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
**/
// no direct access
defined('_JEXEC') or die('Restricted access');
// Fix for Joomla 3
if(!defined('DS'))
define('DS',DIRECTORY_SEPARATOR);
require_once(dirname(__FILE__).DS.'helper.php');
$language = JFactory::getLanguage();
$language->load('mod_b_related_content');
if($params->get('logfile'))
modBRelatedContentHelper::logThis(1, print_r($params, true));
$addCurrentID = $params->get('itemid') ? true : false;
$useContentCatRouter = $params->get('contentCatUrl') ? true : false;
$numberArticles = $params->get('numberArticles');
$numberK2Articles = $params->get('numberArticlesK2');
$articles = modBRelatedContentHelper::getArticles($params);
if($articles > 0) {
$i = 0;
foreach($articles as $article) {
$urls[$i] = modBRelatedContentHelper::getUrl($article, $addCurrentID, $useContentCatRouter);
if($params->get('logfile')) {
modBRelatedContentHelper::logThis(2, print_r($article, true));
modBRelatedContentHelper::logThis(3, print_r($urls[$i], true));
}
$i++;
}
}
require(JModuleHelper::getLayoutPath('mod_b_related_content'));
?>