CpmFetch - Embedding in templates (SMF, Wordpress, PHPBB, etc, ...) CpmFetch - Embedding in templates (SMF, Wordpress, PHPBB, etc, ...)
 

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

CpmFetch - Embedding in templates (SMF, Wordpress, PHPBB, etc, ...)

Started by vuud, May 07, 2005, 07:27:38 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

vuud

CpmFetch can be pretty easily embedded into other applications.  This thread is dedicated to that.

It has been reported to work in:

  • SMF Forums
  • PHPBB
  • WordPress
  • Mambo
  • Xoop


It has not been able to work in:
* Let me know if anyone has this problem


Subscribe to the announcements mailer at http://cpmfetch.fistfullofcode.com to be notified of releases
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

mojito

The links on returned images in tables can be enhanced in design  by passing css right.
But I need the links to keep me inside my wrapper as my coppermine is part of a mambo portal. And clicking an image takes me to the instal of coppermine without my mambo wrapper content around.

I have trolled around the code and found various clues but im not confidant I'd be editing the right bit.

Any pointers for this. Maybee I can hard code in my coppermine link as being absolute?

Please also note i couldnt post a new thread, this thread seems to be the only option.

thanks
mojito

vuud

The links on returned images in tables can be enhanced in design  by passing css right.
But I need the links to keep me inside my wrapper as my coppermine is part of a mambo portal. And clicking an image takes me to the instal of coppermine without my mambo wrapper content around.

I have trolled around the code and found various clues but im not confidant I'd be editing the right bit.

Any pointers for this. Maybee I can hard code in my coppermine link as being absolute?

Please also note i couldnt post a new thread, this thread seems to be the only option.

thanks
mojito
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

vuud

Quote from: mojito on June 05, 2005, 01:37:53 PM
The links on returned images in tables can be enhanced in design  by passing css right.
But I need the links to keep me inside my wrapper as my coppermine is part of a mambo portal. And clicking an image takes me to the instal of coppermine without my mambo wrapper content around.

I have trolled around the code and found various clues but im not confidant I'd be editing the right bit.

Any pointers for this. Maybee I can hard code in my coppermine link as being absolute?

Please also note i couldnt post a new thread, this thread seems to be the only option.

thanks
mojito


So you just want to make the links point to something other than coppermine?  I don't know mambo... but I like to help

Lemme know
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

fishfreek

First I want to thank Vuud for his help in getting this figured out via e-mail.

Installing CpmFetch and PHPBB using the PHPBB template system (NO EXTRA MODS NEEDED).  There are other solutions on this website that require the install of other mods like Extreme Styles inorder for this to work.  This soultion uses the phpbb template system with out the need for additional mods to be installed.

Everything that I reference below I did on my website http://www.felineadvice.com to get cpmfetch working with the phpbb templates.  I am using Smartor's EZportal but you can use this method to intergrate cpmfetch on any phpbb file you wish.

Open the phpbb file you wish to have cpmfetch included in.  In my example I am using portal.php but you can use index.php or any other phpbb file.

