forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: Shelia on April 16, 2008, 05:55:58 am

Title: Embedding in Wordpress
Post by: 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 ->

                       
Code: [Select]
<?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!
Title: Re: Embedding in Wordpress
Post by: vuud on April 16, 2008, 07:42:00 am
I have been trying to embed this code into the sidebar on a new Wordpress 2.50 install ->

                       
Code: [Select]
<?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)
Title: Re: Embedding in Wordpress
Post by: capecodgal on April 16, 2008, 07:11:33 pm
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
Title: Re: Embedding in Wordpress
Post by: Nibbler on April 16, 2008, 07:12:50 pm
You can't include() the php file using an url. Use a path instead.
Title: Re: Embedding in Wordpress
Post by: Shelia on April 16, 2008, 08:51:51 pm
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.
Title: Re: Embedding in Wordpress
Post by: Nibbler on April 16, 2008, 08:55:35 pm
If you provide more information we could help you find the right path.
Title: Re: Embedding in Wordpress
Post by: Shelia on April 17, 2008, 12:20:43 am
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.
Title: Re: Embedding in Wordpress
Post by: ashenasylum on May 02, 2008, 01:06:12 am
I'm also having this problem.  When I attempt to include this into my wordpress header.php file (inside of a div code):

Code: [Select]
<!--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:

Code: [Select]
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.
Title: Re: Embedding in Wordpress
Post by: 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/)
Title: Re: Embedding in Wordpress
Post by: ashenasylum on May 02, 2008, 05:29:25 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.  :]
Title: Re: Embedding in Wordpress
Post by: poubao on June 23, 2008, 07:34:48 pm
Here the code i use in the sidebar of Wordpress 2.51

Code: [Select]
<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