LarskoOrg : sitemap

HomePage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register
Sitemap

By far my most popular script. Produces a Sitemap of a webserver file and directory structure.

The script is lightweight and highly configurable. It needs no database or other storage facilities. The size of the files can be displayed and files and directories can be filtered. The latest version supports regular expressions for filtering, display of the contents of the HTML title tag as title and better HTML output.

See also PublicationsPage for an article on how to write it.

Demo is accessible here?.

  Attachment Size Date Added
      sitemap.tar.gz   10.29 KB   10/02/2006 2:03 pm
 



CategoryCode
CategoryPHP

HomePage » CodePage » PHPCode » sitemap
 Comments [Hide comments/form]
Hi Can you please tell me whether you offer install instructions for the sitemap script in English?

Thanks,

Tony
-- CPE-144-131-172-76.vic.bigpond.net.au (2006-01-30 09:34:41)
Well, I can: put the file where you want it to be, and probably edit the commented stuff at the top.
-- MetalHead (2006-01-30 13:34:18)
Awesome script... Congrats & many thanks!... You made my job much easier!
-- modemcable193.66-130-66.mc.videotron.ca (2006-05-07 21:49:32)
Hello,
your script is very good, thanks. Is it possible to change it a little? The result could be display the <title> tag. ist it possible?
Andrew (Germany)
-- c-134-234-202.f.dsl.de.ignite.net (2006-09-11 20:39:24)
Could you elaborate on that? What do you want to be in the <title> tag?
-- MetalHead (2006-09-11 21:39:15)
Hello,
thank you for your answer ...
now, the results displays the filenames. I think it is very good to display the title tag. I mean the title dicribes the content better ....
what do you think?

Greetings , Andrew
-- c-134-233-217.f.dsl.de.ignite.net (2006-09-13 19:04:32)
This would be quite slow for many files, since they have to be parsed. If you let me know your email address, I'll send you a version that does this when I get around to doing it :)
-- MetalHead (2006-09-13 22:12:09)
I use the script (with modifications) for my Homepage :-) Thank you!
Gunter (Gemany)
-- p549A00D6.dip0.t-ipconnect.de (2006-10-19 16:32:52)
Can I send a modification per mail?
-- 244.86.79.83.cust.bluewin.ch (2006-11-08 13:38:22)
Sure, feel free to send me patches.
-- MetalHead (2006-11-08 19:53:41)
I just hacked my copy to handle symlinks instead of recursively trying to read symlink'd directories and ultimately choking :: as (nospace) knight (at) charter (dot) net :: to get it
-- ip68-104-0-227.lv.lv.cox.net (2007-01-04 23:04:28)
Bingo! I modified your sitemap script to work with p tags instead of tables so sthat I could use an xhtml 1.0 transitional doctype and validate the page I have it embedded in. I'm using a stylesheet class with p to replace absmiddle. Another step would be to rewrite the php to strip the slashes when using quotes. Take a look:
http://oregonstate.edu/instruct/cs295/demos/index.php
Pam Van Londen
pam@i-dev.us
-- 70-56-16-229.eugn.qwest.net (2007-01-08 00:51:00)
Uhh, what do you mean by "expanding boxes"?
-- MetalHead (2007-10-10 11:03:49)
Well....all the sub cats are held within a parent folder. Anyway to have a little + next to the parent folder so it expands the sub cats?
-- host86-128-53-97.range86-128.btcentralplus.com (2007-10-16 12:59:08)
I'm not planning to add anything like that at the moment, but the [usenet] script uses this. Maybe you can merge that into the sitemap script.
-- MetalHead (2007-10-17 13:04:28)
What about if the php files have extensions like...
.php?id=1&cat=1
-- bas1-stlambert20-1178035570.dsl.bell.ca (2007-11-24 09:33:58)
You can add that specific extension, but wildcards are not supported.
-- MetalHead (2007-11-25 03:16:58)
what would be good is that if there was a version where the output could be bullet points.
e.g.
- jhkdfs
-jdjhjhkjh
-kjhkjhkd
-- 79-75-130-66.dynamic.dsl.as9105.com (2007-12-02 17:02:24)
ok that didnt come out as expected

html example of what i mean

<ul>
<li>nlijhisd</li>
<li>jlhkjdfs</li>
<ul>
<li>nlijhisd</li>
<li>jlhkjdfs</li>
<li>blar</li>
</ul>
<li>etc</li>
</ul>
-- 79-75-130-66.dynamic.dsl.as9105.com (2007-12-02 17:09:50)
Drop me an email and I'll send you a version that does this as soon as I get around to implementing it.
-- MetalHead (2007-12-03 10:05:08)
Excellent excellent script! Just what I have been looking for!

But I would like to not display repertories, just htm files.
What should I change?

Best regards.
-- cal69-3-82-243-140-185.fbx.proxad.net (2008-02-08 16:55:49)
Hey,
Job well done on the sitemap. I wanted to point out a couple of bugs I found during my use of it if I may be so bold:
A) There are one too many lines - a single vertical line extends all the way from the server image to the bottom of the screen. Removing it would make more visual sense.
B) It always fills in vertcal bars, even when it should be empty space. When there are deeply nested folders they appear where there should be none. Example - this may not look right:
||L Folder
|||L Child
||||L childs child
||||L another child child
^^ a couple extra bars

