Page 1 of 2 12 LastLast
Results 1 to 10 of 58

Thread: Google Sitemap v2.7

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2009
    Location
    Amsterdam
    Posts
    7

    Default

    Different error here:

    The XML page cannot be displayed

    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. The following tags were not closed: urlset. Error processing resource 'http://yourgasm.net/sitemap.php'.

  2. #2

    Default

    This works - save as sitemap.php

    Code:
        <?php
        echo "<?xml version='1.0' encoding='iso-8859-1'?>";
        echo "<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">";
    
        // hostname on which MySQL is (usally localhost)
        $dbhost = "localhost";
        // Database name
        $dbname = "";
        // Username
        $dbuser = "";
        // Password
        $dbpass = "";
    
        // mysql_connect() fnction
        $conn = mysql_connect($dbhost,$dbuser,$dbpass)
        or die("Unable to connect to MySQL.");
    
        // mysql_select_db() function
        mysql_select_db($dbname,$conn)
        or die("Unable to connect to Database $dbname");
    
        $sql = "Select  VID, title, description, adddate, flvdoname, duration from video where approve=1 and active=1";
    
        // execute SQL Command
        $res = mysql_query($sql,$conn)
        or die( "Error: " . mysql_error() );
    
        // Retrieve Results
        while ($info = mysql_fetch_row($res)) {
        $SefUrl=strtolower(preg_replace("/[^a-zA-Z0-9]+/","_", $info[1]));
    
        echo "<url><loc>http://www.site.com/video/".$info[0]."/".$SefUrl."/</loc></url>";
        
        } 
        echo "</urlset>";
    
        // mysql_close() function
        mysql_close($conn);
        ?>

  3. #3
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default

    Can't the db login stuff be eliminated by using the config include?

    require 'include/config.php';

    and instead of this echo "<url><loc>http://www.site.com/video/".$info[0]."/".$SefUrl."/</loc></url>";

    put echo "<url><loc>{$base_url}/video/".$info[0]."/".$SefUrl."/</loc></url>";

    or will that bork the whole thing....Imma go try it.
    If it's not fun, stop doing it!

  4. #4

    Default

    I made it as a stand alone script. But both ways are fine

  5. #5
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default

    Yeah, the inlude works but I think the DB stuff needs to be this:

    $sql = "Select video_id, video_title, video_description, video_add_date, video_flv_name, video_length from videos where video_approve=1 and video_active=1";
    If it's not fun, stop doing it!

  6. #6
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default

    I'm trying to automate this as much as I can so that I can just upload it to all my vshare sites without having to configure each one each time...the only thing I can't get to work is the {$base_url} part. Comes out looking weird

    Code:
    http:///6/using_satchel_and_claymore_in_ctf/http:///etc
    Last edited by grynmoors; 05-16-2009 at 12:37 PM.
    If it's not fun, stop doing it!

  7. #7

    Default

    Quote Originally Posted by grynmoors View Post
    I'm trying to automate this as much as I can so that I can just upload it to all my vshare sites without having to configure each one each time...the only thing I can't get to work is the {$base_url} part. Comes out looking weird

    Code:
    http:///6/using_satchel_and_claymore_in_ctf/http:///etc

    Keep in mind its still xml format even though it has php extension

    Code:
    $config['baseurl']

  8. #8

    Default

    Quote Originally Posted by carefree2 View Post
    I made it as a stand alone script. But both ways are fine
    Yeah, the inlude works but I think the DB stuff needs to be this:

    $sql = "Select video_id, video_title, video_description, video_add_date, video_flv_name, video_length from videos where video_approve=1 and video_active=1";

  9. #9
    Join Date
    Sep 2010
    Posts
    1

    Default

    Quote Originally Posted by grynmoors View Post
    Can't the db login stuff be eliminated by using the config include?

    require 'include/config.php';

    and instead of this echo "<url><loc>http://www.site.com/video/".$info[0]."/".$SefUrl."/</loc></url>";

    put echo "<url><loc>{$base_url}/video/".$info[0]."/".$SefUrl."/</loc></url>";

    or will that bork the whole thing....Imma go try it.
    I made it as a stand alone script. But both ways are fine

  10. #10
    Join Date
    Sep 2010
    Location
    Pokhara Nepal
    Posts
    49

    Default What do i have to do to work?

    Quote Originally Posted by lenco12 View Post
    I made it as a stand alone script. But both ways are fine
    Do i need to edit the codes? or it is working? which file i have to edit now? please make it clear. i am still unable to make it work.
    Nepal's Largest video community portal. share wisely at WWW.CLONEVIDEOS.COM

Page 1 of 2 12 LastLast

Similar Threads

  1. [addon] Google Sitemap Generator
    By RAMMSTEIN in forum Template Modifications
    Replies: 5
    Last Post: 11-07-2008, 04:25 AM
  2. Google Video Sitemap
    By CliftonH in forum Web Site Promotion
    Replies: 6
    Last Post: 08-10-2008, 10:20 PM
  3. Sitemap
    By autodafe in forum Feature Requests
    Replies: 23
    Last Post: 02-29-2008, 12:08 AM
  4. New Google video sitemap !!!
    By chadon in forum Feature Requests
    Replies: 2
    Last Post: 12-21-2007, 06:48 PM
  5. Sitemap Generator for vShare
    By autodafe in forum General Discussions
    Replies: 14
    Last Post: 10-24-2007, 03:50 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •