31
liomj
Re: wgFilemanager released for testing and contribution
  • 8/27 0:03

  • liomj

  • Just popping in

  • Posts: 82

  • Since: 2012/4/10


thank you for a new module for XOOPS

i got this error in modules/system/admin.php?fct=modulesadmin&op=installlist

Error: Error: Undefined constant '_MI_WGFILEMANAGER_NAME' in file /modules/wgfilemanager/xoops_version.php line 34

XOOPS Version XOOPS 2.5.11-Stable
PHP Version 7.4.33
MySQL Version 5.5.5-10.4.27-MariaDB



32
liomj
Re: activate block by default
  • 8/26 23:56

  • liomj

  • Just popping in

  • Posts: 82

  • Since: 2012/4/10


Hi i tried asking ChatGPT AI, I got this answer below. I didnt test it, not sure if it will work.

Yes, in XOOPS CMS, it is possible to have a block automatically activated upon installation of a module. This involves modifying the installation script of the module so that the block is registered and set as active during the installation process. Here's how you can do it:

Step-by-Step Guide
1. Locate the xoops_version.php file in your module:

This file contains the configuration details for your module, including block definitions.

2. Define the Block:

Ensure that your block is defined in the xoops_version.php file under the $modversion['blocks'] array. For example:

$modversion['blocks'][1] = [
    
'file'        => 'block_file.php',
    
'name'        => 'Block Name',
    
'description' => 'Block Description',
    
'show_func'   => 'show_block_function',
    
'template'    => 'block_template.tpl',
    
'edit_func'   => 'edit_block_function',
    
'options'     => 'option1|option2',
];


3. Modify the Installation Script:

Typically, the block is registered during the module installation process. To activate it by default, you can add code to set the block as active in the xoops_version.php file.

Add the following to the module's xoops_version.php file:

// Add the block automatically upon installation
$modversion['onInstall'] = 'module_install_function';

// Custom installation function in your module's include/oninstall.php
function module_install_function(&$module) {
    
$moduleHandler xoops_getHandler('module');
    
$moduleObj $moduleHandler->getByDirname('your_module_name');
    
$blockHandler xoops_getHandler('block');

    
// Loop through the blocks defined in xoops_version.php
    
$blocks $blockHandler->getByModule($moduleObj->getVar('mid'));

    foreach (
$blocks as $block) {
        
// Activate the block
        
$block->setVar('isactive'1);
        
$blockHandler->insert($block);
    }

    return 
true;
}


Replace 'your_module_name' with the actual directory name of your module.

4. Create oninstall.php File:

If not already present, create an oninstall.php file in the include directory of your module and define the module_install_function as shown above.

5. Test the Installation:

Install your module through the XOOPS administration panel and verify that the block is automatically activated upon installation.

Summary
By customizing the installation process, you can ensure that blocks are automatically activated when the module is installed. The key is to modify the xoops_version.php file and create a custom installation function that activates the block.



33
goffy
activate block by default
  • 8/24 9:52

  • goffy

  • Just can't stay away

  • Posts: 542

  • Since: 2010/12/27


is there a way to activate a block automatically, means, that after installation the block is already activated



34
heyula
Re: wgFilemanager released for testing and contribution
  • 8/21 15:19

  • heyula

  • Theme Designer

  • Posts: 595

  • Since: 2008/4/24


Great module. I will try it as soon as possible. Thank you.



35
goffy
wgFilemanager released for testing and contribution
  • 8/21 13:17

  • goffy

  • Just can't stay away

  • Posts: 542

  • Since: 2010/12/27


wgFilemanager 1.0.0 Alpha is released for testing and contribution.

This XOOPS module is especially developed for file management.

The module currently provides:
* Browse files and directories
- 3 different styles: list / grouped / cards
- display/hide file preview and/or icons

*File management:
- Upload file
- Download file
- Print file
- Preview for image and pdf file (modal)
- Edit file
- Delete file

*Directory management:
- Create directory
- Rename directory
- Move directory by drag&drop
- Deleting directory with complete content

*Permission management:
- Global permissions
- Permissions by directory

Requirements:
- XOOPS 2.5.11-Stable
- PHP 7.4 or higher
- Bootstrap 4 Theme

DOWNLOAD: https://github.com/XoopsModules25x/wgfilemanager

FORK: https://github.com/XoopsModules25x/wgfilemanager

Tutorial: coming soon



36
Mamba
Re: XOOPS 2.5.12 Beta-2 available for Testing

Excellent!

Thanks for letting us know!
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs



37
jjdai
Re: XOOPS 2.5.12 Beta-2 available for Testing
  • 8/18 21:19

  • jjdai

  • Just popping in

  • Posts: 25

  • Since: 2006/6/17


Bonsoir,
Yes in all cases I correct by putting the name of the image after the smarty tag like that I no longer have a problem.
<img src="<{$modPathIcon16}>/arrows/down-1.png" title="<{$smarty.const._AM_SLIDER_DOWN}>">



JJDai



38
Mamba
Re: XOOPS 2.5.12 Beta-2 available for Testing

Somehow your images are not visible. Can you fix it?

And thanks for the note about missing Beta-2 - I'll change it on GitHub to Beta-3, since that's where the next release will be.

I just updated yesterday Smarty to 4.5.4 release
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs



39
jjdai
Re: XOOPS 2.5.12 Beta-2 available for Testing
  • 8/18 9:58

  • jjdai

  • Just popping in

  • Posts: 25

  • Since: 2006/6/17


a very little remark :
in the bottom af admin:
Powered by XOOPS 2.5.12-Beta1 © 2001-2024
instead
Powered by XOOPS 2.5.12-Beta2 © 2001-2024



40
jjdai
Re: XOOPS 2.5.12 Beta-2 available for Testing
  • 8/18 8:16

  • jjdai

  • Just popping in

  • Posts: 25

  • Since: 2006/6/17


Hello,

I have been testing xoops 2.5.12 on a preproduction site for 10 days.
I have not encountered any major problems, however there is a problem that is not a bug, but rather a regression with the smarty plugins xoModuleIcons16 , xoModuleIcons32 , ....

in many old modules we can see in the templates:

categories

The name of the icon is without apostrophes, because the old function received a string of characters with apostrophes, if there were apostrophes, the image was simply not displayed.

with xoops 2.5.12 you have to write:
categories

with apostrophes.
The function receives an array and if the apostrophes are missing it bugs, which is normal behavior.

the problem is that if we have several sites with different versions it will be a bit problematic to maintain these modules.

If we leave without apostrophes to bug with xoops 2.5.12

if we put the apostrophes it causes problems with previous versions.

so I modify by putting the name of the icon after the smarty tag to not have a problem on the different versions, 2.5.10, 2.5.11, and 2.5.12

categories

Thanks for the work done on this version, JJDai




TopTop
« 1 2 3 (4) 5 6 7 ... 29429 »



Login

Who's Online

119 user(s) are online (29 user(s) are browsing Support Forums)


Members: 0


Guests: 119


more...

Donat-O-Meter

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

Latest GitHub Commits