This repository has been archived by the owner on Jul 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathtemplate.php
147 lines (144 loc) · 5.3 KB
/
template.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?php
/**
* Project: inWidget: show pictures from instagram.com on your site!
* File: template.php
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of MIT license
* https://inwidget.ru/MIT-license.txt
*
* @link https://inwidget.ru
* @copyright 2014-2020 Alexandr Kazarmshchikov
* @author Alexandr Kazarmshchikov
* @package inWidget
*
*/
if (!$inWidget instanceof \InWidget\Core) {
throw new \Exception('inWidget object was not initialised.');
}
?>
<!DOCTYPE html>
<html lang="<?= $inWidget->langName ?>">
<head>
<title>inWidget - free Instagram widget for your site!</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta http-equiv="content-language" content="<?= $inWidget->langName ?>"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<link rel="stylesheet" type="text/css" href="<?= $inWidget->skinPath . $inWidget->skinName ?>.css?r2" media="all"/>
<?php if ($inWidget->adaptive === false) : ?>
<style type='text/css'>
.widget {
width: <?= $inWidget->width ?>px;
}
.widget .data a.image:link, .widget .data a.image:visited {
width: <?= $inWidget->imgWidth ?>px;
height: <?= $inWidget->imgWidth ?>px;
}
.widget .data .image span {
width: <?= $inWidget->imgWidth ?>px;
height: <?= $inWidget->imgWidth ?>px;
}
.copyright, .cacheError {
width: <?= $inWidget->width ?>px;
}
</style>
<?php
else :
require_once 'plugins/adaptive.php';
endif;
?>
</head>
<body>
<div id="widget" class="widget">
<a href="https://instagram.com/<?= $inWidget->data->username ?>" target="_blank" class="title">
<div class="icon"> </div>
<div class="text"><?= $inWidget->lang['title']; ?></div>
<div class="clear"> </div>
</a>
<?php if ($inWidget->toolbar == true) : ?>
<table class="profile">
<tr>
<td rowspan="2" class="avatar">
<a href="https://instagram.com/<?= $inWidget->data->username ?>" target="_blank"><img src="<?= $inWidget->data->avatar ?>"></a>
</td>
<td class="value">
<?= $inWidget->data->posts; ?>
<span><?= $inWidget->lang['statPosts'] ?></span>
</td>
<td class="value">
<?= $inWidget->data->followers ?>
<span><?= $inWidget->lang['statFollowers'] ?></span>
</td>
<td class="value" style="border-right:none !important;">
<?= $inWidget->data->following ?>
<span><?= $inWidget->lang['statFollowing'] ?></span>
</td>
</tr>
<tr>
<td colspan="3" style="border-right:none !important;">
<a href="https://instagram.com/<?= $inWidget->data->username ?>" class="follow" target="_blank"><?= $inWidget->lang['buttonFollow'] ?> ►</a>
</td>
</tr>
</table>
<?php endif;
$i = 0;
$count = $inWidget->countAvailableImages($inWidget->data->images);
if ($count > 0) {
if ($inWidget->config['imgRandom'] === true) {
shuffle($inWidget->data->images);
}
echo '<div id="widgetData" class="data">';
foreach ($inWidget->data->images as $key => $item) {
if ($inWidget->isBannedUserId($item->authorId) === true) {
continue;
}
switch ($inWidget->preview) {
case 'large':
$thumbnail = $item->large;
break;
case 'fullsize':
$thumbnail = $item->fullsize;
break;
default:
$thumbnail = $item->small;
}
echo '<a href="' . $item->link . '" class="image" target="_blank"><span style="background-image:url(' . $thumbnail . ');"> </span></a>';
$i++;
if ($i >= $inWidget->view) {
break;
}
}
echo '<div class="clear"> </div>';
echo '</div>';
} else {
if (!empty($inWidget->config['HASHTAG'])) {
$inWidget->lang['imgEmptyByHash'] = str_replace(
'{$hashtag}',
$inWidget->config['HASHTAG'],
$inWidget->lang['imgEmptyByHash']
);
echo '<div class="empty">' . $inWidget->lang['imgEmptyByHash'] . '</div>';
} else {
echo '<div class="empty">' . $inWidget->lang['imgEmpty'] . '</div>';
}
}
?>
</div>
<div class='copyright'>
© <a href='https://inwidget.ru' target='_blank' title='Free Instagram widget for your website!'>inwidget.ru</a>
</div>
<?php if (isset($inWidget->data->isBackup)) : ?>
<div class='cacheError'>
<?= $inWidget->lang['errorCache'] . ' ' . date(
'Y-m-d H:i:s',
$inWidget->data->lastupdate
) . ' <br /> ' . $inWidget->lang['updateNeeded'] ?>
</div>
<?php endif; ?>
</body>
</html>
<!--
inWidget - free Instagram widget for your site!
https://inwidget.ru
© Alexandr Kazarmshchikov
-->