CPMfetch for 1.5.6 - Page 4 CPMfetch for 1.5.6 - Page 4
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

CPMfetch for 1.5.6

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

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

kwalsh

After much thinking, i think its my div tables that are surrounding it. Anyone good at coding can confirm/fix please?

<div style="position:absolute; left:157px; top:568px; width:651px;">

Quote from: kwalsh 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:

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

Αndré

A link to the affected page would be really helpful.

forbesy

A quick question ;

I've got CPMFetch running nicely, displaying six random images from the gallery on my (myBB 1.6) forum, (all bridging working fine) but how do I tweak the information that is displayed below each picture?  I'm sure that there's just a line I need to change somewhere - essentially, all I want displayed is the image title (not description, owner name etc, number of views, etc).  I'm a bit of a newb to this PHP game - I've had a look through the cpmfetch.php file, but can't see anything obvious that needs to be changed.

Any help grateully appreciated!

Matt
Southsea UK

Forum - http://fhd-forums.orgfree.com/forums/index.php
CPGallery - http://fhd-forums.orgfree.com/gallery/index.php



Αndré

Is this topic already solved, as I cannot see any information below your pictures? I don't know this plugin well, so there's maybe some option like "show meta data blow pictures on/off", which you currently use.

astrasuite

That's a tough one it seems, at least for me.  I think you will have to modify function createTable in cpmfetch.php to add the title under each table TR created ...

I prefer to have no titles under thumbnails, but open the larger image in Lightbox, and the title will be there ... example below where I use cpmfetch in Wordpress, fetching images from my coppermine gallery

http://www.astrasuite.com/astrablog/palmer-audio-2-5-turntable-gallery/


Quote from: forbesy on August 27, 2013, 08:43:17 AM
A quick question ;

I've got CPMFetch running nicely, displaying six random images from the gallery on my (myBB 1.6) forum, (all bridging working fine) but how do I tweak the information that is displayed below each picture?  I'm sure that there's just a line I need to change somewhere - essentially, all I want displayed is the image title (not description, owner name etc, number of views, etc).  I'm a bit of a newb to this PHP game - I've had a look through the cpmfetch.php file, but can't see anything obvious that needs to be changed.

Any help grateully appreciated!

Matt
Southsea UK

Forum - http://fhd-forums.orgfree.com/forums/index.php
CPGallery - http://fhd-forums.orgfree.com/gallery/index.php

astrasuite

While migrating my Wordpress Nextgen images to Coppermine, to be called by cpmfetch instead, I just realized I do have some rare occasions where having a title under thumbs is good. 

I use cpg1.5.24, cpmfetch 2.1.1, using the function cpm_viewLastAddedMediaFrom.  The cpmfetch subtitle option does not seem to work. 

For those with the same configuration, I modified the function htmlTagTD under cpmfetch.php (jcr are my comments) :



function htmlTagTD($contents, $row) {
$htmlOut = '<td';

if (array_key_exists('cellstyle',$this->styleHash))
$htmlOut .= " {$this->styleHash['cellstyle']}";

// jcr - added check if row is null to avoid PHP warnings by server - $row != "" and
if ($row != "" and array_key_exists('cpmCellCssId',$row)) $htmlOut .= " id='{$row['cpmCellCssId']}'";


$htmlOut .= $this->getOptionAttributes("cellattributes");

//jcr - cancel this out and expand it -  $htmlOut .= '>' . $contents . '</td>' . "\n";

//jcr - add title below thumb if requested - i.e. 'showtitle' is in options
if ((array_key_exists('showtitle',$this->optionHash)) and (array_key_exists('cpmAlttag',$row))) {
$htmlOut .= '>' . $contents . "\n" . $row['cpmAlttag'] . '</td>' . "\n";
} else {
$htmlOut .= '>' . $contents . '</td>' . "\n";
}

return $htmlOut;

/*
$htmlOut = '<td';
if (array_key_exists('cellstyle',$this->styleHash)) $htmlOut .= " {$this->styleHash['cellstyle']}";
if ($extraAttributes != "") $htmlOut .= " " . $extraAttributes;
$htmlOut .= $this->getOptionAttributes("cellattributes");
$htmlOut .= '>' . $contents . '</td>' . "\n";
return $htmlOut;
*/


}


I then call from my wordpress post as shown below.  This calls 2 albums, the second album is the one where I want titles under the thumb.  I just pass "showtitle" => "true" as part of the options array, as well as a css style to center it.

The result is at -> http://www.astrasuite.com/astrablog/absolare-gallery/


  include "../client-system-albums/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("../client-system-albums/cpmfetch/cpmfetch_config.php");
  $objCpm->cpm_unlock_private(true);
  $options=array(imagesize => "thumb", imagelink => "large", imagewidth => "128", imageheight => "128", windowtarget => "_blank", "alttag" => "{{pTitle}}", "tablestyle" => "center-css-table");
  $objCpm->cpm_viewLastAddedMediaFrom ("album=152",20,5,$options);
  echo '<div class="clr"></div>';
  echo "<p>&nbsp;</p>";
  echo "<p>&nbsp;</p>";
  echo "<p>&nbsp;</p>";
  echo "<div class='h2h1-custom7'><h2>Absolare Leather Options</h2></div>";
  $options=array(imagesize => "thumb", imagelink => "large", imagewidth => "128", imageheight => "128", windowtarget => "_blank", "alttag" => "{{pTitle}}", "tablestyle" => "center-css-table", "showtitle" => "true", "cellstyle" => "center-text");
  $objCpm->cpm_viewLastAddedMediaFrom ("album=153",20,5,$options);
  $objCpm->cpm_close();


