• [MOD] Google Sitemap for your gallery 5 0 5 1
Currently:  

Author Topic: [MOD] Google Sitemap for your gallery  (Read 279603 times)

0 Members and 1 Guest are viewing this topic.

Offline kandr

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #90 on: January 22, 2009, 04:58:17 PM »
Ясно, понял. Как поступить с категориями? Также?

Code: [Select]
$categories = mysql_query('SELECT cat_id, cat_name FROM ' . $table_prefix . 'categories' WHERE cat_id NOT IN (0,1,2,3)');
Еще возвращаясь к карте сайта, возможно ли там добавить к выводу не только категории, но и все картинки?

PS. У меня категория 0 есть, это мод, который делали на заказ отдельно. Он выводит к основной картинке дополнительные, которые появляются рядом, и дают увеличенный вид вместо основной без перезагрузки страницы. Так вот все эти картинки привязаны к 0 категории и к имени основной картинки. Из за этого яша дал кучу ошибок на на не существующие страницы, и выкинул из поиска....

если вам понадобится этот мод могу вам выслать  :wink:

Offline awall

  • Pre-Newbie
  • Posts: 1
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #91 on: March 28, 2009, 03:05:46 PM »
Need help on google sitemaps,
can't get it work on details page
my url is like this  http://www.arcadewall.net/play_driving_2_gamename_22.html

so would need to change in google.php something to get url like this so I would need to get mysql query from categories and image tables

play_Categoryname_CategoryID_Gamename_GameID.html

but don't know how to get it working

Awall

http://www.arcadewall.net

Offline leblover

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #92 on: April 21, 2009, 02:14:08 PM »
hello there


im having this error from google

Code: [Select]
Sitemap file size error
Your Sitemap exceeds the maximum file size limit. Please create multiple Sitemaps containing fewer URLs to meet the file size limit. Help Help
lebanon is the best
world is !!!!!!

ok world is nice :P

http://www.leblover.com/gallery

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #93 on: April 21, 2009, 06:45:25 PM »
hi leblover,
62000 links is a big deal in one file, btw for you server too...

split you google.php into example
google.php and google2.php
edit mysql queries in google.php to list as example the 1st 20000 entries
and in google2.php the rest of them

add:
Code: [Select]
RewriteRule ^sitemap2.xml$ google2.phpinto .htaccess

tell google to visit the sitemap2.xml

voilla :)
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline didoman

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #94 on: April 27, 2009, 11:02:38 AM »
This works great. Thank you to all the smart people on this forum.
One question...

Currently the only pages being mapped are:
categories.php?cat_id=
details.php?image_id=
member.php?action=showprofile&user_id=

Is it possible to include other pages that are not in the database.
Eg. I have created extra pages like about.html etc... and their hyperlinks are written http://www.example.com/index.php?template=about

Id like these adhoc pages to be mapped also. Is this feasible.
Thanks in advance.
Rob









Offline leblover

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #95 on: April 27, 2009, 11:05:39 AM »
thx alote but how to make that 20000 in the google.php ?


thats my code

i cant find it ?
 pls

 :oops:

Code: [Select]
<?
# Create Google Sitemap for 4images
# Created by Mai Minh (minh@maingo.com http://www.vna2z.com)
# Date: 28/11/2006
# You can send ping to Google with this request: http://www.google.com/webmasters/sitemaps/ping?sitemap=URL_TO_YOUR_SITEMAP
#---------------------------------

require("config.php");

# 4images top page (with trailing slash)
$gallery_url = 'http://www.leblover.com/gallery/';

$link=mysql_connect("$db_host","$db_user","$db_password");
mysql_select_db("$db_name") or die ("Cannot connect database!");

# Priotity
$prio_img = 0.3;
$prio_cat = 0.8;

# Frequency
$freq_img = 'yearly';
$freq_cat = 'daily';

# Print XML header
xml_head();

# Print URLs
$categories = mysql_query('SELECT cat_id FROM ' . $table_prefix . 'categories');
while ($category = mysql_fetch_array($categories))
{
        $catid = $category['cat_id'];
        $cat_url = $gallery_url.'cat'.$catid.'.htm';
        print_xml($cat_url,$prio_cat,'',$freq_cat);
}

$images = mysql_query('SELECT image_id,image_active,image_date FROM ' . $table_prefix . 'images');
while ($image = mysql_fetch_array($images))
{
        if ($image['image_active'] == 1) {
                $imgid = $image['image_id'];
                $date = $image['image_date'];
                $date = date("Y-m-d",$date)."T".date("H:i:s",$date)."+00:00";
                $img_url = $gallery_url.'img'.$imgid.'.htm';
                print_xml($img_url,$prio_img,$date,$freq_img);
        }
}

# Print XML footer
xml_foot();

function xml_head() {
        $freq = 'daily';
        $priority = '1.0';
        $mod = date("Y-m-d")."T".date("H:i:s")."+00:00";
        echo "<?xml version='1.0' encoding='UTF-8'?>
<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\">
<url>
  <loc>http://www.leblover.com/gallery</loc>
  <lastmod>$mod</lastmod>
  <changefreq>$freq</changefreq>
  <priority>$priority</priority>
</url>";
}

#-----------------------------------------------
# xml_foot
#-----------------------------------------------
function xml_foot() {
        echo "
</urlset>";
}

#-----------------------------------------------
# print_xml
#-----------------------------------------------
function print_xml($url,$priority,$lastmod,$changefreq) {
        echo "
<url>
  <loc>$url</loc>
  <priority>$priority</priority>
  <lastmod>$lastmod</lastmod>
  <changefreq>$changefreq</changefreq>
</url>";
}
?>
lebanon is the best
world is !!!!!!

ok world is nice :P

http://www.leblover.com/gallery

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #96 on: April 27, 2009, 11:59:22 PM »
hi,

google.php
Code: [Select]
$images = mysql_query('SELECT image_id,image_name,image_active,image_date FROM ' . $table_prefix . 'images ORDER by image_id ASC limit 0,20000');
google2.php
Code: [Select]
$images = mysql_query('SELECT image_id,image_name,image_active,image_date FROM ' . $table_prefix . 'images ORDER by image_id ASC limit 20000,20000');
in google2.php
remove
Code: [Select]
$categories = mysql_query('SELECT cat_id FROM ' . $table_prefix . 'categories');
while ($category = mysql_fetch_array($categories))
{
        $catid = $category['cat_id'];
        $cat_url = $gallery_url.'cat'.$catid.'.htm';
        print_xml($cat_url,$prio_cat,'',$freq_cat);
}

there is no need to add categories again
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline AntiNSA2

  • Hero Member
  • *****
  • Posts: 774
  • As long as I can finish my site before I die.
    • View Profile
    • http://www.thelifephotography.com
Re: [MOD] Google Sitemap for your gallery
« Reply #97 on: May 15, 2009, 09:40:29 AM »
Greetings...

Ok I have seen the code on the first pages to add to this mod if you are using short URL mod....

And I iknow there are two popular SEO mods here.

I am using the http://www.4homepages.de/forum/index.php?topic=17598.0 [MOD] Google Friendly Urls For 4images Best Seo Mod

Whish is not the short URL mod.

When I install the file of this mod I get this result when going to the google.php file
Code: [Select]
0.3  2008-12-03T00:00:00+00:00  yearly  http://thelifephotography.com/img15.htm 
But I think this is wrong.. shouldnt it list the image and cat names?

And I want them to come daily I guess... The more the better. Is there any bad reason to not want google to come daily?

the Best Seo Mod works great... can you tell me what to do to get these to work together?

And whats the best way to9 get the IPTC keyword data stored in the database indexed by google? Thanks!

As long as I can finish my site before I die.

Offline AntiNSA2

  • Hero Member
  • *****
  • Posts: 774
  • As long as I can finish my site before I die.
    • View Profile
    • http://www.thelifephotography.com
Re: [MOD] Google Sitemap for your gallery
« Reply #98 on: May 15, 2009, 02:42:51 PM »
Ok, with short url mod turned on I am getting results like this:

Code: [Select]
http://thelifephotography.com/img69.htm 0.5 2009-01-17T00:00:00+00:00 daily   http://thelifephotography.com/img70.htm 0.5 2009-01-17T00:00:00+00:00 daily   http://thelifephotography.com/img71.htm 0.5

IS this how it should look? Shouldnt it say the image name in the address instead of  img71.htm ?? Imm am not  sure how to kknow if it is working or not....
As long as I can finish my site before I die.

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #99 on: May 15, 2009, 04:39:18 PM »
hi AntiNSA2,

this is because google.php is using [Mod] Search Engine Friendly URLs aka Short URLs

here are changes which i did for [MOD] Google Friendly Urls For 4images Best Seo Mod

replace

Code: [Select]
# Print URLs
$categories = mysql_query('SELECT cat_id FROM ' . $table_prefix . 'categories');
while ($category = mysql_fetch_array($categories))
{
$catid = $category['cat_id'];
$cat_url = $gallery_url.'cat'.$catid.'.htm';
print_xml($cat_url,$prio_cat,'',$freq_cat);
}

$images = mysql_query('SELECT image_id,image_active,image_date FROM ' . $table_prefix . 'images');
while ($image = mysql_fetch_array($images))
{
if ($image['image_active'] == 1) {
$imgid = $image['image_id'];
$date = $image['image_date'];
$date = date("Y-m-d",$date)."T".date("H:i:s",$date)."+00:00";
$img_url = $gallery_url.'img'.$imgid.'.htm';
print_xml($img_url,$prio_img,$date,$freq_img);
}
}

with

Code: [Select]
# Print URLs
$categories = mysql_query('SELECT cat_id, cat_name FROM ' . $table_prefix . 'categories');
while ($category = mysql_fetch_array($categories))
{
$catid = $category['cat_id'];
$catname = strtr($category['cat_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
if ($shortURL == 1) {
$cat_url = $gallery_url.'cat-'.$catname.'-'.$catid.'.html';
}else {
$cat_url = $gallery_url.'categories.php?cat_id='.$catid;
}

print_xml($cat_url,$prio_cat,$lastmod,$freq_cat);
}

$images = mysql_query('SELECT image_id,image_name,image_active,image_date FROM ' . $table_prefix . 'images');
while ($image = mysql_fetch_array($images))
{
if ($image['image_active'] == 1) {
$imgid = $image['image_id'];
           $imgname = strtr($image['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
$date = $image['image_date'];
$lastmod = date("Y-m-d",$date)."T".date("H:i:s",$date)."+00:00";
if ($shortURL == 1) {
$img_url = $gallery_url.'img-'.$imgname.'-'.$imgid.'.html';
}else{
$img_url = $gallery_url.'details.php?image_id='.$imgid;
}
print_xml($img_url,$prio_img,$lastmod,$freq_img);
}
}


in my original google.php i added more replacement chars
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline AntiNSA2

  • Hero Member
  • *****
  • Posts: 774
  • As long as I can finish my site before I die.
    • View Profile
    • http://www.thelifephotography.com
Re: [MOD] Google Sitemap for your gallery
« Reply #100 on: May 15, 2009, 06:10:18 PM »
Hey Thanks! I think that it is working now... jsut submitted to google will wait to see what happens... il report back to see if there were no errors....

Thanks
As long as I can finish my site before I die.

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #101 on: May 15, 2009, 06:11:44 PM »
you should try it before you are submitting non working urls ;)

eg
Code: [Select]
http://thelifephotography.com/img-the chinese lower class struggle for work daily as global economic crises widens as unemployment increases,and income gap widens-11.html
Code: [Select]
http://thelifephotography.com/cat-news updates-10.html
therefore i wrote that i have more then default replacement chars

cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline AntiNSA2

  • Hero Member
  • *****
  • Posts: 774
  • As long as I can finish my site before I die.
    • View Profile
    • http://www.thelifephotography.com
Re: [MOD] Google Sitemap for your gallery
« Reply #102 on: May 16, 2009, 07:03:42 AM »
I really was trying to avoid submitting it with errors and it seems I am to late....

I am using this google.php
Code: [Select]
<?
# Create Google Sitemap for 4images
# Created by Mai Minh (minh@maingo.com http://www.vna2z.com)
# Modified by Oliver van der Werf (info@flash-webdesign.de http://www.flash-webdesign.de)
# Date: 28/11/2006 | 02.01.2007
# You can send ping to Google with this request: http://www.google.com/webmasters/sitemaps/ping?sitemap=URL_TO_YOUR_SITEMAP
#---------------------------------

require("config.php");

$link=mysql_connect("$db_host","$db_user","$db_password");
mysql_select_db("$db_name") or die ("Cannot connect database!");

# 4images top page (with trailing slash)
$gallery_url = 'http://thelifephotography.com/';

# Priotity
//select between 0.0 and 1.0
//0.0 identifies the lowest priority page(s) on your website
//1.0 identifies the highest priority page(s) on your website
$prio_img = 0.5;
$prio_cat = 0.8;
$prio_profile = 0.3;

# Frequency
//"always", "hourly", "daily", "weekly", "monthly", "yearly" or "never"
$freq_img = 'daily';
$freq_cat = 'daily';
$freq_profile = 'daily';

# Use Short URLs
$shortURL = 1; // 0 or 1

# Print XML header
xml_head();

# Print URLs
$categories = mysql_query('SELECT cat_id, cat_name FROM ' . $table_prefix . 'categories');
while ($category = mysql_fetch_array($categories))
{
$catid = $category['cat_id'];
$catname = strtr($category['cat_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
if ($shortURL == 1) {
$cat_url = $gallery_url.'cat-'.$catname.'-'.$catid.'.html';
}else {
$cat_url = $gallery_url.'categories.php?cat_id='.$catid;
}

print_xml($cat_url,$prio_cat,$lastmod,$freq_cat);
}

$images = mysql_query('SELECT image_id,image_name,image_active,image_date FROM ' . $table_prefix . 'images');
while ($image = mysql_fetch_array($images))
{
if ($image['image_active'] == 1) {
$imgid = $image['image_id'];
           $imgname = strtr($image['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
$date = $image['image_date'];
$lastmod = date("Y-m-d",$date)."T".date("H:i:s",$date)."+00:00";
if ($shortURL == 1) {
$img_url = $gallery_url.'img-'.$imgname.'-'.$imgid.'.html';
}else{
$img_url = $gallery_url.'details.php?image_id='.$imgid;
}
print_xml($img_url,$prio_img,$lastmod,$freq_img);
}
}

$profiles = mysql_query('SELECT user_id, user_lastaction FROM ' . $table_prefix . 'users WHERE user_id >= "1"');
while ($profile = mysql_fetch_array($profiles))
{

$profileid = $profile['user_id'];
$date = $profile['user_lastaction'];
$date = date("Y-m-d",$date)."T".date("H:i:s",$date)."+00:00";
$profile_url = $gallery_url.'member.php?action=showprofile&amp;user_id='.$profileid;
print_xml($profile_url,$prio_profile,$date,$freq_profile);
}

# Print XML footer
xml_foot();

function xml_head() {
$freq = 'daily';
$priority = '1.0';
$mod = date("Y-m-d")."T".date("H:i:s")."+00:00";
echo "<?xml version='1.0' encoding='UTF-8'?>
<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\">";
}

#-----------------------------------------------
# xml_foot
#-----------------------------------------------
function xml_foot() {
echo "
</urlset>";
}

#-----------------------------------------------
# print_xml
#-----------------------------------------------
function print_xml($url,$priority,$lastmod,$changefreq) {
$temp = "<url>
<loc>$url</loc>";
$temp .= "  <priority>$priority</priority>";
if ($lastmod != '') {
$temp .="  <lastmod>$lastmod</lastmod>";
}
$temp .= "  <changefreq>$changefreq</changefreq>
</url>";
echo $temp;
}
?>
I understand I guess that I need to add characters to mine? To tell you the truth I am not wuite sure how the site map should work... should it display an exact url to each image/page?  I am guessing this is so...


Im not sure how to add special characters or even how to add any characters. If you are using the same mod can I  ask you to post your google.php?

Here is the only message I could get from google about the errors
Code: [Select]
83 Parsing error
We were unable to read your Sitemap. It may contain an entry we are unable to recognize. Please validate your Sitemap before resubmitting. Help Help
Problem detected on: May 15, 2009


I noticed some strange characters on my google.php file when viewed @ www.thelifephotography.com/google.php which look like this
Code: [Select]
s�

I am guessing this is also something to do with the characters that need to be added?

 I really am hoping to get a ton of hits from google, as each of my images are so heavily keyworded ... I am struggling to try to sell stock photography ...

Because it indexed the sitemap I have now and reported errors, how long before it re-indexes? I hope it doesnt kill the status of seach listing.
As long as I can finish my site before I die.

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #103 on: May 16, 2009, 08:16:11 AM »
hi,

try to use chars replacement which you are using in includes/sessions.php

my
Code: [Select]
$catname = strtr($category['cat_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
$imgname = strtr($image['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
was only an example.

you have to remove all special chars, which google can't read from your sitemap
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline AntiNSA2

  • Hero Member
  • *****
  • Posts: 774
  • As long as I can finish my site before I die.
    • View Profile
    • http://www.thelifephotography.com
Re: [MOD] Google Sitemap for your gallery
« Reply #104 on: May 16, 2009, 02:58:03 PM »
Code: [Select]
OK Im sorry , I am trying to understand what you mean... I looked in sessions and see this [code]
$row['cat_name'] = strtr($row['cat_name'], "éèêàëâúóíì àáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
and this
Code: [Select]
$row['image_name'] = strtr($row['image_name'], "éèêàëâúóì íáàABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
I have these two characters which I think caused a problem with google
Code: [Select]
àì

So I need to add these to the google site map? I added them to both session and google.php... But I dont underastand  why I see the eeeaea and other repeated letters which are all vowels.. I mean we cant take them out or the english is destroyed.. And google can read them.

I am confused. On my sitemap I am seeing urls like this
Code: [Select]
  http://thelifephotography.com/img-csian boy sitting in front of grandparents house locked out while grandma plays mahjong eanton iuangzhou iuandong csia-194.html

Which is strange... letters are missing and filled with random letters meaning jibberish .. The actual address is this
Code: [Select]
http://thelifephotography.com/img-dsianaboyasittingainafrontaofagrandparentsahousealockedaoutawhileagrandmaaplaysamahjongafantonajuangzhouajuandongadsia-195.htm

Im sorry if I m missing something so obvious... I am trying to figure out this is a really important mod ...... If you can  offer any more help I really appreciate it.

Thanks
Robert                                                                                         

[/code]
As long as I can finish my site before I die.