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

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

0 Members and 1 Guest are viewing this topic.

Offline rodier

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #75 on: April 23, 2008, 04:29:41 AM »
I'm having a problem

My root folder of 4 images is http://www.estampafotos.com/galeria/

The sitemap is generated in http://www.estampafotos.com/sitemap.xml

When i open the sitemap in browser shows this error

Code: [Select]
Warning: require(config.php) [function.require]: failed to open stream: No such file or directory in /home2/estampaf/public_html/google.php on line 9

Warning: require(config.php) [function.require]: failed to open stream: No such file or directory in /home2/estampaf/public_html/google.php on line 9

Fatal error: require() [function.require]: Failed opening required 'config.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/home2/estampaf/php') in /home2/estampaf/public_html/google.php on line 9

How can i fix this?

Thanks!!!!

you need put google.php to root  where is config.php (it seems config.php missing)  or try set better attributres to config.php (set it to 777)

Offline KurtW

  • 4images Guru
  • *******
  • Posts: 2.778
    • View Profile
    • Malediven-Bilder ~~Dreams~~
Re: [MOD] Google Sitemap for your gallery
« Reply #76 on: April 23, 2008, 06:01:48 AM »
I'm having a problem

My root folder of 4 images is http://www.estampafotos.com/galeria/

The sitemap is generated in http://www.estampafotos.com/sitemap.xml

Thanks!!!!

Hi,

The 4images Copyright is not available.
I assume that you have been licensed.

http://www.4homepages.de/4images/license.php#english


KurtW

Offline fbmd

  • Pre-Newbie
  • Posts: 3
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #77 on: June 17, 2008, 03:46:52 AM »
I adapted for those who use the [Mod] Search Engine Friendly URLs aka Short URLs.
I hope it will be useful for someone.

Offline praveen100

  • Pre-Newbie
  • Posts: 1
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #78 on: September 15, 2008, 02:56:08 PM »
Thanks but I have more than 50000 URL  :roll:
so I got this error on Google Sitemape
Quote
Your Sitemap contains too many URLs. Please create multiple Sitemaps with up to 50000 URLs each and submit all Sitemaps

any fix for this 50000 url limit. i too facing the same issue now :(

Offline picturexone

  • Pre-Newbie
  • Posts: 1
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #79 on: October 24, 2008, 06:17:19 PM »
Dear sir it is Argent that i using your given site map detail everything is fine but site map is showing the url like that

http://www.picturexone.com/cat4.htm

but my actually link is like that: http://picturexone.com/img-lamberti-car-2-7.htm
how can i change my site map like that please dear do it please please

Offline om6acw

  • Full Member
  • ***
  • Posts: 187
    • View Profile
    • My Animal's World
Re: [MOD] Google Sitemap for your gallery
« Reply #80 on: January 01, 2009, 07:18:01 PM »
So I did some changes in google.php and right now I have "almost" properly formatted links in sitemap.xml
but still I cant figure out how to replace empty space in names with "-"
Right now my links in sitemap looks like this:

Quote
http://www.myanimalsworld.com/img-wedge pond-17.htm

but working link should be like this with missing - between words

Quote
http://www.myanimalsworld.com/img-wedge-pond-17.htm

here is my 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://www.myanimalsworld.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 WHERE auth_viewimage = 0');
while ($category = mysql_fetch_array($categories))
{
$catid = $category['cat_id'];
$cat_name = $category['cat_name'] = strtr($category['cat_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
if ($shortURL == 1) {
$cat_url = $gallery_url.'cat-'.$cat_name.'-'.$catid.'.htm';
}else {
$cat_url = $gallery_url.'categories.php?cat_id='.$catid;
}

print_xml($cat_url,$prio_cat,'',$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'];
$imgna = $image['image_name'] = strtr($image['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");
$date = $image['image_date'];
$date = date("Y-m-d",$date)."T".date("H:i:s",$date)."+00:00";
if ($shortURL == 1) {
$img_url = $gallery_url.'img-'.$imgna.'-'.$imgid.'.htm';
}else{
$img_url = $gallery_url.'details.php?image_id='.$imgid;
}
print_xml($img_url,$prio_img,$date,$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;
}
?>

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Google Sitemap for your gallery
« Reply #81 on: January 01, 2009, 08:12:02 PM »
below
Code: [Select]
$imgna = $image['image_name'] = strtr($image['image_name'], "éèêàëâúóíáABCDEFGHIJKLMNOPQRSTUVWXYZ","eeeaeauoiaabcdefghijklmnopqrstuvwxyz");

Insert:
Code: [Select]
$imgna = str_replace(array(" ", "-"), array("_", "_"), $imgna); ### " - " used as a string separator in URL, it might break the link if image name has such character
$imgna = urlencode($imgna); ### make sure any other non-latin letters or special characters converted to a proper url string
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline om6acw

  • Full Member
  • ***
  • Posts: 187
    • View Profile
    • My Animal's World
Re: [MOD] Google Sitemap for your gallery
« Reply #82 on: January 01, 2009, 08:47:28 PM »
Thanks V@no this help me a lot!!!! I have actually one more question, some of my photo names are in this format
Quote
Ovis Canadensis (Bighorn sheep)
in my links they are shown like 
Quote
ovis_canadensis_(bighorn_sheep)
what kind of characters are safe for using in links because I think I have to change this () to something else. Maybe for _ but I am not sure if you can have two of them in line like this __

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Google Sitemap for your gallery
« Reply #83 on: January 01, 2009, 09:43:24 PM »
urlencode() function would convert anything that is not safe for links to link-safe format, so if () are not converted, then they are safe. Do you have problems with such links?


(warning: foul language)


P.S.
You can have as many _ in a link as a link length standard limit is.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline om6acw

  • Full Member
  • ***
  • Posts: 187
    • View Profile
    • My Animal's World
Re: [MOD] Google Sitemap for your gallery
« Reply #84 on: January 01, 2009, 09:48:39 PM »
urlencode() function would convert anything that is not safe for links to link-safe format, so if () are not converted, then they are safe. Do you have problems with such links?


(warning: foul language)

I don't have any problem with this kind of links but I was asking because I wasn't sure if this characters are safe or not. Thanks for you help and time.

Offline mike30

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #85 on: January 02, 2009, 12:21:29 AM »
Thanks for this mod!

Offline kandr

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #86 on: January 22, 2009, 03:46:15 PM »
Кто нибудь может помочь мне?? Как исправить google.php, чтоб картинки не брались из категории 0?

PLEASE!!! :cry:

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Google Sitemap for your gallery
« Reply #87 on: January 22, 2009, 04:15:22 PM »
Code: [Select]
$images = mysql_query('SELECT image_id,image_active,image_date FROM ' . $table_prefix . 'images WHERE cat_id NOT IN (0,1,2,3)');
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline kandr

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #88 on: January 22, 2009, 04:42:39 PM »
что значит NOT IN (0,1,2,3)');?

Мне нужно не брать из категорий 0 и 7, а брать из 1,2,3,4,5,6.

ps V@no, СПАСИБО! Thanx, +1  :)

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Google Sitemap for your gallery
« Reply #89 on: January 22, 2009, 04:47:27 PM »
это был пример. меняете числа на ID категорий, которые хотите исключить из списка. (1,7) = исключить две категории: категорию с ID 7 и с ID 1

P.S.
в 4images не возможно иметь категорию с ID 0
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)