• Dynamic Site Map (All Versions)

    Home » Forums » Developers, developers, developers » Web design and development » Dynamic Site Map (All Versions)

    Author
    Topic
    #381959

    Drew – love the idea, sounds great, but I’ve not used any ASP before – what do I do with it, please?! confused

    Viewing 1 reply thread
    Author
    Replies
    • #651365

      Wow, the first response to my ‘Star Post’ I posted weeks ago! grin

      I feel all giddy now.

      As to your question, you don’t have to do anything with it. Just save/upload it to your website. Then put a link on a page so you can get to it. (Or get to it manually http://mysite/sitemap.asp). You can put the .asp file anywhere on your site, it doesn’t matter, and it will display the sitemap of your site (based on your Frontpages Navigation.)

      It does allow three different ways to display. Once you have uploaded it, and viewed it, you can change the hyperlink that directs you to it to have ?View=AllBullets or ?View=ChildBullets these are called ‘QueryString’s. The ASP file reads it. If it doesn’t see any, it defaults to just using Indentions (?View=Indented does that too), if it does see a value for ‘View’, it uses the method requested.

      Let me know if this doesn’t answer you question.

      • #651369

        Thanks for the quick response, but it doesn’t seem to be seeing anything! The navigation is all set up but the sitemap page remains determinedly blank. I haven’t adjusted the view at all yet … but then I haven’t viewed anything yet …

        I put it in one of my photo sites Davrica Cats (the link is off the bottom of the left frame) – perhaps you could have a look …?!

        • #651373

          You’re right, it’s not doing anything. The problem is, the webserver isn’t reading the ASP as ASP, it’s reading it all as HTML, because you get the ASP code when you view the source, instead of what the ASP code is supposed to kick out.

          Does your hosting service support ASP? (What’s you’re hosting service?)

        • #651375

          Okay, already figured out your hosted by Verio….I’m looking at their site now…

          • #651378

            Who’s Verio? My hosting site is UK Space 4 U, and I don’t know if they support ASP or not, I’ve never had reason to ask them!

            However, the ASP code showed up in the html window in FrontPage from the start, and that was long before I sent it to the webserver …?

            Even more confused!!!

            • #651383

              When I did a whois search, it brought up Verio. Wierd, your hosting must lease their IP’s from them.

              Anywho, I looked at the UK Space 4 U site, and it doesn’t allow for ASP. ASP is Active Server Pages. It is a server side script. What you see in Front Page is the ASP code. But when it is run on an ASP enabled web, you won’t see anything that is between the flags. Anything between those flags is ‘read’ by the server, and not sent to the user. That allows for ‘dynamic’ pages. Your site allows for PHP, which is the PERL version of ASP. I may see if I can write that thing in PERL. Who knows. If I do, I’ll post it here.

            • #651385

              I see! Oh, well, thanks for trying!

              cheers

            • #651411

              Can you do me a favor, and put the attached file (unzipped) into your root web directory? Same place as sitemap.asp. Then link it and try it. Does it show your site’s navigation (listed, not like sitemap.asp is supposed to do. I decided to learn PHP today grin, so I am going to make a php version that should work on your site. But I want to make sure what I wrote works on another php enabled server, since it took me an hour to set mine IIS up with php extensions.

        • #651377

          Okay, under Verio’s packages, you’d need at least the Bronze Windows 2000 package, which will let you run ASP code.

          Drew

          • #651379

            I have sent them an email to find out what the position is.

            • #651452

              Hey, I just edited the original post, it now has a link to the PHP version of this. Try it on your site, it should work just fine for you.

              Drew

            • #651501

              Hi Drew, thanks for all this, and sorry I didn’t respond to your request to test last night – I was very tired and I’m afraid I went to bed!

              brainwash I must admit I wish I could just decide to learn something that is effectively a whole new language and be able to do exactly what I want with it just a couple of hours later!

              cheers I’ll try it tonight when I get home.

            • #652684

              Did the .php version work?

            • #652712

              Sorry, I had a lot on and didn’t get a chance to have a look!

              Anyway, no, I’m afraid it didn’t. I got this message instead – do you know what’s wrong?:

              Warning: file(“./_vti_pvt/structure.cnf”) – No such file or directory in /home/b/e/beryltwo/public_html/davrica/test.php on line 9
              Warning: Invalid argument supplied for foreach() in /home/b/e/beryltwo/public_html/davrica/test.php on line 12
              Warning: file(“http://www.example.com/”) – No such file or directory in /home/b/e/beryltwo/public_html/davrica/test.php on line 17
              Warning: Bad arguments to implode() in /home/b/e/beryltwo/public_html/davrica/test.php on line 17

              It looks to me like it’s looking for an example file of some sort and not finding it?

            • #652720

              What file did you try? The file I posted to this thread, or the finished file, that I posted in a new thread (which I have a link to in the first post….I just added that link the other day.)?

            • #652726

              The one in this thread – I thought the link in the first post was to this one! I’ll try the other one now …!

            • #652731

              OK, the other one gave this message:


              Warning: file(“./_vti_pvt/structure.cnf”) – No such file or directory in /home/b/e/beryltwo/public_html/davrica/sitemap.php on line 82
              Warning: Invalid argument supplied for foreach() in /home/b/e/beryltwo/public_html/davrica/sitemap.php on line 83

              Is it just me or has anyone else had trouble with this?!

            • #652774

              It’s having problems finding your structure.cnf file. I think the ‘site’ you are working on is a subweb. It should have it’s own structure file, so open that php file in FrontPage, and got to the HTML tab. Go to line 82, and remove the period before the slash. If that doesn’t work, you’ll need to find that file. Check out post 217511. Read the three methods of finding that file. Post back with the file structure to where that file is.

            • #653319

              Hi Drew; still not working, I’m afraid!

              As far as I’m aware, it’s not a subweb; it has its own FrontPage window and is linked to other webs I have only where I have specifically hyperlinked them. The structure.cnf file is in the _vti_pvt folder, exactly as expected.

              The error I’m getting now is:

              $line){ if(strpos($line,”,”)){ $line=str_replace(“,”,chr(0) . chr(0),$line); } $Temp=Explode(“,”, $line); foreach($Temp as $Word){ $Word=str_replace(chr(0) . chr(0),”,”,$Word); } $Elements=count($Temp); if($Elements==7){ $Records[$RowCount][0]=$Temp[0]; $Records[$RowCount][1]=$Temp[4]; $Records[$RowCount][2]=$Temp[1]; $Records[$RowCount][3]=$Temp[3]; $RowCount++; } } $RowCount–; } ?>

              It looks to me as if removing the fullstop just caused an error in the document! I tried removing the slash as well (which would be the requirement if it was straight html, looking at a subdirectory) but the same thing happened …

              Feel free to check it out at http://www.berylm.com/davrica%5B/url%5D – the link is still at the bottom of the left frame!

              Sorry to be such a trouble … sad

            • #653800

              Try replacing it with:

              /home/b/e/beryltwo/public_html/davrica/_vti_pvt/structure.cnf

              See if that works (replace that whole string….from your error message, it looks like that should be the fully ‘qualified’ path)

            • #653807

              Now we get an error message that at least reads in English!

              Warning: file(“/home/b/e/beryltwo/public_html/davrica/_vti_pvt/structure.cnf”) – No such file or directory in /home/b/e/beryltwo/public_html/davrica/sitemap.php on line 82

              Warning: Invalid argument supplied for foreach() in /home/b/e/beryltwo/public_html/davrica/sitemap.php on line 83

              I’ll send you a PM with details and you can have a fiddle with it yourself – maybe you can get it to work for me!

            • #653808

              Sounds fine with me….I was going to suggest that…..

            • #653840

              at least keep the rest of us up-to-date on the final solution, I for one am curious about the problem and resolution.

              Cheers

            • #654416

              Well nothing so far. At least not that we can ‘prove’ yet. I have not been able to find the ‘structure.cnf’ file on her ‘server’. We think it may be an issue that the file is being kept on her local desktop, which is a possibility, but remote. A lot of ‘navigation’ features use webbots, which would have to ‘see’ the structure on the server. Not too mention that her navigation wouldn’t be available from another machine (if she needed to make a change from another location). (I think she is going to try that…not sure…to see if the ‘structure’ appears on another machine, which would prove that it is on the server or not).

              Hey Beryl, if you read this, there is something else that may be the cause. It is quite possible that the file is ‘secured’ in some way, that would be causing that error. Many times a security problem will create the same error as when the file doesn’t exist. Maybe you could contact your hosting company to find that file, and if they can find it, set the permissions a little looser (at least to allow for reading it). You maybe able to read it from FP, because you should be ‘logged’ into the site with Admin credentials (for your site).

            • #655247

              Good news – I manually uploaded the _vti_pvt folder, complete with structure.cnf, and if you go to the page and have a look, it now works – click here to see! (scroll down in the left frame to see link to sitemap).

              So the next questions would be, (1) how do I apply styles (I know that’s not what it would be, but the equivalent), eg make the top level bigger and bold, next level just bold, etc? and (2) each of those links needs to open the page in the left frame, not the main window; how do I get it to do that?

              Anyway, many thanks, Drew – a very useful bit of code!

            • #655265

              That is odd that FrontPage was ‘storing’ the data locally. Wierd. I wonder if it will start using the web based structure.cnf now that it’s there!?!?

              As far as styling….ummmm….other then changing the font or background, doing ‘layered’ styling is going to be a bit more difficult. It is building that tree from code, so in order to change the style that it is using, you will need to modify the code, based on how ‘deep’ you are into the tree. Also, keep in mind that a ‘scaled’ effect could get too small, or too big, the ‘deeper’ your website gets.

            • #655349

              Regarding the styling, fair enough – it’s not important, it’s only cosmetic, after all.

              However, the fact that the links are appearing in the wrong frame is not cosmetic – the site doesn’t work when the pages come up in the middle instead of the left frame!

              Any chance of a way of correcting that?

              Ta muchly

            • #655455

              Not sure what you mean by that. Are you saying the script pulls nothing up when it’s loaded in the left frame? That doesn’t make much sense, since the script is pulling from the same file either way. Or are you saying the links on the page are pulling the pages into the wrong frame? If that second guess is the problem, that is relatively easy to fix. Go into the code, and look for the part where it is building the ‘Iink’. Have the link changed to have a ‘Target’ property, to point to your main frames name.

            • #656787

              It’s the second problem – the target frame is wrong – and your solution sounds right, but how on earth do I implement it? I mean what exactly do I add to to the link to change the target? I’m willing to be it’s not target:=”…” as it would be in html!

              Please go right down to basics, I know no PHP at all …!

            • #657031

              Okay, here’s a little lesson in server side scripting. With PHP and ASP, your code is ‘run’ on the server, but to have it interact with a web user, it writes or outputs results to an HTML page.

              In ASP, you can use response.write or =, in PHP you use print or echo. So, here’s a line from the php sitemap page.

              print ‘‘ . $Records[$i][3] . “n”; (I had to put spaces within the markers so it would show in this post.)

              In the code above, it is printing everything after the print command. However, it is a ‘string’ that is put together with variables. ‘< a href="' prints ‘ to be ‘ target=”_blank”>’ You will need to do this in several places, since there are several places that are outputting HTML. (With the print or echo command).

            • #657359

              Great – that works perfectly! (once I realised I needed to replace the ‘_blank’ with the name of the left frame!) cheers

              Next question – you mention in passing that you can specify which type of layout you want (indented, bulleted or child bullets), but you don’t say how to do that – I tried just replacing the instances of “” with “allbullets” but it didn’t do anything – is there something else I need to do instead?

              groovin Many thanks for this – it’s a great tool! bravo

            • #657438

              Whoops, my bad, I was a wee bit tired when I wrote that post…..before taking my advice, always ask if my caffiene levels are normal! evilgrin

              Yes, the _blank tells it to use a new window…or instance of the browser. You just have to replace it with the name of any frame for that frame to be the ‘target’.

              The layout is specified by the View Querystring….

              http://www.mysite.com/sitemap.php produces an indented format.
              http://www.mysite.com/sitemap.php?View=Indented also produces and indented format.
              http://www.mysite.com/sitemap.php ?View=AllBullets produces a bulleted list where all links are bulleted.
              http://www.mysite.com/sitemap.php?View=ChildBullets Produces a bulleted list where all links but the root nav(s) are bulleted.

              I actually had that listed in the original ASP post.

            • #657475

              Yes, that works perfectly, Drew, many thanks! By the way, just out of curiosity, when you wrote:
              ___________________________________________

              Whoops, my bad, I was a wee bit tired when I wrote that post…..
              ___________________________________________

              What was ‘my bad’ supposed to be?! I can usually guess or work out what people mean with the odd typos, but that one’s got me stumped!

            • #657602

              My Bad means ‘My fault’…..I have no idea where I picked that up….it’s just something I say.

              Glad its working for you now.

              Drew

    • #645861

      A few weeks ago I posted about a Dynamic SiteMap page, that used an ActiveX .dll that I wrote in VB. I had a comment or two about VB ActiveX controls, since not all hosting companies allow for ActiveX controls.

      Attached is an .asp page that creates a dynamic sitemap using FrontPage’s navigation file. (In other words, the page will always show a site map built from the current navigation). This page does NOT use an ActiveX .dll, it is strictly ASP. So obviously you must have a service provider that allows for ASP. The only quirk I can think of, which may trip this code up, is that it uses the FileSystemObject to read the FrontPage data file. If anyone has a problem using this page due to that, you may be able to use ADO to read the file. Let me know, and I’ll look into it, or if you rewrite it with ADO, post it please.

      One last thing. It displays in three different ‘modes’.

      sitemap.asp or sitemap.asp?View=Indented Builds the page with the links being indented. (Looks fine, but source is full of

    Viewing 1 reply thread
    Reply To: Dynamic Site Map (All Versions)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: