1
Gizmhail
Re: A xoops module generator to test
  • 2006/2/5 20:21

  • Gizmhail

  • Just popping in

  • Posts: 15

  • Since: 2005/2/15


I'm still testing Oryxgen, but the result are really nice ^^

While I'm testing it, I'm keeping track of some possible improvements, I'll update them here if you're interested.

For the moment, here is what I've noticed :

* in the generated class, if 2 attributes point to the same table field, they will generate 2 getter function with the same name : getter name should be defined by class attribute name, not target field name
* the imports shouldn't have the directory name hardcoded, but should use $xoopsModule->getVar("dirname") (for instance in generated classes)
* in generated classes, in the toString fucntion, use include_once instead of include
* generate the mysql.sql file
* use a special prexif for table read by oryxgen in the database, to be able to test a module and, in the meantime, edit it (something like (xoops_prexif)_oryxgen_ ). Practically, this prefix should be removed in the generated code



2
Gizmhail
Re: A xoops module generator to test
  • 2006/1/21 10:39

  • Gizmhail

  • Just popping in

  • Posts: 15

  • Since: 2005/2/15


Thanks for this module !

I'd like to test it since I'm currently building a new module.

I'll tell you here the problems I encounter.

-------------
[Install]
First, I didn't managed to install it as it is in the archive.

Well, with a XOOPS 2.0.13.2, if I try to install it, I get this error :

You have an error in your SQL syntax near 'ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=21 ' at line 11

Unable to install oryxgen
Error(s):


After some tries, I edited the modules\oryxgen\sql\mysql.sql file and removed any occurance of

ENGINE=MyISAM DEFAULT CHARSET=utf8


Then, I've been able to go on.

I wonder what are the php/mysql/xoops version requirements of your module ? Maybe my MySql version (I think it is 3.23.58) is too old ?
-------------

But once I get past this, I've been able to generate a module, and what is produced is pretty interesting :)
I've not used every functionnality yet, but the result is what is was looking for, congratulations !

By the way, I'm currently going through the documentation, and it says that the additions in the XOOPS class directory are mandatory. I want to avoid this, so do you know which part of the generated code is dependant on those files, so that I know which part I'll have to edit ?

Again, thanks for this great module !



3
Gizmhail
Re: multimenu
  • 2006/1/6 21:50

  • Gizmhail

  • Just popping in

  • Posts: 15

  • Since: 2005/2/15


Hehe, it's quite handy to have a nickname not really common : a glance at google and I know if someone need help on my works ;)

Well, I read your post again, and my patch should suit your need : if it doesn't, I'm interested, to be able to correct my patch, since it is exactly its goal



4
Gizmhail
Re: multimenu
  • 2006/1/6 17:24

  • Gizmhail

  • Just popping in

  • Posts: 15

  • Since: 2005/2/15


Quote:

dream77 wrote:


"In the gizmhail version of block.php"
I do not find any gizmhail at all, and in block.php I do not find the lines they talk about.

Please help me if you can.


I've fallen upon this thread, and I guess I'm the Gizmhail you speak about

The post you quote must be this one. Its author has enhanced (I guess ) a modification I made for multimenu. Here is this modification, a download link is in the page:
http://www.gizmhail.net/xoops/modules ... atch&back=Multimenu_patch

If I can help you more, don't hesitate !



5
Gizmhail
Re: [MULTIMENU] Test the multiMenu 1.6
  • 2005/3/1 13:32

  • Gizmhail

  • Just popping in

  • Posts: 15

  • Since: 2005/2/15


I've made a patch that suits my need better, and I would like to have your opinion on the interest/validity of it.
It activates dynamic sub-menu without checking directories inclusion.

Nothing is changed, there's only 2 additions in the blocks/block.php file. I'll quote the normal code between my é addition to allow you to locate them.

My code - part 1(this code determines which main main is active):

$currentmainmenu = -1;
$opengroupheadermenu = -1;
$sql =                  "SELECT groups, link, submenu, title, target, imageurl, weight
                FROM "
.$xoopsDB->prefix('multimenu').$options[11]."
                WHERE hide = 1
                ORDER BY "
.$options[3];
$result $xoopsDB->queryF($sql ,$randlimit ,$rand);
while ( 
$myrow $xoopsDB->fetchArray($result) ) {
    
// On teste si on est dans un menu principal
    
if($myrow['submenu'] == 0)
    {
        
$currentmainmenu $myrow['link'];
    }
    
$isSub substr_count($_SERVER['REQUEST_URI'], $myrow['link']);
    if (
$isSub>0)
    {
        
$opengroupheadermenu $currentmainmenu;
    }
}
$currentmainmenu = -1;


Standard code just following:

$sql =                  "SELECT groups, link, submenu, title, target, imageurl, weight
                        FROM "
.$xoopsDB->prefix('multimenu').$options[11]."
                        WHERE hide = 1
                        ORDER BY "
.$options[3];

    
$result $xoopsDB->queryF($sql ,$randlimit ,$rand);

    while ( 
$myrow $xoopsDB->fetchArray($result) ) {

    
$imenu['submenu'] = $myrow['submenu'];  // fetch the value from database, is it a submenu?
    
$title $myts->makeTboxData4Show($myrow["title"]);
        if ( !
XOOPS_USE_MULTIBYTES ) {
            if (
strlen($myrow['title']) >= $options[5]) {
                
$title $myts->makeTboxData4Show(substr($myrow['title'],0,($options[5]-1)))."...";
            } else {
                
$title $myts->makeTareaData4Show($myrow['title']);
            }
        }
        
$groups explode(" ",$myrow['groups']);
        if (
count(array_intersect($group,$groups)) > 0) {
if ( 
$options[4] == ) {$imenu['title'] = $title;} else {$imenu['title'] = "";}
$alt_title strip_tags($myrow['title']);

if (
$myrow['link']) {
        if (    (
eregi("mailto:"$myrow['link'])) ||
            (
eregi("http://"$myrow['link'])) ||
            (
eregi("https://"$myrow['link'])) ||
            (
eregi("ftp://"$myrow['link'])))
             {
            
$link $myrow['link'];
            } else {
            
$link XOOPS_URL."/".$myrow['link'];
            }

//-------------Added for showing submenu when actived-------
$imenu['showsub'] = 0;
//if ( (!empty($xoopsModule)) && (eregi("/".$xoopsModule->getVar('dirname')."/", $link)) ) {
if ( (!empty($xoopsModule)) && (eregi("/".$xoopsModule->getVar('dirname')."/"$link)) || $myrow['submenu'] == 1) {
  
$imenu['showsub'] = 1;
  }


My code - Part 2, just following yours(this part activate sub menus according to the active main menu):
// On teste si on est dans un sous-menu dynamique
if($imenu['submenu'] == 2)
{
    
//On vérifie si le dernier menu principal est l'entête du groupe actif
    
if($currentmainmenu==$opengroupheadermenu)
    {
        
$imenu['showsub'] = 1;
    }
    else
    {
        
$imenu['showsub'] = 0;
    }
}
// On teste si on est dans un menu principal
if($imenu['submenu'] == 0)
{
    
//On stocke les information relative à ce
    
$currentmainmenu $myrow['link'];
}


Sorry for the french comments ;)

In advance, thanks for any advice or tips :)



6
Gizmhail
Re: [MULTIMENU] Test the multiMenu 1.6
  • 2005/2/18 16:27

  • Gizmhail

  • Just popping in

  • Posts: 15

  • Since: 2005/2/15


I'm quite a lazy guy, so I'll not sum up evrything me told in this topic about version 1.5 ;) : I've got a problem to make some sublink appear.

I go on with the discussion here, since my problems remains in version 1.6.

So, concerning your last porposition Solo (ie, moving my "customcontent" directory content in the multiMenu dir, to have a TRUE module in my path), it didn't worked.

I think that the problems resides in my target page content :

<?php
include '../../../mainfile.php';
include(
XOOPS_ROOT_PATH."/header.php");


echo 
"test";

include(
XOOPS_ROOT_PATH."/footer.php");
?>


I guess that nothing here tells Xoops(and so multiMenu) in which module I am...

Do you know how I should edit my page to make XOOPS believe it's a module part? Or any other ideas ?

PS : For my lazy fellows who do not want to read through our previous discussion , I've currently avoid this problem by adding this:
$temppatharray=explode("/",$myrow['link']);
array_pop($temppatharray);
$baselink=implode("/",$temppatharray);
if (
eregi($baselink ,$_SERVER['REQUEST_URI']))
{
  
$imenu['showsub'] = 1;
}

just after that :
//-------------Added for showing submenu when actived-------
$imenu['showsub'] = 0;
//if ( (!empty($xoopsModule)) && (eregi("/".$xoopsModule->getVar('dirname')."/", $link)) ) {
if ( (!empty($xoopsModule)) && (eregi("/".$xoopsModule->getVar('dirname')."/"$link)) || $myrow['submenu'] == 1) {
  
$imenu['showsub'] = 1;
  }


in modules/multiMenu/blocks/block.php.
But I stilll wonder if it's ok; hence my question.




TopTop



Login

Who's Online

56 user(s) are online (35 user(s) are browsing Support Forums)


Members: 0


Guests: 56


more...

Donat-O-Meter

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