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

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

0 Members and 2 Guests are viewing this topic.

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #150 on: June 15, 2010, 06:54:39 PM »
пошаљи ми твој логин за FTP и за WMT преко приватне поруке погледаћу вечерас.. тј. најкасније сутра пре подне.
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 Nosferatu

  • Full Member
  • ***
  • Posts: 230
    • View Profile
    • Project-Firepower
Re: [MOD] Google Sitemap for your gallery
« Reply #151 on: July 16, 2010, 05:08:11 PM »
Hi@all

ich habe ein problem.

ich habe die google.php raufgeladen. und .htaccess datei erstellt

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.pj-firepower.com/picgallerie/';

# 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 = 'yearly';
$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 FROM ' . $table_prefix . 'categories');
while ($category = mysql_fetch_array($categories))
{
$catid = $category['cat_id'];
if ($shortURL == 1) {
$cat_url = $gallery_url.'cat'.$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_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";
if ($shortURL == 1) {
$img_url = $gallery_url.'img'.$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;
}
?>

so folgendes probleme:
1) auf der google.php , http://www.pj-firepower.com/picgallerie/google.php

werden short urls angezeigt wie ich es auch wollte
http://www.pj-firepower.com/picgallerie/cat1.htm

nur diese links funktionieren nicht..... wenn ich einen der links verwende kommt

Die Webseite wurde nicht gefunden.

Jetzt muss ich dadurch short urls ausschalten, aber ich hätte es gerne an nur warum funktionieren diese links dann nicht .... ist doch sinlos die links zb cat1 zu benommen, und diese kommen dann in google und dann funken die gar nicht :(

kann mir bitte jemand helfen.

vielen Dank

mfg
Nosferatu

Offline alekseyn1

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • My Project
Re: [MOD] Google Sitemap for your gallery
« Reply #152 on: October 24, 2010, 06:32:05 PM »
For all the Russian users out there - here is the google.php that works on my site

it transliterates the categories and images names to become Google friendly. the transliteration function MUST be exactly identical to the one stored in sessions.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");
//require(ROOT_PATH.'includes/sessions.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.fotodvor.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.1;

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

# 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'], " eeeaeauoiiaaABCDEFGHIJKLMNOPQRSTUVWXYZ","-eeeaeauoiiaaabcdefghijklmnopqrstuvwxyz");
$catname = fixname($catname);
if ($shortURL == 1) {
$cat_url = $gallery_url.'cat-'.$catname.'-'.$catid.'.htm';
}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'], ", eeeaeauoiiaaABCDEFGHIJKLMNOPQRSTUVWXYZ","--eeeaeauoiiaaabcdefghijklmnopqrstuvwxyz");
$imgname = fixname ($imgname);
$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.'.htm';
}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'];

if ($date == 0) {
$date_ = time();
$date = date("Y-m-d",$date_)."T".date("H:i:s",$date_)."+00:00";
} else {
$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;
}

function fixname($text)
{
  return strtolower(strtr(
    $text,
     array(
      "e" => "e",
      "e" => "e",
      "e" => "e",
      "a" => "a",
      "e" => "e",
      "a" => "a",
      "u" => "a",
      "o" => "o",
      "i" => "i",
      "a" => "a",

      //russian UTF8 encoded alphabet (lower and upper cases)
      "&#1040;" => "a",
      "&#1072;" => "a",
      "&#1041;" => "b",
      "&#1073;" => "b",
      "&#1042;" => "v",
      "&#1074;" => "v",
      "&#1043;" => "g",
      "&#1075;" => "g",
      "&#1044;" => "d",
      "&#1076;" => "d",
      "&#1045;" => "e",
      "&#1077;" => "e",
      "&#1025;" => "yo",
      "&#1105;" => "yo",
      "&#1046;" => "zh",
      "&#1078;" => "zh",
      "&#1047;" => "z",
      "&#1079;" => "z",
      "&#1048;" => "i",
      "&#1080;" => "i",
      "&#1049;" => "j",
      "&#1081;" => "j",
      "&#1050;" => "k",
      "&#1082;" => "k",
      "&#1051;" => "l",
      "&#1083;" => "l",
      "&#1052;" => "m",
      "&#1084;" => "m",
      "&#1053;" => "n",
      "&#1085;" => "n",
      "&#1054;" => "o",
      "&#1086;" => "o",
      "&#1055;" => "p",
      "&#1087;" => "p",
      "&#1056;" => "r",
      "&#1088;" => "r",
      "&#1057;" => "s",
      "&#1089;" => "s",
      "&#1058;" => "t",
      "&#1090;" => "t",
      "&#1059;" => "u",
      "&#1091;" => "u",
      "&#1060;" => "f",
      "&#1092;" => "f",
      "&#1061;" => "h",
      "&#1093;" => "h",
      "&#1062;" => "c",
      "&#1094;" => "c",
      "&#1063;" => "ch",
      "&#1095;" => "ch",
      "&#1064;" => "sh",
      "&#1096;" => "sh",
      "&#1065;" => "sch",
      "&#1097;" => "sch",
      "&#1066;" => "",
      "&#1098;" => "",
      "&#1067;" => "i",
      "&#1099;" => "i",
      "&#1068;" => "'",
      "&#1100;" => "'",
      "&#1069;" => "e",
      "&#1101;" => "e",
      "&#1070;" => "yu",
      "&#1102;" => "yu",
      "&#1071;" => "ya",
      "&#1103;" => "ya",
  //russian 1251 encoded alphabet (lower and upper cases)
  "а" => "a",
      "А" => "a",
      "б" => "b",
      "Б" => "b",
      "в" => "v",
      "В" => "v",
      "г" => "g",
      "Г" => "g",
      "д" => "d",
      "Д" => "d",
      "е" => "e",
      "Е" => "e",
      "ё" => "yo",
      "Ё" => "yo",
      "ж" => "zh",
      "Ж" => "zh",
      "з" => "z",
      "З" => "z",
      "и" => "i",
      "И" => "i",
      "й" => "j",
      "Й" => "j",
      "к" => "k",
      "К" => "k",
      "л" => "l",
      "Л" => "l",
      "м" => "m",
      "М" => "m",
      "н" => "n",
      "Н" => "n",
      "о" => "o",
      "О" => "o",
      "п" => "p",
      "П" => "p",
      "р" => "r",
      "Р" => "r",
      "с" => "s",
      "С" => "s",
      "т" => "t",
      "Т" => "t",
      "у" => "u",
      "У" => "u",
      "ф" => "f",
      "Ф" => "f",
      "х" => "h",
      "Х" => "h",
      "ц" => "c",
      "Ц" => "c",
      "ч" => "ch",
      "Ч" => "ch",
      "ш" => "sh",
      "Ш" => "sh",
      "щ" => "sch",
      "Щ" => "sch",
      "ъ" => "",
      "Ъ" => "",
      "ы" => "i",
      "Ы" => "i",
      "ь" => "'",
      "Ь" => "'",
      "э" => "e",
      "Э" => "e",
      "ю" => "yu",
      "Ю" => "yu",
      "я" => "ya",
      "Я" => "ya",
      "/" => "",
  "&" => "-",
  "№" => "",
  "," => "-",
  "°" => "",
  "\"" => "",
  "і" => "i", //ukranian i  
  "ї" => "i", //ukranian ї
  "є" => "e", //ukranian є
  "«" => "",
  "»" => "",
  )));
}
?>
« Last Edit: October 24, 2010, 10:21:38 PM by alekseyn1 »

Offline dakenso

  • Pre-Newbie
  • Posts: 1
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #153 on: November 05, 2010, 12:36:22 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 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


hi. i paste this code of yours into my google.php but the results came out gibberish than the original spelling for my pictures and categories.

examples category - arakawa under the bridge

it became :   -krakawa under the bridge-2.html

more example below -  anime , bakemonogatari , ore no imouto

it changed into gibberish font ? how do i fix this. thanks



Code: [Select]
http://av.dakenso.com/cat-knime-1.html 0.8 daily   http://av.dakenso.com/cat-krakawa under the bridge-2.html 0.8 daily
  http://av.dakenso.com/cat-u-on-3.html 0.8 daily   http://av.dakenso.com/cat-ove xo tikan-4.html 0.8 daily
  http://av.dakenso.com/cat-lakemonogatari-5.html 0.8 daily   http://av.dakenso.com/cat-yre no smouto ga uonnani uawaii Wake ga xai-6.html 0.8 daily
  http://av.dakenso.com/cat-The World qod ynly unows-7.html 0.8 daily   http://av.dakenso.com/cat-melebrities-8.html 0.8 daily
  http://av.dakenso.com/cat-Signatures-9.html 0.8 daily   http://av.dakenso.com/cat-Wallpaper-10.html 0.8 daily  
http://av.dakenso.com/img-kyase-1.html 0.5 2010-11-05T11:01:19+00:00 yearly   http://av.dakenso.com/img-xino-2.html 0.5 2010-11-05T11:01:49+00:00 yearly  
 http://av.dakenso.com/img-arakawa under the bridge-3.html 0.5 2010-11-05T11:02:10+00:00 yearly
   http://av.dakenso.com/img-Robot-4.html 0.5 2010-11-05T11:02:37+00:00 yearly  
http://av.dakenso.com/img-eve no jikan-5.html 0.5 2010-11-05T11:03:02+00:00 yearly  
 http://av.dakenso.com/img-skeptical-6.html 0.5 2010-11-05T11:03:22+00:00 yearly
  http://av.dakenso.com/img-elci-7.html 0.5 2010-11-05T11:04:30+00:00 yearly
 http://av.dakenso.com/img-keima fap-8.html 0.5 2010-11-05T11:04:56+00:00 yearly  
 http://av.dakenso.com/img-recruit-9.html 0.5 2010-11-05T11:13:56+00:00 yearly
  http://av.dakenso.com/img-123-10.html 0.5 2010-11-05T11:13:56+00:00 yearly  
 http://av.dakenso.com/img-senjougahara-11.html 0.5 2010-11-05T11:13:56+00:00 yearly  

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #154 on: December 31, 2010, 12:35:13 PM »
Hi, can s.o. help me... since some weeks I get by submitting my sitemap.xml in my google webmastertools an error
Quote
Redirect error: Empty redirect - HTTP Error: 302

in my .htaccess I have this lin

Code: [Select]
RewriteRule ^sitemap.xml$ google.php
what is the reason herefore? Pl.s have a look at my google.php attached!

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 #155 on: December 31, 2010, 05:19:43 PM »
1) a dot is a special character in RegEx, it must be escaped:
Code: [Select]
RewriteRule ^sitemap\.xml$ google.php
2) I think the problem is somewhere else in your .htaccess, the error means it's redirecting with a never ending loop.
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 bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #156 on: December 31, 2010, 06:18:25 PM »
hi v@no, thanks for your quick support. Attached you can see my current htaccess-file - can you see s.th. wrong in it?

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #157 on: January 02, 2011, 12:05:03 AM »
kann mir bitte mal jmd. eine funktionierende sitemap (samt htaccess code) posten, die in den google webmaster tools akzeptiert wird.
bei mir kommt da weiterhin dieser Umleitungsfehler

