XoopsModules25x/xoopstube

View on GitHub
xoops_version.php

Summary

Maintainability
D
1 day
Test Coverage
<?php

/**
 * Module: XoopsTube
 *
 * 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.
 *
 * PHP version 5
 *
 * @category        Module
 * @package         Xoopstube
 * @author          XOOPS Development Team
 * @copyright       2001-2016 XOOPS Project (https://xoops.org)
 * @license         GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html)
 * @link            https://xoops.org/
 * @since           1.0.6
 */

use XoopsModules\Xoopstube;

require_once __DIR__ . '/preloads/autoloader.php';

$moduleDirName      = basename(__DIR__);
$moduleDirNameUpper = mb_strtoupper($moduleDirName);

// ------------------- Informations ------------------- //
$modversion = [
    'version'             => '1.8.0',
    'module_status'       => 'RC-3',
    'release_date'        => '2022/02/20',
    'name'                => _MI_XOOPSTUBE_NAME,
    'description'         => _MI_XOOPSTUBE_DESC,
    'official'            => 1, //1 indicates supported by XOOPS Dev Team, 0 means 3rd party supported
    'author'              => 'McDonald',
    'author_mail'         => 'https://xoops.org',
    'author_website_url'  => 'https://xoops.org',
    'author_website_name' => 'XOOPS',
    'credits'             => 'WF-Projects Team. Based on the module WF-Links, thanks to the dream-team for some code snippits.',
    'license'             => 'GPL 2.0 or later',
    'license_url'         => 'www.gnu.org/licenses/gpl-2.0.html/',
    'help'                => 'page=help',
    'release_info'        => 'Changelog',
    'release_file'        => XOOPS_URL . "/modules/{$moduleDirName}/docs/changelog file",

    'manual'              => 'link to manual file',
    'manual_file'         => XOOPS_URL . "/modules/{$moduleDirName}/docs/install.txt",
    'min_php'             => '7.3',
    'min_xoops'           => '2.5.10',
    'min_admin'           => '1.2',
    'min_db'              => ['mysql' => '5.5'],
    // images
    'image'               => 'assets/images/logoModule.png',
    'iconsmall'           => 'assets/images/iconsmall.png',
    'iconbig'             => 'assets/images/iconbig.png',
    'dirname'             => $moduleDirName,
    // Local path icons
    'modicons16'          => 'assets/images/icons/16',
    'modicons32'          => 'assets/images/icons/32',
    'demo_site_url'       => 'https://xoops.org',
    'demo_site_name'      => 'XOOPS Demo Site',
    'support_url'         => 'https://xoops.org/modules/newbb',
    'support_name'        => 'Support Forum',
    'module_website_url'  => 'www.xoops.org',
    'module_website_name' => 'XOOPS Project',
    // Admin system menu
    'system_menu'         => 1,
    // Admin menu
    'hasAdmin'            => 1,
    'adminindex'          => 'admin/index.php',
    'adminmenu'           => 'admin/menu.php',
    // Main menu
    'hasMain'             => 1,
    // Install/Update
    'onInstall'           => 'include/oninstall.php',
    //    'onUpdate'            => 'include/onupdate.php'
];

// ------------------- Mysql ------------------- //
// 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!)
//require_once __DIR__ . '/config/config.php';
$modversion['tables'] = [
    $moduleDirName . '_broken',
    $moduleDirName . '_cat',
    $moduleDirName . '_videos',
    $moduleDirName . '_mod',
    $moduleDirName . '_votedata',
    $moduleDirName . '_indexpage',
    $moduleDirName . '_altcat',
];

// ------------------- Blocks ------------------- //
$modversion['blocks'][] = [
    'file'        => $moduleDirName . '_top.php',
    'name'        => _MI_XOOPSTUBE_BNAME1,
    'description' => _MI_XOOPSTUBE_BNAME1_DESC,
    'show_func'   => 'showTopVideoBlock',
    'edit_func'   => 'editTopVideoBlock',
    'options'     => 'published|10|19|d/m/Y|0',
    'template'    => 'xoopstube_block_new_t.tpl',
    'can_clone'   => true,
];

$modversion['blocks'][] = [
    'file'        => $moduleDirName . '_top.php',
    'name'        => _MI_XOOPSTUBE_BNAME2,
    'description' => _MI_XOOPSTUBE_BNAME2_DESC,
    'show_func'   => 'showTopVideoBlock',
    'edit_func'   => 'editTopVideoBlock',
    'options'     => 'published|10|19|d/m/Y|0',
    'template'    => 'xoopstube_block_new.tpl',
    'can_clone'   => true,
];

