[ Video Sharing CMS v4 ] Sitemap for 3.6

Started by marketania,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

marketaniaTopic starter

I wonder if u guys knows about this

http://oppageekstyle.com/en/script-sitemap-phpvibe-3-6/

I saw it online few days ago.. Can someone suggest how to implement it ?
  •  

PHPVibe A.

It looks poorly coded. By the looks of it, you edit the database details and you save it as a php file, the upload and access it in browser.

We are releasing a plugin as well for sitemap & video sitemap.

identicalmedia

PLEASE HOW SOON WILL YOU RELEASE NEW PLUGIN ?
  •  

PHPVibe A.

Not very soon, there are other's to be release before it. I think coding will not start sooner than next friday on this one.

marketaniaTopic starter

  •  

arnlweb

#5
I create a sitemap, please follow this link..... for the source code.

http://www.arnlweb.com/sitemap-for-phpvibe/

Thank you.
Web Development Services
  •  

Marius P.

#6
Quote from: arnlweb on
I create a sitemap, please follow this link..... for the source code.

http://www.arnlweb.com/sitemap-for-phpvibe/

Thank you.

Great job, almost!

Here is something I want to add to your strategy.

But first, let me ask you, are you going to submit 1000 links as sitemaps to your google webmaster tools?

No, what you want to do is have an index sitemap.

So, let me pseudo-code it fast for you:
if(!$_get['page']) {
/*We are on the first page */
$count = "Select count of videos in database";
$map = $count/bpp() - 1; /* this is the number of pages/sitemaps */
for( $i=1; $i<$map; $i++ )  {
/* you build a sitemap entry to every sitemap page, clever, right? */
output itemap_$map.xml
}
}



<?xml version="1.0" encoding="UTF-8"?> <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <sitemap>     <loc>http://www.example.com/sitemap1.xml</loc> <lastmod>2012-01-01T11:11:11+00:00</lastmod> </sitemap> <sitemap> <loc>http://www.example.com/sitemap2.xml</loc> <lastmod>2012-01-01T11:11:11+00:00</lastmod> </sitemap> </sitemapindex>
http://www.mugo.ca/Blog/Google-Sitemaps-for-big-sites-splitting-the-sitemap-into-multiple-files
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

ownbond

