-
Notifications
You must be signed in to change notification settings - Fork 6
/
mod_insertarticle.php
executable file
·110 lines (76 loc) · 3.32 KB
/
mod_insertarticle.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?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/
-------------------------------------------------------------------------
<<<<<<< HEAD
//$query = "SHOW DATABASES" or die("Error in the consult.." . mysqli_error($enlace));
//$query = "SHOW DATABASES" or die("Error in the consult.." . mysqli_error($enlace));
//$query = "SHOW DATABASES" or die("Error in the consult.." . mysqli_error($enlace));
//$query = "SHOW DATABASES" or die("Error in the consult.." . mysqli_error($enlace));
neeee 2222
*/
=======
new popo*/
>>>>>>> All
//no direct access
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
//this is intializer.php
defined('DS')? null :define('DS',DIRECTORY_SEPARATOR);
// include the helper file
require_once(dirname(__FILE__).DS.'helper.php');
jimport( 'joomla.html.parameter' );
jimport( 'joomla.html.registry' );
jimport( 'joomla.version' );
// get a parameter from the module's configuration
if ($params->get('only_article_view', 0)){ //default is 0: show the module in all views
$ArticleView=ModInsertarticle::isArticle();
}else{
$ArticleView=False;
}
if (!$ArticleView){
$args['id'] = $params->get('id');
$item = ModInsertarticle::getArticles($args);
//*************
$config=&JFactory::getConfig();
$Itemid= $params->get('Itemid','');
// get the parameter values
$moduleclass_sfx = $params->get('moduleclass_sfx');
$showtitle_article = $params->get('showtitle_article', 1);
$read_more = $params->get('read_more', 1);
$show_edit = $params->get('show_edit', 1);
$txt_read_more = $params->get('txt_read_more', 1);
$readMoreTXT = JText::_("READMORE");
if($txt_read_more==0) $readMoreTXT=$item->title;
$app = JFactory::getApplication();
$parametar = $app->getParams();
//
$ver = new JVersion();
$vernum = $ver->getShortVersion();
$pos = strrpos($vernum, "3.");
if ($pos === false) { // note: three equal signs
// not found...
$parametar = new JParameter($item->attribs);
}else{
$parametar = new JRegistry($item->attribs);
}
$user =& JFactory::getUser( );
$url ="";
//***********
if(!empty($item->id)){
$canEdit =JFactory::getUser()->authorise('core.edit', 'com_content.article.'.$item->id);
if(empty($Itemid)) {
$url = JRoute::_("index.php?option=com_content&view=article&id=".$item->id.":".$item->alias."&catid=".$item->catid, true);
}else{
$url = JRoute::_("index.php?option=com_content&view=article&id=".$item->id.":".$item->alias."&catid=".$item->catid."&Itemid=".$Itemid, true);
}
// include the template for display
require JModuleHelper::getLayoutPath('mod_insertarticle', $params->get('layout', 'default'));
}
}
?>