I'm trying (trying being the keyword) to implement this on a database driven structure, so I have to change ANYTHING like "getcwd" or "fopen" to database queries. It is proving challenging. First of all, I don't have access to functions like "readdir" and "is_file", second, I have to figure out how to make a row result that looks like Array["./this/is/a/directory/filename.ext"] to use this code. Wish me luck.
-- gh96.gemini.edu (2008-05-24 01:04:16)
Hi!
Here is my little contribution to your work. I had removed all "absmiddle" tags, instead I used some CSS. Also I added upload function by implementing another php script. To upload files you need to type password -it's simple javascript. As you can see password is also the name of php script, that is answerable for upload. Lastly I changed default windows-like icons to some icons from free tango icos set. You can find them all here: http://tango.freedesktop.org/Tango_Icon_Library

Here you can test my modification of sitemap script:

http://www.drozdak.rempli.net/en/index.php (password is: password)

...and download it:

http://www.drozdak.rempli.net/Sitemap_script/sitemap_2_en.zip

http://www.drozdak.rempli.net/Sitemap_script/sitemap_2_pl.zip

Greetings,
drozdak
-- 212-102-25-63.adsl.inetia.pl (2008-06-11 12:20:52)
Looks good, thanks!
-- MetalHead (2008-06-11 12:42:36)
It's very nice to hear you like it. Can I change the comment in main php file from:

/* Sitemap version 2.1 (C) copyright Metalhead 2004
Sitemap home: http://www.metalhead.ws/phpbin/
This script is released under the terms of the GNU General Public License. A copy of the GPL is included with this script. */

to:

/* Sitemap version 2.2 (D) copyright Metalhead 2004
Sitemap home: http://www.metalhead.ws/phpbin/
This script is released under the terms of the GNU General Public License. A copy of the GPL is included with this script. Some new features added by drozdak(drozdak@o2.pl). */

?

Greetings,
drozdak
-- 212-102-25-63.adsl.inetia.pl (2008-06-11 14:03:37)
Sure, you can do anything as long as you keep the original note.
-- MetalHead (2008-06-12 12:37:24)
Ok, I find your script very useful, and I think I will be able to develop it in my free time, the next thing to do is make it w3c compilant :) I don't know why it crashes PHP when I'm adding "alt" attribute to images, maybe the way to solve it is display images by CSS.

Greetings,
drozdak
-- 212-102-21-123.adsl.inetia.pl (2008-06-12 21:46:03)
Hello,
god script, thank you for publishing. but the script shows not the title from directories, only from files. Is this a mistake or a feature?
greetings
tom
-- p548A5C3B.dip.t-dialin.net (2009-01-26 20:16:27)
It can only show the name of directories as there's nothing to get a title from.
-- MetalHead (2009-01-27 09:57:09)
yes, i Know, but i think perhaps it is possible to display the title from the index.html, index.php etc. in the directories when there are in it?
-- p548A70E3.dip.t-dialin.net (2009-01-27 20:12:35)
That should be quite easy to implement; the title would show up twice though unless index.* is filtered later on.
-- MetalHead (2009-01-28 09:47:17)
wonderful, can you tell me when you would like to integrate it?
Thank you for answer ...
-- p548A7074.dip.t-dialin.net (2009-01-31 16:05:44)
I'm not planning to do it, as I don't think it's applicable for the general case -- I was suggesting that it'd be easy to do for *you* :)
Feel free to send me an email if you run into any trouble however.
-- MetalHead (2009-02-01 13:54:39)
OK, what is your E-Mail?
-- p548A539B.dip.t-dialin.net (2009-02-01 19:34:42)
There's a link on the front page...
-- MetalHead (2009-02-02 09:54:59)
Hi there, great script just what I was after thanks very much!

Just one thing, is it possible to not hyperlink the directories? As clicking them results in HTTP 403 as no page exists. I have played around with it to try to achieve this but not having any luck.
-- mail6.icap.com (2009-03-19 12:34:46)
Hi there, there was some funny stuff and my previous links are dead but I'm back and by visiting the link below you can download my modification of MetalHead's sitemap script.

Modification includes:
- adjustment to HTML 4.01 Strict standard
- CSS support with some Tango flavour
- folders are not hyperlinks now, just regular text (it eliminates the bug that was causing HTTP 403 error)
- icons are switched to ones from Gnome Colors set (by perfectska04, can be found on gnome-look.org)

Here is the link:
http://two.xthost.info/drozdak/sitemap_mod.zip

If the host is down or something you can contact me at drozdak@o2.pl
greetz!
-- 212-102-16-251.adsl.inetia.pl (2009-04-14 01:47:54)
maybe i missed it, but it would be nice if there were an easier way to tell what directory the images were in, instead of manually changing all the images sources to say src='images/'

Also, for dynamically generated titles, the script is unable to pull the titles. I did a workaround to look for ";<title>(.+)</title>;" first and if that was blank look for ";title\ =\ \"(.+)\";" as for me the <title> tag is actually in an included file that needs the variable passed to it. For example, $title = "About Us".

Overall, excellent script! Very useful.
-- 204-11-134-66.restechservices.net (2009-05-29 22:19:26)
Hey thanks for the answer with the dynamic title ";title\ =\ \"(.+)\";" it works fine.
Thanks for the execellent script.
-- dslb-088-074-138-068.pools.arcor-ip.net (2009-07-16 15:11:18)
Hello, thaks a lot for your scripts,

I used and all ok in my old server, the link for example was
http://www.dominio/subdominio/

But now, in my new server, the link is only:
http://subdominio/
-- dynamic-ip-adsl-190.186.7.47.cotas.com.bo (2010-04-23 23:48:03)
Valid XHTML 1.0 Transitional? :: Valid CSS? :: Powered by Wikka Wakka Wiki 1.1.6.2?
Page was generated in 0.0868 seconds