I have been trying to embed this code into the sidebar on a new Wordpress 2.50 install ->
<?php
include_once "http://xxxxx.com/gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("http://xxxxx.com/gallery/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia(2,3,$options);
$objCpm->cpm_close();
?>
I've had to use the full path to get rid of the errors but now the entire sidebar is blank. Anyone out there got cpmfetch working in the latest version of Wordpress? If so, can you give me some help, an example or point me in the right direction?
Thanks!
Quote from: Shelia on April 16, 2008, 05:55:58 AM
I have been trying to embed this code into the sidebar on a new Wordpress 2.50 install ->
<?php
include_once "http://xxxxx.com/gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("http://xxxxx.com/gallery/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia(2,3,$options);
$objCpm->cpm_close();
?>
I've had to use the full path to get rid of the errors but now the entire sidebar is blank. Anyone out there got cpmfetch working in the latest version of Wordpress? If so, can you give me some help, an example or point me in the right direction?
Thanks!
I had it working on an old version of WP, but will be doing it soon for my podcast site very soon.
(http://www.higrowradio.com/index.php - still under construction)
Will post back if no one else does. If it can't be done I will fix it (I need it to work)
as a work around you could use an iframe; I am not sure why your example isn't working but I have used frames for fetch on my wordpress sites and have never had an issue
You can't include() the php file using an url. Use a path instead.
Thanks vuud I'll keep checking.
Nibbler.......I couldn't get it to work using various (partial and full) paths so I tried using the url since nothing else worked.
You would think this would be fairly simple but I guess if that were true everything would be right with the world.
If you provide more information we could help you find the right path.
Thanks Nibbler but the path isn't the problem. When I include the correct path and use the code outside of Wordpress it works just fine.
I'm also having this problem. When I attempt to include this into my wordpress header.php file (inside of a div code):
<!--images-->
<?php
include "../illustrated/cpmfetch/cpmfetch.php";
$objCpm = new cpm("../illustrated/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia(1,4);
$objCpm->cpm_close();
?>
it returns this error:
Warning: include(../illustrated/cpmfetch/cpmfetch.php) [function.include]: failed to open stream: No such file or directory in /home/.dillinger/machinehead/flyleafonline.com/wp-content/themes/classic/header.php on line 234
Warning: include() [function.include]: Failed opening '../illustrated/cpmfetch/cpmfetch.php' for inclusion (include_path='.:/usr/local/php5/lib/php:/usr/local/lib/php') in /home/.dillinger/machinehead/flyleafonline.com/wp-content/themes/classic/header.php on line 234
Fatal error: Class 'cpm' not found in /home/.dillinger/machinehead/flyleafonline.com/wp-content/themes/classic/header.php on line 235
I've tried varying forms of paths, using different amounts of periods/urls, and nothing seems to work. I can get it to work fine outside of wordpress as well. Not sure what the problem is.
Did you try without the ../ at the start? If that doesn't work either then use the full path (/home/.dillinger/machinehead/flyleafonline.com/ilustrated/)
Quote from: Nibbler on May 02, 2008, 01:09:10 PM
Did you try without the ../ at the start? If that doesn't work either then use the full path (/home/.dillinger/machinehead/flyleafonline.com/ilustrated/)
I did try it without the ../ at the start, and it still gave me the error. But the full path typed out worked for me. Thank you. :]
Here the code i use in the sidebar of Wordpress 2.51
<li><h2>Dernière Photo cpmfetch.</h2>
<?php
include_once "../cpmfetch/cpmfetch.php";
$objCpm = new cpm("../cpmfetch/cpmfetch.php");
$objCpm->cpm_viewLastAddedMedia(1,1);
//$objCpm->cpm_close();
?>
</li>
<!--************fin test cpmfetch************-->
You can see here, the first pic in the sidebar "cpmfetch in WordPress sidebar" (http://blog-photos.cabiddu.net/)
Hope it can help you
Poubao :D