$modversion['blocks'][] = [
    'file'        => $moduleDirName . '_top.php',
    'name'        => _MI_XOOPSTUBE_BNAME3,
    'description' => _MI_XOOPSTUBE_BNAME3_DESC,
    'show_func'   => 'showTopVideoBlock',
    'edit_func'   => 'editTopVideoBlock',
    'options'     => 'hits|10|19|d/m/Y|0',
    'template'    => 'xoopstube_block_top_t.tpl',
    'can_clone'   => true,
];

$modversion['blocks'][] = [
    'file'        => $moduleDirName . '_top.php',
    'name'        => _MI_XOOPSTUBE_BNAME4,
    'description' => _MI_XOOPSTUBE_BNAME4_DESC,
    'show_func'   => 'showTopVideoBlock',
    'edit_func'   => 'editTopVideoBlock',
    'options'     => 'hits|10|19|d/m/Y|0',
    'template'    => 'xoopstube_block_top.tpl',
    'can_clone'   => true,
];

$modversion['blocks'][] = [
    'file'        => $moduleDirName . '_top.php',
    'name'        => _MI_XOOPSTUBE_BNAME5,
    'description' => _MI_XOOPSTUBE_BNAME5_DESC,
    'show_func'   => 'showTopVideoBlock',
    'edit_func'   => 'editTopVideoBlock',
    'options'     => 'published|5|19|d/m/Y|0',
    'template'    => 'xoopstube_block_new_h.tpl',
    'can_clone'   => true,
];

$modversion['blocks'][] = [
    'file'        => $moduleDirName . '_top.php',
    'name'        => _MI_XOOPSTUBE_BNAME6,
    'description' => _MI_XOOPSTUBE_BNAME6_DESC,
    'show_func'   => 'getRandomVideo',
    'edit_func'   => 'editTopVideoBlock',
    'options'     => 'random|5|19|d/m/Y|0',
    'template'    => 'xoopstube_block_random.tpl',
    'can_clone'   => true,
];

$modversion['blocks'][] = [
    'file'        => $moduleDirName . '_top.php',
    'name'        => _MI_XOOPSTUBE_BNAME7,
    'description' => _MI_XOOPSTUBE_BNAME7_DESC,
    'show_func'   => 'getRandomVideoForHorizontalBlock',
    'edit_func'   => 'editTopVideoBlock',
    'options'     => 'randomh|5|19|d/m/Y|0',
    'template'    => 'xoopstube_block_random_h.tpl',
    'can_clone'   => true,
];

$modversion['blocks'][] = [
    'file'        => $moduleDirName . '_banner.php',
    'name'        => _MI_XOOPSTUBE_BNAME8,
    'description' => _MI_XOOPSTUBE_BNAME8_DESC,
    'show_func'   => 'xtubeShowBannerB',
    'edit_func'   => 'xtubeEditBannerB',
    'options'     => 'hits|10|19',
    'template'    => 'xoopstube_block_banner.tpl',
    'can_clone'   => true,
];

$modversion['blocks'][] = [
    'file'        => $moduleDirName . '_block_tag.php',
    'name'        => _MI_XOOPSTUBE_BNAME9,
    'description' => _MI_XOOPSTUBE_BNAME9_DESC,
    'show_func'   => 'xtubeShowTagBlockCloud',
    'edit_func'   => 'xtubeEditTagBlockCloud',
    'options'     => '100|0|150|80',
    'template'    => 'xoopstube_tag_block_cloud.tpl',
    'can_clone'   => true,
];

$modversion['blocks'][] = [
    'file'        => $moduleDirName . '_block_tag.php',
    'name'        => _MI_XOOPSTUBE_BNAME10,
    'description' => _MI_XOOPSTUBE_BNAME10_DESC,
    'show_func'   => 'xtubeShowTagBlockTop',
    'edit_func'   => 'xtubeEditTagBlockTop',
    'options'     => '50|30|c',
    'template'    => 'xoopstube_tag_block_tag.tpl',
    'can_clone'   => true,
];

$modversion['blocks'][] = [
    'file'        => $moduleDirName . '_top.php',
    'name'        => _MI_XOOPSTUBE_BNAME11,
    'description' => _MI_XOOPSTUBE_BNAME11_DESC,
    'show_func'   => 'getSpotlightVideos',
    'edit_func'   => 'editTopVideoBlock',
    'options'     => 'date|3|19',
    'template'    => 'xoopstube_block_spotlight.tpl',
    'can_clone'   => true,
];

// This part inserts the selected topics as sub items in the Xoops main menu
/** @var \XoopsModuleHandler $moduleHandler */
$moduleHandler = xoops_getHandler('module');
$module        = $moduleHandler->getByDirname($modversion['dirname']);
$cansubmit     = 0;
if (is_object($module)) {
    $groups = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getGroups() : XOOPS_GROUP_ANONYMOUS;
    /** @var \XoopsGroupPermHandler $grouppermHandler */
    $grouppermHandler = xoops_getHandler('groupperm');
    if ($grouppermHandler->checkRight('XTubeSubPerm', 0, $groups, $module->getVar('mid'))) {
        $cansubmit = 1;
    }
}
if (1 == $cansubmit) {
    $modversion['sub'][0]['name'] = _MI_XOOPSTUBE_SMNAME1;
    $modversion['sub'][0]['url']  = 'submit.php';
}
unset($cansubmit);

$i                             = 1;
$modversion['sub'][$i]['name'] = _MI_XOOPSTUBE_SMNAME2;
$modversion['sub'][$i]['url']  = 'topten.php?list=hit';

++$i;
$modversion['sub'][$i]['name'] = _MI_XOOPSTUBE_SMNAME3;
$modversion['sub'][$i]['url']  = 'topten.php?list=rate';

++$i;
$modversion['sub'][$i]['name'] = _MI_XOOPSTUBE_SMNAME4;
$modversion['sub'][$i]['url']  = 'newlist.php?newvideoshowdays=7';
unset($i);

// Search
$modversion['hasSearch']      = 1;
$modversion['search']['file'] = 'include/search.inc.php';
$modversion['search']['func'] = 'xtubeSearch';

// Comments
$modversion['hasComments']             = 1;
$modversion['comments']['itemName']    = 'lid';
$modversion['comments']['pageName']    = 'singlevideo.php';
$modversion['comments']['extraParams'] = ['cid'];

// Comment callback functions
$modversion['comments']['callbackFile']        = 'include/comment_functions.php';
$modversion['comments']['callback']['approve'] = 'xtubeApproveComment';
$modversion['comments']['callback']['update']  = 'xtubeUpdateComment';

// ------------------- Templates ------------------- //
$modversion['templates'] = [
    ['file' => $modversion['dirname'] . '_brokenvideo.tpl', 'description' => ''],
    ['file' => $modversion['dirname'] . '_videoload.tpl', 'description' => ''],
    ['file' => $modversion['dirname'] . '_index.tpl', 'description' => ''],
    ['file' => $modversion['dirname'] . '_ratevideo.tpl', 'description' => ''],
    ['file' => $modversion['dirname'] . '_singlevideo.tpl', 'description' => ''],
    ['file' => $modversion['dirname'] . '_topten.tpl', 'description' => ''],
    ['file' => $modversion['dirname'] . '_viewcat.tpl', 'description' => ''],
    ['file' => $modversion['dirname'] . '_newlistindex.tpl', 'description' => ''],
    ['file' => $modversion['dirname'] . '_letterschoice.tpl', 'description' => ''],
];

// ------------------- Config ------------------- //
$modversion['config'][] = [
    'name'        => 'popular',
    'title'       => '_MI_XOOPSTUBE_POPULAR',
    'description' => '_MI_XOOPSTUBE_POPULARDSC',
    'formtype'    => 'select',
    'valuetype'   => 'int',
    'default'     => 100,
    'options'     => [
        '5'    => 5,
        '10'   => 10,
        '50'   => 50,
        '100'  => 100,
        '200'  => 200,
        '500'  => 500,
        '1000' => 1000,
    ],
];

$modversion['config'][] = [
    'name'        => 'displayicons',
    'title'       => '_MI_XOOPSTUBE_ICONDISPLAY',
    'description' => '_MI_XOOPSTUBE_DISPLAYICONDSC',
    'formtype'    => 'select',
    'valuetype'   => 'int',
    'default'     => 1,
    'options'     => [
        '_MI_XOOPSTUBE_DISPLAYICON1' => 1,
        '_MI_XOOPSTUBE_DISPLAYICON2' => 2,
        '_MI_XOOPSTUBE_DISPLAYICON3' => 3,
    ],
];

$modversion['config'][] = [
    'name'        => 'daysnew',
    'title'       => '_MI_XOOPSTUBE_DAYSNEW',
    'description' => '_MI_XOOPSTUBE_DAYSNEWDSC',
    'formtype'    => 'textbox',
    'valuetype'   => 'int',
    'default'     => 10,
];

$modversion['config'][] = [
    'name'        => 'daysupdated',
    'title'       => '_MI_XOOPSTUBE_DAYSUPDATED',
    'description' => '_MI_XOOPSTUBE_DAYSUPDATEDDSC',
    'formtype'    => 'textbox',
    'valuetype'   => 'int',
    'default'     => 10,
];

$modversion['config'][] = [
    'name'        => 'perpage',
    'title'       => '_MI_XOOPSTUBE_PERPAGE',
    'description' => '_MI_XOOPSTUBE_PERPAGEDSC',
    'formtype'    => 'select',
    'valuetype'   => 'int',
    'default'     => 10,
    'options'     => [
        '5'  => 5,
        '10' => 10,
        '15' => 15,
        '20' => 20,
        '25' => 25,
        '30' => 30,
        '50' => 50,
    ],
];

$modversion['config'][] = [
    'name'        => 'admin_perpage',
    'title'       => '_MI_XOOPSTUBE_ADMINPAGE',
    'description' => '_MI_XOOPSTUBE_AMDMINPAGEDSC',
    'formtype'    => 'select',
    'valuetype'   => 'int',
    'default'     => 10,
    'options'     => [
        '5'   => 5,
        '10'  => 10,
        '15'  => 15,
        '20'  => 20,
        '25'  => 25,
        '30'  => 30,
        '50'  => 50,
        '75'  => 75,
        '100' => 100,
    ],
];

$qa = ' (A)';
$qd = ' (D)';

$modversion['config'][] = [
    'name'        => 'linkxorder',
    'title'       => '_MI_XOOPSTUBE_ARTICLESSORT',
    'description' => '_MI_XOOPSTUBE_ARTICLESSORTDSC',
    'formtype'    => 'select',
    'valuetype'   => 'text',
    'default'     => 'title ASC',
    'options'     => [
        _MI_XOOPSTUBE_TITLE . $qa      => 'title ASC',
        _MI_XOOPSTUBE_TITLE . $qd      => 'title DESC',
        _MI_XOOPSTUBE_SUBMITTED2 . $qa => 'published ASC',
        _MI_XOOPSTUBE_SUBMITTED2 . $qd => 'published DESC',
        _MI_XOOPSTUBE_RATING . $qa     => 'rating ASC',
        _MI_XOOPSTUBE_RATING . $qd     => 'rating DESC',
        _MI_XOOPSTUBE_POPULARITY . $qa => 'hits ASC',
        _MI_XOOPSTUBE_POPULARITY . $qd => 'hits DESC',
    ],
];

$modversion['config'][] = [
    'name'        => 'sortcats',
    'title'       => '_MI_XOOPSTUBE_SORTCATS',
    'description' => '_MI_XOOPSTUBE_SORTCATSDSC',
    'formtype'    => 'select',
    'valuetype'   => 'text',
    'default'     => 'title',
    'options'     => [
        'Weight' => 'weight',
        'Title'  => 'title',
    ],
];

$modversion['config'][] = [
    'name'        => 'subcats',
    'title'       => '_MI_XOOPSTUBE_SUBCATS',
    'description' => '_MI_XOOPSTUBE_SUBCATSDSC',
    'formtype'    => 'yesno',
    'valuetype'   => 'int',
    'default'     => 0,
];

$modversion['config'][] = [
    'name'        => 'catcolumns',
    'title'       => '_MI_XOOPSTUBE_CATCOLUMNS',
    'description' => '_MI_XOOPSTUBE_CATCOLUMNSDSC',
    'formtype'    => 'select',
    'valuetype'   => 'int',
    'default'     => 2,
    'options'     => [
        '1' => 1,
        '2' => 2,
        '3' => 3,
        '4' => 4,
        '5' => 5,
    ],
];

xoops_load('XoopsEditorHandler');
$editorHandler = XoopsEditorHandler::getInstance();
$editorList    = array_flip($editorHandler->getList());

$modversion['config'][] = [
    'name'        => 'form_options',
    'title'       => '_MI_XOOPSTUBE_EDITOR',
    'description' => '_MI_XOOPSTUBE_EDITORCHOICE',
    'formtype'    => 'select',
    'valuetype'   => 'text',
    'options'     => $editorList,
    'default'     => 'dhtmltextarea',
];

$modversion['config'][] = [
    'name'        => 'form_optionsuser',
    'title'       => '_MI_XOOPSTUBE_EDITORUSER',
    'description' => '_MI_XOOPSTUBE_EDITORCHOICEUSER',
    'formtype'    => 'select',
    'valuetype'   => 'text',
    'options'     => $editorList,
    'default'     => 'dhtmltextarea',
];

//                                'default'     => 'dhtmltextarea'),
//                                'default'     => 'dhtmlext'),

$modversion['config'][] = [
    'name'        => 'screenshot',
    'title'       => '_MI_XOOPSTUBE_USESHOTS',
    'description' => '_MI_XOOPSTUBE_USESHOTSDSC',
    'formtype'    => 'yesno',
    'valuetype'   => 'int',
    'default'     => 1,
];

$modversion['config'][] = [
    'name'        => 'usethumbs',
    'title'       => '_MI_XOOPSTUBE_USETHUMBS',
    'description' => '_MI_XOOPSTUBE_USETHUMBSDSC',
    'formtype'    => 'yesno',
    'valuetype'   => 'int',
    'default'     => 0,
];

