|
1
|
|
|
<?php declare(strict_types=1); |
|
2
|
|
|
/* |
|
3
|
|
|
You may not change or alter any portion of this comment or credits |
|
4
|
|
|
of supporting developers from this source code or any supporting source code |
|
5
|
|
|
which is considered copyrighted (c) material of the original comment or credit authors. |
|
6
|
|
|
|
|
7
|
|
|
This program is distributed in the hope that it will be useful, |
|
8
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
9
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
/** |
|
13
|
|
|
* @copyright XOOPS Project (https://xoops.org) |
|
14
|
|
|
* @license https://www.fsf.org/copyleft/gpl.html GNU public license |
|
15
|
|
|
* @since 1.0 |
|
16
|
|
|
* @author trabis <[email protected]> |
|
17
|
|
|
* @author Bandit-x |
|
18
|
|
|
* @author Mowaffak |
|
19
|
|
|
*/ |
|
20
|
|
|
|
|
21
|
|
|
use XoopsModules\Publisher\Common\Configurator; |
|
22
|
|
|
use XoopsModules\Publisher\Constants; |
|
23
|
|
|
use XoopsModules\Publisher\Helper; |
|
24
|
|
|
use XoopsModules\Publisher\ItemHandler; |
|
25
|
|
|
use XoopsModules\Publisher\Seo; |
|
26
|
|
|
use XoopsModules\Publisher\Utility; |
|
27
|
|
|
|
|
28
|
|
|
require_once \dirname(__DIR__) . '/include/common.php'; |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* @param $options |
|
32
|
|
|
* |
|
33
|
|
|
* @return bool|array |
|
34
|
|
|
*/ |
|
35
|
|
|
function publisher_latest_news_show($options) |
|
36
|
|
|
{ |
|
37
|
|
|
$block = []; |
|
38
|
|
|
|
|
39
|
|
|
$configurator = new Configurator(); |
|
40
|
|
|
$icons = $configurator->icons; |
|
41
|
|
|
|
|
42
|
|
|
$helper = Helper::getInstance(); |
|
43
|
|
|
$helper->loadLanguage('main'); |
|
44
|
|
|
/** @var ItemHandler $itemHandler */ |
|
45
|
|
|
$itemHandler = $helper->getHandler('Item'); |
|
46
|
|
|
// xoops_loadLanguage('main', 'publisher'); |
|
47
|
|
|
|
|
48
|
|
|
$start = $options[0]; // You can show articles from specified range |
|
49
|
|
|
$limit = $options[1]; |
|
50
|
|
|
$columnCount = $options[2]; |
|
51
|
|
|
$letters = (int)$options[3]; |
|
52
|
|
|
$selectedStories = $options[4]; |
|
53
|
|
|
$sort = $options[9]; |
|
54
|
|
|
$order = Utility::getOrderBy($sort); |
|
55
|
|
|
$imgWidth = $options[11]; |
|
56
|
|
|
$imgHeight = $options[12]; |
|
57
|
|
|
$border = $options[13]; |
|
58
|
|
|
$bordercolor = $options[14]; |
|
59
|
|
|
|
|
60
|
|
|
$block['spec']['columnwidth'] = (1 / $columnCount * 100); |
|
61
|
|
|
|
|
62
|
|
|
$allcats = false; |
|
63
|
|
|
if (empty($options[31])) { |
|
64
|
|
|
$allcats = true; |
|
65
|
|
|
} elseif (in_array(0, explode(',', $options[31]), true)) { |
|
66
|
|
|
$allcats = true; |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
// creating the ITEM objects that belong to the selected category |
|
70
|
|
|
if ($allcats) { |
|
71
|
|
|
$criteria = null; |
|
72
|
|
|
} else { |
|
73
|
|
|
$criteria = new \CriteriaCompo(); |
|
74
|
|
|
$criteria->add(new \Criteria('categoryid', '(' . $options[31] . ')', 'IN')); |
|
75
|
|
|
} |
|
76
|
|
|
|
|
77
|
|
|
// Use specific ITEMS |
|
78
|
|
|
if (0 != $selectedStories) { |
|
79
|
|
|
unset($criteria); //removes category option |
|
80
|
|
|
$criteria = new \CriteriaCompo(); |
|
81
|
|
|
$criteria->add(new \Criteria('itemid', '(' . $selectedStories . ')', 'IN')); |
|
82
|
|
|
} |
|
83
|
|
|
|
|
84
|
|
|
$publisherIsAdmin = $helper->isUserAdmin(); |
|
85
|
|
|
if (!$publisherIsAdmin) { |
|
86
|
|
|
if (null === $criteria) { |
|
87
|
|
|
$criteria = new \CriteriaCompo(); |
|
88
|
|
|
} |
|
89
|
|
|
$criteriaDateSub = new \Criteria('datesub', time(), '<='); |
|
90
|
|
|
$criteria->add($criteriaDateSub); |
|
91
|
|
|
} |
|
92
|
|
|
|
|
93
|
|
|
$itemsObj = $itemHandler->getItems($limit, $start, [Constants::PUBLISHER_STATUS_PUBLISHED], -1, $sort, $order, '', true, $criteria, 'itemid'); |
|
94
|
|
|
|
|
95
|
|
|
$scount = count($itemsObj); |
|
96
|
|
|
|
|
97
|
|
|
if (0 == $scount) { |
|
98
|
|
|
return false; |
|
99
|
|
|
} |
|
100
|
|
|
$k = 0; |
|
101
|
|
|
$columns = []; |
|
102
|
|
|
|
|
103
|
|
|
foreach ($itemsObj as $itemId => $itemObj) { |
|
104
|
|
|
$item = []; |
|
105
|
|
|
$item['itemurl'] = $itemObj->getItemUrl(); |
|
106
|
|
|
$item['title'] = $itemObj->getItemLink(); |
|
107
|
|
|
$item['alt'] = strip_tags($itemObj->getItemLink()); |
|
108
|
|
|
$mainImage = $itemObj->getMainImage(); |
|
109
|
|
|
if (empty($mainImage['image_path'])) { |
|
110
|
|
|
$mainImage['image_path'] = PUBLISHER_URL . '/assets/images/default_image.jpg'; |
|
111
|
|
|
} |
|
112
|
|
|
// check to see if GD function exist |
|
113
|
|
|
if (!empty($mainImage['image_path']) && !function_exists('imagecreatetruecolor')) { |
|
114
|
|
|
$item['item_image'] = $mainImage['image_path']; |
|
115
|
|
|
} else { |
|
116
|
|
|
$item['item_image'] = PUBLISHER_URL . '/thumb.php?src=' . $mainImage['image_path'] . '&w=' . $imgWidth; // No $imgHeight for autoheight option |
|
117
|
|
|
$item['image_path'] = $mainImage['image_path']; |
|
118
|
|
|
} |
|
119
|
|
|
$item['text'] = $itemObj->getBlockSummary($letters); |
|
120
|
|
|
$item['display_item_image'] = $options[10]; |
|
121
|
|
|
$item['display_summary'] = $options[16]; |
|
122
|
|
|
$item['display_adminlink'] = $options[29]; |
|
123
|
|
|
$item = $itemObj->getMainImage($item); //returns an array |
|
124
|
|
|
|
|
125
|
|
|
$lsHeight = $imgPosition = $lsMargin = ''; |
|
126
|
|
|
if (0 != $options[12]) { |
|
127
|
|
|
$lsHeight = 'height="' . $imgHeight . '" '; |
|
128
|
|
|
} // set height = 0 in block option for auto height |
|
129
|
|
|
|
|
130
|
|
|
if ('LEFT' === $options[15]) { |
|
131
|
|
|
$imgPosition = 'float: left'; |
|
132
|
|
|
$lsMargin = '-right'; |
|
133
|
|
|
$block['position'] = $imgPosition; |
|
134
|
|
|
$block['margin'] = $lsMargin; |
|
135
|
|
|
} |
|
136
|
|
|
|
|
137
|
|
|
if ('CENTER' === $options[15]) { |
|
138
|
|
|
$imgPosition = 'text-align:center'; |
|
139
|
|
|
$lsMargin = ''; |
|
140
|
|
|
$block['position'] = $imgPosition; |
|
141
|
|
|
$block['margin'] = $lsMargin; |
|
142
|
|
|
} |
|
143
|
|
|
|
|
144
|
|
|
if ('RIGHT' === $options[15]) { |
|
145
|
|
|
$imgPosition = 'float: right'; |
|
146
|
|
|
$lsMargin = '-left'; |
|
147
|
|
|
$block['position'] = $imgPosition; |
|
148
|
|
|
$block['margin'] = $lsMargin; |
|
149
|
|
|
} |
|
150
|
|
|
|
|
151
|
|
|
//Image |
|
152
|
|
|
if (1 == $options[10] && '' != $item['image_path']) { |
|
153
|
|
|
$startdiv = '<div style="' . $imgPosition . '"><a href="' . $item['itemurl'] . '">'; |
|
154
|
|
|
$style = 'style="margin' . $lsMargin . ': 10px; padding: 2px; border: ' . $border . 'px solid #' . $bordercolor . '"'; |
|
155
|
|
|
$enddiv = 'width="' . $imgWidth . '" ' . $lsHeight . '></a></div>'; |
|
156
|
|
|
$image = $startdiv . '<img ' . $style . ' src="' . $item['item_image'] . '" alt="' . $item['image_name'] . '" ' . $enddiv; |
|
157
|
|
|
|
|
158
|
|
|
$item['image'] = $image; |
|
159
|
|
|
} |
|
160
|
|
|
|
|
161
|
|
|
if (is_object($GLOBALS['xoopsUser']) && $GLOBALS['xoopsUser']->isAdmin(-1)) { |
|
162
|
|
|
$item['admin'] = "<a href='" . PUBLISHER_URL . '/submit.php?itemid=' . $itemObj->itemid() . "'" . $icons['edit'] . '</a> '; |
|
163
|
|
|
$item['admin'] .= "<a href='" . PUBLISHER_URL . '/admin/item.php?op=del&itemid=' . $itemObj->itemid() . "'>" . $icons['delete'] . '</a>'; |
|
164
|
|
|
} else { |
|
165
|
|
|
$item['admin'] = ''; |
|
166
|
|
|
} |
|
167
|
|
|
|
|
168
|
|
|
$block['topiclink'] = ''; |
|
169
|
|
|
|
|
170
|
|
|
if (1 == $options[16]) { |
|
171
|
|
|
$block['text'] = $itemObj->getBlockSummary($letters); |
|
172
|
|
|
} |
|
173
|
|
|
|
|
174
|
|
|
$block['archivelink'] = ''; |
|
175
|
|
|
if (1 == $options[17]) { |
|
176
|
|
|
$block['archivelink'] = '| <a href="' . PUBLISHER_URL . '/archive.php">' . _MB_PUBLISHER_ARCHIVE . '</a> '; |
|
177
|
|
|
} |
|
178
|
|
|
|
|
179
|
|
|
//TODO: Should we not show link to Anonymous? |
|
180
|
|
|
$block['submitlink'] = ''; |
|
181
|
|
|
if (1 == $options[18] && $GLOBALS['xoopsUser']) { |
|
182
|
|
|
$block['submitlink'] = '| <a href="' . PUBLISHER_URL . '/submit.php">' . _MB_PUBLISHER_SUBMITNEWS . '</a> '; |
|
183
|
|
|
} |
|
184
|
|
|
|
|
185
|
|
|
$item['poster'] = ''; |
|
186
|
|
|
if (1 == $options[19]) { |
|
187
|
|
|
$item['poster'] = $itemObj->posterName(); |
|
188
|
|
|
$block['lang_poster'] = _MB_PUBLISHER_POSTEDBY; |
|
189
|
|
|
} |
|
190
|
|
|
|
|
191
|
|
|
$item['posttime'] = ''; |
|
192
|
|
|
if (1 == $options[20]) { |
|
193
|
|
|
$item['posttime'] = $itemObj->getDatesub(); |
|
194
|
|
|
$block['lang_date'] = _MB_PUBLISHER_ON; |
|
195
|
|
|
} |
|
196
|
|
|
|
|
197
|
|
|
$item['topic_title'] = ''; |
|
198
|
|
|
if (1 == $options[21]) { |
|
199
|
|
|
$item['topic_title'] = $itemObj->getCategoryLink(); |
|
200
|
|
|
$item['category'] = strip_tags($itemObj->getCategoryLink()); |
|
201
|
|
|
$block['lang_category'] = _MB_PUBLISHER_CATEGORY; |
|
202
|
|
|
} |
|
203
|
|
|
|
|
204
|
|
|
$item['read'] = ''; |
|
205
|
|
|
if (1 == $options[22]) { |
|
206
|
|
|
$item['read'] = $itemObj->counter(); |
|
207
|
|
|
$block['lang_reads'] = _MB_PUBLISHER_READS; |
|
208
|
|
|
} |
|
209
|
|
|
$item['cancomment'] = $itemObj->cancomment(); |
|
210
|
|
|
$comments = $itemObj->comments(); |
|
211
|
|
|
if (1 == $options[23]) { |
|
212
|
|
|
if ($comments > 0) { |
|
213
|
|
|
//shows 1 comment instead of 1 comm. if comments ==1 |
|
214
|
|
|
//langugage file modified accordingly |
|
215
|
|
|
if (1 == $comments) { |
|
216
|
|
|
$item['comment'] = ' ' . _MB_PUBLISHER_ONECOMMENT . ' '; |
|
217
|
|
|
} else { |
|
218
|
|
|
$item['comment'] = ' ' . $comments . ' ' . _MB_PUBLISHER_COMMENTS . ' '; |
|
219
|
|
|
} |
|
220
|
|
|
} else { |
|
221
|
|
|
$item['comment'] = ' ' . _MB_PUBLISHER_NO_COMMENTS . ' '; |
|
222
|
|
|
} |
|
223
|
|
|
} |
|
224
|
|
|
|
|
225
|
|
|
$item['print'] = ''; |
|
226
|
|
|
if (1 == $options[24]) { |
|
227
|
|
|
$item['print'] = '<a href="' . Seo::generateUrl('print', $itemObj->itemid(), $itemObj->short_url()) . '" rel="nofollow">' . $icons['print'] . '</a> '; |
|
228
|
|
|
} |
|
229
|
|
|
|
|
230
|
|
|
$item['pdf'] = ''; |
|
231
|
|
|
|
|
232
|
|
|
if (1 == $options[25]) { |
|
233
|
|
|
$item['pdf'] = "<a href='" . PUBLISHER_URL . '/makepdf.php?itemid=' . $itemObj->itemid() . "' rel='nofollow'>" . $icons['pdf'] . '</a> '; |
|
234
|
|
|
} |
|
235
|
|
|
|
|
236
|
|
|
$item['email'] = ''; |
|
237
|
|
|
if (1 == $options[26]) { |
|
238
|
|
|
$maillink = 'mailto:?subject=' . sprintf(_CO_PUBLISHER_INTITEM, $GLOBALS['xoopsConfig']['sitename']) . '&body=' . sprintf(_CO_PUBLISHER_INTITEMFOUND, $GLOBALS['xoopsConfig']['sitename']) . ': ' . $itemObj->getItemUrl(); |
|
239
|
|
|
$item['email'] = '<a href="' . $maillink . '">' . $icons['mail'] . '</a> '; |
|
240
|
|
|
} |
|
241
|
|
|
|
|
242
|
|
|
$block['morelink'] = ''; |
|
243
|
|
|
if (1 == $options[27]) { |
|
244
|
|
|
$block['morelink'] = '<a href="' . PUBLISHER_URL . '/index.php">' . _MB_PUBLISHER_MORE_ITEMS . '</a> '; |
|
245
|
|
|
} |
|
246
|
|
|
|
|
247
|
|
|
$item['more'] = ''; |
|
248
|
|
|
if ((1 == $options[28] && '' != $itemObj->body()) || $itemObj->comments() > 0) { |
|
249
|
|
|
$item['more'] = '<a href="' . $itemObj->getItemUrl() . '">' . _MB_PUBLISHER_READMORE . '</a>'; |
|
250
|
|
|
} |
|
251
|
|
|
|
|
252
|
|
|
$block['latestnews_scroll'] = false; |
|
253
|
|
|
if (1 == $options[5]) { |
|
254
|
|
|
$block['latestnews_scroll'] = true; |
|
255
|
|
|
} |
|
256
|
|
|
|
|
257
|
|
|
$block['scrollheight'] = $options[6]; |
|
258
|
|
|
$block['scrollspeed'] = $options[7]; |
|
259
|
|
|
$block['scrolldir'] = $options[8]; |
|
260
|
|
|
|
|
261
|
|
|
$block['template'] = $options[30]; |
|
262
|
|
|
|
|
263
|
|
|
$block['imgwidth'] = $options[11]; |
|
264
|
|
|
$block['imgheight'] = $options[12]; |
|
265
|
|
|
$block['border'] = $options[13]; |
|
266
|
|
|
$block['bordercolor'] = $options[14]; |
|
267
|
|
|
|
|
268
|
|
|
$block['letters'] = $letters; |
|
269
|
|
|
|
|
270
|
|
|
$columns[$k][] = $item; |
|
271
|
|
|
++$k; |
|
272
|
|
|
|
|
273
|
|
|
if ($k == $columnCount) { |
|
274
|
|
|
$k = 0; |
|
275
|
|
|
} |
|
276
|
|
|
} |
|
277
|
|
|
|
|
278
|
|
|
unset($item); |
|
279
|
|
|
$block['columns'] = $columns; |
|
280
|
|
|
$GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . '/modules/' . PUBLISHER_DIRNAME . '/assets/css/' . PUBLISHER_DIRNAME . '.css'); |
|
281
|
|
|
|
|
282
|
|
|
return $block; |
|
283
|
|
|
} |
|
284
|
|
|
|
|
285
|
|
|
/** |
|
286
|
|
|
* @param $options |
|
287
|
|
|
* |
|
288
|
|
|
* @return string |
|
289
|
|
|
*/ |
|
290
|
|
|
function publisher_latest_news_edit($options) |
|
291
|
|
|
{ |
|
292
|
|
|
$tabletag1 = '<tr><td style="padding:3px;" width="37%">'; |
|
293
|
|
|
$tabletag2 = '</td><td style="padding:3px;">'; |
|
294
|
|
|
$tabletag3 = '<tr><td style="padding-top:20px;border-bottom:1px solid #000;" colspan="2">'; |
|
295
|
|
|
$tabletag4 = '</td></tr>'; |
|
296
|
|
|
|
|
297
|
|
|
$form = "<table border='0' cellpadding='0' cellspacing='0'>"; |
|
298
|
|
|
$form .= $tabletag3 . _MB_PUBLISHER_GENERALCONFIG . $tabletag4; // General Options |
|
299
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_FIRST . $tabletag2; |
|
300
|
|
|
$form .= "<input type='text' name='options[]' value='" . $options[0] . "' size='4'> " . _MB_PUBLISHER_ITEMS . '</td></tr>'; |
|
301
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_DISP . $tabletag2; |
|
302
|
|
|
$form .= "<input type='text' name='options[]' value='" . $options[1] . "' size='4'> " . _MB_PUBLISHER_ITEMS . '</td></tr>'; |
|
303
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_COLUMNS . $tabletag2; |
|
304
|
|
|
$form .= "<input type='text' name='options[]' value='" . $options[2] . "' size='4'> " . _MB_PUBLISHER_COLUMN . '</td></tr>'; |
|
305
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_TEXTLENGTH . $tabletag2; |
|
306
|
|
|
$form .= "<input type='text' name='options[]' value='" . $options[3] . "' size='4'> " . _MB_PUBLISHER_LETTER . '</td></tr>'; |
|
307
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_SELECTEDSTORIES . $tabletag2; |
|
308
|
|
|
$form .= "<input type='text' name='options[]' value='" . $options[4] . "' size='16'></td></tr>"; |
|
309
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_SCROLL . $tabletag2; |
|
310
|
|
|
$form .= publisher_mk_chkbox($options, 5); |
|
311
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_SCROLLHEIGHT . $tabletag2; |
|
312
|
|
|
$form .= "<input type='text' name='options[]' value='" . $options[6] . "' size='4'></td></tr>"; |
|
313
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_SCROLLSPEED . $tabletag2; |
|
314
|
|
|
$form .= "<input type='text' name='options[]' value='" . $options[7] . "' size='4'></td></tr>"; |
|
315
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_SCROLLDIR . $tabletag2; |
|
316
|
|
|
|
|
317
|
|
|
$form .= "<select size='1' name='options[8]'>"; |
|
318
|
|
|
|
|
319
|
|
|
$directions = ['right' => _MB_PUBLISHER_SCROLL_RIGHT, 'left' => _MB_PUBLISHER_SCROLL_LEFT, 'up' => _MB_PUBLISHER_SCROLL_UP, 'down' => _MB_PUBLISHER_SCROLL_DOWN]; |
|
320
|
|
|
foreach ($directions as $key => $value) { |
|
321
|
|
|
$form .= "<option value='{$key}'"; |
|
322
|
|
|
if ($options[8] == $key) { |
|
323
|
|
|
$form .= ' selected'; |
|
324
|
|
|
} |
|
325
|
|
|
$form .= ">{$value}</option>"; |
|
326
|
|
|
} |
|
327
|
|
|
$form .= '</select></td></tr>'; |
|
328
|
|
|
|
|
329
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_ORDER . $tabletag2; |
|
330
|
|
|
$form .= "<select name='options[9]'>"; |
|
331
|
|
|
$form .= "<option value='datesub'"; |
|
332
|
|
|
if ('datesub' === $options[9]) { |
|
333
|
|
|
$form .= ' selected'; |
|
334
|
|
|
} |
|
335
|
|
|
$form .= '>' . _MB_PUBLISHER_DATE . '</option>'; |
|
336
|
|
|
$form .= "<option value='counter'"; |
|
337
|
|
|
if ('counter' === $options[9]) { |
|
338
|
|
|
$form .= ' selected'; |
|
339
|
|
|
} |
|
340
|
|
|
$form .= '>' . _MB_PUBLISHER_HITS . '</option>'; |
|
341
|
|
|
$form .= "<option value='weight'"; |
|
342
|
|
|
if ('weight' === $options[9]) { |
|
343
|
|
|
$form .= ' selected'; |
|
344
|
|
|
} |
|
345
|
|
|
$form .= '>' . _MB_PUBLISHER_WEIGHT . '</option>'; |
|
346
|
|
|
$form .= '</select></td></tr>'; |
|
347
|
|
|
|
|
348
|
|
|
$form .= $tabletag3 . _MB_PUBLISHER_PHOTOSCONFIG . $tabletag4; // Photos Options |
|
349
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_IMGDISPLAY . $tabletag2; |
|
350
|
|
|
$form .= publisher_mk_chkbox($options, 10); |
|
351
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_IMGWIDTH . $tabletag2; |
|
352
|
|
|
$form .= "<input type='text' name='options[]' value='" . $options[11] . "' size='4'> " . _MB_PUBLISHER_PIXEL . '</td></tr>'; |
|
353
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_IMGHEIGHT . $tabletag2; |
|
354
|
|
|
$form .= "<input type='text' name='options[]' value='" . $options[12] . "' size='4'> " . _MB_PUBLISHER_PIXEL . '</td></tr>'; |
|
355
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_BORDER . $tabletag2; |
|
356
|
|
|
$form .= "<input type='text' name='options[]' value='" . $options[13] . "' size='4'> " . _MB_PUBLISHER_PIXEL . '</td></tr>'; |
|
357
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_BORDERCOLOR . $tabletag2; |
|
358
|
|
|
$form .= "<input type='text' name='options[]' value='" . $options[14] . "' size='8'></td></tr>"; |
|
359
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_IMGPOSITION . $tabletag2; |
|
360
|
|
|
$form .= "<select name='options[]'>"; |
|
361
|
|
|
$form .= "<option value='LEFT'"; |
|
362
|
|
|
if ('LEFT' === $options[15]) { |
|
363
|
|
|
$form .= ' selected'; |
|
364
|
|
|
} |
|
365
|
|
|
$form .= '>' . _LEFT . "</option>\n"; |
|
366
|
|
|
|
|
367
|
|
|
$form .= "<option value='CENTER'"; |
|
368
|
|
|
if ('CENTER' === $options[15]) { |
|
369
|
|
|
$form .= ' selected'; |
|
370
|
|
|
} |
|
371
|
|
|
$form .= '>' . _CENTER . "</option>\n"; |
|
372
|
|
|
|
|
373
|
|
|
$form .= "<option value='RIGHT'"; |
|
374
|
|
|
if ('RIGHT' === $options[15]) { |
|
375
|
|
|
$form .= ' selected'; |
|
376
|
|
|
} |
|
377
|
|
|
$form .= '>' . _RIGHT . '</option>'; |
|
378
|
|
|
$form .= '</select></td></tr>'; |
|
379
|
|
|
|
|
380
|
|
|
$form .= $tabletag3 . _MB_PUBLISHER_LINKSCONFIG . $tabletag4; // Links Options |
|
381
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_DISPLAY_SUMMARY . $tabletag2; |
|
382
|
|
|
$form .= publisher_mk_chkbox($options, 16); |
|
383
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_DISPLAY_ARCHIVELINK . $tabletag2; |
|
384
|
|
|
$form .= publisher_mk_chkbox($options, 17); |
|
385
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_DISPLAY_SUBMITLINK . $tabletag2; |
|
386
|
|
|
$form .= publisher_mk_chkbox($options, 18); |
|
387
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_DISPLAY_POSTEDBY . $tabletag2; |
|
388
|
|
|
$form .= publisher_mk_chkbox($options, 19); |
|
389
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_DISPLAY_POSTTIME . $tabletag2; |
|
390
|
|
|
$form .= publisher_mk_chkbox($options, 20); |
|
391
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_DISPLAY_TOPICTITLE . $tabletag2; |
|
392
|
|
|
$form .= publisher_mk_chkbox($options, 21); |
|
393
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_DISPLAY_READ . $tabletag2; |
|
394
|
|
|
$form .= publisher_mk_chkbox($options, 22); |
|
395
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_DISPLAY_COMMENT . $tabletag2; |
|
396
|
|
|
$form .= publisher_mk_chkbox($options, 23); |
|
397
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_DISPLAY_PRINT . $tabletag2; |
|
398
|
|
|
$form .= publisher_mk_chkbox($options, 24); |
|
399
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_DISPLAY_PDF . $tabletag2; |
|
400
|
|
|
$form .= publisher_mk_chkbox($options, 25); |
|
401
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_DISPLAY_EMAIL . $tabletag2; |
|
402
|
|
|
$form .= publisher_mk_chkbox($options, 26); |
|
403
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_DISPLAY_MORELINK . $tabletag2; |
|
404
|
|
|
$form .= publisher_mk_chkbox($options, 27); |
|
405
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_DISPLAY_READ_FULLITEM . $tabletag2; |
|
406
|
|
|
$form .= publisher_mk_chkbox($options, 28); |
|
407
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_DISPLAY_ADMINLINK . $tabletag2; |
|
408
|
|
|
$form .= publisher_mk_chkbox($options, 29); |
|
409
|
|
|
$form .= $tabletag3 . _MB_PUBLISHER_TEMPLATESCONFIG . $tabletag4; // Templates Options |
|
410
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_TEMPLATE . $tabletag2; |
|
411
|
|
|
$form .= "<select size='1' name='options[30]'>"; |
|
412
|
|
|
|
|
413
|
|
|
$templates = [ |
|
414
|
|
|
'normal' => _MB_PUBLISHER_TEMPLATE_NORMAL, |
|
415
|
|
|
'extended' => _MB_PUBLISHER_TEMPLATE_EXTENDED, |
|
416
|
|
|
'ticker' => _MB_PUBLISHER_TEMPLATE_TICKER, |
|
417
|
|
|
'slider1' => _MB_PUBLISHER_TEMPLATE_SLIDER1, |
|
418
|
|
|
'slider2' => _MB_PUBLISHER_TEMPLATE_SLIDER2, |
|
419
|
|
|
]; |
|
420
|
|
|
foreach ($templates as $key => $value) { |
|
421
|
|
|
$form .= "<option value='{$key}'"; |
|
422
|
|
|
if (isset($options[30]) && $options[30] == $key) { |
|
423
|
|
|
$form .= ' selected'; |
|
424
|
|
|
} |
|
425
|
|
|
$form .= ">{$value}</option>"; |
|
426
|
|
|
} |
|
427
|
|
|
$form .= '</select></td></tr>'; |
|
428
|
|
|
|
|
429
|
|
|
//Select Which Categories To Show |
|
430
|
|
|
$form .= $tabletag3 . _MB_PUBLISHER_TOPICSCONFIG . $tabletag4; // Topics Options |
|
431
|
|
|
$form .= $tabletag1 . _MB_PUBLISHER_TOPICSDISPLAY . $tabletag2; |
|
432
|
|
|
$form .= Utility::createCategorySelect($options[31], 0, true, 'options[31]'); |
|
433
|
|
|
$form .= '</td></tr>'; |
|
434
|
|
|
|
|
435
|
|
|
$form .= '</table>'; |
|
436
|
|
|
|
|
437
|
|
|
return $form; |
|
438
|
|
|
} |
|
439
|
|
|
|
|
440
|
|
|
/** |
|
441
|
|
|
* @param $options |
|
442
|
|
|
* @param $number |
|
443
|
|
|
* |
|
444
|
|
|
* @return string |
|
445
|
|
|
*/ |
|
446
|
|
|
function publisher_mk_chkbox($options, $number) |
|
447
|
|
|
{ |
|
448
|
|
|
$chk = ''; |
|
449
|
|
|
if (1 == $options[$number]) { |
|
450
|
|
|
$chk = ' checked'; |
|
451
|
|
|
} |
|
452
|
|
|
$chkbox = "<input type='radio' name='options[{$number}]' value='1'" . $chk . '> ' . _YES . ' '; |
|
453
|
|
|
$chk = ''; |
|
454
|
|
|
if (0 == $options[$number]) { |
|
455
|
|
|
$chk = ' checked'; |
|
456
|
|
|
} |
|
457
|
|
|
$chkbox .= "<input type='radio' name='options[{$number}]' value='0'" . $chk . '> ' . _NO . '</td></tr>'; |
|
458
|
|
|
|
|
459
|
|
|
return $chkbox; |
|
460
|
|
|
} |
|
461
|
|
|
|
|
462
|
|
|
/** |
|
463
|
|
|
* @param $options |
|
464
|
|
|
* @param $number |
|
465
|
|
|
* |
|
466
|
|
|
* @return string |
|
467
|
|
|
*/ |
|
468
|
|
|
function publisher_mk_select($options, $number) |
|
469
|
|
|
{ |
|
470
|
|
|
$slc = ''; |
|
471
|
|
|
if (2 == $options[$number]) { |
|
472
|
|
|
$slc = ' checked'; |
|
473
|
|
|
} |
|
474
|
|
|
$select = "<input type='radio' name='options[{$number}]' value='2'" . $slc . '> ' . _LEFT . ' '; |
|
|
|
|
|
|
475
|
|
|
$slc = ''; |
|
476
|
|
|
if (1 == $options[$number]) { |
|
477
|
|
|
$slc = ' checked'; |
|
478
|
|
|
} |
|
479
|
|
|
$select = "<input type='radio' name='options[{$number}]' value='1'" . $slc . '> ' . _CENTER . ' '; |
|
480
|
|
|
$slc = ''; |
|
481
|
|
|
if (0 == $options[$number]) { |
|
482
|
|
|
$slc = ' checked'; |
|
483
|
|
|
} |
|
484
|
|
|
$select .= "<input type='radio' name='options[{$number}]' value='0'" . $slc . '> ' . _RIGHT . '</td></tr>'; |
|
485
|
|
|
|
|
486
|
|
|
return $select; |
|
487
|
|
|
} |
|
488
|
|
|
|