11
mrgym
Re: Making second instances of modules - newbb in particular
  • 2003/11/12 16:27

  • mrgym

  • Just popping in

  • Posts: 28

  • Since: 2002/4/26


How are the present modules being re-written? What are the rules for this?

developing for multiple module instances
When developing, how do you keep an eye out for multiple installed instances? Look at all of the things that are interrelated;

- modversion['name']
- subdirectory name
- table names in /sql
- constants in language/[yourlanguage]/


One variable
Is there one variable that would always be available whether executing .php in the base module directory as well as admin/ ?

table names
Short of editing the table names in the SQL directory how would table names be converted?

Are there any individual modules that have solved this problem?




12
mrgym
admin menus - options??
  • 2003/11/10 21:52

  • mrgym

  • Just popping in

  • Posts: 28

  • Since: 2002/4/26


The whole admin menu at install time ($adminmenu[][title]) doesn't allow for dynamic menu options.

Then I have to take up my centerblock space for admin menus! So, I'm left with;

- echo a table with menu options (doesn't respect template)
- go declare xoopsTpl yourself (it isn't there -- not even GLOBALS[])
- declaring the first form as a menu, and using XoopsFormLabel elements (each being <a href"query">label</a>) within this form.


Have I missed viable options???

(Is this where we discuss the need for future XOOPS versions to use admin templates and module-generated arrays of menu items that are then accepted by xoops_cp_footer() or footer.php?)




13
mrgym
Re: XoopsFormSelect->render( ) <option SELECTED>, not selected='selected' ?
  • 2003/11/5 13:52

  • mrgym

  • Just popping in

  • Posts: 28

  • Since: 2002/4/26


MithyT2 on the topic of your many posts, you have always been a big help to me! I hope to make the same contribution.




14
mrgym
XoopsFormSelect->render( ) <option SELECTED>, not selected='selected' ?
  • 2003/11/4 20:43

  • mrgym

  • Just popping in

  • Posts: 28

  • Since: 2002/4/26


very useful XOOPS forms classes!

The "selected='selected'" output doesn't work in the most recent version of mozilla, but DOES work in IE and Opera.


w3c.org's html 4.01 spec section 17.6.1 says that this output should be;

<option selected> OR
<option SELECTED>



15
mrgym
Re: addOptionArray should be array(array( ))?
  • 2003/10/23 16:05

  • mrgym

  • Just popping in

  • Posts: 28

  • Since: 2002/4/26


Of course!! (slaps head)

I can iterate though the array of revised associative arrays provided by $xoopsDB->fetchArray(), calling addOptionArray on each iteration. This is the simple way addOptionArray was meant to be used.

It would be great to have a method for adding these options that accepted $array[] = array('key'=>'value'). It would allow 1 return from the database method without adding a function that iterates.








16
mrgym
addOptionArray inputs should be array(array( ))?
  • 2003/10/22 20:11

  • mrgym

  • Just popping in

  • Posts: 28

  • Since: 2002/4/26


1. Shouldn't addOptionArray take an array of arrays? This is how data comes back from a query.
2. What methods have been used to convert to a one-dimensional array? Most of the examples grep'ed above the modules directory show 'static' input such as

$x->addOptionArray(array('3600' => _HOUR, '18000' => sprintf(_HOURS
, 5));

or I have found examples of a one dimensional array containing text values that was automatically indexed.


I'm creating select options for admin forms using XoopsFormSelect.

The HTML I hope to create is;
<option value='6'>acategory</option>
<option value='2'>bcategory</option>
<option value='3'>ccategory</option>
<option value='5'>dcategory</option>
<option value='1'>ecategory</option>

so that when the form is posted, I can act on the option value which is the record id.

My database query comes back looking like this (an array or arrays);

$array[0] = array( 'value'=>6,'cat'=>'acategory')
$array[1] = array( 'value'=>2,'cat'=>'bcategory')

and can easily be converted to this;

$array[0] = array('6'=>'acategory')
$array[1] = array('2'=>'bcategory')

addOptionArray would want these to look like this;

$array = array ('6'=>'acategory','2'=>'bcategory')

Before I present my patented kludge for the conversion, I thought I would ask....




17
mrgym
Re: Help needed...
  • 2003/10/21 14:31

  • mrgym

  • Just popping in

  • Posts: 28

  • Since: 2002/4/26


So you need;
- categories for user
- a profile form that has fields matching their category

How will the profile and the profile form information be used?

So Sie Notwendigkeit;
- Kategorien für Benutzer
- eine Profilform, die Felder hat, ihre Kategorie

zusammenzubringen Wie werden das Profil und die Profilforminformationen verwendet?



18
mrgym
Re: speaking of permissions for modules . . .
  • 2003/10/18 21:30

  • mrgym

  • Just popping in

  • Posts: 28

  • Since: 2002/4/26


There are a couple of ways.

1. hiding submenu items can be done in the template for ALL submenu items. Add a smarty <{if}> to the system_block_mainmenu.html using the template manager.

<{foreach item=sublink from=$module.sublinks}>
<{if $xoops_isuser == true}>
<a class="menuSub" href="<{$sublink.url}>"><{$sublink.name}></a>
<{/if}>
<{/foreach}>

2. Your submenu can be generated dynamically. xoops_version.php can look like this;

//submenu
if($xoopsUser){
//make a submenu if is a user
include_once("include/db.class.php");

//global $xoopsDB or
//$GLOBALS['xoopsDB'] even for globals off

$menuDB = new db($GLOBALS['xoopsDB'],$_GET);

//then feed the array to the modversion[sub] array
foreach($menuDB->menu as $k=>$v){
$modversion['sub'][$k]['name']=$v['name'];
$modversion['sub'][$k]['url']= $v['url'];
}

}

//there are already enough vars!
unset($menuDB);

If you need to be more precise than "is this a user" then see the top post in this modules forum.




19
mrgym
developing for multiple module instances
  • 2003/10/17 17:27

  • mrgym

  • Just popping in

  • Posts: 28

  • Since: 2002/4/26


When developing, how do you keep an eye out for multiple installed instances? Look at all of the things that are interrelated;

- modversion['name']
- subdirectory name
- table names in /sql
- constants in language/[yourlanguage]/


One variable
Is there one variable that would always be available whether executing .php in the base module directory as well as admin/ ?

table names
Short of editing the table names in the SQL directory how would table names be converted?

Are there any individual modules that have solved this problem?



20
mrgym
Re: How do you develop your modules?
  • 2003/10/16 14:51

  • mrgym

  • Just popping in

  • Posts: 28

  • Since: 2002/4/26


I agree that the update module or delete template-upload template is a pain. I'm not sure whether this is done because the template is then remotely editable via an HTML form, or because there is some interaction between the template and the chosen theme.

I did see a note under the 2.0.4 or 2.0.5 release that said that the system->general preferences "Update module template .html files from themes/your theme/templates directory?"" now worked. If you look at the XOOPS table tplfile you will see a field called "tpl_lastmodified" which looks like a timestamp. It's easy to imagine a date check on the files in your module subdirectory (in XOOPS > 2.0.3) where the newly-updated templates are used rather than the ones in the database.





TopTop
« 1 (2) 3 »



Login

Who's Online

146 user(s) are online (78 user(s) are browsing Support Forums)


Members: 0


Guests: 146


more...

Donat-O-Meter

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

Latest GitHub Commits