$modversion['config'][] = [
    'name'        => 'updatethumbs',
    'title'       => '_MI_XOOPSTUBE_IMGUPDATE',
    'description' => '_MI_XOOPSTUBE_IMGUPDATEDSC',
    'formtype'    => 'yesno',
    'valuetype'   => 'int',
    'default'     => 1,
];

$modversion['config'][] = [
    'name'        => 'shotwidth',
    'title'       => '_MI_XOOPSTUBE_SHOTWIDTH',
    'description' => '_MI_XOOPSTUBE_SHOTWIDTHDSC',
    'formtype'    => 'textbox',
    'valuetype'   => 'int',
    'default'     => 120,
];

$modversion['config'][] = [
    'name'        => 'shotheight',
    'title'       => '_MI_XOOPSTUBE_SHOTHEIGHT',
    'description' => '_MI_XOOPSTUBE_SHOTHEIGHTDSC',
    'formtype'    => 'textbox',
    'valuetype'   => 'int',
    'default'     => 90,
];

$modversion['config'][] = [
    'name'        => 'maxfilesize',
    'title'       => '_MI_XOOPSTUBE_MAXFILESIZE',
    'description' => '_MI_XOOPSTUBE_MAXFILESIZEDSC',
    'formtype'    => 'textbox',
    'valuetype'   => 'int',
    'default'     => 200000,
];

$modversion['config'][] = [
    'name'        => 'maximgwidth',
    'title'       => '_MI_XOOPSTUBE_IMGWIDTH',
    'description' => '_MI_XOOPSTUBE_IMGWIDTHDSC',
    'formtype'    => 'textbox',
    'valuetype'   => 'int',
    'default'     => 600,
];

$modversion['config'][] = [
    'name'        => 'maximgheight',
    'title'       => '_MI_XOOPSTUBE_IMGHEIGHT',
    'description' => '_MI_XOOPSTUBE_IMGHEIGHTDSC',
    'formtype'    => 'textbox',
    'valuetype'   => 'int',
    'default'     => 600,
];

$modversion['config'][] = [
    'name'        => 'imagequality',
    'title'       => '_MI_XOOPSTUBE_QUALITY',
    'description' => '_MI_XOOPSTUBE_QUALITYDSC',
    'formtype'    => 'textbox',
    'valuetype'   => 'int',
    'default'     => 100,
];

$modversion['config'][] = [
    'name'        => 'imageaspect',
    'title'       => '_MI_XOOPSTUBE_IMAGEASPECT',
    'description' => '_MI_XOOPSTUBE_IMAGEASPECTDSC',
    'formtype'    => 'textbox',
    'valuetype'   => 'int',
    'default'     => 1,
];

// Directories -----------------------------------------------
$modversion['config'][] = [
    'name'        => 'directiories',
    'title'       => '_MI_XOOPSTUBE_PREFERENCES_DIRECTIORIES',
    'description' => '',
    'formtype'    => 'line_break',
    'valuetype'   => 'textbox',
    'default'     => 'odd',
];

$modversion['config'][] = [
    'name'        => 'dirmode',
    'title'       => '_MI_XOOPSTUBE_PREFERENCES_DIRMODE',
    'description' => '_MI_XOOPSTUBE_PREFERENCES_DIRMODE_DESC',
    'formtype'    => 'textbox',
    'valuetype'   => 'text',
    'default'     => '0777',
];

$modversion['config'][] = [
    'name'        => 'mainimagedir',
    'title'       => '_MI_XOOPSTUBE_MAINIMGDIR',
    'description' => '_MI_XOOPSTUBE_MAINIMGDIRDSC',
    'formtype'    => 'textbox',
    'valuetype'   => 'text',
    'default'     => 'modules/' . $moduleDirName . '/assets/images',
];

$modversion['config'][] = [
    'name'        => 'catimage',
    'title'       => '_MI_XOOPSTUBE_CATEGORYIMG',
    'description' => '_MI_XOOPSTUBE_CATEGORYIMGDSC',
    'formtype'    => 'textbox',
    'valuetype'   => 'text',
    //'default'  => 'uploads/xt_images/category',
    'default'     => 'uploads/xoopstube/category',
];

$modversion['config'][] = [
    'name'        => 'videodir',
    'title'       => '_MI_XOOPSTUBE_VIDEODIR',
    'description' => '_MI_XOOPSTUBE_VIDEODIRDSC',
    'formtype'    => 'textbox',
    'valuetype'   => 'text',
    //'default'  => 'uploads/xt_images/videos',
    'default'     => 'uploads/xoopstube/videos',
];

$modversion['config'][] = [
    'name'        => 'videoimgdir',
    'title'       => '_MI_XOOPSTUBE_VIDEOIMGDIR',
    'description' => '_MI_XOOPSTUBE_VIDEOIMGDIRDSC',
    'formtype'    => 'textbox',
    'valuetype'   => 'text',
    //'default'  => 'uploads/xt_images/screenshots',
    'default'     => 'uploads/xoopstube/screenshots',
];

// Other -------------------------------------------------
$modversion['config'][] = [
    'name'        => 'other',
    'title'       => '_MI_XOOPSTUBE_PREFERENCES_OTHERS',
    'description' => '',
    'formtype'    => 'line_break',
    'valuetype'   => 'textbox',
    'default'     => 'odd',
];

$modversion['config'][] = [
    'name'        => 'dateformat',
    'title'       => '_MI_XOOPSTUBE_DATEFORMAT',
    'description' => '_MI_XOOPSTUBE_DATEFORMATDSC',
    'formtype'    => 'textbox',
    'valuetype'   => 'text',
    'default'     => 'D, d-M-Y',
];

$modversion['config'][] = [
    'name'        => 'dateformatadmin',
    'title'       => '_MI_XOOPSTUBE_DATEFORMATADMIN',
    'description' => '_MI_XOOPSTUBE_DATEFORMATADMINDSC',
    'formtype'    => 'textbox',
    'valuetype'   => 'text',
    'default'     => 'D, d-M-Y - G:i',
];

$modversion['config'][] = [
    'name'        => 'totalchars',
    'title'       => '_MI_XOOPSTUBE_TOTALCHARS',
    'description' => '_MI_XOOPSTUBE_TOTALCHARSDSC',
    'formtype'    => 'select',
    'valuetype'   => 'int',
    'default'     => 200,
    'options'     => [
        '100' => 100,
        '200' => 200,
        '300' => 300,
        '400' => 400,
        '500' => 500,
        '750' => 750,
    ],
];
$modversion['config'][] = [
    'name'        => 'autoplay',
    'title'       => '_MI_XOOPSTUBE_AUTOPLAY',
    'description' => '_MI_XOOPSTUBE_AUTOPLAYDSC',
    'formtype'    => 'yesno',
    'valuetype'   => 'int',
    'default'     => 0,
];

$modversion['config'][] = [
    'name'        => 'othervideos',
    'title'       => '_MI_XOOPSTUBE_OTHERVIDEOS',
    'description' => '_MI_XOOPSTUBE_OTHERVIDEOSDSC',
    'formtype'    => 'yesno',
    'valuetype'   => 'int',
    'default'     => 1,
];

$modversion['config'][] = [
    'name'        => 'showsubmitter',
    'title'       => '_MI_XOOPSTUBE_SHOWSUBMITTER',
    'description' => '_MI_XOOPSTUBE_SHOWSUBMITTERDSC',
    'formtype'    => 'yesno',
    'valuetype'   => 'int',
    'default'     => 1,
];

$modversion['config'][] = [
    'name'        => 'showsbookmarks',
    'title'       => '_MI_XOOPSTUBE_SHOWSBOOKMARKS',
    'description' => '_MI_XOOPSTUBE_SHOWSBOOKMARKSDSC',
    'formtype'    => 'yesno',
    'valuetype'   => 'int',
    'default'     => 1,
];

$modversion['config'][] = [
    'name'        => 'usemetadescr',
    'title'       => '_MI_XOOPSTUBE_USEMETADESCR',
    'description' => '_MI_XOOPSTUBE_USEMETADSC',
    'formtype'    => 'yesno',
    'valuetype'   => 'int',
    'default'     => 1,
];

$modversion['config'][] = [
    'name'        => 'usercantag',
    'title'       => '_MI_XOOPSTUBE_USERTAGDESCR',
    'description' => '_MI_XOOPSTUBE_USERTAGDSC',
    'formtype'    => 'yesno',
    'valuetype'   => 'int',
    'default'     => 0,
];

$modversion['config'][] = [
    'name'        => 'showrating',
    'title'       => '_MI_XOOPSTUBE_RATINGDISPLAY',
    'description' => '_MI_XOOPSTUBE_RATINGDISPLAYDSC',
    'formtype'    => 'yesno',
    'valuetype'   => 'int',
    'default'     => 1,
];

$modversion['config'][] = [
    'name'        => 'showdisclaimer',
    'title'       => '_MI_XOOPSTUBE_SHOWDISCLAIMER',
    'description' => '_MI_XOOPSTUBE_SHOWDISCLAIMERDSC',
    'formtype'    => 'yesno',
    'valuetype'   => 'int',
    'default'     => 0,
];

$modversion['config'][] = [
    'name'        => 'disclaimer',
    'title'       => '_MI_XOOPSTUBE_DISCLAIMER',
    'description' => '_MI_XOOPSTUBE_DISCLAIMERDSC',
    'formtype'    => 'textsarea',
    'valuetype'   => 'text',
    'default'     => 'We have the right, but not the obligation to monitor and review submissions submitted by users, to this website. We shall not be responsible for any of the content of these messages. We further reserve the right, to delete, move or edit submissions that we, in its exclusive discretion, deems abusive, defamatory, obscene or in violation of any Copyright or Trademark laws or otherwise objectionable.',
];

