Author Topic: Warning message when posting comment with multilang mod  (Read 3747 times)

0 Members and 1 Guest are viewing this topic.

Offline Matthias70

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • Bildergalerie
Warning message when posting comment with multilang mod
« on: December 07, 2005, 06:43:55 PM »
When I post a comment on my site. I have the following warning message

Quote
Warning: preg_match() expects parameter 2 to be string, resource given in /www/htdocs/v030672/bildergalerie/includes/functions.php on line 1437

Warning: preg_match() expects parameter 2 to be string, resource given in /www/htdocs/v030672/bildergalerie/includes/functions.php on line 1441

Warning: preg_match() expects parameter 2 to be string, resource given in /www/htdocs/v030672/bildergalerie/includes/functions.php on line 1445

I think it's a problem with the multilang mod, because the lines in functions.php are part of the multilang mod.
This is the code in functions.php:

Code: [Select]
function multilang($text, $show_first = 0, $remove = 0){
  global $config;
  preg_match("#\[".$config['language_dir']."\](.*)(\[\/?".$config['language_list']."\]|$)#iDUs", $text, $match);
  if (!empty($match[1])) {
    return $match[1];
  }
  preg_match("#^(.*)\[".$config['language_list']."\]#iDUs", $text, $match);
  if (!empty($match[1])) {
    return $match[1];
  }
  preg_match("#\[".$config['language_dir_default']."\](.*)(\[\/?".$config['language_list']."\]|$)#iDUs", $text, $match);
  if (!empty($match[1])) {
    return $match[1];
  }

Do you have any suggestions?
Matthias

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Warning message when posting comment with multilang mod
« Reply #1 on: December 08, 2005, 12:24:12 AM »
Well, nothing wrong with that function, its how you use it.
Apperently u use it somewhere with a wrong "text" variable.
Trace back the changes you've made in details.php (like removing one-by-one multilang() function out of it.) and see where the error messages stops.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Matthias70

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • Bildergalerie
Re: Warning message when posting comment with multilang mod
« Reply #2 on: December 08, 2005, 04:19:42 PM »
Hi V@no,
I found the problem :-)
Code: [Select]
$clickstream .= multilang($image_name)."</span>";
must be
Code: [Select]
$clickstream .= $image_name."</span>";
Thank you V@no
Matthias