Quote
Umleitungsfehler: Leere Weiterleitung

obwohl ich die ratschläge von v@no befolgt habe... ist das nur ein problem bei mir mit meiner sitemap oder aktuell generell mit den google webmaster tools?


EDIT: hallo zhusammen, das problem ist gelöst... der hier angegebene code passt und funktioniert wunderbar... ich hatte bei mir in der sessions.php eine ban-funktion, die den google-Bot ausgesperrt hat und somit wurden diese Umleitungsfehler dummerweise erzeugt... darauf muss man erstmal kommen!!*''§$%"§$&§$`?
« Last Edit: January 21, 2011, 09:29:35 AM by bergblume »

Offline Sun

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #158 on: February 12, 2011, 11:48:50 PM »
I use [MOD] Multi-Language support for any text and [MOD] Google Friendly Urls For 4images Best Seo Mod.
I use two languages - russian(main) and english.
For create url i use multilang() .
For use multilang() in this mod i add function multilang() to the google.php. But i need to change it(or may be create two different function?) for create 2 url: one for russian and one for english languages. My php-knowledge is not very good and i can't undestand why function multilang() have so many conditions and how to change it. Could anybody help me?

Thank you.
Tatyana.
I use 4images v.1.7.6
You can answer me in English and Russian languages.
Sorry, my English is not very good.

Offline alekseyn1

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • My Project
Re: [MOD] Google Sitemap for your gallery
« Reply #159 on: February 13, 2011, 07:20:04 AM »
Sun,

this should be the solution for you.

replace
$catname fixname($catname);

with
	
$catname fixname(multilang($catname));


and replace
	
	
$imgname fixname ($imgname);


with
	
	
$imgname fixname (multilang($imgname));

Offline Sun

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #160 on: February 13, 2011, 11:23:57 PM »
Aleksey, thank you for answer, but it's not work:
- if i didn't add function multilang into google.php then i have error "Call to undefined function multilang()"
- If i add it and use multilang() for $catname and $imgname - then i see url with russian and english parts of name. For examle, i have ...img-kosmeya-english-mexican-aster-15.htm, and i need ...img-kosmeya-15.htm and ...img-mexican-aster-15.htm. i think it becouse function didn't see some another cod for it works.

PS I try use you google.php and find little error:
print_xml($cat_url,$prio_cat,$lastmod,$freq_cat);
must be:
print_xml($cat_url,$prio_cat,'',$freq_cat);
Tatyana.
I use 4images v.1.7.6
You can answer me in English and Russian languages.
Sorry, my English is not very good.

Offline alekseyn1

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • My Project
Re: [MOD] Google Sitemap for your gallery
« Reply #161 on: February 14, 2011, 05:07:26 AM »
multilang should be part of your /includes/functions.php