basyephoto

First thanks for this, I have a need to support external random photos from my website.  I installed this and it appears to be working fine, however I am seeing the last uploaded instead of the random files.  I see some posted the same thing, and I also see what to find and replace, but I am not sure what file you are talking about?  I can not find that code in the config or cpmfetch file. 

http://centralgarrisonphotos.com/cpmfetch/install.php

There is my install which works fine, to link to form an outside site would the following code work?

<?php
  include "http://centralgarrisonphotos.com/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("http://centralgarrisonphotos.com/cpmfetch/cpmfetch_config.php");
  $objCpm->cpm_viewLastAddedMedia(1,1);
  $objCpm->cpm_close();
?>

<?php
  include "http://centralgarrisonphotos.com/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("http://centralgarrisonphotos.com/cpmfetch/cpmfetch_config.php");
  $objCpm->cpm_viewRandomMedia(1,1):
  $objCpm->cpm_close();
?>

Can I just change the third line to display random images?  I also want to display just one image, so I am assuming this is correct to display?

Αndré

$objCpm->cpm_viewRandomMedia
that method needs to be supported by the CPMFetch object. As I never used CPMFetch, I don't know if it will work. Maybe someone else can check or test that.

gmc

Sorry I missed this thread somehow...  Thanks for 'bumping' it André

Yes - I would expect the code you cited to work... The first example will show the last added file, and the second random (which of course sometimes will be the last added...) Each of your examples will display a single image (1 row by 1 column).

It's only necessary to include cpmfetch.php once... the code will be reused. You can either delete one include - or change to include_once and let php determine if its been loaded already.

This is an extract of code I use with $rows, $columns, $options set prior.  $options can be omitted or be an empty array if not used.

      include_once "$cpg_rel/cpmfetch/cpmfetch.php";
      $objCpm = new cpm("$cpg_rel/cpmfetch/cpmfetch_config.php");
      $objCpm->cpm_viewRandomMedia($rows, $columns, $options);
      $objCpm->cpm_close();


You can see this code in use at http://www.skymasters.org - the random photos down the right column and across the bottom are both served by cpmfetch using the code above...
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

debuk

I am slightly confused with cpmfectch.

I have the following php code

<?php
  include "./gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
$options = array('windowtarget' => '_blank',"imagewidth"=>"60", "imagelength"=>"60","tablestyle" => "cpmfetch");
  $objCpm->cpm_viewLastAddedMedia(4,1);
  $objCpm->cpm_close();
?>

My issue is with the $options part. Have I added it incorrectly? When clicking an image it takes you to the gallery on the same page not a blank/new one and the images aren't resizing either.

Now I'm trying to style the images and have a css file named cpmfetch.css located in the cpmfetch directory. How do I link to this file, at present I have  "tablestyle" => "cpmfetch"  but I'm assuming that is totally wrong.

The website is danicapatrick.uk

debuk

UPDATE: I have now added the $options in the code and have the images resized etc it is just the style sheet that I can't link to.

debuk

So I've realised that "tablestyle" => "cpmfetch" is calling up a classname from a stylesheet, so where do I add my css?

I wish you had the option to edit previous posts  :-[

gmc

Since CPMFetch is invoked outside of Coppermine - you will need to edit the relevant style sheet used on the page you are displaying the pics...

Looking at the source for page danicapatrick.uk - I see many <link rel='stylesheet' ...> tags...
The desired CSS source can be added to any of these - or in a new file that is included.
(or any other mechanism wordpress (what it appears to be) allows for adding CSS code.)

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

netb

Which is the latest version? I decided to try this and it looks really cool but the forum is bloated with topics and as I have seen some users are using the cpmfetch 2.1.1 of which I can't find a download link anywhere. Only version 2.0 in the first post and gmc talks about 2.1.1 but no links.

gmc

V2.0.0 is the latest 'stable' release - and many are using that on their sites...
V2.1.1 is a development release that was never completed or officially released.
At least one item addressed there is for cfimageget - used to display CPG images on external sites (where there is no access to include the cpmfetch code). cfimageget.php is placed in an <img src=...> tag - and the script returns an image the browser will display. This did not work properly in 2.0.0.

I have now attached the V2.1.1 code to the first post, and separately the release notes (also included in the zip) - so you can see the changes and determine which version to use.
Remember 2.1.1 is a dev/beta release... I have been using it for years across my sites - but your mileage may vary... I certainly don't use all the available features in my installations.

Greg
http://greggallery.gmcdesign.com
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

panhead

I am using phpBB and like to include cpmfetch in the index.php. Does anyone know where to put the code in index.php?

phill104

That depends so much on the design of the page and where exactly you want to put the images. I think that is a question better asked on the phpBB forums as they will know their code better than we do.
It is a mistake to think you can solve any major problems just with potatoes.

panhead


zebios

Hello,

it works fine for me, but can i center the Picture in a Block?

gmc

Quote from: zebios on November 22, 2016, 06:24:14 AM
Hello,

it works fine for me, but can i center the Picture in a Block?
You didn't say what software you are using for your 'Block'.. I assume either a portal or CMS...

My response above still applies:
Quote from: gmc on August 10, 2014, 12:03:26 AM
Since CPMFetch is invoked outside of Coppermine - you will need to edit the relevant style sheet used on the page you are displaying the pics...
How it appears on your page will be controlled by that page's CSS...
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money