topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday March 19, 2024, 3:53 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: SOLVED: Automatically create a site link list  (Read 11049 times)

questorfla

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 570
  • Fighting Slime all the Time
    • View Profile
    • Donate to Member
SOLVED: Automatically create a site link list
« on: December 07, 2012, 09:10 PM »
This is probably too easy for most of you but I just can't seem to put the parts together right.

I need a simple script or batch file that will create a list of WEBSITE hyperlinks from the subfolders in a main directory.  The main directory is the main website but each person in the class has their own projects that can each be entered directly by going straight to their own index.php file

Example  Main directory would be www.example.com
First level Subdirectories would be names  like "john", mary", "bill"  etc
Third level Subdirectories would be their sites.  The names could be anything.
maybe first_try, second_try, third_try

The end result would be a word document full of working weblinks:  www.example.com/john/first_try
then www.example.com/john/second_try, then www.example.com/john/third_try

Then on to the next person in the 2nd level and each of their projects and so on.

This is for a setup where the people (second subdir level) as well as each one's projects (third level subdir)
will change and each time it does I have to retype the whole list.  I used to have a program that did this to some extent but dont remember the name.  My efforts at doing it using variables in a batch file are not coming along too well and this month it would almost be faster to type them one at a time.
Currently that would total about 150 weblinks :(  SO..  I was hoping someone better than me might have a solution :)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: SOLVED: Automatically create a site link list
« Reply #1 on: December 07, 2012, 09:19 PM »
For coders reading this, can i suggest that something like with some additional features would make a good app for the NANY 2013 event?

I think one important thing to clarify is whether you are wanting a solution that runs on a windows-only platform, or something that runs in a language more suitable to running it on a web server (perl, python, php, etc.)

questorfla

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 570
  • Fighting Slime all the Time
    • View Profile
    • Donate to Member
Re: SOLVED: Automatically create a site link list
« Reply #2 on: December 07, 2012, 09:32 PM »
Sorry, didn't think about that.  Windows 7 is the OS.  The batch I am trying seaches for the file index.php and if it exists creates a listing to it.  So I should be getting "www.example.com/a/b/index.php".
I think i am not starting from the right point.  The main "www.example.com" is already several levels down from c: so the file either has to be run from a command prompt or i have to give it the correct place to start in the GUI icon.
I don't do this enough to remember from one time to the next :(

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: SOLVED: Automatically create a site link list
« Reply #3 on: December 07, 2012, 10:24 PM »
Right, so basically what you are looking for is a windows tool that will generate a nice index page with site links, based on the idea that some directory is going to be uploaded to a website.

So the tool will at a minimum need to ask which directory to scan, what files to create links for, and what the web url will be where that directory is going to be uploaded.

questorfla

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 570
  • Fighting Slime all the Time
    • View Profile
    • Donate to Member
Re: SOLVED: Automatically create a site link list
« Reply #4 on: December 08, 2012, 12:20 AM »
Yes, exactly!  The "sub sites" each have their own "door" to the main site; their own "Index.php". 
Being able to run a quick list of working hyperlinks whenever I need a current one would be very handy.  The "sub-sites" change.  Sometimes new ones, sometimes old ones gone.  One problem is the APACHE layout included a single main "sub-site" sub-directory called "\webroot\" that shows when I pull a "DIR" command.  It  can't be left in the hyperlink or it wont work. "www.abc.com\webroot\name\project\index.php" is the best I can get. Then delete the "/webroot" afterward.

I ran across the perfect script to do this somewhere years back but I have no idea what it was or where I found it :(

Paul Keith

  • Member
  • Joined in 2008
  • **
  • Posts: 1,989
    • View Profile
    • Donate to Member
Re: SOLVED: Automatically create a site link list
« Reply #5 on: December 08, 2012, 01:27 AM »
It's not a good solution but Scrapbook does have capture multiple pages: https://addons.mozil...ook-plus/?src=search


app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,884
    • View Profile
    • Donate to Member
Re: SOLVED: Automatically create a site link list
« Reply #6 on: December 08, 2012, 02:42 AM »
I used to use dirhtml on Windows for the same purpose and run it on a schedule to regenerate the pages, daily. (this was back in the days when I ran a webserver from my home pc)

While the standard output templates included were kind of look ugly and crude, with a bit of effort, you can rewrite the template it will insert the listings into, styling it with CSS, and use it to build quite an attractive directory.

What I ended up doing was letting the application generate a main menu.php from the folders and then generate pages with item listings within each folder., then assembled it all from the main page with a bunch of php includes written into the main template.

Since I was running it multiple times, with different configurations to generate each part, I ran the whole thing with a batch file to do the full regeneration. Might not still need to do something like that, as I was using a much older version and it may have been improved in more recent versions to not need to use a batch file.

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: SOLVED: Automatically create a site link list
« Reply #7 on: December 10, 2012, 05:30 PM »
questorfla, were you able to try out dirhtml and, if so, did it meet your needs?

questorfla

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 570
  • Fighting Slime all the Time
    • View Profile
    • Donate to Member
Re: SOLVED: Automatically create a site link list
« Reply #8 on: February 02, 2013, 08:45 PM »
 :Thmbsup:  YES!!

and Thanks to everyone.  I have to give HTML at least 3 thumbs up!  More if I had them  Thank You Skwire

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: SOLVED: Automatically create a site link list
« Reply #9 on: February 02, 2013, 08:55 PM »
Cool, thanks for the report back.  I'll mark this thread as solved.

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: SOLVED: Automatically create a site link list
« Reply #10 on: February 02, 2013, 10:52 PM »
BTW, it was April (app103) who suggested dirhtml, not me.   :Thmbsup:

questorfla

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 570
  • Fighting Slime all the Time
    • View Profile
    • Donate to Member
Re: SOLVED: Automatically create a site link list
« Reply #11 on: February 20, 2013, 01:04 AM »
I am not sure which of all the nice people ( I think it was  app103)  provided this but I really appreciate it.  I do have one small problem with the output and i know it is totally due to the way I am using it.  I was hoping maybe the person who uses it could leave mea message.

Basically, I need the outut to provide live hyperlnks to open webpages on a server where we host aas many as 4o different entry points to a single domain.  Each entry point has its own index.html file inside a folder.  The directory strycture is consistent throughout, every site has exactly the same structure to get to the index.html.  
But when I ran the program, it ended up creating links that take me into the text of the folder rathe than opening the site with index.html.  I feel sure this is a "User error " ;).  on MY part.  Any advice appreiated.  Maybe i should be at a different level when i run it?
Under the main webroot which has an index.html just for looks.  there are 20 subfolders.  Each subfolder may have 3 to 6 folders in it.  Those folders are each sites with their own index.html.  

Thanks Much

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,884
    • View Profile
    • Donate to Member
Re: SOLVED: Automatically create a site link list
« Reply #12 on: February 20, 2013, 01:27 AM »
I can't visualize what the problem is. Being a very visual person, I think I'd need some sort of image that would explain your directory structure, what you want included, what you don't want included, an indicator of what it is/isn't being included that you want changed, and screenshots of your dirhtml configuration. Then I'll be able to tell you what settings to change to get the output that you want.