• 17-07-2024, 00:30:45
    #1
    Elimde böyle bir kod var sitemap için, video sürelerini 14:00 dakika gibi alıyor. Ben bu sürenin hepsini nasıl saniye olarak çevirtebilirim?
    <video:duration></video:duration> Burada 14:00 olarak değilde = 840 olarak görünmesini istiyorum.

    <?php
    $total = db::count('video');
    $maxpage = ceil($total / $vidsay);
    if( !is_numeric($page) || $page < 1 || $page > $maxpage ){
        $page = 1;
    }
        
    header("Content-type: text/xml");
    
    ?>
    <?xml version="1.0" encoding="UTF-8"?>
    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
    xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"><?php
    $videos = db::get('video', null, null, ['order' => 'id ASC', 'limit' => $vidsay, 'page' => $page, 'select' => 'id, slug, resim, baslik, aciklama, tarih, goruntulenme, sure']);
    if( $videos ){
        foreach ($videos as $video) {
    ?>
    <url>
    <loc><?=SITE . '/ytbvideo/' . $video->slug?>/</loc>
    <video:video>
    <video:thumbnail_loc><?=SITE . '/video/' . $video->resim?></video:thumbnail_loc>
    <video:title><![CDATA[<?=$video->baslik?>]]></video:title>
    <video:description><![CDATA[<?=$video->aciklama?>]]></video:description>
    <video:duration></video:duration>
    <video:rating>4.2</video:rating>
    <video:view_count><?=number_format($video->goruntulenme, 0)?></video:view_count>
    <video:publication_date><?=date('Y-m-d\TH:i:sP', strtotime($video->tarih))?></video:publication_date>
    </video:video>
    </url>
    <?php
        }
    }
    ?>
    </urlset>
  • 17-07-2024, 00:35:52
    #2
    cryptox1 adlı üyeden alıntı: mesajı görüntüle
    Elimde böyle bir kod var sitemap için, video sürelerini 14:00 dakika gibi alıyor. Ben bu sürenin hepsini nasıl saniye olarak çevirtebilirim?
    <video:duration></video:duration> Burada 14:00 olarak değilde = 840 olarak görünmesini istiyorum.
    <?php
    $total = db::count('video');
    $maxpage = ceil($total / $vidsay);
    if( !is_numeric($page) || $page < 1 || $page > $maxpage ){
        $page = 1;
    }
        
    header("Content-type: text/xml");
    
    ?>
    <?xml version="1.0" encoding="UTF-8"?>
    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
    xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"><?php
    $videos = db::get('video', null, null, ['order' => 'id ASC', 'limit' => $vidsay, 'page' => $page, 'select' => 'id, slug, resim, baslik, aciklama, tarih, goruntulenme, sure']);
    if( $videos ){
        foreach ($videos as $video) {
    ?>
    <url>
    <loc><?=SITE . '/ytbvideo/' . $video->slug?>/</loc>
    <video:video>
    <video:thumbnail_loc><?=SITE . '/video/' . $video->resim?></video:thumbnail_loc>
    <video:title><![CDATA[<?=$video->baslik?>]]></video:title>
    <video:description><![CDATA[<?=$video->aciklama?>]]></video:description>
    <video:duration><?php
    list($dakika, $saniye) = explode(':', $video->sure);
    $sure = ($dakika * 60) + $saniye;
    echo $sure;
    ?></video:duration>
    <video:rating>4.2</video:rating>
    <video:view_count><?=number_format($video->goruntulenme, 0)?></video:view_count>
    <video:publication_date><?=date('Y-m-d\TH:i:sP', strtotime($video->tarih))?></video:publication_date>
    </video:video>
    </url>
    <?php
        }
    }
    ?>
    </urlset>
  • 17-07-2024, 00:37:18
    #3
    YusufOzcan adlı üyeden alıntı: mesajı görüntüle
    <?php
    $total = db::count('video');
    $maxpage = ceil($total / $vidsay);
    if( !is_numeric($page) || $page < 1 || $page > $maxpage ){
        $page = 1;
    }
        
    header("Content-type: text/xml");
    
    ?>
    <?xml version="1.0" encoding="UTF-8"?>
    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
    xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"><?php
    $videos = db::get('video', null, null, ['order' => 'id ASC', 'limit' => $vidsay, 'page' => $page, 'select' => 'id, slug, resim, baslik, aciklama, tarih, goruntulenme, sure']);
    if( $videos ){
        foreach ($videos as $video) {
    ?>
    <url>
    <loc><?=SITE . '/ytbvideo/' . $video->slug?>/</loc>
    <video:video>
    <video:thumbnail_loc><?=SITE . '/video/' . $video->resim?></video:thumbnail_loc>
    <video:title><![CDATA[<?=$video->baslik?>]]></video:title>
    <video:description><![CDATA[<?=$video->aciklama?>]]></video:description>
    <video:duration><?php
    list($dakika, $saniye) = explode(':', $video->sure);
    $sure = ($dakika * 60) + $saniye;
    echo $sure;
    ?></video:duration>
    <video:rating>4.2</video:rating>
    <video:view_count><?=number_format($video->goruntulenme, 0)?></video:view_count>
    <video:publication_date><?=date('Y-m-d\TH:i:sP', strtotime($video->tarih))?></video:publication_date>
    </video:video>
    </url>
    <?php
        }
    }
    ?>
    </urlset>
    çok teşekkür ederim oldu