-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathxoops_version.php
935 lines (854 loc) · 34.4 KB
/
xoops_version.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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
<?php
/*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
* which is considered copyrighted (c) material of the original comment or credit authors.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
* @copyright XOOPS Project https://xoops.org/
* @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html)
* @package
* @since
* @author XOOPS Development Team
*/
use XoopsModules\Xnews;
defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
require_once __DIR__ . '/preloads/autoloader.php';
require_once __DIR__ . '/include/constants.php';
$modversion['version'] = 2.00;
$modversion['module_status'] = 'Alpha 1';
$modversion['release_date'] = '2018/01/12'; // YYYY/mm/dd
$modversion['name'] = 'xNews';
$modversion['description'] = _MI_XNEWS_DESC;
$modversion['author'] = 'The XOOPS Project Module Dev Team & Instant Zero';
$modversion['credits'] = 'The XOOPS Project, Christian, Pilou, Marco, ALL the members of the Newbb Team, GIJOE, Zoullou, Mithrandir, Setec Astronomy, Marcan, 5vision, Anne, Wishcraft, DNPROSSI';
$modversion['help'] = '';
$modversion['license'] = 'GNU GPL 2.0 or later';
$modversion['license_url'] = 'https://www.gnu.org/licenses/gpl-2.0.html';
$modversion['image'] = 'assets/images/module_logo.png';
$modversion['dirname'] = basename(__DIR__);
$modversion['dirmoduleadmin'] = 'Frameworks/moduleclasses';
$modversion['icons16'] = 'Frameworks/moduleclasses/icons/16';
$modversion['icons32'] = 'Frameworks/moduleclasses/icons/32';
$modversion['official'] = 0;
$modversion['original'] = 1;
$modversion['module_website_url'] = 'https://xoops.org/';
$modversion['module_website_name'] = 'XOOPS';
$modversion['min_php'] = '7.2';
$modversion['min_xoops'] = '2.5.10';
$modversion['min_admin'] = '1.2';
$modversion['min_db'] = ['mysql' => '5.5'];
// Install, update, unistall
$modversion['onInstall'] = 'include/oninstall.php';
$modversion['onUpdate'] = 'include/onupdate.php';
$modversion['onUninstall'] = 'include/onuninstall.php';
// Sql file (must contain sql generated by phpMyAdmin or phpPgAdmin)
// All tables should not have any prefix!
$modversion['sqlfile']['mysql'] = 'sql/mysql.sql';
// Tables created by sql file (without prefix!)
$i = 0;
$modversion['tables'][$i] = 'nw_stories';
++$i;
$modversion['tables'][$i] = 'nw_topics';
++$i;
$modversion['tables'][$i] = 'nw_stories_files';
++$i;
$modversion['tables'][$i] = 'nw_stories_votedata';
// Admin things
$modversion['hasAdmin'] = 1;
$modversion['system_admin'] = 1;
$modversion['adminindex'] = 'admin/index.php';
$modversion['adminmenu'] = 'admin/menu.php';
$modversion['system_menu'] = 1;
// Search
$modversion['hasSearch'] = 1;
$modversion['search']['file'] = 'include/search.inc.php';
$modversion['search']['func'] = 'nw_search';
// ------------------- Help files ------------------- //
$modversion['helpsection'] = [
['name' => _MI_XNEWS_OVERVIEW, 'link' => 'page=help'],
['name' => _MI_XNEWS_DISCLAIMER, 'link' => 'page=disclaimer'],
['name' => _MI_XNEWS_LICENSE, 'link' => 'page=license'],
['name' => _MI_XNEWS_SUPPORT, 'link' => 'page=support'],
];
// Menu
$modversion['hasMain'] = 1;
$isSubmissionAllowed = false;
// This part inserts the selected topics as sub items in the Xoops main menu
$i = 1;
if (isset($xoopsModule) && is_object($xoopsModule) && $xoopsModule->dirname() == $modversion['dirname'] && $xoopsModule->isactive()) {
if (!isset($helper)) {
// require_once __DIR__ . '/class/xnews.php';
/** @var Xnews\Helper $helper */
$helper = Xnews\Helper::getInstance();
}
$groups = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getGroups() : [XOOPS_GROUP_ANONYMOUS];
/** @var \XoopsGroupPermHandler $grouppermHandler */
$grouppermHandler = xoops_getHandler('groupperm');
if ($grouppermHandler->checkRight('nw_submit', 0, $groups, $helper->getModule()->getVar('mid'))) {
$isSubmissionAllowed = true;
}
if (!isset($_SESSION['items_count']) || -1 == $_SESSION['items_count']) {
$sql = 'SELECT COUNT(*) as cpt';
$sql .= " FROM {$GLOBALS['xoopsDB']->prefix('nw_topics')}";
$sql .= ' WHERE menu = 1';
$result = $GLOBALS['xoopsDB']->query($sql);
[$count] = $GLOBALS['xoopsDB']->fetchRow($result);
$_SESSION['items_count'] = $count;
} else {
$count = $_SESSION['items_count'];
}
if ($count > 0) {
require_once XOOPS_ROOT_PATH . '/class/tree.php';
require_once __DIR__ . '/class/NewsTopic.php';
$xt = new Xnews\NewsTopic();
$topicObjs = $xt->getAllTopics($helper->getConfig('restrictindex'));
$topicObjsTree = new \XoopsObjectTree($topicObjs, 'topic_id', 'topic_pid');
$topicChildObjs = $topicObjsTree->getAllChild(0);
foreach ($topicChildObjs as $topicChildObj) {
if ($grouppermHandler->checkRight('nw_view', $topicChildObj->topic_id(), $groups, $helper->getModule()->getVar('mid')) && $topicChildObj->menu()) {
$modversion['sub'][$i]['name'] = $topicChildObj->topic_title();
$modversion['sub'][$i]['url'] = 'index.php?topic_id=' . $topicChildObj->topic_id();
++$i;
}
}
unset($xt);
}
$modversion['sub'][$i]['name'] = _MI_XNEWS_SMNAME2;
$modversion['sub'][$i]['url'] = 'archive.php';
++$i;
if ($isSubmissionAllowed) {
$modversion['sub'][$i]['name'] = _MI_XNEWS_SMNAME1;
$modversion['sub'][$i]['url'] = 'submit.php';
++$i;
}
unset($isSubmissionAllowed);
if ($helper->getConfig('newsbythisauthor')) {
$modversion['sub'][$i]['name'] = _MI_XNEWS_WHOS_WHO;
$modversion['sub'][$i]['url'] = 'whoswho.php';
++$i;
}
}
$modversion['sub'][$i]['name'] = _MI_XNEWS_TOPICS_DIRECTORY;
$modversion['sub'][$i]['url'] = 'topics_directory.php';
++$i;
// Templates
$modversion['templates'] = [
['file' => 'xnews_item.tpl', 'description' => ''],
['file' => 'xnews_archive.tpl', 'description' => ''],
['file' => 'xnews_article.tpl', 'description' => ''],
['file' => 'xnews_index.tpl', 'description' => ''],
['file' => 'xnews_by_topic.tpl', 'description' => ''],
['file' => 'xnews_by_this_author.tpl', 'description' => 'Shows a page resuming all the articles of the same author (according to the perms)'],
['file' => 'xnews_ratenews.tpl', 'description' => 'Template used to rate a news'],
['file' => 'xnews_rss.tpl', 'description' => 'Used for RSS per topics'],
['file' => 'xnews_whos_who.tpl', 'description' => "Who's who"],
['file' => 'xnews_topics_directory.tpl', 'description' => 'Topics Directory'],
//WISHCRAFT
['file' => 'xnews_article_pdf.tpl', 'description' => 'PDF Article Layout'],
['file' => 'xnews_item_pdf.tpl', 'description' => 'PDF Item Layout'],
];
$i = 0;
++$i;
// Blocks
$modversion['blocks'][$i]['file'] = 'news_topics.php';
$modversion['blocks'][$i]['name'] = _MI_XNEWS_BNAME1;
$modversion['blocks'][$i]['description'] = 'Shows news topics';
$modversion['blocks'][$i]['show_func'] = 'nw_b_news_topics_show';
$modversion['blocks'][$i]['template'] = 'xnews_block_topics.tpl';
++$i;
$modversion['blocks'][$i]['file'] = 'news_bigstory.php';
$modversion['blocks'][$i]['name'] = _MI_XNEWS_BNAME3;
$modversion['blocks'][$i]['description'] = 'Shows most read story of the day';
$modversion['blocks'][$i]['show_func'] = 'nw_b_news_bigstory_show';
$modversion['blocks'][$i]['template'] = 'xnews_block_bigstory.tpl';
++$i;
$modversion['blocks'][$i]['file'] = 'news_top.php';
$modversion['blocks'][$i]['name'] = _MI_XNEWS_BNAME4;
$modversion['blocks'][$i]['description'] = 'Shows top read news articles';
$modversion['blocks'][$i]['show_func'] = 'nw_b_news_top_show';
$modversion['blocks'][$i]['edit_func'] = 'nw_b_news_top_edit';
$modversion['blocks'][$i]['options'] = 'counter|10|25|0|0|0|0||1||||||';
$modversion['blocks'][$i]['template'] = 'xnews_block_top.tpl';
++$i;
$modversion['blocks'][$i]['file'] = 'news_top.php';
$modversion['blocks'][$i]['name'] = _MI_XNEWS_BNAME5;
$modversion['blocks'][$i]['description'] = 'Shows recent articles';
$modversion['blocks'][$i]['show_func'] = 'nw_b_news_top_show';
$modversion['blocks'][$i]['edit_func'] = 'nw_b_news_top_edit';
$modversion['blocks'][$i]['options'] = 'published|10|25|0|0|0|0||1||||||';
$modversion['blocks'][$i]['template'] = 'xnews_block_top.tpl';
++$i;
$modversion['blocks'][$i]['file'] = 'news_moderate.php';
$modversion['blocks'][$i]['name'] = _MI_XNEWS_BNAME6;
$modversion['blocks'][$i]['description'] = 'Shows a block to moderate articles';
$modversion['blocks'][$i]['show_func'] = 'nw_b_news_topics_moderate';
$modversion['blocks'][$i]['template'] = 'xnews_block_moderate.tpl';
++$i;
$modversion['blocks'][$i]['file'] = 'news_topicsnav.php';
$modversion['blocks'][$i]['name'] = _MI_XNEWS_BNAME7;
$modversion['blocks'][$i]['description'] = 'Shows a block to navigate topics';
$modversion['blocks'][$i]['show_func'] = 'nw_b_news_topicsnav_show';
$modversion['blocks'][$i]['template'] = 'xnews_block_topicnav.tpl';
$modversion['blocks'][$i]['options'] = '0';
$modversion['blocks'][$i]['edit_func'] = 'nw_b_news_topicsnav_edit';
++$i;
$modversion['blocks'][$i]['file'] = 'news_randomnews.php';
$modversion['blocks'][$i]['name'] = _MI_XNEWS_BNAME8;
$modversion['blocks'][$i]['description'] = 'Shows a block where news appears randomly';
$modversion['blocks'][$i]['show_func'] = 'nw_b_news_randomnews_show';
$modversion['blocks'][$i]['template'] = 'xnews_block_randomnews.tpl';
$modversion['blocks'][$i]['options'] = 'published|10|25|0|0';
$modversion['blocks'][$i]['edit_func'] = 'nw_b_news_randomnews_edit';
++$i;
$modversion['blocks'][$i]['file'] = 'news_ratenews.php';
$modversion['blocks'][$i]['name'] = _MI_XNEWS_BNAME9;
$modversion['blocks'][$i]['description'] = 'Shows a block where you can see archives';
$modversion['blocks'][$i]['show_func'] = 'nw_b_news_archives_show';
$modversion['blocks'][$i]['template'] = 'xnews_block_archives.tpl';
$modversion['blocks'][$i]['options'] = '0|0|0|0|1|1'; // Starting date (year, month), ending date (year, month), until today, sort order
$modversion['blocks'][$i]['edit_func'] = 'nw_b_news_archives_edit';
++$i;
// Added in v2.00
$modversion['blocks'][$i]['file'] = 'news_latestnews.php';
$modversion['blocks'][$i]['name'] = _MI_XNEWS_LATESTNEWS_BLOCK;
$modversion['blocks'][$i]['description'] = 'Show latest news';
$modversion['blocks'][$i]['show_func'] = 'nw_b_news_latestnews_show';
$modversion['blocks'][$i]['edit_func'] = 'nw_b_news_latestnews_edit';
$modversion['blocks'][$i]['template'] = 'xnews_block_latestnews.tpl';
$modversion['blocks'][$i]['options'] = '6|2|200|100|100|2|dcdcdc|0|0|1|1|1|1|1|1|1|1|1|1|1|1|1|0|100|30|published|';
++$i;
// Added in v1.63
$modversion['blocks'][$i]['file'] = 'news_block_tag.php';
$modversion['blocks'][$i]['name'] = _MI_XNEWS_BNAME11;
$modversion['blocks'][$i]['description'] = 'Show top tags';
$modversion['blocks'][$i]['show_func'] = 'nw_news_tag_block_top_show';
$modversion['blocks'][$i]['edit_func'] = 'nw_news_tag_block_top_edit';
$modversion['blocks'][$i]['options'] = '50|30|c';
$modversion['blocks'][$i]['template'] = 'xnews_tag_block_top.tpl';
++$i;
$modversion['blocks'][$i]['file'] = 'news_block_tag.php';
$modversion['blocks'][$i]['name'] = _MI_XNEWS_BNAME10;
$modversion['blocks'][$i]['description'] = 'Show tag cloud';
$modversion['blocks'][$i]['show_func'] = 'nw_news_tag_block_cloud_show';
$modversion['blocks'][$i]['edit_func'] = 'nw_news_tag_block_cloud_edit';
$modversion['blocks'][$i]['options'] = '100|0|150|80';
$modversion['blocks'][$i]['template'] = 'xnews_tag_block_cloud.tpl';
// Comments
$modversion['hasComments'] = 1;
$modversion['comments']['pageName'] = 'article.php';
$modversion['comments']['itemName'] = 'storyid';
// Comment callback functions
$modversion['comments']['callbackFile'] = 'include/comment_functions.php';
$modversion['comments']['callback']['approve'] = 'nw_com_approve';
$modversion['comments']['callback']['update'] = 'nw_com_update';
// Select the number of news items to display on top page
$modversion['config'][] = [
'name' => 'storyhome',
'title' => '_MI_XNEWS_STORYHOME',
'description' => '_MI_XNEWS_STORYHOMEDSC',
'formtype' => 'select',
'valuetype' => 'int',
'default' => 5,
'options' => [
'5' => 5,
'10' => 10,
'15' => 15,
'20' => 20,
'25' => 25,
'30' => 30,
],
];
// Format of the date to use in the module, if you don't specify anything then the default date's format will be used
$modversion['config'][] = [
'name' => 'dateformat',
'title' => '_MI_XNEWS_DATEFORMAT',
'description' => '_MI_XNEWS_DATEFORMAT_DESC',
'formtype' => 'textbox',
'valuetype' => 'text',
'default' => '',
];
// Display a navigation's box on the pages ? This navigation's box enable you to jump from one topic to another
$modversion['config'][] = [
'name' => 'displaynav',
'title' => '_MI_XNEWS_DISPLAYNAV',
'description' => '_MI_XNEWS_DISPLAYNAVDSC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 1,
];
/*
$modversion['config'][] = [
'name' => 'anonpost',
'title' => '_MI_XNEWS_ANONPOST',
'description' => '',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
*/
// Auto approuve submited stories
$modversion['config'][] = [
'name' => 'autoapprove',
'title' => '_MI_XNEWS_AUTOAPPROVE',
'description' => '_MI_XNEWS_AUTOAPPROVEDSC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
// Dispay layout, classic or by topics
$modversion['config'][] = [
'name' => 'newsdisplay',
'title' => '_MI_XNEWS_NEWSDISPLAY',
'description' => '_MI_XNEWS_NEWSDISPLAYDESC',
'formtype' => 'select',
'valuetype' => 'text',
'default' => 'Classic',
'options' => [
'_MI_XNEWS_NEWSCLASSIC' => 'Classic',
'_MI_XNEWS_NEWSBYTOPIC' => 'Bytopic',
],
];
// How to display Author's name, username, full name or nothing ?
$modversion['config'][] = [
'name' => 'displayname',
'title' => '_MI_XNEWS_NAMEDISPLAY',
'description' => '_MI_XNEWS_ADISPLAYNAMEDSC',
'formtype' => 'select',
'valuetype' => 'int',
'default' => 1,
'options' => [
'_MI_XNEWS_DISPLAYNAME1' => 1,
'_MI_XNEWS_DISPLAYNAME2' => 2,
'_MI_XNEWS_DISPLAYNAME3' => 3,
],
];
// Number of columns to use to display news
$modversion['config'][] = [
'name' => 'columnmode',
'title' => '_MI_XNEWS_COLUMNMODE',
'description' => '_MI_XNEWS_COLUMNMODE_DESC',
'formtype' => 'select',
'valuetype' => 'int',
'default' => 1,
'options' => [
1 => 1,
2 => 2,
3 => 3,
4 => 4,
5 => 5,
],
];
// Number of news and topics to display in the module's admin part
$modversion['config'][] = [
'name' => 'storycountadmin',
'title' => '_MI_XNEWS_STORYCOUNTADMIN',
'description' => '_MI_XNEWS_STORYCOUNTADMIN_DESC',
'formtype' => 'select',
'valuetype' => 'int',
'default' => 10,
'options' => [
'5' => 5,
'10' => 10,
'15' => 15,
'20' => 20,
'25' => 25,
'30' => 30,
'35' => 35,
'40' => 40,
],
];
// Authorized groups to upload
$modversion['config'][] = [
'name' => 'uploadgroups',
'title' => '_MI_XNEWS_UPLOADGROUPS',
'description' => '_MI_XNEWS_UPLOADGROUPS_DESC',
'formtype' => 'select',
'valuetype' => 'int',
'default' => 2,
'options' => [
'_MI_XNEWS_UPLOAD_GROUP1' => 1,
'_MI_XNEWS_UPLOAD_GROUP2' => 2,
'_MI_XNEWS_UPLOAD_GROUP3' => 3,
],
];
// MAX Filesize Upload in kilo bytes
$modversion['config'][] = [
'name' => 'maxuploadsize',
'title' => '_MI_XNEWS_UPLOADFILESIZE',
'description' => '_MI_XNEWS_UPLOADFILESIZE_DESC',
'formtype' => 'textbox',
'valuetype' => 'int',
'default' => 1048576,
];
/**
* Restrict Topics on Index Page
*
* This is one of the mot important option in the module.
* If you set it to No, then the users can see the introduction's text of each
* story even if they don't have the right to see the topic attached to the news.
* If you set it to Yes then you can only see what you have the right to see.
* Many of the permissions are based on this option.
*/
$modversion['config'][] = [
'name' => 'restrictindex',
'title' => '_MI_XNEWS_RESTRICTINDEX',
'description' => '_MI_XNEWS_RESTRICTINDEXDSC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
// Do you want to enable your visitors to see all the other articles created by the author they are currently reading ?
$modversion['config'][] = [
'name' => 'newsbythisauthor',
'title' => '_MI_XNEWS_NEWSBYTHISAUTHOR',
'description' => '_MI_XNEWS_NEWSBYTHISAUTHORDSC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
/**
* If you set this option to yes then you will see two links at the bottom
* of each article. The first link will enable you to go to the previous
* article and the other link will bring you to the next article
*/
$modversion['config'][] = [
'name' => 'showprevnextlink',
'title' => '_MI_XNEWS_PREVNEX_LINK',
'description' => '_MI_XNEWS_PREVNEX_LINK_DESC',
'formtype' => 'select',
'valuetype' => 'int',
'options' => [
_MI_XNEWS_NONE => 0,
_MI_XNEWS_TOPONLY => 1,
_MI_XNEWS_BOTTOMONLY => 2,
_MI_XNEWS_BOTH => 3,
],
'default' => 0,
];
// Dispay layout, view topics and link enabled
$modversion['config'][] = [
'name' => 'topicdisplay',
'title' => '_MI_XNEWS_TOPICDISPLAY',
'description' => '_MI_XNEWS_TOPICDISPLAYDESC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 1,
];
// Display attached PDF - 1.71
$modversion['config'][] = [
'name' => 'pdf_display',
'title' => '_MI_XNEWS_PDF_DISPLAY',
'description' => '_MI_XNEWS_PDF_DISPLAY_DESC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
// Display attached images - 1.71
$modversion['config'][] = [
'name' => 'images_display',
'title' => '_MI_XNEWS_IMAGES_DISPLAY',
'description' => '_MI_XNEWS_IMAGES_DISPLAY_DESC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
// Actvate PDF plugin detection - 1.71
$modversion['config'][] = [
'name' => 'pdf_detect',
'title' => '_MI_XNEWS_PDF_DETECT',
'description' => '_MI_XNEWS_PDF_DETECT_DESC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
// Display print, friend and pdf icons top-bottom-both-none
$modversion['config'][] = [
'name' => 'displaylinkicns',
'title' => '_MI_XNEWS_DISPLAYLINKICNS',
'description' => '_MI_XNEWS_DISPLAYLINKICNSDESC',
'formtype' => 'select',
'valuetype' => 'int',
'options' => [
_MI_XNEWS_NONE => 0,
_MI_XNEWS_TOPONLY => 1,
_MI_XNEWS_BOTTOMONLY => 2,
_MI_XNEWS_BOTH => 3,
],
'default' => 2,
];
// Seo enable
$modversion['config'][] = [
'name' => 'seo_enable',
'title' => '_MI_XNEWS_SEOENABLE',
'description' => '_MI_XNEWS_SEOENABLEDESC',
'formtype' => 'select',
'valuetype' => 'int',
'options' => [
_MI_XNEWS_NONE => 0,
'htaccess' => 1,
'path-info' => 2,
],
'default' => 0,
];
// Seo path
$modversion['config'][] = [
'name' => 'seo_path',
'title' => '_MI_XNEWS_SEOPATH',
'description' => '_MI_XNEWS_SEOPATHDESC',
'formtype' => 'textbox',
'valuetype' => 'text',
'default' => 'news',
];
// Seo end of URL for Standard WISHCRAFT
$modversion['config'][] = [
'name' => 'seo_endofurl',
'title' => '_MI_XNEWS_SEOENDOFURL',
'description' => '_MI_XNEWS_SEOENDOFURL_DESC',
'formtype' => 'text',
'valuetype' => 'text',
'default' => '.tpl',
];
// Seo end of URL for RSS
$modversion['config'][] = [
'name' => 'seo_endofurl_rss',
'title' => '_MI_XNEWS_SEOENDOFURLRSS',
'description' => '_MI_XNEWS_SEOENDOFURLRSS_DESC',
'formtype' => 'text',
'valuetype' => 'text',
'default' => '.rss',
// Seo end of URL for PDF
];
$modversion['config'][] = [
'name' => 'seo_endofurl_pdf',
'title' => '_MI_XNEWS_SEOENDOFURLPDF',
'description' => '_MI_XNEWS_SEOENDOFURLPDF_DESC',
'formtype' => 'text',
'valuetype' => 'text',
'default' => '.pdf',
];
// Seo level
$modversion['config'][] = [
'name' => 'seo_level',
'title' => '_MI_XNEWS_SEOLEVEL',
'description' => '_MI_XNEWS_SEOLEVELDESC',
'formtype' => 'select',
'valuetype' => 'int',
'options' => [
_MI_XNEWS_ROOT_LEVEL => 0,
_MI_XNEWS_MODULE_LEVEL => 1,
],
'default' => 0,
];
// Do you want to see a summary table at the bottom of each article ?
$modversion['config'][] = [
'name' => 'showsummarytable',
'title' => '_MI_XNEWS_SUMMARY_SHOW',
'description' => '_MI_XNEWS_SUMMARY_SHOW_DESC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
// Do you enable author's to edit their posts ?
$modversion['config'][] = [
'name' => 'authoredit',
'title' => '_MI_XNEWS_AUTHOR_EDIT',
'description' => '_MI_XNEWS_AUTHOR_EDIT_DESC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 1,
];
// Do you want to enable your visitors to rate news ?
$modversion['config'][] = [
'name' => 'ratenews',
'title' => '_MI_XNEWS_RATE_NEWS',
'description' => '',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
// You can set RSS feeds per topic
$modversion['config'][] = [
'name' => 'topicsrss',
'title' => '_MI_XNEWS_TOPICS_RSS',
'description' => '_MI_XNEWS_TOPICS_RSS_DESC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
// If you set this option to yes then the approvers can type the keyword and description's meta datas
$modversion['config'][] = [
'name' => 'metadata',
'title' => '_MI_XNEWS_META_DATA',
'description' => '_MI_XNEWS_META_DATA_DESC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
// If you set this option to yes one line meta data textbox input will be extended
$modversion['config'][] = [
'name' => 'extendmetadata',
'title' => '_MI_XNEWS_EXTEND_META_DATA',
'description' => '_MI_XNEWS_EXTEND_META_DATA_DESC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
// Editor to use
xoops_load('xoopseditorhandler');
$editorHandler = \XoopsEditorHandler::getInstance();
$modversion['config'][] = [
'name' => 'form_options',
'title' => '_MI_XNEWS_FORM_OPTIONS',
'description' => '_MI_XNEWS_FORM_OPTIONS_DESC',
'formtype' => 'select',
'valuetype' => 'text',
'default' => 'dhtml',
'options' => array_flip($editorHandler->getList()),
];
// If you set this option to Yes then the keywords entered in the search will be highlighted in the articles.
$modversion['config'][] = [
'name' => 'keywordshighlight',
'title' => '_MI_XNEWS_KEYWORDS_HIGH',
'description' => '_MI_XNEWS_KEYWORDS_HIGH_DESC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
// If you have enabled the previous option then with this one you can select the color to use to highlight words
$modversion['config'][] = [
'name' => 'highlightcolor',
'title' => '_MI_XNEWS_HIGH_COLOR',
'description' => '_MI_XNEWS_HIGH_COLOR_DES',
'formtype' => 'textbox',
'valuetype' => 'text',
'default' => '#FFFF80',
];
/**
* Tooltips, or infotips are some small textes you can see when you
* move your mouse over an article's title. This text contains the
* first (x) characters of the story
*/
$modversion['config'][] = [
'name' => 'infotips',
'title' => '_MI_XNEWS_INFOTIPS',
'description' => '_MI_XNEWS_INFOTIPS_DES',
'formtype' => 'textbox',
'valuetype' => 'int',
'default' => '0',
];
/**
* This option is specific to Mozilla/Firefox and Opera
* Both of them can display a toolbar wich contains buttons to
* go from article to article. It can show other information too
*/
$modversion['config'][] = [
'name' => 'sitenavbar',
'title' => '_MI_XNEWS_SITE_NAVBAR',
'description' => '_MI_XNEWS_SITE_NAVBAR_DESC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
// With this option you can select the skin (apparence) to use for the blocks containing tabs
$modversion['config'][] = [
'name' => 'tabskin',
'title' => '_MI_XNEWS_TABS_SKIN',
'description' => '_MI_XNEWS_TABS_SKIN_DESC',
'formtype' => 'select',
'valuetype' => 'int',
'options' => [
_MI_XNEWS_SKIN_1 => 1,
_MI_XNEWS_SKIN_2 => 2,
_MI_XNEWS_SKIN_3 => 3,
_MI_XNEWS_SKIN_4 => 4,
_MI_XNEWS_SKIN_5 => 5,
_MI_XNEWS_SKIN_6 => 6,
_MI_XNEWS_SKIN_7 => 7,
_MI_XNEWS_SKIN_8 => 8,
],
'default' => 6,
];
/**
* Display a navigation's box on the pages ?
* This navigation's box enable you to jump from one topic to another
*/
$modversion['config'][] = [
'name' => 'footNoteLinks',
'title' => '_MI_XNEWS_FOOTNOTES',
'description' => '',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 1,
];
// Activate Dublin Core Metadata ?
$modversion['config'][] = [
'name' => 'dublincore',
'title' => '_MI_XNEWS_DUBLINCORE',
'description' => '_MI_XNEWS_DUBLINCORE_DSC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
// Display a "Bookmark this article at these sites" block ?
$modversion['config'][] = [
'name' => 'bookmarkme',
'title' => '_MI_XNEWS_BOOKMARK_ME',
'description' => '_MI_XNEWS_BOOKMARK_ME_DSC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
// Activate Firefox 2 microformats ?
$modversion['config'][] = [
'name' => 'firefox_microsummaries',
'title' => '_MI_XNEWS_FF_MICROFORMAT',
'description' => '_MI_XNEWS_FF_MICROFORMAT_DSC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
// Advertisement
$modversion['config'][] = [
'name' => 'advertisement',
'title' => '_MI_XNEWS_ADVERTISEMENT',
'description' => '_MI_XNEWS_ADV_DESCR',
'formtype' => 'textarea',
'valuetype' => 'text',
'default' => '',
];
// Mime Types: default values : Web pictures (png, gif, jpeg), zip, pdf, gtar, tar, pdf
$modversion['config'][] = [
'name' => 'mimetypes',
'title' => '_MI_XNEWS_MIME_TYPES',
'description' => '',
'formtype' => 'textarea',
'valuetype' => 'text',
'default' => "image/gif\nimage/jpeg\nimage/pjpeg\nimage/x-png\nimage/png\napplication/x-zip-compressed\napplication/zip\napplication/pdf\napplication/x-gtar\napplication/x-tar",
];
// Use enhanced page separator ?
$modversion['config'][] = [
'name' => 'enhanced_pagenav',
'title' => '_MI_XNEWS_ENHANCED_PAGENAV',
'description' => '_MI_XNEWS_ENHANCED_PAGENAV_DSC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
// Use the TAGS system ?
$modversion['config'][] = [
'name' => 'tags',
'title' => '_MI_XNEWS_TAGS',
'description' => '_MI_XNEWS_TAGS_DSC',
'formtype' => 'yesno',
'valuetype' => 'int',
'default' => 0,
];
// Introduction text to show on the submit page
$modversion['config'][] = [
'name' => 'submitintromsg',
'title' => '_MI_XNEWS_INTRO_TEXT',
'description' => '',
'formtype' => 'textarea',
'valuetype' => 'text',
'default' => '',
];
// Image max width
$modversion['config'][] = [
'name' => 'maxwidth',
'title' => '_MI_XNEWS_IMAGE_MAX_WIDTH',
'description' => '',
'formtype' => 'textbox',
'valuetype' => 'int',
'default' => 640,
];
// Image max height
$modversion['config'][] = [
'name' => 'maxheight',
'title' => '_MI_XNEWS_IMAGE_MAX_HEIGHT',
'description' => '',
'formtype' => 'textbox',
'valuetype' => 'int',
'default' => 480,
];
// Thumb max width
$modversion['config'][] = [
'name' => 'thumb_maxwidth',
'title' => '_MI_XNEWS_THUMB_MAX_WIDTH',
'description' => '',
'formtype' => 'textbox',
'valuetype' => 'int',
'default' => 150,
];
// Thumb max max height
$modversion['config'][] = [
'name' => 'thumb_maxheight',
'title' => '_MI_XNEWS_THUMB_MAX_HEIGHT',
'description' => '',
'formtype' => 'textbox',
'valuetype' => 'int',
'default' => 150,
];
// Notification
$modversion['hasNotification'] = 1;
$modversion['notification']['lookup_file'] = 'include/notification.inc.php';
$modversion['notification']['lookup_func'] = 'nw_notify_iteminfo';
$modversion['notification']['category'][1]['name'] = 'global';
$modversion['notification']['category'][1]['title'] = _MI_XNEWS_GLOBAL_NOTIFY;
$modversion['notification']['category'][1]['description'] = _MI_XNEWS_GLOBAL_NOTIFYDSC;
$modversion['notification']['category'][1]['subscribe_from'] = ['index.php', 'article.php'];
$modversion['notification']['category'][2]['name'] = 'story';
$modversion['notification']['category'][2]['title'] = _MI_XNEWS_STORY_NOTIFY;
$modversion['notification']['category'][2]['description'] = _MI_XNEWS_STORY_NOTIFYDSC;
$modversion['notification']['category'][2]['subscribe_from'] = ['article.php'];
$modversion['notification']['category'][2]['item_name'] = 'storyid';
$modversion['notification']['category'][2]['allow_bookmark'] = 1;
// Added by Lankford on 2007/3/23
$modversion['notification']['category'][3]['name'] = 'category';
$modversion['notification']['category'][3]['title'] = _MI_XNEWS_CATEGORY_NOTIFY;
$modversion['notification']['category'][3]['description'] = _MI_XNEWS_CATEGORY_NOTIFYDSC;
$modversion['notification']['category'][3]['subscribe_from'] = ['index.php', 'article.php'];
$modversion['notification']['category'][3]['item_name'] = 'storytopic';
$modversion['notification']['category'][3]['allow_bookmark'] = 1;
$modversion['notification']['event'][1]['name'] = 'new_category';
$modversion['notification']['event'][1]['category'] = 'global';
$modversion['notification']['event'][1]['title'] = _MI_XNEWS_GLOBAL_NEWCATEGORY_NOTIFY;
$modversion['notification']['event'][1]['caption'] = _MI_XNEWS_GLOBAL_NEWCATEGORY_NOTIFYCAP;
$modversion['notification']['event'][1]['description'] = _MI_XNEWS_GLOBAL_NEWCATEGORY_NOTIFYDSC;
$modversion['notification']['event'][1]['mail_template'] = 'global_newcategory_notify';
$modversion['notification']['event'][1]['mail_subject'] = _MI_XNEWS_GLOBAL_NEWCATEGORY_NOTIFYSBJ;
$modversion['notification']['event'][2]['name'] = 'story_submit';
$modversion['notification']['event'][2]['category'] = 'global';
$modversion['notification']['event'][2]['admin_only'] = 1;
$modversion['notification']['event'][2]['title'] = _MI_XNEWS_GLOBAL_STORYSUBMIT_NOTIFY;
$modversion['notification']['event'][2]['caption'] = _MI_XNEWS_GLOBAL_STORYSUBMIT_NOTIFYCAP;
$modversion['notification']['event'][2]['description'] = _MI_XNEWS_GLOBAL_STORYSUBMIT_NOTIFYDSC;
$modversion['notification']['event'][2]['mail_template'] = 'global_storysubmit_notify';
$modversion['notification']['event'][2]['mail_subject'] = _MI_XNEWS_GLOBAL_STORYSUBMIT_NOTIFYSBJ;
$modversion['notification']['event'][3]['name'] = 'new_story';
$modversion['notification']['event'][3]['category'] = 'global';
$modversion['notification']['event'][3]['title'] = _MI_XNEWS_GLOBAL_NEWSTORY_NOTIFY;
$modversion['notification']['event'][3]['caption'] = _MI_XNEWS_GLOBAL_NEWSTORY_NOTIFYCAP;
$modversion['notification']['event'][3]['description'] = _MI_XNEWS_GLOBAL_NEWSTORY_NOTIFYDSC;
$modversion['notification']['event'][3]['mail_template'] = 'global_newstory_notify';
$modversion['notification']['event'][3]['mail_subject'] = _MI_XNEWS_GLOBAL_NEWSTORY_NOTIFYSBJ;
$modversion['notification']['event'][4]['name'] = 'approve';
$modversion['notification']['event'][4]['category'] = 'story';
$modversion['notification']['event'][4]['invisible'] = 1;
$modversion['notification']['event'][4]['title'] = _MI_XNEWS_STORY_APPROVE_NOTIFY;
$modversion['notification']['event'][4]['caption'] = _MI_XNEWS_STORY_APPROVE_NOTIFYCAP;
$modversion['notification']['event'][4]['description'] = _MI_XNEWS_STORY_APPROVE_NOTIFYDSC;
$modversion['notification']['event'][4]['mail_template'] = 'story_approve_notify';
$modversion['notification']['event'][4]['mail_subject'] = _MI_XNEWS_STORY_APPROVE_NOTIFYSBJ;
// Added by Lankford on 2007/3/23
$modversion['notification']['event'][5]['name'] = 'new_story';
$modversion['notification']['event'][5]['category'] = 'category';
$modversion['notification']['event'][5]['title'] = _MI_XNEWS_CATEGORY_STORYPOSTED_NOTIFY;
$modversion['notification']['event'][5]['caption'] = _MI_XNEWS_CATEGORY_STORYPOSTED_NOTIFYCAP;
$modversion['notification']['event'][5]['description'] = _MI_XNEWS_CATEGORY_STORYPOSTED_NOTIFYDSC;
$modversion['notification']['event'][5]['mail_template'] = 'category_newstory_notify';
$modversion['notification']['event'][5]['mail_subject'] = _MI_XNEWS_CATEGORY_STORYPOSTED_NOTIFYSBJ;