• 15-09-2015, 12:20:57
    #1
    Herkese kolay gelsin arkadaşlar.

    Wordpress sitemizde daha önce eklenmiş videolar hep;

    [youtube]OTgEoiFNFGo[/youtube]

    https://www.youtube.com/watch?v=
    OTgEoiFNFGo

    [vimeo]67195812[/vimeo]

    https://vimeo.com/
    67195812

    şeklinde eklenmiş. Bu videolar da şu an çalışmıyor. Birçok konu olduğu için de hepsini tek tek değiştirmek vakit alacak. Bu kodları çalıştırabileceğim bir kod varmıdır temaya ekleyebileceğim? Veya bir eklenti felan?

    Araştırdım ama bulamadım. Yardımcı olabilirseniz sevinirim. İyi forumlar.
  • 16-09-2015, 00:38:50
    #2
    yenden ekleyeceksen youtube deki kodu yazınca oto ekleniyo vereyimmi
  • 16-09-2015, 01:30:41
    #3
    function blogizma_youtube($atts) {
    	extract(shortcode_atts(array(
    		"izle" => 'http://',
    		"width" => '610',
    		"height" => '343',
    	), $atts));
    	return '
    <object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" height="'.$height.'" width="'.$width.'">
    <param name="allowFullScreen" value="true">
    <param name="allowscriptaccess" value="always">
    <param name="src" value="http://www.youtube.com/v/'.$izle.'?version=3&amp;hl=en_US">
    <param name="allowfullscreen" value="true">
    <embed type="application/x-shockwave-flash" src="http://www.youtube.com/v/'.$izle.'?version=3&amp;hl=en_US" allowfullscreen="true" allowscriptaccess="always" height="'.$height.'" width="'.$width.'">
    </object>
    ';
    }
    add_shortcode("youtube", "blogizma_youtube");
    
    function blogizma_vimeo($atts) { extract(shortcode_atts(array( "izle" => 'http://', "width" => '610', "height" => '343',), $atts));
    return '<iframe src="http://player.vimeo.com/video/'.$izle.'" height="'.$height.'" width="'.$width.'" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
    } add_shortcode("vimeo", "blogizma_vimeo");
    fonksiyon dosyanıza ekleyerek shortcode yapısını tekrar çalışır hale getirebilirsiniz.
  • 17-09-2015, 21:46:23
    #4
    Blogizma adlı üyeden alıntı: mesajı görüntüle
    function blogizma_youtube($atts) {
    	extract(shortcode_atts(array(
    		"izle" => 'http://',
    		"width" => '610',
    		"height" => '343',
    	), $atts));
    	return '
    <object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" height="'.$height.'" width="'.$width.'">
    <param name="allowFullScreen" value="true">
    <param name="allowscriptaccess" value="always">
    <param name="src" value="http://www.youtube.com/v/'.$izle.'?version=3&amp;hl=en_US">
    <param name="allowfullscreen" value="true">
    <embed type="application/x-shockwave-flash" src="http://www.youtube.com/v/'.$izle.'?version=3&amp;hl=en_US" allowfullscreen="true" allowscriptaccess="always" height="'.$height.'" width="'.$width.'">
    </object>
    ';
    }
    add_shortcode("youtube", "blogizma_youtube");
    
    function blogizma_vimeo($atts) { extract(shortcode_atts(array( "izle" => 'http://', "width" => '610', "height" => '343',), $atts));
    return '<iframe src="http://player.vimeo.com/video/'.$izle.'" height="'.$height.'" width="'.$width.'" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
    } add_shortcode("vimeo", "blogizma_vimeo");
    fonksiyon dosyanıza ekleyerek shortcode yapısını tekrar çalışır hale getirebilirsiniz.
    Hocam maalesef hata verdi.

    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/matvegeo/public_html/wp-content/themes/delivery-lite/functions.php on line 220
  • 22-09-2015, 08:11:26
    #5
    Fonksiyon dosyanızı eklerseniz, kodlarda bir hata var gibi.
  • 22-09-2015, 10:39:23
    #6
    Veritabanı yedeğini alıp aşağıdaki kodu phpmyadmin üzerinden çalıştırabilirsiniz.

    Bu kod wp_posts tablosunda bulunan yazıların içindeki [youtube] ve [vimeo] şeklinde yazılmış kodları değiştirecektir. O yüzden mutlaka veritabanı yedeğini alın ki ters bir durumda geri dönüş şansınız olsun. Sorumluluk tamamen size aittir.

    Eğer phpmyadmin den yedek alma-geri yükleme konularında yeterli bilgiye sahip değilseniz bu kodu denemeyin, fonksiyon dosyasını paylaşın onun üzerinden shortcode kısmını çözmeye çalışalım.

    UPDATE wp_posts SET post_content = replace(post_content, '[youtube]', 'https://www.youtube.com/watch?v=');
    UPDATE wp_posts SET post_content = replace(post_content, '[/youtube]', '');
    
    UPDATE wp_posts SET post_content = replace(post_content, '[vimeo]', 'https://vimeo.com/');
    UPDATE wp_posts SET post_content = replace(post_content, '[/vimeo]', '');