CpmFetch 1.4 On... Displaying data and images from CPG on your website - Page 21 CpmFetch 1.4 On... Displaying data and images from CPG on your website - Page 21
 

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 1.4 On... Displaying data and images from CPG on your website

Started by vuud, July 08, 2005, 06:43:10 AM

Previous topic - Next topic

0 Members and 7 Guests are viewing this topic.

vuud

Quote from: Babounet on November 07, 2005, 06:34:53 PM
Quote from: vuud on November 03, 2005, 06:54:49 AM
Quote from: Babounet on November 02, 2005, 07:20:46 PM

Can someone explain me how I can use the print_r($row) function?
The problem explain above is certainly not very complicated to solve. But for me, it's not possible as long as I not a php specialist.
Can someone help me with the final solution or with the print_r($row) function?

The print_r function is not to solve your problem, but to teach you something.  It will help you see what data you have at your disposal, which will then help you to solve your problem.

http://www.php.net has the print_r in the documentation !

Its not on the "php specialist" level, or I would not be sending you that way.  A little effort and thought and you can do it.  Really.


Thanks everybody for your help. php as realy no limit and is a big system. But it's not so easy to learn.
I've find an other solution (a friend rewrite a part of the code to do what I need)

Seb

I hope the code rewrite was to the examples, and not to the actual cpmfetch code itself.  Its of course completely okay for you to do it, but it will make upgrades a pain for you. 

Glad to hear one way or another its doing some good for you



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

Feydakin

I went ahead and rewrote most of the site away from Mason and in PHP so that I could get this to work.. Anyway, I have two questions if I may..

1. After much searching I still haven't figured out how to set the border around the image to 0.. Apparently I'm blind..

2. Can I pull the comments with the images?? Maybe just the last comment posted if there is one?? I found this function but I don't think it applies..


cpm_viewLastCommentedImages($rows,$columns, [ array $options=""])


I'm assuming that it just pulls from the images that have comments..

Thanks -

falarious

Hello.

I am gonig to use cpm fetch on my site.

This is the url to it http://falarious.com/index2.php

as you can see, the thumbnails are not all the same size. Also, the thumbnails arent inside the table.
How do I get the thumbnails to all be 100*100, and how do i get the thubnails inside the table?

<?php
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/");

$styleguide = array(

"subtitle" => "</div>
<p>
</p>
<table id='table2' style='border-collapse: collapse;' border='1' bordercolor='#7aabd3' cellpadding='0' cellspacing='0' width='575'>
        <tbody>
        <tr>
          <td bordercolor='#7AABD3' align='center' bgcolor='#103d6a'>
  <strong> <font color='#ffffff' face='Comic Sans MS' size='2'> %t</font></strong></td>
        </tr>
        <tr>
          <td bordercolor='#000033' align='center' bgcolor='#000033' height='59' valign='top'>
  <p>
<font color='#ffffff' face='Comic Sans MS' size='2'>

<strong style='font-weight: 400;'>
%c<br>
<br>
</strong>

</p>
        </tr>
      </tbody></table>    
<p>&nbsp;


 "
,

        

"imagestyle" => "photoclip",
"imagesize" => 'thumb');


$objCpm->cpm_viewLastAddedMedia(20,1,$styleguide);
$objCpm->cpm_close();
?>




tlove

Noticed a slight problem with my image links. I'm using CpmFetch for rss feeds and an image on my main page.

my site

My image links come out with an extra '/' between gallery and album folders. eg http://mysite.com/cpm-dir//albulms/1001/thepic.gif. I'm assuming i used '/gallery/' where i should have used '/gallery' somewhere. I just have no idea where. If i'm right, can somebody point me in the right direction. Otherwise, does anybody know what i need to change to get this corrected.
The output form my feed.xml is( i used some carriage returns to make it easier to read):
Tongo's Photo Shop Recent updates to gallery http://www.tongsondub.com 2005-11-12T10:30:02+01:00 Tongsondub.com
http://www.tongsondub.com http://www.tongsondub.com/images/sitelogo.gif text/html 2005-11-09T01:08:25+01:00
http://www.tongsondub.com admin Personal :: RB.........
http://www.tongsondub.com/tgallery/displayimage.php?pos=-3
<a href="http://www.tongsondub.com/tgallery/displayimage.php?pos=-3">
<img border = "0" src="http://www.tongsondub.com/tgallery//albums/userpics/10001/thumb_Car%20Stuff%20003.jpg" align="right" /></a>
Car Stuff 003.jpg from album Personal<br/>Filesize 74.5 kb<br/>
I can not say what engine that is or whose car its in. That's about all i got to say about that<br/>Rated 0 / 5 stars (0 votes total)
text/html 2005-11-09T01:07:18+01:00 http://www.tongsondub.com admin
Personal :: My new K-sport Coilovers http://www.tongsondub.com/tgallery/displayimage.php?pos=-2
<a href="http://www.tongsondub.com/tgallery/displayimage.php?pos=-2">
<img border = "0" src="http://www.tongsondub.com/tgallery//albums/userpics/10001/thumb_Car%20Stuff%20022.jpg" align="right" />
</a>Car Stuff 022.jpg from album Personal<br/>Filesize 68.6 kb<br/>
Not the most well-known coilovers but they have not let me down.
Most importantly, the price was more than right<br/>Rated 0 / 5 stars (0 votes total) text/html 2005-11-09T01:05:37+01:00
http://www.tongsondub.com admin Personal :: Skyline R34 GTR
http://www.tongsondub.com/tgallery/displayimage.php?pos=-1
<a href="http://www.tongsondub.com/tgallery/displayimage.php?pos=-1">
<img border = "0" src="http://www.tongsondub.com/tgallery//albums/userpics/10001/thumb_gtr.jpg" align="right" /></a>
gtr.jpg from album Personal<br/>Filesize 137.7 kb<br/>The car i will by when i win the Lottery.<br/>Rated 5 / 5 stars (1 votes total)

if you look at the links for the images, they have two '/'s

Thanks all

tlove

found the source of the problem. In the cpmfetch.php file, there is a line that appends '/' to the path to coppermine if its not there and then in the ....._dao.php file, the albums folder is declared as '/albums' so you end up with /coppermine/ and /albums

in cpmfetch(around line 138):

if (substr($urltocpm_,-1) != '/') $urltocpm_ .= '/';


in the dao.php file(around line 170):


$this->fullpathtocpm = $this->partialUrltocpm;

}



$this->OverridePathToAlbums($this->fullpathtocpm . "/albums", $this->partialUrltocpm . "/albums");





$this->setPrivateLockOn(true);

$this->dateFormatString = $this->defaultDateFormatString;


I hope i didn't just screw something up, so far its working fine.

smoke10010

Is there a way to display the thumbs of the last X number of albums updated. much like the cpm_showAlbumsUpdatedOverLastDays except no date and a set number.

vuud

Quote from: smoke10010 on November 14, 2005, 06:25:25 AM
Is there a way to display the thumbs of the last X number of albums updated. much like the cpm_showAlbumsUpdatedOverLastDays except no date and a set number.

Would that mean one thumb from each of the X last updated albums?  Or do you mean the thumb assigned to the album and not the most recent upload?


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

smoke10010

both if possible. Right now i'm not really sure how it works it seems like it takes the last picture of the last album thats been updated.

but i'd like it so that it shows one thumb from each of the X last updated albums preferrably the thumb assigned.

ksshane

Not exactly sure where I went wrong.

Test page shows everything working, but when I add this code

<?php 
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/accgallery");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_close();
?>



To my portal page I get this

cpm_viewRandomMedia(3,3); $objCpm->cpm_close(); ?>


Instead of random photos.

Can someone tell me what I did wrong?

Here is a link to my site if that helps

http://www.aircapitalconstrictors.com/forum/portal1.php

Thanks
Shane

mona87

Im a bit confused.   

this is the code i have to show the last images i uploaded

