51
irmtfan
Re: How to write an standard module for xoops (div table, pagination , sort, order)
  • 2013/5/30 2:22

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


Yes you are right.
Anyway IMO It is efficient to not waste many times on this. write the first version of your module with the most simple codes and try to releasse the first stable version. It is not important if you have to use more queries. then in the next versions you can focus on performances.



52
irmtfan
Re: How to write an standard module for xoops (div table, pagination , sort, order)
  • 2013/5/29 10:53

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


Yes. I knew your intention for adding a fake var (category_name) to article object.
But i dont think it is good for you because:
1- As i said before it will not help you to reduce query.
2- You should overwrite all functions in the parent object (XoopsPersistableObjectHandler) to avoid issues.

for example assume you want to store those objects like this:
$articles $article_handler->getObjects$criteria ); 
foreach (
$articles as $art) { 
  if(!empty(
$_POST["article_title"]) $art->setVar('title'$_POST["article_title"]); 
  
// echo $art->getVar('category_name');
  
$article_handler->insert($arttrue); // error because category_name is not exist.
}

so you have to write insert function too.
then you have to write many other functions. It would not be good for you !!!

based on my experiences using fake vars in a class is only good and acceptable if those tables stick together very tightly and developer dont need to write a handler for one of them.
for example in newbb there is bb_posts and bb_posts_text but there is only one handler NewbbPostHandler extends ArtObjectHandler
Then developer overwritten all needed functions like get, insert, ... by using JOIN.
So in newbb developer dont write any handler for posts text.


side note: it is better to use getAll instead of getObjects because getObjects will be deprecated in next versions.

If you really want to reduce query for category_name the best way is creating a cache file and store all $catNames[$cat_id] = "category_name";
then you have them available any time without any query.



53
irmtfan
Re: TDMCreate v1.39 RC 1 for Testing
  • 2013/5/29 2:46

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


Is this the latest SVN?
http://svn.code.sf.net/p/xoops/svn/XoopsModules/TDMCreate/branches/timgno/1.39

This module creator should follow the standard very tightly. I mean it should not have any hard-code even it vshould remove any instance of dirname from the created module codes.
In one sentence follow the "how to write a standard module for xoops"
eg: It could be very good to have helper and request class in created modules.
@timgno:
I hope you could tell us your ideas about this tutorial



54
irmtfan
xoops 257, 256 and xoops26 bug: XoopsMemberHandler delete functions always returns true
  • 2013/5/28 5:18

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


This bug has been sent by zyspec.
http://sourceforge.net/p/xoops/bugs/1272/

In this topic we can discuss it.

I can find too many functions in xoops dont have a meaningful return
they mainly have a return true
This bug is exist in new core functions too
eg: nearly all functions in moduleadmin class in Frameworks/moduleclasses/moduleadmin/moduleadmin.php

and one important function is addConfigBoxLine.
It always return true whether the chmod is ok or not ok or folder is exist or not exist
So one developer like me have to write a completely same function to find if chmod is ok or not.

So this bug needs more and more attention from core team.



55
irmtfan
Re: xoops256 bug (very important): template duplicate issue
  • 2013/5/28 5:03

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


Please somebody add this bug to sf.net tracker and if possible include the patch.
thank you.



56
irmtfan
Re: xoops 2.6 bug: Cannot add another Locale
  • 2013/5/28 5:02

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


please add this bug to sf.net tracker for xoops26 too.



57
irmtfan
Re: Forum module question
  • 2013/5/28 4:50

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


you are totally right. no forum module is released officially for xoops 256.

you have 2 unofficial choice:

1- newbb 4.3 Alfred stable version
http://www.simple-xoops.de/projekt/2:1-Forum_-_newBB.html
(there is a newbb 4.4 alpha version too for test)

2- newbb 4.33 irmtfan RC7 version:
http://svn.code.sf.net/p/xoops/svn/XoopsModules/newbb/branches/irmtfan/newbb/

you should choose yourself.

Edit:
personally, I will be glad if you could test my version of newbb and report back any issue or request.
It is mainly a debugged version of all older newbb versions include newbb 1, newbb 2, newbb 3.08, newbb 4, and newbb 4.3



58
irmtfan
xoops257 , 256 and xoops26 bug: xoops_version.php of all modules will be included more than once.
  • 2013/5/28 4:46

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


It is an obvious bug.
just put a echo in one modules/MODULE/xoops_version.php and see yourself.
It has a bad impact on site performance. specially it is worse in update and install processes when a module has some special scripts and functionality.

To solve this you should add one static $modVersions to store $modversion from all modules to avoid include xoops_version.php more than one time in XOOPS257|XOOPS256|Xoops26/kernel/module.php in loadInfo function
function loadInfo($dirname$verbose true)
    {
        
// START irmtfan add static $modVersions to store $modversion from all modules to avoid include xoops_version.php more than one time
        
static $modVersions;
        if(isset(
$modVersions[$dirname])) {
            
$this->modinfo $modVersions[$dirname];
            return 
true;
        }
        
// END irmtfan add static $modVersions to store $modversion from all modules to avoid include xoops_version.php more than one time
        
$dirname basename($dirname);
        global 
$xoopsConfig;
        if (
file_exists($file $GLOBALS['xoops']->path('modules/' $dirname '/language/' $xoopsConfig['language'] . '/modinfo.php'))) {
            include_once 
$file;
        } else if (
file_exists($file $GLOBALS['xoops']->path('modules/' $dirname '/language/english/modinfo.php'))) {
            include_once 
$file;
        }

        if (!
file_exists($file $GLOBALS['xoops']->path('modules/' $dirname '/xoops_version.php'))) {
            if (
false != $verbose) {
                echo 
"Module File for $dirname Not Found!";
            }
            return 
false;
        }
        include 
$file;
        
$this->modinfo $modVersions[$dirname] = $modversion;// irmtfan add static $modVersions
        
return true;
    }

It is a bug in xoops 26 alpha too.
Of course it is a bug in xoops256 xoops 255 and all older versions.

please somebody add this bug to sf.net bug tracker on behalf of me.



59
irmtfan
Re: How does the config tables works in XOOPS Core?
  • 2013/5/28 2:44

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


@redheadedrod;
Very good explanations. Thank you.
If i knew you worked on this before I did not put time on it.
We need more tutorials like this.
I will link this topic to the "how to write a standard module" tutorial.



60
irmtfan
Re: Updating Cloned Publisher
  • 2013/5/28 2:38

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


Yes.
The current clone system needs this for any update:
1- update the original module (here: publisher) in local
2- create a clone with the same name in your running website.
3- upload the clone files and update in running website.

With changing the clone system to rename of the modules/MODULE it can be done with ease.

Currently i worked on that but it has the least priority in my to do list.

Ones I finished that script based on publisher method, The above can be done on any module which meets the SmartClone standards.




TopTop
« 1 ... 3 4 5 (6) 7 8 9 ... 284 »



Login

Who's Online

209 user(s) are online (99 user(s) are browsing Support Forums)


Members: 0


Guests: 209


more...

Donat-O-Meter

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

Latest GitHub Commits