Repository navigation
Expand file tree
/
Copy pathmod_sp_tweet.php
More file actions
executable file
·112 lines (102 loc) · 4.05 KB
/
Copy pathmod_sp_tweet.php
File metadata and controls
executable file
·112 lines (102 loc) · 4.05 KB
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
111
112
<?php
/*
# mod_sp_tweet - Twitter Module by JoomShaper.com
# -----------------------------------------------
# Author JoomShaper http://www.joomshaper.com
# Copyright (C) 2010 - 2014 JoomShaper.com. All Rights Reserved.
# license - GNU/GPL V2 or Later
# Websites: http://www.joomshaper.com
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
//Parameters
$style = ($params->get('animation', 'none')=='none' ) ? $params->get ('layout_style','default') : 'default';
$follow_us = $params->get ('follow_us',1);
$tweets = $params->get ('tweets',4);
$avatar = $params->get ('avatar',1);
$avatar_width = $params->get ('avatar_width',48);
$linked_avatar = $params->get ('linked_avatar',1);
$show_user = $params->get ('show_user',1);
$linked_search = $params->get ('linked_search',1);
$linked_mention = $params->get ('linked_mention',1);
$tweet_time = $params->get ('tweet_time',1);
$tweet_time_linked = $params->get ('tweet_time_linked',1);
$tweet_src = $params->get ('tweet_src',1);
$target = $params->get ('target','_blank');
$force_ssl = $params->get ('force_ssl',0);
$moduleName = basename(dirname(__FILE__));
$moduleID = $module->id;
$document = JFactory::getDocument();
$cssFile = JPATH_THEMES. '/'.$document->template.'/css/'.$moduleName.'.css';
// Include helper.php
require_once (dirname(__FILE__).DIRECTORY_SEPARATOR.'helper.php');
$helper = new modSPTwitter($params, $moduleID);
$data= $helper->tweets();
if(JVERSION<3)
{
JHtml::_('behavior.framework');
}
else
{
JHtml::_('jquery.framework');
}
if (is_array($data)) {
if(file_exists($cssFile)) {
$document->addStylesheet(JURI::base(true) . '/templates/'.$document->template.'/css/'. $moduleName.'.'. $style . '.css');
} else {
$document->addStylesheet(JURI::base(true) . '/modules/'.$moduleName.'/assets/css/' . $moduleName.'.'. $style . '.css');
}
if($params->get('animation')!=='none') {
if(JVERSION<3)
{
$document->addScript(JURI::base(true) . '/modules/'.$moduleName.'/assets/js/mod_sp_tweet.js');
}
else
{
$document->addScript(JURI::base(true) . '/modules/'.$moduleName.'/assets/js/mod_sp_tweet_jquery.js');
}
$css = '.sp-tweet div.sp-tweet-item {'
. 'position: absolute;'
. 'visibility: hidden;'
. '}';
if(JVERSION<3)
{
$document->addStyleDeclaration( $css );
}
}
echo '<div id="sp-tweet-id'. $moduleID.'">';
require(JModuleHelper::getLayoutPath($moduleName,$style));
echo '</div>';
}
if ( $params->get('animation', 'none')!=='none' ) { ?>
<?php
if(JVERSION<3)
{
?>
<script type="text/javascript">
window.addEvent('domready', function() {
new sptweetSlide('#sp-tweet-id<?php echo $moduleID; ?>', {
'morphDuration':<?php echo $params->get('morph_duration','500');?>,
'animationPeriodicalTime':<?php echo $params->get ('animation_periodical_time','8000');?>
});
});
</script>
<?php
}
else
{
?>
<script type="text/javascript">
jQuery(function($) {
$(document).ready(function(){
$('#sp-tweet-id<?php echo $moduleID; ?>').sptweetSlide({
'morphDuration':<?php echo $params->get('morph_duration','500');?>,
'animationPeriodicalTime':<?php echo $params->get ('animation_periodical_time','8000');?>
});
});
});
</script>
<?php
}
?>
<?php }