Jump to content

Recommended Posts

Posted

Hi,

 

I have been trying to install dynamic menus using Site Xpert, with mixed results. Everything above HTML is greek to me, but I read somewhere that SSI's are not that efficient. So far, that is the only thing that worked.

 

I have the option of using HTML (with frames), PHP, ASP, JSP or Cold Fusion Templates.

 

I need advice and help. I would rather not use frames or spend more money. What would you recommend?

 

Pat

Posted

Thanks Raul,

 

I already have a program: http://www.xtreeme.com/sitexpert/ .

 

I have the option of using HTML, SSI, PHP, ASP, JSP or some other templates to create the menu.

 

I just don't know enough about SSI, PHP, ASP, etcetera to make a choice.

 

I had the menu up and working with PHP, but it would only appear on one page.

 

Then I tried SSI and it worked, but it did not pick up the correct directory and page descriptions. When I tried to change the descriptions. the entire menu fell apart.

 

I started doing more research and read somewhere that using SSIs can put a strain on servers. I don't want to do that.

 

Which of the scripting methods that tch supports will allow me to use dynamic bit map graphics on every page (without using frames) AND of those which uses the least bandwidth?

 

Thanks for your help.

 

Pat

Posted

Pat, sorry, seems I misunderstood your question.

 

Well, ASP and JSP are not supported on TCH, so you can scrap those out.

That leaves you with HTML, SSI and PHP to chose from.

 

I don't know about SSI putting a big strain on servers - actually, I don't think I have ever even used SSI B)

 

I think I'd go for PHP. It's light, fast and if you ever want to add some functionality to your pages, you have plenty of people to help you :D

Posted

Raul

 

Many thanks!

 

I've been googling and I found that PHP is one of many SSIs. I think I am probably over thinking.

 

Going back to the drawing board to try PHP again. I will holler for help if I need it.

 

I do appreciate your time and effort. B)

 

Pat

Posted

Yes, I see what you mean. PHP is much more versatile.

 

OK. I spent the afternoon converting my files to PHP and adding the finishing touches. I uploaded them and still no dynamic menu bar.

 

I think I have all the images, menu, site head and site body and output files, but I am obviously making a mistake somewhere.

 

The site is http://www.duff2004.com. I still have one htm file for the index, so as not to scare the newbies away. Could that be the problem?

 

Or have I missed something major?

 

I read in one of the TCH forums that if a .html file was requested, but not at the site, the page would default on down eventually to .shtml. I tried that with the SSIs last night but it did not work. Does the same apply to PHP?

 

Any help is greatly appreciated.

 

Pat

Posted (edited)

Pat, I am not sure what the problem could be but from what I can see (the HTML code for each page), there's no code that would create a dynamic menu.

 

I don't have a clue about how that menu system works but I'd say you need to use PHP's inlcludes to include the menu in the pages. Are you doing anything like that?

Does that menu system have a readme.txt or some kind of instructions? Is there some place I can look to see what the steps should be in order to set it up?

 

I didn't understand your other question. Could you explain it a bit further?

Edited by TCH-Raul
Posted

Raul,

 

On http://www.duff2004.com/home.php and the other php pages there is:

 

<!--#include file="output/head_sitemap.inc"-->

</HEAD>

<BODY BGCOLOR="#ffffff">

 

<!--#include file="output/body_sitemap.inc"-->

 

That is all the code that appears in the HTML. Obviously, there is a head_sitemap.inc and a body_sitemap.inc that has been uploaded to the site along with the menu, scripts and images files.

 

The FAQs from Xtreme SiteXpert are here: http://www.xtreeme.com/sitexpert/faq/index.php and their sitemap is here: http://www.xtreeme.com/sitemap/

 

Forget second question, I must have been dreaming.

 

Pat

Posted (edited)

Pat, seems like I'm the one who's been dreaming. Or at least sleeping, since I didn't see those SSI includes... :)

 

Well, you're using SSI includes in a PHP file. I'm not sure if this will work. I think not but on the other hand, I don't see why it wouldn't work. Can anyone say for sure if SSI includes will work inside a PHP file?

Anyway, if you went for the PHP option, you should use PHP includes, since the files you're including probably contain PHP code too.

 

Try re-writing your code like this:

><?php require_once("output/head_sitemap.inc"); ?>
</HEAD>
<BODY BGCOLOR="#ffffff">

<?php require_once("output/body_sitemap.inc"); ?>

 

But from what I've seen, you don't have any "output/head_sitemap.inc" or "output/body_sitemap.inc" files. If I try getting http://www.duff2004.com/output/body_sitemap.inc I get a "404 Not Found" error message. That could be the problem. Are you sure you uploaded those files to the correct directory? Some times we forget that we should upload our web site's stuff into "public_html" and then wonder why things don't work. ;)

Edited by TCH-Raul
Posted

Raul, you are soooo patient.

 

The uploaded files are:

 

Archives (for this purpose, I'm not listing the pages in this directory)

Bazaar (not listing pages)

images (not listing images)

memu

body_sitemap.inc

head_sitemap.inc

sitemap.php

News (not listing pages)

Resources (not listing images)

scripts

menu_dom.js

menu_ie4.js

menu_opera.js

menu_opera_frame.js

Vote (not listing pages)

duffel.php

index.htm

index.php

 

There is also a template.php which I did not upload

 

I can see that the body_sitemap and head_sitemap shoud be menu/body_sitemap and menu/head_sitemap.

 

OR should that not be there at all? Just menu/sitemap.php?

 

The sitemap.php is simply:

 

><? include ("head_sitemap.inc") ?> 
</HEAD>
<BODY BGCOLOR="#ffffff">
<? include ("body_sitemap.inc") ?>

 

The head_sitemap.inc is mostly js defining how to respond to various browsers and more stuff that seems logical but that I don't fully understand, such as arrays, absPath="", and popupOffsets to name a few.

 

The body_sitemap.inc looks like plain HTML with the menu and mouseover conditions defined.

 

I will correct the path to the sitemap head and body but would appreciate advice on if it should be menu/body_sitemap and menu/head_sitemap or just menu/sitemap.php or all three?

 

><?php require_once("menu/output/head_sitemap.inc"); ?>
</HEAD>
<BODY BGCOLOR="#ffffff">

<?php require_once("menu/output/body_sitemap.inc"); ?>

 

Will that work, or should I take the body_sitemap.inc and body_sitemap.inc out of the menu directory?

 

Thank you ever so much for all your help.

Pat

Posted (edited)

Oh! OK, now I get it! :)

 

Pat, you probably left the "output" path as it was on an example from sitexpert. That was probably supposed to be changed from "output" to whatever name your folder has. In this case, you told sitexpert to save the menu files into a directory named "menu", so you should have replaced "output" with "menu".

 

Basically, the files you are trying to include are in a directory named "menu", so try it with "menu/head_sitemap.inc", like so:

><?php require_once("menu/head_sitemap.inc"); ?>
</HEAD>
<BODY BGCOLOR="#ffffff">

<?php require_once("menu/body_sitemap.inc"); ?>

That should work :)

Edited by TCH-Raul
Posted

HELLLP!

 

I am using this as the test page:

http://www.duff2004.com/Achives/history.php

 

After changing the script, uploading and going to the page in my browser, I get:

 

Warning: main(menu/head_sitemap.inc): failed to open stream: No such file or directory in /home/glillian/public_html/Achives/history.php on line 6

 

Fatal error: main(): Failed opening required 'menu/head_sitemap.inc' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/glillian/public_html/Achives/history.php on line 6

 

What now?

 

Pat

Posted (edited)

You have a problem with paths, there. Nothing to worry about, you just need to understand relative paths a little better :)

 

I'll write a brief explanation of how relative and absolute paths work.

 

Let's think of your public_html directory on the FTP server as the root of all paths - /

Under that root, you have, among other things, the "Archives" directory and the "menu" directory, which translate into "/Archives" and "/menu".

 

You have "head_sitemap.inc" inside the "menu" directory, so it's path is "/menu/head_sitemap.inc", right? And the file you're using for tests is "history.php", which is inside the "Archives" folder, which will make it's path be "/Archives/history.php". Are you still with me? Good :)

 

Now, when you specify a PHP include such as

require_once("menu/head_sitemap.inc");

you're telling PHP to include the file whose path is the one you specify but which in turn is appended to the directory of the currently executing script - in this case the currently executing script is "history.php" and the folder where it is kept is "/Archives".

 

So what you're actually telling PHP to include in that file is "/Archives/head_sitemap.inc", which doesn't exist ;)

 

What you want to tell PHP to include is "/menu/head_sitemap.inc", so that's what you would have to put in the require_once(...) statement.

 

But in this case, that's not what you will do, because our root folder, /, is not the public_html directory. In the real world, the root directory is... well, the root :P Every path is built starting from it. And our public_html directory is just a directory a bit under the root directory.

 

In TCH's servers (and mostly in every UNIX system), each account has a "home directory". That directory is usually "/home/yourusername" and that's exactly our case here at TCH. So imagine your username is "duff"; your home directory would be "/home/duff".

Inside that directory, there's the "public_html" directory, which is where you place everything you want to be accessible on your web site.

 

So... going back to our "include" problem, the correct absolute path for the include would be "/home/duff/public_html/menu/head_sitemap.inc".

 

There's another way to do this, which is by using relative paths. The difference between absolute and relative paths is that if using the former, you specify the complete path to the directory or file you want to reach, right from the root directory, while if you use the latter, you build the path to the directory or file you want to reach, from the directory where the file you're workin on resides.

 

In this case, using a relative path to reach the "head_sitemap.inc" file would wield this relative path: "../menu/head_sitemap.inc"

The "../" means "go up one directory". In our case, since we were in "/home/duff/public_html/Archives/", going up one directory means we'll get to "/home/duff/public_html/" and then we just need to add the rest of the path - "menu/head_sitemap.inc".

 

And now you're probably asking yourself "which should I use, absolute or relative paths?".

Well, in my humble opinion, both have advantages and disadvantages.

 

Absolute paths are good because you can use them in a file, put it anywhere in your web site and the paths will always be correct. On the other hand, they are longer and, by consequence, harder to write. If you move your site to another host - not that you'll want to leace TCH ;) - you will probably have to change them all, too, since it's probable that the path to your home directory will change.

 

Relative paths are good because they are shorter and easier to write than absolute paths.But, in my opinion, they're worse than absolute paths, because, using your situation as an example, imagine you'd change the location of "history.php": the relative path would no longer work.

 

Well, this is getting much longer than I expected, so I'll stop here. I think I've explained everything you need to know about this, anyway.

 

I hope it helps :)

Edited by TCH-Raul
Posted

Hello Again Raul,

 

I truly appreciate all your help. I am saving your description of relative paths. I will refer to it often. I NEED a compass. :D

 

I did finally have some luck (see http://www.duff2004.com/ ), but I don't have the problem truly resolved yet.

 

I finally went back to using SSIs because nothing I did would get the PHP to work in this situation. I had managed briefly to get the menu working once before with SSIs so I knew it could be done.

 

The program tutorial says to use absolute paths for the menu when using SSIs, but did not address PHP paths. Or I slept through it.

 

My solution was to rename the folder that contained the head_sitemap.inc and body_sitemap.inc and sitemap.shtml from menu to output. Without your help I would not have discovered the problem.

 

So, again and again thanks.

 

Now I just need to get the rest of the menu working...

 

Pat

Posted (edited)

No problem! :)

And if you need any more help, you know where the family forums are :)

 

By the way, if you renamed the folder, now it should work with PHP too. Give it a try :dance:

Edited by TCH-Raul
Posted

Hi Raul,

 

I'm ba-ack!

 

I thought I was doing well, but now my pages are being eaten. I am losing content on the pages whenever I try to add the includes on pages that are linked by the drop down menus.

 

I am convinced you are correct -- the path is simply wrong. But the script for the path is generated by the program. Directions say ABSOLUTE paths should be used for the site map.

 

It appears that all my links are relative. There are some written in script and I have no idea what they are. Here is an example script from the body_sitemap.inc that refers to the page I am testing: "www.duff2004/Archives/history"

 

>m1mn4 = new Array
(
"History","Achives/history.shtml",0
,"Links","Achives/links.shtml",0
)


absPath="";
if (m1.v19 && !m1.v20)
{
if (document.URL.lastIndexOf("\\")>document.URL.lastIndexOf("/")) {sepCh = "\\";} else {sepCh = "/";}
absPath = document.URL.substring(0,document.URL.lastIndexOf(sepCh)+1);
}
m1.popupOffset = 7;
m1.v02=m1.v23;

 

In your opinion, is the above linking to a relative URL or absolute? It's all Greek to me.

 

Once I REALLY get the path problem resolved, I will switch to PHP. Then I can start over. I did find some documentaion on it. With PHP it says I should copy the (.inc) gernerated files to the weserver, e.g. to the /include subdirectory.

 

Then add

><?include ("/include/head_sitemap.inc) ?>

and

><?include ("/include/body_sitemap.inc) ?>

 

Is there a space on either side of the parentheses above?

 

Thank you again and again.

 

Pat

Posted

Well, first of all, I see another problem in the code above: it has "Achives" instead of "Archives" :)

 

Anyway, it seems that the problem is not only about the code you write but also about the code your program writes - it's using relative links...

 

If your program specifies the links as "Archives/history.shtml" (relative) like it's doing, then if you use that file somewhere else, it won't work. The link should be something like "http://duff2004.com/Archives/history.shtml" (absolute).

 

About the space in the parentheses, you don't need it but you do need to close the double quotes :)

<?include ("/include/head_sitemap.inc") ?>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...