What i made wrong
http://www.animaxtube.com/sitemap.php
Printable View
What i made wrong
http://www.animaxtube.com/sitemap.php
This one worked for me on 2.7 don't remember whos it is but it works fine google visits every day :rolleyes:
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 = "your database";
// Username
$dbuser = "Database username";
// Password
$dbpass = "Database password";
// 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 video_id, video_title, video_description, video_add_date, video_flv_name, video_length from videos where video_approve=1 and video_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.viewmyvids.com/video/".$info[0]."/".$SefUrl."/</loc></url>";
}
echo "</urlset>";
// mysql_close() function
mysql_close($conn);
?>
Updated and working 100%
http://forums.buyscripts.in/vshare-m...ap-v2-7-a.html
This code works perfect on v2.7 I had to do a small modification to this code because I have a SEO hack to make my video links to end on (.html) this makes google like you a bit more.
Original
To thisCode:echo "
<url>
<loc>$url/view/".$info[0]."/".$SefUrl."/</loc>";
echo "
You can see it working here http://videos.colombiascortvip.com:81/googlesitemap.phpCode:echo "
<url>
<loc>$url/view/".$info[0]."/".$SefUrl.".html</loc>";
echo "
http://videos.colombiascortvip.com:81
Thank you all!
Now its working good.
Thanks so much 4 sharing with us,bros
Thanks for the map, works nice. Should be nice also to include thumbnail infos to have miniatures included in searches results.. ;)
"Just copy this code and save it as sitemap.php at you vshare files."
What does, "You vshare files" mean? It is, of course, simply a flaw within your English here but unfortunately it does not specify enough where it should go. Does it need to be put in public_html, or does it need placement within public_html/templates, etc.
Thanks for the clarification.
put it in the same directory as your index.php
I am currently getting the following message after creating the sitemap.php file and placing it within my public_html folder (with the index.php).
This XML file does not appear to have any style information associated with it. The document tree is shown below.
This message is then followed by the code within the file. Is this normal? If so, no problems here, but it seems a bit fishy.
Thanks for the sitemap anywho, and the answers of course.
--
Cheers,