Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Embedding in Wordpress  (Read 9500 times)

0 Members and 1 Guest are viewing this topic.

Shelia

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Embedding in Wordpress
« 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!
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Embedding in Wordpress
« Reply #1 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)
Logged
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

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 123
Re: Embedding in Wordpress
« Reply #2 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
Logged

Nibbler

  • Guest
Re: Embedding in Wordpress
« Reply #3 on: April 16, 2008, 07:12:50 pm »

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

Shelia

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Embedding in Wordpress
« Reply #4 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.
Logged

Nibbler

  • Guest
Re: Embedding in Wordpress
« Reply #5 on: April 16, 2008, 08:55:35 pm »

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

Shelia

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Embedding in Wordpress
« Reply #6 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.
Logged

ashenasylum

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Embedding in Wordpress
« Reply #7 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.
Logged

Nibbler

  • Guest
Re: Embedding in Wordpress
« Reply #8 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/)
Logged

ashenasylum

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Embedding in Wordpress
« Reply #9 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.  :]
Logged

poubao

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: la
  • Offline Offline
  • Gender: Male
  • Posts: 277
    • Collections du Laos
Re: Embedding in Wordpress
« Reply #10 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"

Hope it can help you

Poubao :D
Logged
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**
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 19 queries.