Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Calling Other Directories through PHP

Calling Other Directories through PHP

Locked

Views: 1,872

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
10 Jun 2006, 10:34 PM
#1
kebeid avatar

kebeid

New Zenner

Join Date:
Mar 2006
Posts:
66
Plugin Contributions:
0

Calling Other Directories through PHP

Hi all,

I'm doing a new layout/template for my website. The header has the logo called through some php function (I don't know php to save my life) from the images directory in the respective template directory. How can I do this for other images. I tried to play around with the function but got errors, so is there a function that does this or a way to call it.

Thanks in advance,

Pete

Kebeid.com

12 Jun 2006, 7:35 PM
#2
kebeid avatar

kebeid

New Zenner

Join Date:
Mar 2006
Posts:
66
Plugin Contributions:
0

Re: Calling Other Directories through PHP

I just wanna do it this way because it'll keep all the images in one place rather than have the images in each overrided folder.

I've never found someone asking about this before so maybe it isn't possible to call a file in a different directory through php.

(sorry I'm postin again - didn't find "edit" button")

Pete

13 Jun 2006, 12:58 AM
#3
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Calling Other Directories through PHP

What you want is possible but unless it is "very important" that you do this I would suggest that you do not. As you will have to touch many files where these calls are made to relocate all images to a common dir. You might find success in locating your new image directory and changing this in the below code "$current_page_base,'images'). '/' " pointing to your new dir. Or you might need to also change the a href="' pointer to your literal address for your images. Again these occur in a multitude of files as there are button images, logo images, header images banner images etc etc.

I guess I do not see the need to go to all this work when the files and the program are happy where they are.

From tpl_header.php line #71

<div id="logo"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div>

I just wanna do it this way because it'll keep all the images in one place rather than have the images in each overrided folder.
Just one last time, do you realize the implication of changing all of these core files and what will happen when a patch or upgrade is required? And you not only must do the catalog files but there are the Admin files as well...

Much Much Much easier to learn the eloquent override system than what you are about to embark upon. IMO

13 Jun 2006, 1:07 AM
#4
kebeid avatar

kebeid

New Zenner

Join Date:
Mar 2006
Posts:
66
Plugin Contributions:
0

Re: Calling Other Directories through PHP

I'm only using this for my template files ... so that I don't have to have the images in the overridden directories and done with the <img> tag (which doesn't work). But the zen_image thing worked after changing parts of it to be my image file.

Thanks Kobra!

Pete

13 Jun 2006, 9:21 PM
#5
kebeid avatar

kebeid

New Zenner

Join Date:
Mar 2006
Posts:
66
Plugin Contributions:
0

Re: Calling Other Directories through PHP

Oh you know what... I didn't realize that you should just put the path to the images folder of the template (includes/templates/yourtemplate/yourimages) I was thinking too hard about it. The <img> tag suffices and works with that path.

Pete