• 21-11-2012, 14:00:25
    #1
    Üyeliği durduruldu
    Arkadaşlar kullandığım script php 4x destekli olduğu için host değişiminden sonra bir hata aldım 2 gündür uğraşıyorum bir türlü çözüm bulamadım

    Hata : Warning: Invalid argument supplied for foreach() in /home/bilginc/public_html/system/functions.php on line 302


    Kodlar :

    Alıntı
    foreach($bbcodes_img as $bbcode => $bbcodehtml)
    { $text = preg_replace($bbcode, $bbcodehtml, $text); }

    if ($cfg['parser_vid'])
    {
    $bbcodes = array(
    '\\[youtube\\]([^\\([]*)\\[/youtube\\]' => '<object width="400" height="329"><param name="movie" value="http://www.youtube.com/v/\\1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/\\1" type="application/x-shockwave-flash" wmode="transparent" width="400" height="329"></embed></object>',
    '\\[yahoo\\]([^\\([]*)\\[/yahoo\\]' => '
    <object width="512" height="323"><param name="movie" value="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.4" /><param name="allowFullScreen" value="true" /><param name="flashVars" value="id=\\1"/>
    <embed src="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.4" type="application/x-shockwave-flash" width="512" height="323" allowFullScreen="true" flashVars="id=\\1"></embed></object>',

    '\\[google\\]([^\\([]*)\\[/google\\]' => '<object width="400" height="329"><param name="movie" value="http://video.google.com/googleplayer.swf?docId=\1"></param><param name="wmode" value="transparent"></param><embed src="http://video.google.com/googleplayer.swf?docId=\\1" type="application/x-shockwave-flash" wmode="transparent" width="400" height="329"></embed></object>',
    '\\[metacafe=([^\\[]*)\\]' => '<embed style="width:425px; height:345px;" src="http://www.metacafe.com/fplayer/\\1" width="400" height="345" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>');

    foreach($sed_parser[1] as $bbcode => $bbcodehtml)
    { $text = preg_replace($bbcode, $bbcodehtml, $text); }
    }

    $bbcodes = array(
    '\\[colleft\\]([^\\[]*)\\[/colleft\\]' => '<div class="colleft">\\1</div>',
    '\\[colright\\]([^\\[]*)\\[/colright\\]' => '<div class="colright">\\1</div>',
    '\\[center\\]([^\\[]*)\\[/center\\]' => '<div style="text-align:center;">\\1</div>',
    '\\[right\\]([^\\[]*)\\[/right\\]' => '<div style="text-align:right;">\\1</div>',
    '\\[left\\]([^\\[]*)\\[/left\\]' => '<div style="text-align:left;">\\1</div>',
    '\\[c1\\[^\\[]*)\\]([^\\[]*)\\[c2\\[^\\[]*)\\]([^\\[]*)\\[c3\\]' => '<table style="margin:0; vertical-align:top; width:100%;"><tr><td style="padding:8px; vertical-align:top; width:\\1%;">\\2</td><td style="padding:8px; vertical-align:top; width:\\3%;">\\4</td></tr></table>'
    );

    foreach($sed_parser[1] as $bbcode => $bbcodehtml)
    { $text = preg_replace($bbcode, $bbcodehtml, $text); }

    return(substr($text,1));
    }
  • 21-11-2012, 14:50:42
    #2
    $bbcodes_img tanımlı değil. eğer görünen kadarsa fonksiyon

    foreach($bbcodes_img

    olan bölümü tanımlı olan değişken $bbcodes ile yani;

    foreach($bbcodes olarak değiştirirseniz düzeleceğini tahmin ediyorum.
  • 21-11-2012, 15:05:22
    #3
    Üyeliği durduruldu
    hocam o zamanda şöyle bir hata alıyorum

    Warning: preg_replace() [function.preg-replace]: Delimiter must not be alphanumeric or backslash in
  • 21-11-2012, 15:15:42
    #4
    preg_replace'den daha önce ereg_replace mi kullanılmıştı? ifadeler fonksiyonla uyumlu görünmüyor
  • 21-11-2012, 15:19:25
    #5
    Üyeliği durduruldu
    miscel adlı üyeden alıntı: mesajı görüntüle
    preg_replace'den daha önce ereg_replace mi kullanılmıştı? ifadeler fonksiyonla uyumlu görünmüyor
    evet hocam daha önce ereg kullanıyordum şuan preg kullanıyorum
  • 21-11-2012, 15:34:33
    #6
    ifadeler fonksiyona göre değişmeli, o zaman doğru sonucu verir. bu ifadeler eski fonksiyonunuz için geçerli. Ama eski fonksiyonla kullanmayı istiyorsanız
    mb_ereg_replace ya da mb_eregi_replace fonksiyonlarını kullanabilirsiniz.
  • 21-11-2012, 15:40:43
    #7
    Üyeliği durduruldu
    hocam epeybi hata vardı neredeyse hepsini giderdim şuan

    Warning: Invalid argument supplied for foreach() in /home/bilginc/public_html/system/functions.php on line 201

    Warning: Invalid argument supplied for foreach() in /home/bilginc/public_html/system/functions.php on line 193

    bu hata satırları ise

    /* ------------------ */
    
    function sed_bbcode($text)
    	{
    	global $L, $skin, $sys, $cfg, $sed_groups, $sed_parser;
    
    	$text = sed_bbcode_autourls($text);
    	$text = " ".$text;
    
    	foreach($sed_parser[0] as $bbcode => $bbcodehtml)
    		{
    		if (!empty($bbcodehtml['bb1']))
    			{ $text = str_replace($bbcodehtml['bb1'], $bbcodehtml['code1'], $text); }
    		if (!empty($bbcodehtml['bb2']))
    			{ $text = str_replace($bbcodehtml['bb2'], $bbcodehtml['code2'], $text); }
    		}
    
    	foreach($sed_parser[1] as $bbcode => $bbcodehtml)
    		{
    		if (!empty($bbcodehtml['bb1']))
    			{ $text = preg_replace($bbcodehtml['bb1'], $bbcodehtml['code1'], $text); }
    		if (!empty($bbcodehtml['bb2']))
    			{ $text = preg_replace($bbcodehtml['bb2'], $bbcodehtml['code2'], $text); }
    		}
    
    	return(substr($text,1));
    	}
    
    /* ------------------ */

    bir tek bu kaldı tekrar teşekkürler