Hi, i am using cpmfetch on my site http://fangs-up.com and as you can see it does work, however on the page http://fangs-up.com/wp/ it comes up with this error:
Warning: include_once(gallery/cpmfetch/cpmfetch.php) [function.include-once]: failed to open stream: No such file or directory in /home/fakefan1/public_html/fangs-up.com/wp/wp-content/themes/classic/header.php on line 33
Warning: include_once() [function.include]: Failed opening 'gallery/cpmfetch/cpmfetch.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/fakefan1/public_html/fangs-up.com/wp/wp-content/themes/classic/header.php on line 33
Fatal error: Class 'cpm' not found in /home/fakefan1/public_html/fangs-up.com/wp/wp-content/themes/classic/header.php on line 34
how can i stop this and what is causing it?
Problem is that you used the wrong path. Solution is to use the correct path.
what would the correct path be? would i not have to go down a folder as the gallery folder and the wp folders are in the same level? is this possible?
Try to disable the $objCpm->cpm_close()
like this: //$objCpm->cpm_close();
no, that doesnt work either. it keeps the same error.
May be you make a mistake when you paste your code, try to copy the code you use in http://fangs-up.com/videos.php (http://fangs-up.com/videos.php)
Or you could just do as Nibbler suggests ;)
I thought i was using the right path. And its the same code as i use on all pages, its in the sidebar.php, not individually on every page. its alright saying use the right path, but when you dont give the right path or any hints what sort of help is that!?
Quote from: SkinsFan on September 13, 2009, 07:24:14 PM
I thought i was using the right path. And its the same code as i use on all pages, its in the sidebar.php, not individually on every page. its alright saying use the right path, but when you dont give the right path or any hints what sort of help is that!?
since the file that is working, the index page, is not in the /wp/ directory, that means that your path has to change in order for the code to work in the /wp/ directory.....some folks assume you should know this, that is why they didn't tell you what to change...
;)
try changing the code to:
include $_SERVER['DOCUMENT_ROOT'].'/gallery/cpmfetch/cpmfetch.php';
$objCpm = new cpm("../gallery/cpmfetch/cpmfetch_config.php");
thanks! now it works on the files in the wp folder, but not on those not in it :/
There is not a lot more we can tell you. There are many resources out there for learning basic skills such as paths. Teaching that is beyond the scope of this board.
Here is a good guide which might make it clearer in your mind.
http://www.webdiner.com/webadv/begin/paths.htm
Quote from: SkinsFan on September 15, 2009, 08:26:36 PM
thanks! now it works on the files in the wp folder, but not on those not in it :/
you need to use a different set of code for the index file...use the one that works in /wp/ for that file...and then change the code so that it works on the index page (the way you had it originally)...
so you will have two cpmfetch codes, one with the path I gave you and one with the original path that you had...