<?php
include "cpmfetch.php";
$objCpm = new cpm('/visual');
$objCpm->cpm_viewLastAddedMedia (1,4);
$objCpm->cpm_close();
?>



i want the images though to resized down to about 50 for the width.  so i added the option array

<?php
include "cpmfetch.php";
$objCpm = new cpm('/visual');
$objCpm->cpm_viewLastCommentedImages(1,4, [ array imagewidth="50"])
$objCpm->cpm_close();
?>




this is the error i got when i went to my broswer.


QuoteParse error: parse error, unexpected '[' in /home/***/public_html/cpmfetch/test2.php on line 4


any help would be greatly appreciated!

vuud

Quote from: ksshane on November 15, 2005, 01:02:09 AM
Not exactly sure where I went wrong.

Test page shows everything working, but when I add this code

<?php 
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/accgallery");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_close();
?>



To my portal page I get this

cpm_viewRandomMedia(3,3); $objCpm->cpm_close(); ?>


Instead of random photos.

Can someone tell me what I did wrong?

Here is a link to my site if that helps

http://www.aircapitalconstrictors.com/forum/portal1.php

Thanks
Shane

Looks as if your portal is processing or stripping part of the code out.  You can bring it up in the embedding thread, maybe someone else has a problem.  Be worth noting what portal you are using.


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: mona87 on November 15, 2005, 03:44:48 AM
Im a bit confused.   

this is the code i have to show the last images i uploaded

<?php
include "cpmfetch.php";
$objCpm = new cpm('/visual');
$objCpm->cpm_viewLastAddedMedia (1,4);
$objCpm->cpm_close();
?>



i want the images though to resized down to about 50 for the width.  so i added the option array

<?php
include "cpmfetch.php";
$objCpm = new cpm('/visual');
$objCpm->cpm_viewLastCommentedImages(1,4, [ array imagewidth="50"])
$objCpm->cpm_close();
?>


this is the error i got when i went to my broswer.
QuoteParse error: parse error, unexpected '[' in /home/***/public_html/cpmfetch/test2.php on line 4
any help would be greatly appreciated!

It looks as though you are following the docs too literally.  Typically the [ ] around something means that parameter is optional... 

Try something like this:

$objCpm->cpm_viewLastCommentedImages(1,4, array( imagewidth => "50"));


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

pyimaung

I've used CpmFetch for my site and it was working fine. But all of a sudden, it has stopped fetching pics. I uploaded new photos but it's not showing the latest uploaded pics. Why has it stopped fetching? My code is below:


<?php 
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm('/gallery');
$styleguide = array();
$styleguide['imagelink'] = "none";
$styleguide['windowtarget'] = "_blank-cfshow";
$objCpm->cpm_viewLastAddedMedia(1,5,$styleguide); 
$objCpm->cpm_close();
?>


Can anyone spot the problem?? Could it be a database error? How can I fix this? Thanks

vuud

Quote from: pyimaung on November 15, 2005, 01:50:45 PM
I've used CpmFetch for my site and it was working fine. But all of a sudden, it has stopped fetching pics. I uploaded new photos but it's not showing the latest uploaded pics. Why has it stopped fetching? My code is below:


<?php 
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm('/gallery');
$styleguide = array();
$styleguide['imagelink'] = "none";
$styleguide['windowtarget'] = "_blank-cfshow";
$objCpm->cpm_viewLastAddedMedia(1,5,$styleguide); 
$objCpm->cpm_close();
?>


Can anyone spot the problem?? Could it be a database error? How can I fix this? Thanks



You can add in $objCpm->setDebugMode(true);

This will add in a bunch of comments into your html showing the queiers and results and such.  Might help


Also, try adding

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

That will display a lot more than normal







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

pyimaung

Hi Vuud,
Thanks for your reply. I've tried both your suggestions but still not working.
I found out another thing today. I'm the admin and all the photos I upload are fetched but the pics that my users upload which I have to approve do not get fetched. I tried registering as a normal user and tried uploading and approved the files with my admin account. It appears in CPG but CPMFetch does not fetch. I tried uploading again as an admin and the photos were fetched just fine. Please help..Thanks.

Ralphfolkes

I was unable to start a new topic so I am replyng to this one in hopes of an answer.

I have installed cpmfetch on my website and it is functioning for the most part except that when I try to use the last added media command I don't get the last added media.

                     
I am using the following code
<?php 
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/Gallery");
$objCpm->cpm_viewLastaddedMedia(5,1);
$objCpm->cpm_viewRandomMedia(5,1);
$objCpm->cpm_close();
?>

Which gets me    http://isaiahfolkes.com/isaiah_folkes__index.php
It should have a single coluum with 5 pics of last added and then 5 random pics.  The problem I am having is the last added pics don't match coppermine http://isaiahfolkes.com/Gallery/thumbnails.php?album=lastup&cat=0

Is there something I am missing or doing wrong?

jphahn

Quote from: pyimaung on November 15, 2005, 01:50:45 PM
I've used CpmFetch for my site and it was working fine. But all of a sudden, it has stopped fetching pics. I uploaded new photos but it's not showing the latest uploaded pics. Why has it stopped fetching?

I was having exactly the same problem.  It worked fine up until a few days ago.  I was using the SSI method to include the latest photos on an html page.  I changed it to use this method: http://forum.coppermine-gallery.net/index.php?topic=23537.0 and it works fine now.

Jason

guytoon

Hi,

CPMFetch is doing exactly what I'd like to. Unfortunately i tried to install it on 2 servers and it doesnt works. Averything is successfull on the test page but no thumbnail is displayed.

Link to my public cftest http://www.breizhskiff.com/galerie/cpmfetch/cftest.php
Coppermine is there : http://www.breizhskiff.com/galerie/

Note that my directory "albums" has no pictures at the root but in subdirectories (anyway I tried with ome at the root and it didn't change anything).

Thanks for your knid help.

Ghislain

vuud

Quote from: pyimaung on November 16, 2005, 06:38:52 PM
Hi Vuud,
Thanks for your reply. I've tried both your suggestions but still not working.
I found out another thing today. I'm the admin and all the photos I upload are fetched but the pics that my users upload which I have to approve do not get fetched. I tried registering as a normal user and tried uploading and approved the files with my admin account. It appears in CPG but CPMFetch does not fetch. I tried uploading again as an admin and the photos were fetched just fine. Please help..Thanks.

Sorry, my time has been very limited lately so I have not been able to hang out on the board much.

CpmFetch will not grab photos that require logins to see, or ones that are awaiting approval.  So that could be a problem. 

This will help if they are just restricted

cpm_unlockPrivate($bool)

This toggles access to non-public photos (default: false) It allows images not publically available to be selected and displayed until it is turned off, or the object is lost. This program makes no distinction beyond if a media item is public or not - Meaning that photos that may be viewable by logged in users are considered private, not something in between.

I do not think there is a way around the "needing approval" state at this time - that is intentional though - as if you dont want them showing up in your gallery till you see them, you probably don't want them anywhere else.




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: Ralphfolkes on November 18, 2005, 09:54:43 AM
I was unable to start a new topic so I am replyng to this one in hopes of an answer.

I have installed cpmfetch on my website and it is functioning for the most part except that when I try to use the last added media command I don't get the last added media.

                     
I am using the following code
<?php 
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/Gallery");
$objCpm->cpm_viewLastaddedMedia(5,1);
$objCpm->cpm_viewRandomMedia(5,1);
$objCpm->cpm_close();
?>

Which gets me    http://isaiahfolkes.com/isaiah_folkes__index.php
It should have a single coluum with 5 pics of last added and then 5 random pics.  The problem I am having is the last added pics don't match coppermine http://isaiahfolkes.com/Gallery/thumbnails.php?album=lastup&cat=0

Is there something I am missing or doing wrong?

Well, its good you were not able to start a new topic - posts go here.

Second, amazingly enough Isaiah and I have the same head circumferance...  Wierd. :p

What you are doing looks correct, but your right, something is busted in there.

A few things:

What version of CPG?

Are the other ones uploaded any differently than the ones its showing?









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