FIND:  $template->assign_vars(array(

ADD BEFORE:


include "./cpmfetch/coppermine.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_setReturnType('html');


Where ./cpmfetch/coppermine.php is the path to the coppermine file installed when you uploaded cpmfetch and /gallery is the path to your coppermine gallery.  In my example my forum is installed in the root of my web space so the gallery is one level up aswell as the cpmfetch install.

FIND:
$template->assign_vars(array(

ADD AFTER:
'RANDOM_IMAGE' => $objCpm->cpm_viewRandomMedia(1,3),

FIND:
);

This is the closing bracket for the template array.

ADD AFTER:
$objCpm->cpm_close();

SAVE FILE

Now open the assocated template file.  In my example I am using portal_body.tpl  Locate where you want the images to appear and insert the approprate HTML and {RANDOM_IMAGE} where you want the images to appear.

If you follow the above you will end up with one row of images and three across.  Edit the  $objCpm->cpm_viewRandomMedia(1,3), in your file if you want more rows or more images.


toastk

I can't seem to add cpmfetch calls to my Wordpress sidebar without cpmfetch (apparently) hosing WP's access to the database. That is, if I add cpmfetch calls to display three random thumbnails from my Coppermine gallery in my WP sidebar, anything from Wordpress in the sidebar below the thumbnails (e.g., category archives, author lists, blogroll, etc.) will not display. Disable the cpmfetch calls, and everything returns to normal.

I am basically using the standard cpmfetch example/test code to pull in a set of 3 images:
<?php
        
include "../cpmfetch/coppermine.php";
        
$objCpm = new cpm("/gallery");
        
$objCpm->cpm_viewRandomMedia(3,1);
        
$objCpm->cpm_close();
?>


I am inserting this code into my Wordpress sidebar.php template. I've tried doing so in a number of ways with varying degrees of failure. Like I said, it's not that the thumbnails aren't displaying; it's that Wordpress's access to its database seems to get hosed by cpmfetch.

Anyone else have this problem? Know of a work-around? Your advice is appreciated.

My blog is here. You'll probably see working thumbnails in the sidebar if you look; these are being created by a different, less robust plugin to which I've made extensive repairs and additions. I'd like to use cpmfetch in its place....

I am using (or trying to use):

  • Wordpress 1.5.1
  • Coppermine Gallery 1.3.3
  • cpmfetch 1.2.2
[/i]

vuud


Toastk,

There was a bug fix in 1.3.4 of cpmfetch that resolved an issue just like this.

IF your cpmfetch and wordpress tables are in the same database, this will most likely solve your problem.

Upgrade to the newest dev version 1.3.8 and give it another try.  Be warned, the coppermine.php file has been renamed, so remove the old one and use cpmfetch.php instead.  (makes more sense doesn't it)

Let us know how that works out, but I am darn sure it will fix your problem

Vuud



Quote from: toastk on June 26, 2005, 06:40:01 PM
I can't seem to add cpmfetch calls to my Wordpress sidebar without cpmfetch (apparently) hosing WP's access to the database. That is, if I add cpmfetch calls to display three random thumbnails from my Coppermine gallery in my WP sidebar, anything from Wordpress in the sidebar below the thumbnails (e.g., category archives, author lists, blogroll, etc.) will not display. Disable the cpmfetch calls, and everything returns to normal.

I am basically using the standard cpmfetch example/test code to pull in a set of 3 images:
<?php
        
include "../cpmfetch/coppermine.php";
        
$objCpm = new cpm("/gallery");
        
$objCpm->cpm_viewRandomMedia(3,1);
        
$objCpm->cpm_close();
?>


I am inserting this code into my Wordpress sidebar.php template. I've tried doing so in a number of ways with varying degrees of failure. Like I said, it's not that the thumbnails aren't displaying; it's that Wordpress's access to its database seems to get hosed by cpmfetch.

Anyone else have this problem? Know of a work-around? Your advice is appreciated.

My blog is here. You'll probably see working thumbnails in the sidebar if you look; these are being created by a different, less robust plugin to which I've made extensive repairs and additions. I'd like to use cpmfetch in its place....

I am using (or trying to use):

  • Wordpress 1.5.1
  • Coppermine Gallery 1.3.3
  • cpmfetch 1.2.2
[/i]
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

toastk

Ha! I was just going to report back that I had tracked this down to the Coppermine and Wordpress tables residing in the same database! I simply created unique DB usernames for wordpress and coppermine, and my problems went away.

I will still upgrade to the newest dev version of cpmfetch, though. I bet cpmfetch forces creation of a new link identifier when it calls mysql_connect() now, doesn't it? ;)

Thanks for the quick response!

Quote from: vuud on June 26, 2005, 06:48:43 PM
Toastk,

There was a bug fix in 1.3.4 of cpmfetch that resolved an issue just like this.

IF your cpmfetch and wordpress tables are in the same database, this will most likely solve your problem.

Upgrade to the newest dev version 1.3.8 and give it another try.  Be warned, the coppermine.php file has been renamed, so remove the old one and use cpmfetch.php instead.  (makes more sense doesn't it)

Let us know how that works out, but I am darn sure it will fix your problem

Vuud

toastk

Quote from: vuud on June 26, 2005, 06:48:43 PM
Let us know how that works out, but I am darn sure it will fix your problem

I upgraded to the latest dev version of cpmfetch and then rolled back to using identical DB usernames in Coppermine and Wordpress. The latest build definitely resolved the issue (but I'm still going to use distinct DB usernames!).

And sure enough... mysql_connect() is forcing creation of a new link. :o  ;D

Thanks again.

vuud

Well, the real problem is that this is one of my first projects in PHP (I come from a perl, java, vb, c++ background).  But your conclusion sounds accurate... I misunderstood when they said database, they meant MYSQL, not the Database inside it (word is used too much). 

But yeah, thats what it does now.  The old solution would have been to not do the close() and that would have the same effect (allowing PHP to clean it up later - but that just is bad form if you ask me)

Good luck!



Quote from: toastk on June 26, 2005, 08:05:58 PM
Ha! I was just going to report back that I had tracked this down to the Coppermine and Wordpress tables residing in the same database! I simply created unique DB usernames for wordpress and coppermine, and my problems went away.

I will still upgrade to the newest dev version of cpmfetch, though. I bet cpmfetch forces creation of a new link identifier when it calls mysql_connect() now, doesn't it? ;)

Thanks for the quick response!

Quote from: vuud on June 26, 2005, 06:48:43 PM
Toastk,

There was a bug fix in 1.3.4 of cpmfetch that resolved an issue just like this.

IF your cpmfetch and wordpress tables are in the same database, this will most likely solve your problem.

Upgrade to the newest dev version 1.3.8 and give it another try.  Be warned, the coppermine.php file has been renamed, so remove the old one and use cpmfetch.php instead.  (makes more sense doesn't it)

Let us know how that works out, but I am darn sure it will fix your problem

Vuud
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

blambert

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.lambertandassoc.com%2Fphotos%2Fscreenshot.jpg&hash=1013140889e6c5510058c851e6c180b80c4ec7d8)

How can I do this...the screenshot was done by a graphics editor.
Here is what I have done so far....can you help with a suggestion?
http://www.lambertandassoc.com/photos/index.php
http://www.lambertandassoc.com/photos/themes/space/callalb.php
http://www.lambertandassoc.com/photos/themes/space/template.shtml
What I am showing is that both parts work but not together. When I run the index.php it won't parse the cal.php which is nested in the templates.shtml. But when I load it direct throught the browser the template.shtml parses the callalb.php.  The callalb.php is really just the 'lastup' being merged into a table right to the {Gallery} with the Random and Lastup turned off. Please help if you can....I have some important projects I am trying to do and they like this style...similar to http://hubblesite.org/gallery/  

vuud

Quote from: blambert on July 07, 2005, 06:56:17 AM

How can I do this...the screenshot was done by a graphics editor.
Here is what I have done so far....can you help with a suggestion?
http://www.lambertandassoc.com/photos/index.php
http://www.lambertandassoc.com/photos/themes/space/callalb.php
http://www.lambertandassoc.com/photos/themes/space/template.shtml
What I am showing is that both parts work but not together. When I run the index.php it won't parse the cal.php which is nested in the templates.shtml. But when I load it direct throught the browser the template.shtml parses the callalb.php.  The callalb.php is really just the 'lastup' being merged into a table right to the {Gallery} with the Random and Lastup turned off. Please help if you can....I have some important projects I am trying to do and they like this style...similar to http://hubblesite.org/gallery/ 

Are you using cpmfetch and saying its messing up your template? 

If not you are posing very very large screen comps in the wrong place.

Let me know, I can either help or magically teleport this post to the proper location (by using magic)




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

Daethian

Okay reposting here :D

Okay I'm sure this is something simple but I have no idea what I'm doing!  I want to use cpmfetch to show random images on my xoops set up.  I installed it and ran the test and I got pass/info and no errors.   I made the custom block but no images will show up in it.  I just want one image. 


include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_viewRandomMedia(1,1);
$objCpm->cpm_close();


I also tried

include "./coppermine/coppermine.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_viewRandomMedia(1,1);
$objCpm->cpm_close();


I'm an intermediate user
my test set up is http://foreverpurple.com/xoopstest/index.php
my gallery is http://foreverpurple.com/gallery/index.php
version is 1.3.2


I'm also thinking of trying to embed this in my B2evolution blog.
"How naked?
4th base naked."

vuud

Quote from: Daethian on July 13, 2005, 03:42:17 AM
Okay reposting here :D

Okay I'm sure this is something simple but I have no idea what I'm doing!  I want to use cpmfetch to show random images on my xoops set up.  I installed it and ran the test and I got pass/info and no errors.   I made the custom block but no images will show up in it.  I just want one image. 


include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_viewRandomMedia(1,1);
$objCpm->cpm_close();


I also tried

include "./coppermine/coppermine.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_viewRandomMedia(1,1);
$objCpm->cpm_close();


I'm an intermediate user
my test set up is http://foreverpurple.com/xoopstest/index.php
my gallery is http://foreverpurple.com/gallery/index.php
version is 1.3.2


I'm also thinking of trying to embed this in my B2evolution blog.


If nothing is happening, and like you said you have xoop set to run PHP in there, then I would suggest trying to add this to the code (somewhere above it)


<?php error_reporting(E_ALL); ini_set('display_errors',1);  ?>


Sometimes the default for PHP is to not display some types of errors... this will tell it to show all the problems.

The other thing is the <?php ?> blocks... you don't have them listed, but I assume you have them in there?

One other thing to try is to VIEW SOURCE in your browser...  sometimes things may not display, but there is output.  Its rare, but I suppose it happens :)

Hope some of that helps, at tleast the error_reporting... may it give you errors (sounds wierd doesn't it)









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

Daethian

I did have them in there but tonight I took them out after someone over at the xoops board said that is how he fixed his.

I'm not sure where to insert that code to generate the errors.  In the XOOPS files some where??  I'll go back to the XOOPS board to see if they responded.
http://www.xoops.org/modules/newbb/viewtopic.php?topic_id=37651&start=0#forumpost169002

That install is strictly a test setup and I'm willing to allow you access to the admin panel to see what I mean.  you can catch me on yahoo if you want purple_penpal@yahoo.com
"How naked?
4th base naked."

vuud

Quote from: Daethian on July 13, 2005, 07:18:58 AM
I did have them in there but tonight I took them out after someone over at the xoops board said that is how he fixed his.

I'm not sure where to insert that code to generate the errors.  In the XOOPS files some where??  I'll go back to the XOOPS board to see if they responded.
http://www.xoops.org/modules/newbb/viewtopic.php?topic_id=37651&start=0#forumpost169002

That install is strictly a test setup and I'm willing to allow you access to the admin panel to see what I mean.  you can catch me on yahoo if you want purple_penpal@yahoo.com

That code has to go somewhere before the calls you make for cpmfetch...  Anywhere that gets executed. 

I checked the forum and it looks like that has to be in a different file and included.... If you want to give me access, PM me the information and I will poke it with a stick a few times.

I'd be interesting to see XOOP from the inside anyway



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

mrmike987

Does anyone here know how to add     <?php $objCpm->cpm_viewLastAddedMedia(1,2)  ?>
to a block in phpnuke?

Thanks

vuud

Quote from: mrmike987 on July 13, 2005, 11:08:41 PM
Does anyone here know how to add     <?php $objCpm->cpm_viewLastAddedMedia(1,2)  ?>
to a block in phpnuke?

Thanks

I don't know PhpNuke, but I just read some of the docs... it looks like you can just create a block and have that execute cpmfetch calls. 

I was reading this page, and the one following it.
http://phpnuke.org/modules.php?name=PHP-Nuke_HOWTO&page=block-theory.html

Seems like it should not be so bad.

Let me know how that works out - I think the wierd thing to do would be figuring out the path to the cpmfetch install from where the block is executed (not where it resides).





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

marian

I want to display one coppermine image in the sidebar of the new template we are finalising. I gave the guy who has written the template the code
<?php
include "./cpmfetch.php";
$objCpm = new cpm("/photos"); $objCpm->cpm_viewLastAddedMedia(1,1);
$objCpm->cpm_close();
?>
That works perfectly on a php page but since he has put it in the Mambo template it is generating errors. You can see these on our test site at www.bymnews.com/merge!

vuud

Quote from: marian on July 21, 2005, 05:16:54 PM
I want to display one coppermine image in the sidebar of the new template we are finalising. I gave the guy who has written the template the code
<?php
include "./cpmfetch.php";
$objCpm = new cpm("/photos"); $objCpm->cpm_viewLastAddedMedia(1,1);
$objCpm->cpm_close();
?>
That works perfectly on a php page but since he has put it in the Mambo template it is generating errors. You can see these on our test site at www.bymnews.com/merge!


Where did you install cpmfetch too?  Unless you installed it in the /merge directory, it wont be able to find it.  You need to edit the include statement to be able to find the file.

For example, if you put the cpmfetch folder off the root of the web site  ( /cpmfetch )

You need to change the include above too:

include "../cpmfetch/cpmfetch.php";
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