Admin in conventional theme
from PEAK XOOPS Support&Experiment
(2007/3/21 6:04)
|
Admin area in XOOPS 2.0.x is hard to use for the handicapped.However the admin area cannot be customized in HTML level.Thus I've made a hack/module for"Admin in theme".- install/update the latest altsys- insert a line into mainfile.php[code]include XOOPS_ROOT_PATH."/include/common.php";include XOOPS_TRUST_PATH.'/libs/altsys/include/admin_in_theme.inc.php';[/code]- specify the name of the theme for admin area in preferences of altsysIt will be modified which any blocks can be lay-outed in the future.
|
a useful function array_map()
from PEAK XOOPS Support&Experiment
(2007/3/20 13:06)
|
array_map() the built-in function of PHP is fast and useful one.eg1) fetching an array of integer from a textbox. [1,2,3,4]You can get it by just a line.[code]$myarray = array_map('intval', explode(',', $post_data ) ) ;[/code]eg2) merging arrays with unique elements of arrays or objectsNeither"operator +"nor array_merge() are enough for the purpose.You can use array_map() usefully like this.[code]$merged_array = array_map('unserialize', array_unique( array_map('serialize', array_merge( $array1 , $array2 ) ) ) ) ;[/code]
|
Adminmenu hack without core hacks
from PEAK XOOPS Support&Experiment
(2007/3/19 4:20)
|
I know, you know"adminmenu in X2.0.x is hard to use".There are four problems I can see.(1) hard to catch popup (especially modules placed bottom)(2) only with alt=""(3) a lot of unreachable items if JavaScript is disabled(4) no information which module is activeThus, I've modified altsys to solve the problems.Install/Update the latest altsys and change the value of"Rewrite admin menu".Since this is not a hack, you have to click once more to reflect the effect.There are three types of hacks.Especially, I love"Like XoopsCube Legacy 2.1". (see the picture)This solves all of problems, and you will access each items without stressess :-)
|
MEMO for myself about indexes for array(2)
from PEAK XOOPS Support&Experiment
(2007/3/10 4:56)
|
Index specified by a boolean, a double, ant an int will be integer index via intval()exception: out of the range of 32bit integerIndex specified by a string will be two type of index by the condition[code]/^[-]?[1-9][0-9]*$/[/code]If the string matches this regex, it will be integer index.Else, it will be string index (associated array).
|
4th developper of D3
from PEAK XOOPS Support&Experiment
(2007/3/9 4:51)
|
The 4th developper has just been born.hodaka is one of the best module contributer.Weblog D3http://www.kuri3.net/modules/mydownloads/singlefile.php?lid=18Though I knew he was developping a module based on weblog-1.42, I'm surprised weblog D3 has the spec of xoops_breadcrumbs which is one of the latest topic.This module requests in your theme.html[code]......[/code]
|
A suggestion of hierarchical submenu
from PEAK XOOPS Support&Experiment
(2007/3/8 3:43)
|
$modversino['sub'] can be extended as RECURSIVE like ...[code]array('name'=> (name of this node)'url'=> (relative link from XOOPS_URL/modules/dirname/ )'sub'=> (array of sub nodes)) ,[/code]Then you can get hierarchical submenus for theme's power.When you assign the submenus for your theme, you should call XoopsModule::getInfo('sub') instead of XoopsModule::subLink().[code]$module-> subLink()$module-> getInfo('sub')[/code]This code flagment will be useful for the agility of your module.In function of dirname_get_submenu, you should cache the result as a static variable.xoops_version.php[code]$modversion['sub'] = array() ;if( is_object( @$GLOBALS['xoopsModule'] )&&$GLOBALS['xoopsModule']-> getVar('dirname') == dirname ) {require_once dirname(__FILE__).'/include/common_functions.php';$modversion['sub'] = dirname_get_submenu( $mydirname ) ;}[/code]You can find the latest d3forum and pico offer this kind of submenus.I'll be happy if a lot of themes supporting hierarchical submenus are rele ...
|
MEMO for myself about indexes for array
from PEAK XOOPS Support&Experiment
(2007/3/7 5:28)
|
[code]# php -r'$a=array("1"=> 1);var_dump($a[1]);'int(1)[/code][code]# php -r'$a=array("1a"=> 1);var_dump($a);'array(1) {["1a"]=> int(1)}[/code][code]# php -r'$a=array("0x1a"=> 1);var_dump($a);'array(1) {["0x1a"]=> int(1)}[/code][code]# php -r'$a=array(0x1a=> 1);var_dump($a);'array(1) {[26]=> int(1)}[/code][code]# php -r'$a=array(""=> 1);var_dump($a);'array(1) {[""]=> int(1)}[/code][code]# php -r'$a=array(false=> 1);var_dump($a);'array(1) {[0]=> int(1)}[/code][code]# php -r'$a=array(true=> 1);var_dump($a);'array(1) {[1]=> int(1)}[/code][code]# php -r'$a=array(1.1=> 1);var_dump($a);'array(1) {[1]=> int(1)}[/code][code]# php -r'$a=array("1.1"=> 1);var_dump($a);'array(1) {["1.1"]=> int(1)}[/code][code]# php -r'$a=array("01"=> 1);var_dump($a);'array(1) {["01"]=> int(1)}[/code][code]# php -r'$a=array(-1=> 1);var_dump($a);'array(1) {[-1]=> int(1)}[/code][code]# php -r'$a=array("-1"=> 1);var_dump($a);'array(1) {[-1]=> int(1)}[/code][code]# php -r'$a=array("+1"=> 1);var_dump($a);'array(1) {["+ ...
|
cache of kernel/module.php does not work
from PEAK XOOPS Support&Experiment
(2007/3/6 3:26)
|
The cache for module objects does not work nearly at all.This bug causes double/triple parsing xoops_version.php.It makes your site slow, perhaps.I've patched the bug like this.Though the source file of the diff is from 2.0.16-JP, it might be applicatable for 2.0.x from xoops.org
|
empower your theme by xugj_assign.php
from PEAK XOOPS Support&Experiment
(2007/3/2 3:43)
|
- put xugj_assign.php in your theme. (XOOPS_ROOT_PATH/themes/(theme)/)- insert a line into your theme.html[code][/code]Then you can get breadcrumbs list automatically even with modules don't support xoops_breadcrumbs.xugj_assign.php[code]
|
xoops_breadcrumbs - the unified breadcrumbs list for XOOPS
from PEAK XOOPS Support&Experiment
(2007/3/1 4:21)
|
[/xlang:ja]breadcrumbs list should be displayed by theme.html instead of each modules's templates.Now, I suggest'xoops_breadcrumbs'as a template variable of $xoopsTpl.All modules should assign'xoops_breadcrumbs'like ...[code][0] => array('name'=> '(module name)','url'=> '(URL for module top)') ,[1] => array('name'=> '(category name)','url'=> '(URL for list in a category)') ,[2] => array('name'=> '(subcategory name)','url'=> '(URL for list in a subcategory)') ,[3] => array('name'=> '(the article name)')[/code]If all modules assigns like this, you can write in theme.html like this.[code]TOP > [/code]You can understand this is the true"breadcrumbs list".I've implemented xoops_breadcrumbs into pico and bulletin2.But there are a lot of un-impelented modules in the world.Though I know the fact, here is a magic named xugj_assign.php(To be continued...)
|