$modversion['config'][] = [
    'name'        => 'showvideodisclaimer',
    'title'       => '_MI_XOOPSTUBE_SHOWVIDEODISCL',
    'description' => '_MI_XOOPSTUBE_SHOWVIDEODISCLDSC',
    'formtype'    => 'yesno',
    'valuetype'   => 'int',
    'default'     => 0,
];

$modversion['config'][] = [
    'name'        => 'videodisclaimer',
    'title'       => '_MI_XOOPSTUBE_VIDEODISCLAIMER',
    'description' => '_MI_XOOPSTUBE_VIDEODISCLAIMERDSC',
    'formtype'    => 'textsarea',
    'valuetype'   => 'text',
    'default'     => 'The videos on this site are provided as is without warranty either expressed or implied. If you have a question concerning a particular piece video, feel free to contact the administrator of this website.<br><br>Contact us if you have questions concerning this disclaimer.',
];

$modversion['config'][] = [
    'name'        => 'copyright',
    'title'       => '_MI_XOOPSTUBE_COPYRIGHT',
    'description' => '_MI_XOOPSTUBE_COPYRIGHTDSC',
    'formtype'    => 'yesno',
    'valuetype'   => 'int',
    'default'     => 1,
];

/**
 * Make Sample button visible?
 */
$modversion['config'][] = [
    'name'        => 'displaySampleButton',
    'title'       => '_MI_XOOPSTUBE_SHOW_SAMPLE_BUTTON',
    'description' => '_MI_XOOPSTUBE_SHOW_SAMPLE_BUTTON_DESC',
    'formtype'    => 'yesno',
    'valuetype'   => 'int',
    'default'     => 1,
];

/**
 * Show Developer Tools?
 */
$modversion['config'][] = [
    'name'        => 'displayDeveloperTools',
    'title'       => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_DEV_TOOLS',
    'description' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_DEV_TOOLS_DESC',
    'formtype'    => 'yesno',
    'valuetype'   => 'int',
    'default'     => 0,
];

// ------------------- Notification ------------------- //
$modversion['config'][] = [
    'name'        => 'notifications',
    'title'       => '_MI_XOOPSTUBE_PREFERENCES_COMMENTS',
    'description' => '',
    'formtype'    => 'line_break',
    'valuetype'   => 'textbox',
    'default'     => 'odd',
];

$modversion['hasNotification']             = 1;
$modversion['notification']['lookup_file'] = 'include/notification.inc.php';
$modversion['notification']['lookup_func'] = 'xtubeNotifyIteminfo';

$modversion['notification']['category'][] = [
    'name'           => 'global',
    'title'          => _MI_XOOPSTUBE_GLOBAL_NOTIFY,
    'description'    => _MI_XOOPSTUBE_GLOBAL_NOTIFYDSC,
    'subscribe_from' => ['index.php', 'viewcat.php', 'singlevideo.php'],
];

$modversion['notification']['category'][] = [
    'name'           => 'category',
    'title'          => _MI_XOOPSTUBE_CATEGORY_NOTIFY,
    'description'    => _MI_XOOPSTUBE_CATEGORY_NOTIFYDSC,
    'subscribe_from' => ['viewcat.php', 'singlevideo.php'],
    'item_name'      => 'cid',
    'allow_bookmark' => 1,
];

$modversion['notification']['category'][] = [
    'name'           => 'video',
    'title'          => _MI_XOOPSTUBE_VIDEO_NOTIFY,
    'description'    => _MI_XOOPSTUBE_FILE_NOTIFYDSC,
    'subscribe_from' => 'singlevideo.php',
    'item_name'      => 'lid',
    'allow_bookmark' => 1,
];

$modversion['notification']['event'][] = [
    'name'          => 'new_category',
    'category'      => 'global',
    'title'         => _MI_XOOPSTUBE_GLOBAL_NEWCATEGORY_NOTIFY,
    'caption'       => _MI_XOOPSTUBE_GLOBAL_NEWCATEGORY_NOTIFYCAP,
    'description'   => _MI_XOOPSTUBE_GLOBAL_NEWCATEGORY_NOTIFYDSC,
    'mail_template' => 'global_newcategory_notify',
    'mail_subject'  => _MI_XOOPSTUBE_GLOBAL_NEWCATEGORY_NOTIFYSBJ,
];

