Need help to get the correct path
-
Hi.
I really hope someone can help me with this. I’m using a weather script to display the weather in my header.php. It’s not a plugin, so I use php include to get the script. Everything is working perfectly except the weather icons. I don’t know how to get the correct path to the img folder.
The blog is not online, so I don’t have a link yet, but maybe this will help:
To get the script to work, I’ve modified these paths in the weather script.
Default (not working):
//Required files require "../lib/yrFetch.class.php"; require "../lib/yrLayout.class.php";Modified (working):
//Required files require (TEMPLATEPATH . '/easyYr02/lib/yrFetch.class.php'); require (TEMPLATEPATH . '/easyYr02/lib/yrLayout.class.php');But this doesn’t work with the images. The code is different:
Default:
// Create new layout class and set image directory $yr_layout = new yrLayout(); $yr_layout->imgDir="../img/";I’ve tried this:
// Create new layout class and set image directory $yr_layout = new yrLayout(); $yr_layout->imgDir=(TEMPLATEPATH . '/easyYr02/img/');But the path to the img folder gets totally messed up.
As you can see, my php skills are rock bottom. I don’t know if these code snippets will help to see the problem. I only need to get the correct path to the img folder. It’s located in my theme folder ( themes/themename/easyYr02(script folder)/img/imagefiles.png )
Cheers!
The topic ‘Need help to get the correct path’ is closed to new replies.