Advanced search  

News:

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

Pages: 1 2 [3] 4 5 6   Go Down

Author Topic: CPMfetch for 1.5.6  (Read 86795 times)

0 Members and 1 Guest are viewing this topic.

lurkalot

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 814
  • +Tinyportal Support team.
Re: CPMfetch for 1.5.6
« Reply #40 on: June 25, 2012, 11:17:17 PM »

eita,  if you're using a php block in your portal then you won't need the

<?php  at the beginning

And the ?> at the end of your code.

You could try the code I use in a Tinyportal php block, it's the second one in this post http://forum.coppermine-gallery.net/index.php/topic,65412.msg336985.html#msg336985

You'll need to change the url's etc to match yours instead of mine. ;)
« Last Edit: June 25, 2012, 11:24:34 PM by lurkalot »
Logged
Running SMF 2.0.11  / Tinyportal 1.2, bridged with Coppermine 1.5.34, plus cpmfetch 2.0.0

eita

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: CPMfetch for 1.5.6
« Reply #41 on: June 25, 2012, 11:34:11 PM »

That was quick reply, lurkalot  :), thanks a lot. But I'm probablys still doing something wrong, bexause when I tried the mentioned codes I got these errors:

The first (shown in my post):
Code: [Select]
Syntax error in block code. Please check the code.
The other two (shown in my post) both gave the same error message:
Code: [Select]
Fatal error: Class 'cpm' not found in /home/eita932/public_html/smftest/Sources/PortalBlocks.php(3561) : eval()'d code on line 2
Logged

eita

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: CPMfetch for 1.5.6
« Reply #42 on: June 27, 2012, 11:14:43 PM »

That was it, lurkalot  ;D - it was perfect.
Thank you a billion times!
Logged

lurkalot

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 814
  • +Tinyportal Support team.
Re: CPMfetch for 1.5.6
« Reply #43 on: June 29, 2012, 12:36:25 AM »

That was it, lurkalot  ;D - it was perfect.
Thank you a billion times!

No problem.  By the way, as your using SMF, and Simpleportal, do your thumbnails align to the left in your block?  if so ad this to your index.css file in each theme you use. 

Code: [Select]
#cpmfetch table {
    width: 100%;
}

#cpmfetch td {
    width: 25%;
}

#cpmfetch {
    text-align: center;
}
Logged
Running SMF 2.0.11  / Tinyportal 1.2, bridged with Coppermine 1.5.34, plus cpmfetch 2.0.0

eita

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: CPMfetch for 1.5.6
« Reply #44 on: June 29, 2012, 02:02:43 AM »

Yes, they align to the left. No big deal, but even better if they are in the center. I sure will try your solution  ;).

Simpleportal is my choice, no doubt about it. (Using the SMF default theme) it even created a scrollbar when I tested to move a block containing several thumbnails to the left side blocks. Different with the core theme..that expanded to fit the number of images no matter of it was two or more.. But that's not about your great code.

One more thing you might be able to help me with, if you would be so kind? I changed your code to show random insted of latest pictures. Have no idea about how things should be done, just tested...and it worked great. But when looking closer to the code I see one more thing that probably should be changed. I just have no idea what to change it into.

Code: [Select]
echo '<div id="cpmfetch">';chdir("../cpg15x/cpmfetch/");include "cpmfetch.php"; $objCpm = new cpm();$options = array("subtitle" => "<center>{{pTitle}} <br>{{pHits}} Views <center> </center>");$objCpm->cpm_viewRandomMedia(1,4,$options);$objCpm->cpm_close();chdir("../../");echo '<a href="http://bestregion.net/cpg15x/thumbnails.php?album=lastup&cat=0?action=gallery"><u><b>View more random images</b></u></a>';
if ($context['user']['is_logged'])

if ($context['user']['is_logged'])
{
$thecat = 10000 + $context['user']['id'];
echo ' •
<a href="http://bestregion.net/cpg15x/index.php?cat='. $thecat .'" alt="My Gallery"><u><b>My Gallery</b></u></a>';
}

My question is if this (bold) should be changed? Just ask because for me as total stranger to coding might look as short for "latest uploaded/updated":
/thumbnails.php?album=lastup&cat=0?action=gallery"><u><b>View more random images</b></u></a>'

Just asking  :) 
Logged

eita

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: CPMfetch for 1.5.6
« Reply #45 on: June 29, 2012, 02:20:39 AM »

One more thing to mention: the code works just as good on bridged as on not bridged Coppermine/SMF. If someone wonder.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277
Re: CPMfetch for 1.5.6
« Reply #46 on: June 29, 2012, 08:43:46 AM »

Code: [Select]
thumbnails.php?album=lastuphas to be changed to
Code: [Select]
thumbnails.php?album=randomto access the "random" meta album.
Logged

lurkalot

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 814
  • +Tinyportal Support team.
Re: CPMfetch for 1.5.6
« Reply #47 on: June 29, 2012, 08:55:19 AM »


My question is if this (bold) should be changed? Just ask because for me as total stranger to coding might look as short for "latest uploaded/updated":
/thumbnails.php?album=lastup&cat=0?action=gallery"><u><b>View more random images</b></u></a>'

Just asking  :)

That bit of code was added just to give the block a bit more functionality, As I was pulling the latest gallery images to my front page, I thought it would be useful to have a show more latest images link.  You are set to random, so you could replace "lastup" in that line to "random" if you wish.
Logged
Running SMF 2.0.11  / Tinyportal 1.2, bridged with Coppermine 1.5.34, plus cpmfetch 2.0.0

eita

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: CPMfetch for 1.5.6
« Reply #48 on: June 29, 2012, 12:29:58 PM »

Thank you, André and lurakot. I will change that bit of the code as soon as I'm back at my own computer. Even if it's working great as it is I suppose it will prevent trouble at some point to do so.
Great help and support, people, and please excuse such silly questions. It's great to receive help even if one don't know anything about coding.
I salut you!
Logged

ian_m

  • Coppermine newbie
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 3
Re: CPMfetch for 1.5.6
« Reply #49 on: March 10, 2013, 02:19:15 AM »

Can someone give me some info to help get me started with CPMfetch.

I am using coppermine 1.5.22 andthe only download of CPMfetch that I can find is 1.63

This thread starts with changing the 1 line of code in install.php however in my download that files contains no php just the following

Code: [Select]
/**
 *  RELEASE VERSION: 1.6.3
 *
 * This is the installation program for CpmFetch. 
 *
 * Usage:  Call this file from a web browser and follow the instructions
 *
 */

I had a scan here http://sourceforge.net/projects/coppermine/files/Plugins/1.5.x/ and cant find it and have been unable to locate downloads in any other treads. Its late and I might be overlooking the obvious so sorry if I am but can someone point me to a download for 1.5.22 or the older one that has the one line of code that requires changing for the newer coppermine.

Many thanks

Ian
Logged

lurkalot

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 814
  • +Tinyportal Support team.
Re: CPMfetch for 1.5.6
« Reply #50 on: March 10, 2013, 10:43:55 AM »


I am using coppermine 1.5.22 andthe only download of CPMfetch that I can find is 1.63


Ian. The edited version of CpmFetch 2.0.0 is attached to the bottom of the very first post in this thread. Here
« Last Edit: March 10, 2013, 11:17:02 PM by lurkalot »
Logged
Running SMF 2.0.11  / Tinyportal 1.2, bridged with Coppermine 1.5.34, plus cpmfetch 2.0.0

ian_m

  • Coppermine newbie
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 3
Re: CPMfetch for 1.5.6
« Reply #51 on: March 11, 2013, 12:06:22 AM »

A haa I was having a blind moment thanks for that.

I must say the docs are really impressive, the only thing is on the download it might be worth updating that line 61 with the working code for 1.5

Thanks again and sorry for my post I just seemed to be over looking it somehow.

Cheers

Ian
Logged

lurkalot

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 814
  • +Tinyportal Support team.
Re: CPMfetch for 1.5.6
« Reply #52 on: March 11, 2013, 12:32:22 AM »

A haa I was having a blind moment thanks for that.

I must say the docs are really impressive, the only thing is on the download it might be worth updating that line 61 with the working code for 1.5

Thanks again and sorry for my post I just seemed to be over looking it somehow.

Cheers

Ian

Ian, not your fault, I added it after you posted. Actually the file should already have the edit for 1.5.x  I edited it before I uploaded it.  Please make sure you got the file from the first post in this topic, not the file I pointed to earlier today.
Logged
Running SMF 2.0.11  / Tinyportal 1.2, bridged with Coppermine 1.5.34, plus cpmfetch 2.0.0

ian_m

  • Coppermine newbie
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 3
Re: CPMfetch for 1.5.6
« Reply #53 on: March 11, 2013, 01:18:02 AM »

I think I downloaded the file about 5 mins after your post last night however more than an hour has past since I downloaded so cant remember now.
Good news that whatever download I have is working fine I am only using for something very simple when I get more time I might add the Jquery nivo slider to get some cool fade effects but I really only want get a most recent uploads to show on a sidebar.

For info this is in fact being called from a snippet on the MODx framework which runs the site I am using coppermine for the site gallery as I have found most of the MODx images scripts to much hassle to get things how I want them.

Thanks again

Ian
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 692
    • GMC Design Photo Gallery
Re: CPMfetch for 1.5.6
« Reply #54 on: March 19, 2013, 04:58:58 AM »

Trying to run CPMFetch against a Gallery at version 1.5.22.
I downloaded the newest file (from first post in this thread), uploaded the cpmfetch folder and ran the install.
The install worked and displayed photos as expected.
The cfig_random.php script however doesn't appear to be working - attempts to run it result in the error (image):
"The image "http://greggallery.gmcdesign.com/cpmfetch/cfig_random.php" cannot be displayed because it contains errors."
The response should be the display of a random image from the gallery suitable for use in a IMG tag...

Tried setting debug in cpmfetch_config.php:
// Toggles debug mode on / off - put inline as HTML comments
  $config_overrides['cfDebugMode'] = 'true';
but as this is only expected to ruturn a jpg image - no diagnostics are visible...

The cpmfetch_config.php that I had working with an old 1.4.x gallery indicated:
$CONFIG_WRITTEN_VERSION="2.1.1";

The current cpmfetch_config.php downloaded and installed with 1.5.22 gallery indicates:
$CONFIG_WRITTEN_VERSION="2.0.0";

cfig_random.php includes cfimaget.php - which contains (at 2.0.0):
// This one you need to adjust unless your galler is at http://www.youname.com/photos
// If you installed right to the root of your web site, just use a /
// TODO This should be path to config file
//  $urltocpm = "/photos/";
$pathToConfigFile = "";
It appears the 'todo' was done - and now no update is needed?

the 2.1.1 version contained these comments leading me to believe "" is he correct value (cfimageget.php is in the same folder):
// This is the relative path to the cpmfetch_config.php file
// If this script is in the same directory as the cpmfetch.php file, you should be able
// to leave it blank
$pathToConfigFile = "";

I can dig deeper into this - but wanted to see if I was missing something obvious...  or if there is a known problem in this area (didn't see any other hits on the board searching...)
My primary use of cpmfetch is via variations of the cfig_random.php script in image tags to pull random images meeting certain category or album criteria...

Gallery info:
My gallery is at http://greggallery.gmcdesign.com  running Version 1.5.22
Plugins: minicms and shopcpg
Mods: cpmfetch
You can view the error using:
http://greggallery.gmcdesign.com/cpmfetch/cfig_random.php
A working version (V2.1.1 of CPMFetch against an old gallery (1.4.x) waiting for an upgrade...):
http://skygallery.gmcdesign.com/cpmfetch/cfig_random.php

Thanks for the help!
Greg
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 692
    • GMC Design Photo Gallery
Re: CPMfetch for 1.5.6
« Reply #55 on: March 21, 2013, 07:12:01 AM »

Well... think I solved my problem... I went back to what I was running with the 1.4.x galleries - which appears to be a higher version of CPMFETCH than what is available here - 2.1.1 vs 2.0.0.
I did need to change line 61 of install.php to change the reference to p.owner_name as described in earlier post - and then all was well again.

I'll look for my original download of 2.1.1 in case someone else needs it.

Greg
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

lurkalot

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 814
  • +Tinyportal Support team.
Re: CPMfetch for 1.5.6
« Reply #56 on: March 21, 2013, 09:01:22 AM »

Well... think I solved my problem... I went back to what I was running with the 1.4.x galleries - which appears to be a higher version of CPMFETCH than what is available here - 2.1.1 vs 2.0.0.
I did need to change line 61 of install.php to change the reference to p.owner_name as described in earlier post - and then all was well again.

I'll look for my original download of 2.1.1 in case someone else needs it.

Greg

2.0.0 was the latest stable release, I think you must have a development release.
Logged
Running SMF 2.0.11  / Tinyportal 1.2, bridged with Coppermine 1.5.34, plus cpmfetch 2.0.0

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 692
    • GMC Design Photo Gallery
Re: CPMfetch for 1.5.6
« Reply #57 on: March 21, 2013, 02:31:23 PM »

Appears so... I found the original zip - and it was named copperminefetch-2.1.1-dev.zip.  Looks like I downloaded it in 2009 - would have only been to fix a problem I was having... I will play with dev versions in my 'sandbox' - but I had implemented this across my sites in the same timeframe as upgrades to 1.4.21.

If you would like a copy of the zip - let me know...
A quick 'size' compare shows about 2500 byte increase in cpmfetch.php; 2500 byte increase in cpmfetch_dao.php; 400 byte decrease in cfimageget.php.

It does need the same one line change in install.php that version 2.0.0 required to work with 1.5.x.

Greg
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 692
    • GMC Design Photo Gallery
Re: CPMfetch for 1.5.6
« Reply #58 on: March 21, 2013, 02:47:57 PM »

And from the 2.1.1 changelog - specifically had changes to cfimageget (included in cfig_random.php) to support cpmfetch v2...

Changes to cfimageget

2007-06-20 05:43  wbchmura

  * .: Fixes to make it compatible with cpmfetch 2.x. Also added in
    normal as alias to int, cat as an alias to category.

Attaching the release notes in case others have issues with 2.0.0...
Greg
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

kwalsh

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: CPMfetch for 1.5.6
« Reply #59 on: May 20, 2013, 01:26:25 AM »

Hi guys

installed this a few times in the past so im not sure why im having trouble with it.

My gallery thumbs are too big for the space i want them to show up on my main page. I tried to use the resize code but they are not resizing and i dont understand why!

Heres the code i currently have:

Code: [Select]
<?php
  
include "./gallery/cpmfetch/cpmfetch.php";
  
$objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
  
$options = array('windowtarget' => '_blank',"imageheight"=>'30',"imagewidth"=>'30');
  
$objCpm->cpm_viewLastAddedMedia(1,4);
  
$objCpm->cpm_close();
?>

the thumbs at the moments are 120 pixels which are way too big for what i need, i need at least half that size.
Logged
Pages: 1 2 [3] 4 5 6   Go Up
 

Page created in 0.097 seconds with 21 queries.