$modversion['notification']['event'][] = [
    'name'           => 'video_modify',
    'category'       => 'global',
    'admin_only'     => 1,
    'title'          => _MI_XOOPSTUBE_GLOBAL_VIDEOMODIFY_NOTIFY,
    'caption'        => _MI_XOOPSTUBE_GLOBAL_VIDEOMODIFY_NOTIFYCAP,
    'description'    => _MI_XOOPSTUBE_GLOBAL_VIDEOMODIFY_NOTIFYDSC,
    'mail_template'  => 'global_videomodify_notify',
    'mail_subject] ' => _MI_XOOPSTUBE_GLOBAL_VIDEOMODIFY_NOTIFYSBJ,
];

$modversion['notification']['event'][] = [
    'name'          => 'video_broken',
    'category'      => 'global',
    'admin_only'    => 1,
    'title'         => _MI_XOOPSTUBE_GLOBAL_VIDEOBROKEN_NOTIFY,
    'caption'       => _MI_XOOPSTUBE_GLOBAL_VIDEOBROKEN_NOTIFYCAP,
    'description'   => _MI_XOOPSTUBE_GLOBAL_VIDEOBROKEN_NOTIFYDSC,
    'mail_template' => 'global_videobroken_notify',
    'mail_subject'  => _MI_XOOPSTUBE_GLOBAL_VIDEOBROKEN_NOTIFYSBJ,
];

$modversion['notification']['event'][] = [
    'name'          => 'video_submit',
    'category'      => 'global',
    'admin_only'    => 1,
    'title'         => _MI_XOOPSTUBE_GLOBAL_VIDEOSUBMIT_NOTIFY,
    'caption'       => _MI_XOOPSTUBE_GLOBAL_VIDEOSUBMIT_NOTIFYCAP,
    'description'   => _MI_XOOPSTUBE_GLOBAL_VIDEOSUBMIT_NOTIFYDSC,
    'mail_template' => 'global_videosubmit_notify',
    'mail_subject'  => _MI_XOOPSTUBE_GLOBAL_VIDEOSUBMIT_NOTIFYSBJ,
];

$modversion['notification']['event'][] = [
    'name'          => 'new_video',
    'category'      => 'global',
    'title'         => _MI_XOOPSTUBE_GLOBAL_NEWVIDEO_NOTIFY,
    'caption'       => _MI_XOOPSTUBE_GLOBAL_NEWVIDEO_NOTIFYCAP,
    'description'   => _MI_XOOPSTUBE_GLOBAL_NEWVIDEO_NOTIFYDSC,
    'mail_template' => 'global_newvideo_notify',
    'mail_subject'  => _MI_XOOPSTUBE_GLOBAL_NEWVIDEO_NOTIFYSBJ,
];

$modversion['notification']['event'][] = [
    'name'          => 'video_submit',
    'category'      => 'category',
    'admin_only'    => 1,
    'title'         => _MI_XOOPSTUBE_CATEGORY_FILESUBMIT_NOTIFY,
    'caption'       => _MI_XOOPSTUBE_CATEGORY_FILESUBMIT_NOTIFYCAP,
    'description'   => _MI_XOOPSTUBE_CATEGORY_FILESUBMIT_NOTIFYDSC,
    'mail_template' => 'category_videosubmit_notify',
    'mail_subject'  => _MI_XOOPSTUBE_CATEGORY_FILESUBMIT_NOTIFYSBJ,
];

$modversion['notification']['event'][] = [
    'name'          => 'new_video',
    'category'      => 'category',
    'title'         => _MI_XOOPSTUBE_CATEGORY_NEWVIDEO_NOTIFY,
    'caption'       => _MI_XOOPSTUBE_CATEGORY_NEWVIDEO_NOTIFYCAP,
    'description'   => _MI_XOOPSTUBE_CATEGORY_NEWVIDEO_NOTIFYDSC,
    'mail_template' => 'category_newfile_notify',
    'mail_subject'  => _MI_XOOPSTUBE_CATEGORY_NEWVIDEO_NOTIFYSBJ,
];

$modversion['notification']['event'][] = [
    'name'          => 'approve',
    'category'      => 'video',
    'invisible'     => 1,
    'title'         => _MI_XOOPSTUBE_VIDEO_APPROVE_NOTIFY,
    'caption'       => _MI_XOOPSTUBE_VIDEO_APPROVE_NOTIFYCAP,
    'description'   => _MI_XOOPSTUBE_VIDEO_APPROVE_NOTIFYDSC,
    'mail_template' => 'video_approve_notify',
    'mail_subject'  => _MI_XOOPSTUBE_VIDEO_APPROVE_NOTIFYSBJ,
];
// On Update
//if (!empty($_POST['fct']) && !empty($_POST['op']) && $_POST['fct'] == 'modulesadmin' && $_POST['op'] == 'update_ok'
//    && $_POST['dirname'] == $modversion['dirname']
//) {
//    require_once __DIR__   . '/include/onupdate.inc.php';
//}