1
tank1955
Video Tube - need help accessing globals in admin/index.php
  • 2008/6/10 1:33

  • tank1955

  • Module Developer

  • Posts: 276

  • Since: 2007/9/7 1


I am developing my next version (1.6) of Video Tube module and have hit a roadblock I can't figure out. I don't seem to be able to access the $xoopsModuleConfig global in admin/index.php file.

//admin/index.php excerpt
include_once("admin_header.php");

global 
$xoopsOption$xoopsDB$xoopsUser$xoopsConfig$xoopsModuleConfig;

$vusecats $xoopsModuleConfig['videousecats'];
if (
$vusecats) {
  
$numcolumns 9;  
}else{  
  
$numcolumns 8;
}


$vusecats returns a '0' but it should be '1'. xoopsModuleConfig['videousecats'] is working in all of my other files, just not in the admin/index.php file.

//admin/adminheader.php excerpt
include_once '../../../mainfile.php';
include_once 
XOOPS_ROOT_PATH."/header.php";
include_once 
XOOPS_ROOT_PATH."/class/xoopsmodule.php";
include_once 
XOOPS_ROOT_PATH."/include/cp_functions.php";

if (
$xoopsUser) {
  
$xoopsModule XoopsModule::getByDirname("videotube");
  if ( !
$xoopsUser->isAdmin($xoopsModule->mid()) ) { 
    
redirect_header(XOOPS_URL."/",3,_NOPERM);;
    exit();
  }
} else {
  
redirect_header(XOOPS_URL."/",3,_NOPERM);
  exit();
}


I know I must be overlooking something.

I am working with XOOPS 2.0.16

//snippets from xoops_version.php
// Admin things
$modversion['hasAdmin'] = 1;
$modversion['adminindex'] = "admin/index.php";
$modversion['adminmenu'] = "admin/menu.php";

$modversion['config'][13]['name'] = 'videousecats';
$modversion['config'][13]['title'] = '_MI_VP_VCATEGORIESENABLE';
$modversion['config'][13]['description'] = '_MI_VP_VCATEGORIESENABLEDSC';
$modversion['config'][13]['formtype'] = 'yesno';
$modversion['config'][13]['valuetype'] = 'int';
$modversion['config'][13]['default'] = 0;


Any suggestions?

2
tank1955
Re: Video Tube - need help accessing globals in admin/index.php
  • 2008/6/10 2:13

  • tank1955

  • Module Developer

  • Posts: 276

  • Since: 2007/9/7 1


Right after I posed the question here I managed to locate the answer in the FAQ's. For those interested here is the code that solved my problem.

$module_handler =& xoops_gethandler('module');
$module         =& $module_handler->getByDirname('videotube');
$config_handler =& xoops_gethandler('config');
$moduleConfig   =& $config_handler->getConfigsByCat(0$module->getVar('mid'));

$vusecats $moduleConfig['videousecats'];
if (
$vusecats) {
  
$numcolumns 9;  
}else{  
  
$numcolumns 8;
}

3
urbanspacema
Re: Video Tube - need help accessing globals in admin/index.php

Hello Tank1955

is possible in a forthcoming version have a block with the video player as in http://www.skopemag.com?

tnx
Urban

4
tank1955
Re: Video Tube - need help accessing globals in admin/index.php
  • 2008/6/12 1:13

  • tank1955

  • Module Developer

  • Posts: 276

  • Since: 2007/9/7 1


Thanks for the suggestion Urban. I will be adding a video player block in version 1.6 in which you will be able to select Featured, Random, Latest or Most Viewed Video. Version 1.6 should be ready mid July 2008.

5
urbanspacema
Re: Video Tube - need help accessing globals in admin/index.php

perfect!
it would be nice to have the template 'class' and 'id' for so that we can work with style sheets.

even better would be if it were all tableless (only div)

plus (suggestion)
a form to insert a comment for every video.
a page with all the videos but without the player (only thumbs)

urban

Login

Who's Online

421 user(s) are online (155 user(s) are browsing Support Forums)


Members: 0


Guests: 421


more...

Donat-O-Meter

and
Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits