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

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

0 Members and 2 Guests are viewing this topic.

Offline thestroller

  • Pre-Newbie
  • Posts: 4
    • View Profile
    • Something about Viet Nam
[MOD] Google Sitemap for your gallery
« on: November 28, 2006, 07:54:24 AM »
Hi,

You can create a Google Sitemap for your Gallery to improve traffic to your site.

You must install the Search Engine friendly MOD before use this file.

1. Upload the file google.php to the root folder of 4images.
2. Modify the .htaccess to rewrite the URL of sitemap.

Code: [Select]
RewriteRule ^sitemap.xml$ google.php
Now the URL of sitemap is: http://www.yourdomain.com/sitemap.xml

You can send a ping to Google to notify your new sitemap by this way: http://www.google.com/webmasters/sitemaps/ping?sitemap=URL_TO_YOUR_SITEMAP

Good luck!
Mai
« Last Edit: January 02, 2007, 06:02:39 PM by mawenzi »

Offline Naveen

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Create Google Sitemap for your gallery
« Reply #1 on: December 02, 2006, 09:00:50 AM »
Thanx a million  :lol:

This is an excellent MOD, been looking for it for quite a while now.

Cheers  :mrgreen:

Offline Naveen

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Create Google Sitemap for your gallery
« Reply #2 on: December 02, 2006, 09:53:56 AM »
Ok there is an error in the sitemap.

There is no Last Modified Date for categories and google throws that as an error. Maybe we can assign current date there similar to $mod

Offline Zyga

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
Re: Create Google Sitemap for your gallery
« Reply #3 on: December 03, 2006, 09:42:44 AM »
In php file is
Code: [Select]
echo "<?xml version='1.0' encoding='UTF-8'?>   Should I change it to ISO-8859-2 is whole my gallery works with it ?
Yeah I know i can check it but... I don't want play with google


How can add a links for profiles to a map ?
« Last Edit: December 08, 2006, 10:12:03 PM by Zyga »

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: Create Google Sitemap for your gallery
« Reply #4 on: January 02, 2007, 05:13:23 PM »
I have modify the Code a little bit... (o:

-now the Profiles are included
-now you can use it also without the Short URL Mod
(# Use Short URLs
$shortURL      = 1; // 0 or 1)

-bugfix: Last Modified Date for categories...

Enjoy it...

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.picsforfree.de/';

# 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;
}
?>

@mawenzi
Verschiebe diesen Thread doch bitte mal und umbennen des Titels wäre bestimmt auch keine schlechte Idee... (o:

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #5 on: January 02, 2007, 06:04:45 PM »
@ Acidgod 
... gesagt ... getan ... ;)
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 ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: [MOD] Google Sitemap for your gallery
« Reply #6 on: January 02, 2007, 06:05:05 PM »
THX... (o:

Offline kai

  • Administrator
  • Addicted member
  • *****
  • Posts: 1.421
    • View Profile
    • 4images - Image Gallery Management System
Re: [MOD] Google Sitemap for your gallery
« Reply #7 on: January 02, 2007, 06:13:29 PM »
Great job!
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline son_gokou

  • Full Member
  • ***
  • Posts: 199
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #8 on: January 03, 2007, 02:45:24 AM »
I think I dont have access to .htaccess.

Can you tell me exactly what this mod does?

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: [MOD] Google Sitemap for your gallery
« Reply #9 on: January 03, 2007, 09:41:59 AM »
You don't need the .htaccess Part....

Here you can take a look:
http://www.picsforfree.de/google.php

Offline medo007

  • Newbie
  • *
  • Posts: 29
  • Internet addict
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #10 on: January 03, 2007, 10:53:45 AM »
You don't need the .htaccess Part....

Here you can take a look:
http://www.picsforfree.de/google.php

I can't see it!

I get this:
Code: [Select]
http://www.picsforfree.de/cat1.htm 0.8 daily   http://www.picsforfree.de/cat2.htm 0.8 daily   http://www.picsforfree.de/cat4.htm 0.8 daily   http://www.picsforfree.de/cat5.htm 0.8 daily   http://www.picsforfree.de/cat6.htm 0.8 daily   http://www.picsforfree.de/cat7.htm 0.8 daily   http://www.picsforfree.de/cat8.htm 0.8 daily   http://www.picsforfree.de/cat9.htm 0.8 daily   http://www.picsforfree.de/cat10.htm 0.8 daily   http://www.picsforfree.de/cat11.htm 0.8 daily   http://www.picsforfree.de/cat12.htm 0.8 daily   http://www.picsforfree.de/cat13.htm 0.8 daily   http://www.picsforfree.de/cat14.htm 0.8 daily   http://www.picsforfree.de/cat15.htm 0.8 daily   http://www.picsforfree.de/cat16.htm 0.8 daily   http://www.picsforfree.de/cat17.htm 0.8 daily   http://www.picsforfree.de/cat18.htm 0.8 daily   http://www.picsforfree.de/cat19.htm 0.8 daily   http://www.picsforfree.de/cat20.htm 0.8 daily   http://www.picsforfree.de/cat21.htm 0.8 daily   http://www.picsforfree.de/cat22.htm 0.8 daily   http://www.picsforfree.de/cat23.htm 0.8 daily   http://www.picsforfree.de/cat24.htm 0.8 daily   http://www.picsforfree.de/cat25.htm 0.8 daily   http://www.picsforfree.de/cat26.htm 0.8 daily   http://www.picsforfree.de/cat27.htm 0.8 daily   http://www.picsforfree.de/cat28.htm 0.8 daily   http://www.picsforfree.de/cat29.htm 0.8 daily   http://www.picsforfree.de/cat30.htm 0.8 daily   http://www.picsforfree.de/cat31.htm 0.8 daily   http://www.picsforfree.de/cat32.htm 0.8 daily   http://www.picsforfree.de/cat33.htm 0.8 daily   http://www.picsforfree.de/cat34.htm 0.8 daily   http://www.picsforfree.de/cat36.htm 0.8 daily   http://www.picsforfree.de/cat37.htm 0.8 daily   http://www.picsforfree.de/cat38.htm 0.8 daily   http://www.picsforfree.de/cat39.htm 0.8 daily   http://www.picsforfree.de/cat40.htm 0.8 daily   http://www.picsforfree.de/cat41.htm 0.8 daily   http://www.picsforfree.de/cat42.htm 0.8 daily   http://www.picsforfree.de/cat43.htm 0.8 daily   http://www.picsforfree.de/cat44.htm 0.8 daily   http://www.picsforfree.de/cat45.htm 0.8 daily   http://www.picsforfree.de/cat46.htm 0.8 daily   http://www.picsforfree.de/cat47.htm 0.8 daily   http://www.picsforfree.de/cat48.htm 0.8 daily   http://www.picsforfree.de/cat49.htm 0.8 daily   http://www.picsforfree.de/cat50.htm 0.8 daily   http://www.picsforfree.de/cat51.htm 0.8 daily   http://www.picsforfree.de/cat52.htm 0.8 daily   http://www.picsforfree.de/cat53.htm 0.8 daily   http://www.picsforfree.de/cat54.htm 0.8 daily   http://www.picsforfree.de/cat55.htm 0.8 daily   http://www.picsforfree.de/cat56.htm 0.8 daily   http://www.picsforfree.de/cat57.htm 0.8 daily   http://www.picsforfree.de/cat58.htm 0.8 daily   http://www.picsforfree.de/cat68.htm 0.8 daily   http://www.picsforfree.de/cat73.htm 0.8 daily   http://www.picsforfree.de/cat83.htm 0.8 daily   http://www.picsforfree.de/cat84.htm 0.8 daily   http://www.picsforfree.de/cat85.htm 0.8 daily   http://www.picsforfree.de/cat86.htm 0.8 daily   http://www.picsforfree.de/cat87.htm 0.8 daily   http://www.picsforfree.de/cat88.htm 0.8 daily   http://www.picsforfree.de/cat89.htm 0.8 daily   http://www.picsforfree.de/cat90.htm 0.8 daily   http://www.picsforfree.de/cat91.htm 0.8 daily   http://www.picsforfree.de/cat92.htm 0.8 daily   http://www.picsforfree.de/cat93.htm 0.8 daily   http://www.picsforfree.de/cat94.htm 0.8 daily   http://www.picsforfree.de/cat95.htm 0.8 daily   http://www.picsforfree.de/cat96.htm 0.8 daily   http://www.picsforfree.de/cat97.htm 0.8 daily   http://www.picsforfree.de/cat98.htm 0.8 daily   http://www.picsforfree.de/cat99.htm 0.8 daily   http://www.picsforfree.de/cat100.htm 0.8 daily   http://www.picsforfree.de/cat101.htm 0.8 daily   http://www.picsforfree.de/cat102.htm 0.8 daily   http://www.picsforfree.de/cat103.htm 0.8 daily   http://www.picsforfree.de/cat104.htm 0.8 daily   http://www.picsforfree.de/cat105.htm 0.8 daily   http://www.picsforfree.de/cat106.htm 0.8 daily   http://www.picsforfree.de/cat107.htm 0.8 daily   http://www.picsforfree.de/cat108.htm 0.8 daily   http://www.picsforfree.de/cat109.htm 0.8 daily   http://www.picsforfree.de/cat110.htm 0.8 daily   http://www.picsforfree.de/cat111.htm 0.8 daily   http://www.picsforfree.de/cat112.htm 0.8 daily   http://www.picsforfree.de/cat113.htm 0.8 daily   http://www.picsforfree.de/cat114.htm 0.8 daily   http://www.picsforfree.de/cat115.htm 0.8 daily   http://www.picsforfree.de/cat116.htm 0.8 daily   http://www.picsforfree.de/cat117.htm 0.8 daily   http://www.picsforfree.de/cat118.htm 0.8 daily   http://www.picsforfree.de/cat119.htm 0.8 daily   http://www.picsforfree.de/cat120.htm 0.8 daily   http://www.picsforfree.de/cat121.htm 0.8 daily   http://www.picsforfree.de/cat122.htm 0.8 daily   http://www.picsforfree.de/cat123.htm 0.8 daily   http://www.picsforfree.de/cat124.htm 0.8 daily   http://www.picsforfree.de/cat125.htm 0.8 daily   http://www.picsforfree.de/cat126.htm 0.8 daily   http://www.picsforfree.de/cat127.htm 0.8 daily   http://www.picsforfree.de/cat128.htm 0.8 daily   http://www.picsforfree.de/cat129.htm 0.8 daily   http://www.picsforfree.de/cat130.htm 0.8 daily   http://www.picsforfree.de/cat131.htm 0.8 daily   http://www.picsforfree.de/cat132.htm 0.8 daily   http://www.picsforfree.de/cat134.htm 0.8 daily   http://www.picsforfree.de/cat135.htm 0.8 daily   http://www.picsforfree.de/cat136.htm 0.8 daily   http://www.picsforfree.de/cat137.htm 0.8 daily   http://www.picsforfree.de/cat138.htm 0.8 daily   http://www.picsforfree.de/cat139.htm 0.8 daily   http://www.picsforfree.de/cat140.htm 0.8 daily   http://www.picsforfree.de/cat141.htm 0.8 daily   http://www.picsforfree.de/cat142.htm 0.8 daily   http://www.picsforfree.de/cat143.htm 0.8 daily   http://www.picsforfree.de/cat144.htm 0.8 daily   http://www.picsforfree.de/img7367.htm 0.5 2006-09-05T11:07:18+00:00 yearly   http://www.picsforfree.de/img7368.htm 0.5 2006-09-05T11:07:18+00:00 yearly   http://www.picsforfree.de/img193.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img192.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img191.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img190.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img189.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img188.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img274.htm 0.5 2005-09-06T17:01:54+00:00 yearly   http://www.picsforfree.de/img186.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img276.htm 0.5 2005-09-06T17:01:54+00:00 yearly   http://www.picsforfree.de/img185.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img202.htm 0.5 2005-09-06T16:43:19+00:00 yearly   http://www.picsforfree.de/img275.htm 0.5 2005-09-06T17:01:54+00:00 yearly   http://www.picsforfree.de/img182.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img181.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img180.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img179.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img178.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img177.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img176.htm 0.5 2005-09-06T16:16:20+00:00 yearly   http://www.picsforfree.de/img175.htm

Lot's of that!  :D
mEDO

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: [MOD] Google Sitemap for your gallery
« Reply #11 on: January 03, 2007, 10:58:27 AM »
LOL...

You don't now Google Sitemap?  8O

http://www.google.com/webmasters/sitemaps/

Offline medo007

  • Newbie
  • *
  • Posts: 29
  • Internet addict
    • View Profile
Re: [MOD] Google Sitemap for your gallery
« Reply #12 on: January 03, 2007, 11:26:15 AM »
I don't have sitemap.xml file!
I have to create it manualy or...?  :?
mEDO

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: [MOD] Google Sitemap for your gallery
« Reply #13 on: January 03, 2007, 01:41:04 PM »
Try to use the IE... (o:

Mozilla don't show XML Files correctly...

Offline lorddean

  • Newbie
  • *
  • Posts: 20
    • View Profile
    • ElitePhoto.eu
Re: [MOD] Google Sitemap for your gallery
« Reply #14 on: January 04, 2007, 11:05:24 PM »
How does this MOD treat links to images/categories which belong to locked/non-public categories/images?