1
Dannomite82
Re: Fatal Error: call to a member function and undefined variable in Smart Media
  • 2011/3/30 17:20

  • Dannomite82

  • Just popping in

  • Posts: 2

  • Since: 2010/10/22


A few years later, but in case someone else is still troubleshooting this:

Adding
Quote:
global $smartmedia_clip_handler

above the line in question, fixes the error, but it's still broken. Basically, your version of php wasn't seeing $smartmedia_clip_handler as defined for whatever reason.

Upon getting my hands dirty, I also found out that the function in question is incomplete. It never returns a value.

Adding

Quote:
$result = $this->_db->query($sql);
while ($myrow = $this->_db->fetchArray($result)) {
$ret[] = $myrow;
}
return $ret;


to

Quote:
function &getClipsFromAdmin($start=0, $limit=0, $sort='clipid', $order='ASC', $languagesel) in smartmedia/classes/clip.php

should fix it.



2
Dannomite82
Re: xlanguage in xoops 2.4
  • 2010/10/22 13:48

  • Dannomite82

  • Just popping in

  • Posts: 2

  • Since: 2010/10/22


My problem thus far is in getting the module to recognize the language variable in the URL that the block generates. It always defaults to the system language. (I did a few echo tests to confirm this)

Running in debug mode and haven't noticed anything out of the ordinary. As for the version of PHP, pretty sure it's 4.

Any thoughts on this?

On a related note, how exactly is the language variable (say www.mysite.com/modules/mycontentmod/index.php?lang=french) passed to the module?

EDIT: I should note that I'm using the newest version of Xoops and the 3.11 version of the module.

EDIT 2: It appears as though the variable $xoopsconfig["language"] is being used to determine which language is used, and that the variable is stuck on the default system language regardless of the value of index.php?lang=yourlanghere.

EDIT 3: Problem solved.

In the functions.php file's xlanguage_ml function, I added:
include_once(XOOPS_ROOT_PATH.'/modules/xlanguage/include/vars.php');
$myLang $xlanguage["lang"];


and replaced

if(isset($xlanguage_langs[$xoopsConfig['language']])) {
        
$lang $xlanguage_langs[$xoopsConfig['language']];
        
$patterns[] = '/([([^]]*|)?'.preg_quote($lang).'(|[^]]*)?])('.$mid_pattern.')([/([^]]*|)?'.preg_quote($lang).'(|[^]]*)?])/isU';
        
$replaces[] = '$4';
}


with
if(isset($xlanguage_langs[$myLang])) {
        
$lang $xlanguage_langs[$myLang];
        
$patterns[] = '/([([^]]*|)?'.preg_quote($lang).'(|[^]]*)?])('.$mid_pattern.')([/([^]]*|)?'.preg_quote($lang).'(|[^]]*)?])/isU';
        
$replaces[] = '$4';
}




TopTop



Login

Who's Online

248 user(s) are online (149 user(s) are browsing Support Forums)


Members: 0


Guests: 248


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