i am unable to configure sitemap for my site...:(
http://www.mast.pk/sitemap.php
it shows blank page
  •  

ownbond

Quote[08-Oct-2014 16:34:50 Asia/Karachi] PHP Parse error:  syntax error, unexpected ''<','>','"','\")' (T_ENCAPSED_AND_WHITESPACE), expecting ')' in /home/pnfcom/public_html/mast.pk/sitemap.php on line 46

this is the error in log... :(
  •  

Marius P.

Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

ownbond

#10
Complete Code:
<?php
header("Content-Type: text/xml");
print "<?xml version='1.0′ encoding='utf-8'?>";

require_once("load.php");

$pageLimit = 5000;
$base = "http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"];
$siteurl = SITE_URL;
$base = substr($base,0,strrpos($base,"/")+1);
$link = mysql_connect(DB_HOST,DB_USER,DB_PASS);
mysql_select_db(DB_NAME,$link);

if (isset($_GET["page"]))
{
print "<urlset xmlns='http://www.google.com/schemas/sitemap/0.84′ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd'>";
$page = intval($_GET["page"]);
$from = (($page-1)*$pageLimit);
$xmlsitemap = mysql_query("select * from ".DB_PREFIX."videos LIMIT ".$from.",".$pageLimit."");
while($row = mysql_fetch_array($xmlsitemap)){
print "<url>";
print "<loc>".$siteurl."video/".$row['id']."/".nice_url($row['title']).'/'."</loc>";
print "</url>";
}
print "</urlset>";
}
else
{
print "<sitemapindex xmlns='http://www.google.com/schemas/sitemap/0.84′ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/siteindex.xsd'>";
$sql = "SELECT count(*) as count FROM ".DB_PREFIX."videos";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
$pages = ceil($row["count"] / $pageLimit);
for($i=1;$i<=$pages;$i++)
{
print "<sitemap>";
$loc = $base."sitemap.php?page=".$i;
print "<loc>".$siteurl."sitemap_".$i.".xml</loc>";
print "</sitemap>";
}
print "</sitemapindex>";
}
exit();
function xmlentities($text)
{
$search = array('&','<','>','"','\");
$replace = array('&amp;','&lt;','&gt;','&quot;','&apos;');
$text = str_replace($search,$replace,$text);
return $text;
}
?>[/quote]

Line 46:
[quote]$search = array('&','<','>','"','\");
  •  

Marius P.

I guess is because of the copy&paste and should be:

$search = array('&','<','>','"','\'');



this is why is not ok to copy/paste code :)
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

ownbond

  •  

ownbond

Every thing is working fine but showing this error in log:

Quote[08-Oct-2014 17:43:51 Asia/Karachi] PHP Warning:  session_start(): Cannot send session cache limiter - headers already sent (output started at /home/pnfcom/public_html/mast.pk/sitemap.php:3) in /home/pnfcom/public_html/mast.pk/load.php on line 3

http://www.mast.pk/sitemap.php
  •  

Marius P.

use

ob_start();

at the top of the file and


ob_end_flush()



at the bottom.

Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

ownbond

Quote from: @Mario on
use

ob_start();

at the top of the file and


ob_end_flush()


this is correct or not??
Quoteob_end_flush();
at the bottom.
  •  

ownbond

  •  

identicalmedia

  •  

conghandang

I get above code! but received Error: Parse error: syntax error, unexpected '"', expecting ')' in /home/u933587756/public_html/videosidemap.php on line 55

Could You Help Me For My sitemap! 3.6II

Thanks
  •  

krejcis

Hello,
Please guys share functional complete sitemap. This is one of the keyfeature and till now it doesn´t work. I have still error when I will try steps which are described here.
Please who has it functional..share it.
Thanks

Jan
  •  

ownbond

Quote from: identicalmedia on
Please share the code

Create a new file in public_html with name sitemap.php
and paste this code
Dear Here is the Code:

Quote<?php
ob_start();
header("Content-Type: text/xml");
print "<?xml version='1.0' encoding='utf-8'?>";

require_once("load.php");

$pageLimit = 5000;
$base = "http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"];
$siteurl = SITE_URL;
$base = substr($base,0,strrpos($base,"/")+1);
$link = mysql_connect(DB_HOST,DB_USER,DB_PASS);
mysql_select_db(DB_NAME,$link);

if (isset($_GET["page"]))
{
print "<urlset xmlns='http://www.google.com/schemas/sitemap/0.84'; xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'; xsi:schemaLocation='http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd'>";
$page = intval($_GET["page"]);
$from = (($page-1)*$pageLimit);
$xmlsitemap = mysql_query("select * from ".DB_PREFIX."videos LIMIT ".$from.",".$pageLimit."");
while($row = mysql_fetch_array($xmlsitemap)){
print "<url>";
print "<loc>".$siteurl."video/".$row['id']."/".nice_url($row['title']).'/'."</loc>";
print "</url>";
}
print "</urlset>";
}
else
{
print "<sitemapindex xmlns='http://www.google.com/schemas/sitemap/0.84'; xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'; xsi:schemaLocation='http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/siteindex.xsd'>";
$sql = "SELECT count(*) as count FROM ".DB_PREFIX."videos";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
$pages = ceil($row["count"] / $pageLimit);
for($i=1;$i<=$pages;$i++)
{
print "<sitemap>";
$loc = $base."sitemap.php?page=".$i;
print "<loc>".$siteurl."sitemap_".$i.".xml</loc>";
print "</sitemap>";
}
print "</sitemapindex>";
}
exit();
function xmlentities($text)
{
$search = array('&','<','>','"','\'');
$replace = array('&amp;','&lt;','&gt;','&quot;','&apos;');
$text = str_replace($search,$replace,$text);
return $text;
}
ob_end_flush();
?>
  •  

identicalmedia

thanks very much for sharing..

I have Issue

when i view the phpfile i see only two sitemap index  instead of three

<sitemapindex xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/siteindex.xsd"><sitemap><loc>http://www.vevora.com/sitemap_1.xml</loc></sitemap><sitemap><loc>http://www.vevora.com/sitemap_2.xml</loc></sitemap></sitemapindex>


and when i try to view the link : http://www.vevora.com/sitemap_1.xml

i get error 404 page not found
  •  

krejcis

The htacces modification should be :

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /test/
RewriteRule ^embed/([^/]*)/$ /embed.php?id=$1 [L]
RewriteRule ^sitemaps.xml sitemap.php
RewriteRule ^sitemap_(.*).xml?$ sitemap.php?page=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/?$ index.php?rp=$1 [L]

</IfModule>

<ifModule mod_headers.c>
    Header set Access-Control-Allow-Origin: *
</ifModule>


right?

I made these steps and when I open "myweb.com/sitemap_1.xml I have 500 internal server error


any suggestions??

thanks

Jan
  •  

ownbond

#23
Quote from: identicalmedia on
thanks very much for sharing..

I have Issue

when i view the phpfile i see only two sitemap index  instead of three

<sitemapindex xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/siteindex.xsd"><sitemap><loc>http://www.vevora.com/sitemap_1.xml</loc></sitemap><sitemap><loc>http://www.vevora.com/sitemap_2.xml</loc></sitemap></sitemapindex>


and when i try to view the link : http://www.vevora.com/sitemap_1.xml

i get error 404 page not found

First of All the 2 sitemap's are generated automatically against your number of videos,
if your videos are increased than 10,000 then another sitemap will be generated auto. (5000 Links per sitemap)

Second You have to change you .htaccess file data to make sitemap_1.xml accessible (phpvibe root .htaccess)

Quote
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^embed/([^/]*)/$ /embed.php?id=$1 [L]
RewriteRule ^feed(.*)$ feed.php [L]
RewriteRule ^sitemaps.xml sitemap.php
RewriteRule ^sitemap_(.*).xml?$ sitemap.php?page=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/?$ index.php?rp=$1 [L]

</IfModule>
<ifModule mod_headers.c>
    Header set Access-Control-Allow-Origin: *
</ifModule>
  •  

Marius P.

Hi,
Jan what is the actual error in the log? Error 500 is server error but is not very specific, it can trigger on anything.
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

identicalmedia

  •  

krejcis

Hi Mario,
I made change of htaccess which recommended Ownbond and it seems to work fine. I have in sitemap only URL of videos  to my site is ist correct? I thought there should be also tags and description for each video right?
I so...how to modify? But I am happy that sitemap passed on the google webmaster tool.:-)

check it here please:
http://goprotube.com/sitemap_1.xml
.thanks guys...
  •  

krejcis

  •  

Marius P.

Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

tesladisk

Hi to all i use this sitemap code and works really well so far if anyone can make it better beloow is the code
<?php
mysql_connect("localhost", "YOUR DATABASE NAME HERE", "YOUR DATABASE PASS HERE") or
    die("Could not connect: " . mysql_error());
mysql_select_db("vaperstu_vibe");//////////// <  

  $query = mysql_query ( "SELECT  * FROM vibe_videos WHERE pub > 0 ORDER BY `date` DESC" );
  $row = mysql_fetch_assoc ( $query );

 echo '<?xml version="1.0" encoding="utf-8"?>' . "
  ";
  ?>

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <?php
  ############# BEGIN LOOP ############
  do {
  $link = 'http://YOURDOMAIN.com/video/' . $row['id'].'/' .$row['title'].'/';
  $lastmod = $row['date']; 
  $priority = 0.5;
  $changefreq = 'weekly';

  ?>
  <url>
  <loc><?php $input = $link; $patterns = '/ /'; $replacements = '-'; echo preg_replace($patterns, $replacements, $input); ?></loc>
  <lastmod><?php $datetime = new DateTime($lastmod); $result = $datetime->format('Y-m-d\TH:i:sP'); echo $result; ?></lastmod>
  <priority><?=$priority?></priority>
  <changefreq><?=$changefreq?></changefreq>
  </url>
  <?php
  } while ( $row = mysql_fetch_assoc ( $query ) );
  ############# END LOOP ############

  ?>
  </urlset>
  •  

maldboy

not works for mee...
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /home/therap/public_html/sitemap.php on line 7
http://tv-therapy.net/video/// 2014-12-27T16:53:34+00:00 0.5 weekly
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /home/therap/public_html/sitemap.php on line 30
  •  

marketaniaTopic starter

Can this be implemented as an option in 4.0 ? Or is it too buggy for official release ?
  •  

Marius P.

Quote from: marketania on
Can this be implemented as an option in 4.0 ? Or is it too buggy for official release ?

It will come with it's own sitemap suite (html & xml).
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

Similar topics (7)