-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod_jlvk_lastcommnets.php
45 lines (42 loc) · 1.45 KB
/
mod_jlvk_lastcommnets.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
<?php
/**
* @package mod_jlvk_lastcommnets
* @author Vadim Kunitsyn ([email protected])
* @version 3.0
* @copyright (C) 2012-2022 by Vadim Kunitsyn (https://www.joomline.ru)
* @license GNU/GPL: http://www.gnu.org/copyleft/gpl.html
*
*/
// No direct access
defined('_JEXEC') or die('Restricted access');
$api_id = $params->get('api_id');
$width = $params->get('width');
$height = $params->get('height');
$limit = $params->get('limit');
$doc = JFactory::getDocument();
$doc->addCustomTag('
<script type="text/javascript">
if(!window.VK) {
document.write(unescape(\'<script type="text/javascript" src="https://vk.com/js/api/openapi.js?169">%3C/script%3E\'));
}
</script>
');
?>
<div id="mod_jlvkcomments"></div>
<script type="text/javascript">
function VKInit() {
VK.init({apiId: <?=$api_id ?>, onlyWidgets: true});
VK.Widgets.CommentsBrowse('mod_jlvkcomments', {width: <?php echo $width ?>, limit: <?php echo $limit ?>, mini: auto, height: <?php echo $height ?>});
}
if (window.addEventListener) {
window.addEventListener("load",VKInit,false);
} else if (window.attachEvent) {
window.attachEvent("onload",VKInit);
} else { window.onload = function() {
VKInit();
}
}
</script>
<div style="text-align: right;">
<a style="text-decoration:none; color: #c0c0c0; font-family: arial,helvetica,sans-serif; font-size: 5pt; " target="_blank" href="https://joomline.ru/rasshirenija/plugin/plugin-jl-vkcomments.html">Расширения Вконтакте</a>
</div>