Embedding in Wordpress Embedding in Wordpress
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Embedding in Wordpress

Started by Shelia, April 16, 2008, 05:55:58 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Shelia

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!

vuud

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)
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

capecodgal

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

Nibbler

You can't include() the php file using an url. Use a path instead.

Shelia

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.

Nibbler

If you provide more information we could help you find the right path.

Shelia

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.

ashenasylum

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.

Nibbler

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/)

ashenasylum

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.  :]

poubao

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"

Hope it can help you

Poubao :D
L'incohérence de ceux qui nous dirigent, l'incompétence de ceux qui nous commandent,sont un vibrant hommage pour ceux qui exécutent.
                                          **Général Patton**