1
astronaute
Meta description lame code
  • 2006/9/20 18:35

  • astronaute

  • Just popping in

  • Posts: 12

  • Since: 2006/8/23


Hi all,

If I set a different meta description for each page in some module, depending on page name and such, XOOPS engine reset it and put the default one.

I found this in class/theme.php line (272):

// @internal: Lame fix to ensure the metas specified in the XOOPS config page don't appear twice
$old = array( 'robots''keywords''description''rating''author''copyright' );
foreach ( 
$this->metas['meta'] as $name => $value ) {
    if ( 
in_array$name$old ) ) {
        
$this->template->assign"xoops_meta_$name"htmlspecialchars$valueENT_QUOTES ) );
        unset( 
$this->metas['meta'][$name] );
    }
}


I tried removing "description" from $old array, and it works, BUT there is second META DESCRIPTION generated just below with DEFAULT value.

So in comments it says that its "Lame fix to ensure the metas specified in the XOOPS config page don't appear twice"
They forgot to put that because of this "lame" fix, all pages shows same description ...

Is there a way to fix this to show only one META DESCRIPTION (and keywords), the good one specified in modules ?

Thank you very much for your help.

2
astronaute
Re: Meta description lame code
  • 2006/9/20 21:30

  • astronaute

  • Just popping in

  • Posts: 12

  • Since: 2006/8/23


Ok more news on lame code :)

class/theme.php line 196 :

// Meta tags
        
$config_handler =& xoops_gethandler('config');
        
$criteria = new CriteriaCompo(new Criteria('conf_modid'0));
        
$criteria->add(new Criteria('conf_catid'XOOPS_CONF_METAFOOTER));
        
$config $config_handler->getConfigs($criteriatrue);
        foreach ( 
array_keys($config) as $i ) {
            
$name $config[$i]->getVar'conf_name''n' );
            
$value $config[$i]->getVar'conf_value''n' );
            if ( 
substr$name0) == 'meta_' ) {
                
$this->addMeta'meta'substr$name), $value );
                
//echo "- $name : $value <br />";
            
} else {
                
// prefix each tag with 'xoops_'
                
$this->template->assign"xoops_$name"$value );
            }
        }


This is the code that takes default values for meta tags from DB.

and this line on Lame code overwrite GOOD values :

$this->template->assign"xoops_meta_$name"htmlspecialchars$valueENT_QUOTES ) );



So actually i'm XOOPS beginner but I can't understand such coding errors in such a good CMS as Xoops.

Is there someone who can explain me what to do to debug Meta tags please ?

Is there some kind of bug tracker or such ?

Thank you very much.

Login

Who's Online

273 user(s) are online (194 user(s) are browsing Support Forums)


Members: 0


Guests: 273


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