CPMfetch for 1.5.6 - Page 3 CPMfetch for 1.5.6 - Page 3
 

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 for 1.5.6

Started by lurkalot, June 08, 2010, 11:35:18 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lurkalot

#40
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. ;)
Running SMF 2.1.4  / Tinyportal 3.0.1, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

eita

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):
Syntax error in block code. Please check the code.

The other two (shown in my post) both gave the same error message:
Fatal error: Class 'cpm' not found in /home/eita932/public_html/smftest/Sources/PortalBlocks.php(3561) : eval()'d code on line 2

eita

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

lurkalot

Quote from: eita on June 27, 2012, 11:14:43 PM
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. 


#cpmfetch table {
    width: 100%;
}

#cpmfetch td {
    width: 25%;
}

#cpmfetch {
    text-align: center;
}
Running SMF 2.1.4  / Tinyportal 3.0.1, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

eita

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.

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

eita

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

Αndré

thumbnails.php?album=lastup
has to be changed to
thumbnails.php?album=random
to access the "random" meta album.

lurkalot

Quote from: eita on June 29, 2012, 02:02:43 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.
Running SMF 2.1.4  / Tinyportal 3.0.1, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

eita

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!

ian_m

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

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

lurkalot

#50
Quote from: ian_m on March 10, 2013, 01:19:15 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
Running SMF 2.1.4  / Tinyportal 3.0.1, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

ian_m

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

lurkalot

Quote from: ian_m on March 10, 2013, 11:06:22 PM
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.
Running SMF 2.1.4  / Tinyportal 3.0.1, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

ian_m

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

gmc

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
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

gmc

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
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

lurkalot

Quote from: gmc on March 21, 2013, 06: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

2.0.0 was the latest stable release, I think you must have a development release.
Running SMF 2.1.4  / Tinyportal 3.0.1, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

gmc

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
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

gmc

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
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

kwalsh

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:

<?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.