Advanced search  

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

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

Author Topic: CPMfetch for 1.5.6  (Read 324314 times)

0 Members and 2 Guests are viewing this topic.

kwalsh

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: CPMfetch for 1.5.6
« Reply #60 on: May 20, 2013, 11:08:41 am »

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

Code: [Select]
<div style="position:absolute; left:157px; top:568px; width:651px;">
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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: CPMfetch for 1.5.6
« Reply #61 on: May 21, 2013, 11:36:01 am »

A link to the affected page would be really helpful.
Logged

forbesy

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: CPMfetch for 1.5.6
« Reply #62 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


Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: CPMfetch for 1.5.6
« Reply #63 on: August 27, 2013, 09:19:51 am »

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

astrasuite

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
Re: CPMfetch for 1.5.6
« Reply #64 on: September 19, 2013, 01:07:20 am »

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/


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
Logged

astrasuite

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
Re: CPMfetch for 1.5.6
« Reply #65 on: September 22, 2013, 02:42:01 pm »

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


Code: [Select]
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/

Code: [Select]

  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();
Logged

basyephoto

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: CPMfetch for 1.5.6
« Reply #66 on: May 31, 2014, 12:26:04 am »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: CPMfetch for 1.5.6
« Reply #67 on: June 16, 2014, 12:23:35 pm »

Code: [Select]
$objCpm->cpm_viewRandomMediathat 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.
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: CPMfetch for 1.5.6
« Reply #68 on: June 17, 2014, 04:44:26 am »

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

debuk

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: CPMfetch for 1.5.6
« Reply #69 on: August 09, 2014, 05:39:18 pm »

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
Logged

debuk

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: CPMfetch for 1.5.6
« Reply #70 on: August 09, 2014, 05:42:51 pm »

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

debuk

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: CPMfetch for 1.5.6
« Reply #71 on: August 09, 2014, 06:13:43 pm »

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  :-[
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: CPMfetch for 1.5.6
« Reply #72 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...

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

netb

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 82
Re: CPMfetch for 1.5.6
« Reply #73 on: March 11, 2015, 03:15:34 pm »

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

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: CPMfetch for 1.5.6
« Reply #74 on: March 14, 2015, 11:46:20 pm »

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

panhead

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 108
Re: CPMfetch for 1.5.6
« Reply #75 on: May 25, 2015, 09:19:05 pm »

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

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: CPMfetch for 1.5.6
« Reply #76 on: May 26, 2015, 12:15:19 am »

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.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

panhead

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 108
Re: CPMfetch for 1.5.6
« Reply #77 on: May 26, 2015, 08:14:00 am »

OK, will do.
Logged

zebios

  • Coppermine newbie
  • Country: 00
  • Offline Offline
  • Posts: 2
    • referencement google
Re: CPMfetch for 1.5.6
« Reply #78 on: November 22, 2016, 06:24:14 am »

Hello,

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

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: CPMfetch for 1.5.6
« Reply #79 on: November 22, 2016, 01:25:20 pm »

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:
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...
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money
Pages: 1 2 3 [4] 5 6 7   Go Up
 

Page created in 0.038 seconds with 20 queries.