Go Back   BuyScripts Forums > vShare YouTube Clone > vShare Modifications

Reply
 
LinkBack Thread Tools Display Modes
  #31 (permalink)  
Old 06-10-2009, 11:33 AM
Junior Member
 
Join Date: May 2009
Posts: 9
Default wrong?

What i made wrong
http://www.animaxtube.com/sitemap.php
Reply With Quote
  #32 (permalink)  
Old 06-25-2009, 04:06 PM
Member
 
Join Date: Apr 2009
Posts: 30
Default This is the one that worked for me

Quote:
Originally Posted by grynmoors View Post
Oh good! I couldn't get carefree's code to work with 2.7 so I took RAMMSTEINS code, which looks like this and it works for me in 2.7:

Code:
<?php
header("content-type:text/xml;charset=utf-8");

require 'include/config.php';
$url = VSHARE_URL;

echo "<?xml version='1.0' encoding='iso-8859-1'?>";
echo "<urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9' xmlns:video='http://www.google.com/schemas/sitemap-video/1.0'>";

# channels
$sql = "SELECT channel_id, channel_name FROM `channels`
                ORDER BY `channel_sort_order` ASC";
$res = mysql_query($sql,$conn)
or die( "Error: " . mysql_error() );
while ($info = mysql_fetch_row($res)) {
srand ((double) microtime( )*1000000);
$random_number = rand(6,7);
$SefUrl=strtolower(preg_replace("/[^a-zA-Z0-9]+/","_", $info[1]));

echo "<url><loc>$url/channel/".$info[0]."/".$info[1]."/</loc>";
echo "<changefreq>monthly</changefreq>";
echo "<priority>0.$random_number</priority>";
echo "</url>";
}

# videos
$sql = "SELECT video_id, video_title, video_add_date FROM `videos` WHERE
           `video_active`='1' AND
           `video_approve`='1' AND
           `video_type`='public'
            ORDER BY `video_id` DESC";
$res = mysql_query($sql,$conn)
or die( "Error: " . mysql_error() );
while ($info = mysql_fetch_row($res)) {
srand ((double) microtime( )*1000000);
$random_number = rand(4,6);
$SefUrl=strtolower(preg_replace("/[^a-zA-Z0-9]+/","-", $info[1]));

echo "<url><loc>$url/view/".$info[0]."/".$SefUrl."/</loc>";
echo "<lastmod>".$info[2]."</lastmod><changefreq>monthly</changefreq>";
echo "<priority>0.$random_number</priority>";
echo "</url>";
}

# tags
$sql = "SELECT tag FROM `tags` WHERE
           `active`='1' AND
           `tag_count` > 0
            ORDER BY `tag_count` DESC";

$res = mysql_query($sql,$conn)
or die( "Error: " . mysql_error() );
while ($info = mysql_fetch_row($res)) {
srand ((double) microtime( )*1000000);
$random_number = rand(1,4);
$SefUrl=strtolower(preg_replace("/[^a-zA-Z0-9]+/","_", $info[1]));

echo "<url><loc>$url/tag/".$info[0]."/</loc>";
echo "<changefreq>monthly</changefreq>";
echo "<priority>0.$random_number</priority>";
echo "</url>";
}

mysql_close($conn);

echo "</urlset>";
?>
The only thing I had to do to my site was remove the ampersand (&) from my channel titles in vShare which caused the same problem as it did with 2.6. I'm weeding thru this to see what I did last time to fix it, but for now I just took that out of my channel titles in vShare admin panel.


This one worked for me on 2.7 don't remember whos it is but it works fine google visits every day



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);
    
?>
Reply With Quote
  #33 (permalink)  
Old 06-26-2009, 03:57 PM
Senior Member
 
Join Date: Feb 2008
Location: Greece
Posts: 242
Default

Updated and working 100%
Google Sitemap v2.7
Reply With Quote
  #34 (permalink)  
Old 06-27-2009, 03:50 PM
Junior Member
 
Join Date: Jun 2009
Posts: 3
Lightbulb

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
Code:
echo "
<url>
<loc>$url/view/".$info[0]."/".$SefUrl."/</loc>";
echo "
To this
Code:
echo "
<url>
<loc>$url/view/".$info[0]."/".$SefUrl.".html</loc>";
echo "
You can see it working here http://videos.colombiascortvip.com:81/googlesitemap.php



http://videos.colombiascortvip.com:81
Reply With Quote
  #35 (permalink)  
Old 06-29-2009, 06:07 AM
Junior Member
 
Join Date: May 2009
Posts: 9
Default Thanxks to all

Thank you all!
Now its working good.
Reply With Quote
  #36 (permalink)  
Old 09-23-2009, 07:17 AM
Junior Member
 
Join Date: Sep 2009
Posts: 1
Default

Thanks so much 4 sharing with us,bros
Reply With Quote
  #37 (permalink)  
Old 10-14-2009, 10:37 PM
Senior Member
 
Join Date: Jan 2008
Posts: 188
Default

Thanks for the map, works nice. Should be nice also to include thumbnail infos to have miniatures included in searches results..
Reply With Quote
  #38 (permalink)  
Old 11-03-2009, 12:04 AM
Member
 
Join Date: Oct 2009
Posts: 39
Default

"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.

Last edited by Blain; 11-03-2009 at 12:22 AM.
Reply With Quote
  #39 (permalink)  
Old 11-03-2009, 12:53 AM
Senior Member
 
Join Date: May 2007
Location: Planet Earth
Posts: 1,445
Default

put it in the same directory as your index.php
__________________
Please use the search feature before asking questions, many have been answered.
Please do not PM me. Ask in the forums so that everyone may benefit! Thx!

SCAVideos.com DF2Videos.com Rigidheddleweaving.com/videos
Reply With Quote
  #40 (permalink)  
Old 11-04-2009, 01:34 AM
Member
 
Join Date: Oct 2009
Posts: 39
Default

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,
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[addon] Google Sitemap Generator RAMMSTEIN Template Modifications 5 11-07-2008 03:25 AM
Google Video Sitemap CliftonH Web Site Promotion 6 08-10-2008 10:20 PM
Sitemap autodafe Feature Requests 23 02-28-2008 11:08 PM
New Google video sitemap !!! chadon Feature Requests 2 12-21-2007 05:48 PM
Sitemap Generator for vShare autodafe General Discussions 14 10-24-2007 03:50 PM


All times are GMT. The time now is 02:10 PM.


Powered by vBulletin. Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO