-
Notifications
You must be signed in to change notification settings - Fork 6
/
helper.php
executable file
·47 lines (38 loc) · 1.29 KB
/
helper.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
<?php
/*------------------------------------------------------------------------
# mod_insertarticle
# ------------------------------------------------------------------------
# author Cristian Grañó (percha.com)
# copyright Copyright (C) 2010 YourAwesomeSite.com. All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://www.yourawesomesite.com
# Technical Support: Forum - http://www.percha.com/
-------------------------------------------------------------------------*/
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
class ModInsertarticle {
public function getArticles($args){
$db = &JFactory::getDBO();
$item = "";
$id = $args['id'];
if($id > 0){
$query = "select * ";
$query .= "FROM #__content WHERE id =".$id." AND state=1 " ;
//echo $query;
$db->setQuery($query);
$item = $db->loadObject();
}
return $item;
}
/**
* Function to test whether we are in an article view.
*
* returns boolean True if current view is an article
*/
public function isArticle() {
$option = JRequest::getCmd('option');
$view = JRequest::getCmd('view');
$id = JRequest::getInt('id');
// return True if this is an article
return ($option == 'com_content' && $view == 'article' && $id);
}
}