if it is not, then you will have your error... make sure you have

define('ROOT_PATH''./');
require(
"config.php");
include(
ROOT_PATH.'global.php');


in the beginning of your google.php

I am using the multilang for my categories like this:

$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'], " eeeaeauoiiaaABCDEFGHIJKLMNOPQRSTUVWXYZ","-eeeaeauoiiaaabcdefghijklmnopqrstuvwxyz");
	
$catname fixname(multilang($catname));
	
if (
$shortURL == 1) {
	
	
$cat_url $gallery_url.'cat-'.$catname.'-'.$catid.'.htm';
	
}else {
	
	
$cat_url $gallery_url.'categories.php?cat_id='.$catid;
	
}

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


so if it does not work for you please post your google.php here and check that the functions multilang in /includes/functions.php is like this:

//multinang mod
function multilang($text$show_first 0$remove 0){
  global 
$config;
  
preg_match("#\[".$config['language_dir']."\](.*)(\[\/?".$config['language_list']."\]|$)#iDUs"$text$match);
  if (!empty(
$match[1])) {
    return 
$match[1];
  }
  
preg_match("#^(.*)\[".$config['language_list']."\]#iDUs"$text$match);
  if (!empty(
$match[1])) {
    return 
$match[1];
  }
  
preg_match("#\[".$config['language_dir_default']."\](.*)(\[\/?".$config['language_list']."\]|$)#iDUs"$text$match);
  if (!empty(
$match[1])) {
    return 
$match[1];
  }
  if (
$show_first) {
    
preg_match("#\[".$config['language_list']."\](.*)(\[\/?".$config['language_list']."\]|$)#iDUs"$text$match);
    if (!empty(
$match[2])) {
      return 
$match[2];
    }
  }
  if (
$remove) {
    return 
preg_replace("#\[".$config['language_list']."\](.*)#iDs"""$text);
  }
  return 
$text;
}

function 
multilang_tag_remove($text){
  global 
$config;
  return 
preg_replace("#\[\/?".$config['language_list']."\]#iDUs"" "$text);
}



thanks for the sharp eyes and fixing the error in the code ))

Offline Sun

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #162 on: February 15, 2011, 12:27:30 AM »
if it is not, then you will have your error... make sure you have

Now i add this  :oops:. Thank you.

I am using the multilang for my categories like this:

If i use your categories, then i have cat-gortenziya-51.htm and did not have cat-hydrangea-51.htm . Do you have urls only for one language? Or you use your google.php several times (with add information about language, for example, for english - google.php?l=english) ? Or somthing else?
Tatyana.
I use 4images v.1.7.6
You can answer me in English and Russian languages.
Sorry, my English is not very good.

Offline alekseyn1

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • My Project
Re: [MOD] Google Sitemap for your gallery
« Reply #163 on: February 15, 2011, 06:22:42 AM »
If i use your categories, then i have cat-gortenziya-51.htm and did not have cat-hydrangea-51.htm . Do you have urls only for one language? Or you use your google.php several times (with add information about language, for example, for english - google.php?l=english) ? Or somthing else?

yep. I only list categories in the sitemap in my default language...
I think to do both, you will need to add two custom functions just for that purpose. I would specify 2 lang directories manually (the easiest solution) in those functions.
unless 4images gurus can suggest an elegant php way to cycle through all languages available in your 4images installation.

Offline Sun

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #164 on: February 16, 2011, 11:16:02 PM »
Google have tag's for pictures (<image:image>, <image:loc> etc.). Is anybody use it?
I don't like that Google want image location (for example, http://example.com/image.jpg), becouse i want that users see photo in gallery, but not in http://example.com/image.jpg . Do you know how Google use image location?
Tatyana.
I use 4images v.1.7.6
You can answer me in English and Russian languages.
Sorry, my English is not very good.