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

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 2 Guests are viewing this topic.

gmc

Quote from: MDkai on April 01, 2006, 06:34:38 PM
After reading gmc's tip i found the /* */ on a different location (between the beta part)
I switched the position but got a parsing error.

After deleting the two /* */ i had no problems at all and the image from my gallery was there ;)
Just my two cents
Because of the way its coded - two variable assignment statements - removing all the comment tags (/* */) happens to work as well... It first assigns the old (pre 1.4) values - then reassigns the new (1.4+) values...
The intent was comment out the old - and uncomment the new - but as you said - it works with no comments as well...

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

niks_007

Hi Friends,
   When i try to fatch CPG i got following error.


Unknown column 'u.user_website' in 'field list'
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/bollyin/public_html/fatch/cpmfetch_dao.php on line 710

See the cftest.php page...

http://www.bollywoodplus.co.in/fatch/cftest.php

Thanks
I hope some one will help me...
Nishant

gmc

Quote from: niks_007 on April 01, 2006, 08:28:49 PM
Hi Friends,
...

Unknown column 'u.user_website' in 'field list'
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/bollyin/public_html/fatch/cpmfetch_dao.php on line 710
...

Thanks
I hope some one will help me...
Nishant

Please scroll down to post 717... or any number of others below that address this problem...
Greg
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

niks_007

hi....
       The CF is working but i want following

To get pics from last updated three albums from cat=5

how could i can get that


I am using follwing code but it is returing images from last updated album. and i want pics from last three updated albums from cat=5
<?php
include "cpmfetch.php";
$objCpm = new cpm('/wallpapers');
$objCpm->cpm_viewRandomMedia (1,4);
$objCpm->cpm_viewLastAddedMediaFrom (1,4, "cat=5");
$objCpm->cpm_close();
?>




and below image its Tital

What code i need to made

Niks...


doktor k


gmc

Quote from: gmc on April 01, 2006, 05:58:33 PM
Still not able to display images at all in one of my installations, an empty table is produced...
Added "$objCpm->cpm_setDebugMode('true');" to the script, and appears it is finding 0 rows....

Some further testing and some progress...
In disecting and testing the SQL returning 0 rows:

SELECT  p.filepath AS pFilepath, p.filename AS pFilename, p.aid AS pAid, p.filesize AS pFilesize, p.title AS pTitle, p.caption AS pCaption, p.owner_name AS pOwner_name, p.owner_id as pOwnerId, p.ctime AS pCtime, p.hits AS pHits, a.title AS aTitle, a.description AS aDescription, p.pid AS pPid, p.pic_rating AS pPic_Rating,  p.votes AS pVotes, p.pwidth AS pWidth, p.pheight AS pHeight, u.user_lastvisit AS uUser_lastvisit, u.user_regdate AS uUser_regdate, u.user_email AS uUser_email FROM  sk_cpg_pictures as p, sk_cpg_albums as a, sk_cpg_users AS u  WHERE a.aid = p.aid AND p.owner_id = u.user_id AND p.approved='YES'   and a.visibility = 0  ORDER BY rand(836697) LIMIT 6

The WHERE clause eliminating all the rows was "p.owner_id = u.user_id"
For some reason all my pics had an owner_id of '0'... and the only user defined is the admin with a user_id of '1'...
No idea how or why that happened (and not a CPMFETCH problem - maybe something to do with the 1.2.2 to 1.4.3 upgrade....)
After reviewing my other sites, and backing up the database (gallery has NO USER PICS) - issued following SQL:

UPDATE `sk_cpg_pictures` SET `owner_id` = '1';


and now at least something appears....  and appeared to cause no other problems....
Have to see what happens on next batch load of pics...

Next post for the remaining problem....
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

OK... slugged through the last one... now down to a problem with generated pic urls...
Generated source code from cftest.php:

<p>Your installation seems correct so far, you should see a small grid of thumbnails from your gallery</p>
<table  >
<tr>
<td class="photoclip"><a href="/displayimage.php?pos=-422"  class="photoclip" ><img  src="//albums/pictures/2005events/thumb_D05_1976.JPG" class="photoclip" alt="One of the last photos submitted" title="One of the last photos submitted" width="100"   /></a><br /><br />skymasters<br>0 views</td><td class="photoclip"><a href="/displayimage.php?pos=-49"  class="photoclip" ><img  src="//albums/pictures/2001/thumb_slootto.jpg" class="photoclip" alt="One of the last photos submitted" title="One of the last photos submitted" width="100"   /></a><br /><br />skymasters<br>2.8 views</td><td class="photoclip"><a href="/displayimage.php?pos=-574"  class="photoclip" ><img  src="//albums/pictures/2004events/thumb_DSC_2443.JPG" class="photoclip" alt="One of the last photos submitted" title="One of the last photos submitted" width="100"   /></a><br /><br />skymasters<br>0 views</td>
</tr>
<tr>
<td class="photoclip"><a href="/displayimage.php?pos=-318"  class="photoclip" ><img  src="//albums/pictures/2005meetings/thumb_D05_0098.jpg" class="photoclip" alt="One of the last photos submitted" title="One of the last photos submitted" width="100"   /></a><br /><br />skymasters<br>0 views</td><td class="photoclip"><a href="/displayimage.php?pos=-261"  class="photoclip" ><img  src="//albums/pictures/2004events/thumb_DSC_1615.JPG" class="photoclip" alt="One of the last photos submitted" title="One of the last photos submitted" width="100"   /></a><br /><br />skymasters<br>0 views</td><td class="photoclip"><a href="/displayimage.php?pos=-682"  class="photoclip" ><img  src="//albums/pictures/2004events/thumb_DSC_2699.JPG" class="photoclip" alt="One of the last photos submitted" title="One of the last photos submitted" width="100"   /></a><br /><br />skymasters<br>2 views</td>
</tr>
</table>

Notice the "src=//albums/pictures/..."
Can't get the correct src to appear with anything I've tried (short of capturing output buffer and manipulating before display).

Gallery is at the root of a subdomain:  http://gallery.skymasters.org
Test script is at http://gallery.skymasters.org/cpmfetch/cftest.php
Partial URL variable in cftest.php is set to:  $ChangeThisToYourPartialUrlToCPG = "/";   

cfimageget.php and cfig_random.php both work fine...  but prefer the features and flexibility of generating the full table of info.

Suggestions on how to tackle this one are welcome....
Thanks!
Greg
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

niks_007

hi....
       The CF is working but i want following

To get pics from last updated three albums from cat=5

how could i can get that


I am using follwing code but it is returing images from last updated album. and i want pics from last three updated albums from cat=5

Code:
<?php
include "cpmfetch.php";
$objCpm = new cpm('/wallpapers');
$objCpm->cpm_viewRandomMedia (1,4);
$objCpm->cpm_viewLastAddedMediaFrom (1,4, "cat=5");
$objCpm->cpm_close();
?>



and below image its Tital

What code i need to made

Niks...

gmc

Quote from: gmc on April 02, 2006, 04:35:43 AM

Generated source code from cftest.php:

...
<img  src="//albums/pictures/2005events/thumb_D05_1976.JPG"

Notice the "src=//albums/pictures/..."
Can't get the correct src to appear with anything I've tried (short of capturing output buffer and manipulating before display).

Well... some RTFC (since the manual didn't have this one...) found a function cpm_OverridePathToAlbums in cpmfetch.php....
Added:

$objCpm->cpm_OverridePathToAlbums('/albums');

to cftest.php - and it shows pics now from the same subdomain....
Not sure why I would need to do that... but it works...

Haven't gotten the right combo yet for crossing subdomains... but trying...


mcm - between this function and cpm_OverrideUrlToCoppermine ... I think you can get yours to work....

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

Quote from: niks_007 on April 02, 2006, 06:29:36 AM
hi....
       The CF is working but i want following

To get pics from last updated three albums from cat=5
...
I am using follwing code but it is returing images from last updated album. and i want pics from last three updated albums from cat=5

Code:
<?php
...
$objCpm->cpm_viewLastAddedMediaFrom (1,4, "cat=5");
...
?>

...
Niks...

Niks,
It can take much longer than 8 hours to get a reply...  Not an expert - but I don't see a single call way to get what you ask....

The cpm_viewLastAddedMediaFrom function will give the last media in the category as you have it coded... regardless of what album or how many are from each album....
Don't know how many albums you have in the category... but to get a pic from each, you would need to call cpm_viewLastAddedMediaFrom once for each album:

$objCpm->cpm_viewLastAddedMediaFrom (1,1, "album=x");

Put a table around the calls to format it nicely - since cf willl return a table for each call...

If you have more albums than you want pics - well then you need some data from the tables to get the most recent pics... idenitfy the albums they are in.... and then make the calls or just format it yourself...

You didn't give me enough time to try to figure out code for that...  and still trying to figure out my last issue....
Greg
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

rtpHarry

I am making a website which will show photo's from music events, they are broken into different categories for nights run by different people, each event (a single night / date) gets its own album. I need to display the last album added over any category on the front page. There are lots of functions but I dont seem to be able to do this particular task.

What I intend to do is make a call to the code for function cpm_viewLastAddedMediaFrom($rows, $columns, $source, $options="") and pass through the id of the last album added to the system, ie:

$objCpm->cpm_viewLastAddedMediaFrom (2,4, "album=AVARIABLECONTAININGLASTADDEDALBUMID");

So as u may have guessed by now my question is does anybody know a snippet of code that will extract the id of the last added album? Would just finding the highest album ID work or is there a possiblity that lower numbers may be re-used if for example an old album has been deleted?
Matthew Harris
www.runtings.com

TroutSlayer

Hi!

I'm still trying to get a firm grip using all the different functions, options, source variables included with cpmfetch, but so far I like it.  Thank you.  I tried searching the forums for this, but couldn't come up with anything.  The problem I'm having is getting the functions to work on albums numbers greater than 36.

This code works fine:
<?
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/Gallery");
$picOptions = array("imagestyle" => "cpg", "imagelink" => "album", "alttag" => "%a");
$picDesc = array("noimage" => "", "subtitle" => "%d", "tablestyle" => "tableGen");

   // THUMBNAIL
   $objCpm->cpm_viewRandomMediaFrom(1,1, "album=36", $picOptions);

   // DESCRIPTION
   $objCpm->cpm_viewRandomMediaFrom(1, 1, "album=36", $picDesc);

   // PICTURE COUNT
   $objCpm->cpm_listMediaCountFrom("album=36");



This almost identicle code does not work:

// THUMBNAIL
   $objCpm->cpm_viewRandomMediaFrom(1,1, "album=38", $picOptions);

   // DESCRIPTION
   $objCpm->cpm_viewRandomMediaFrom(1, 1, "album=38", $picDesc);

   // PICTURE COUNT
   $objCpm->cpm_listMediaCountFrom("album=38");
?>


The pieces of code are on the same page.  Top piece works, bottom one doesn't.  Any help or explanation would be greatly appreciated.  Thank you...

stuarta

sorry to ask again, but how would I go about using this with my gallery on one host with a database but display the last added on another host.
Comptia A+ / Network + certified

Daworm

Ok - i've browsed through a lot of posts on here - but I can't seem to find the specific answer to my issue.

I have resolved a few other issues, for exampe that funny "call to non-function" or whatever it was, among other things.
But as yet - I can't get it to generate HTML and display my gallery.

I've tried editing a few files suchs as "cfimageget.php" and changing the urltocpm value, and ... there was one other change - but I can't quite remember it (it's 12:30AM here and I'm dead tired)

If you could even point me to a post that addresses this exact issue I'd be most grateful.

Using the latest "stable" release from the CpmFetch website - I've got it 'mostly' working. Just can't get the turn in part.  :(

vuud

Quote from: stuarta on April 04, 2006, 10:35:21 AM
sorry to ask again, but how would I go about using this with my gallery on one host with a database but display the last added on another host.

You could either use cfimageget (that comes with it) or you could use a php include to run a php file on the host from the remote server (which may or may not work depending on php permissions). 

Should be something in the docs about that.
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: TroutSlayer on April 04, 2006, 12:24:39 AM
Hi!

I'm still trying to get a firm grip using all the different functions, options, source variables included with cpmfetch, but so far I like it.  Thank you.  I tried searching the forums for this, but couldn't come up with anything.  The problem I'm having is getting the functions to work on albums numbers greater than 36.

This code works fine:
<?
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/Gallery");
$picOptions = array("imagestyle" => "cpg", "imagelink" => "album", "alttag" => "%a");
$picDesc = array("noimage" => "", "subtitle" => "%d", "tablestyle" => "tableGen");

   // THUMBNAIL
   $objCpm->cpm_viewRandomMediaFrom(1,1, "album=36", $picOptions);

   // DESCRIPTION
   $objCpm->cpm_viewRandomMediaFrom(1, 1, "album=36", $picDesc);

   // PICTURE COUNT
   $objCpm->cpm_listMediaCountFrom("album=36");



This almost identicle code does not work:

// THUMBNAIL
   $objCpm->cpm_viewRandomMediaFrom(1,1, "album=38", $picOptions);

   // DESCRIPTION
   $objCpm->cpm_viewRandomMediaFrom(1, 1, "album=38", $picDesc);

   // PICTURE COUNT
   $objCpm->cpm_listMediaCountFrom("album=38");
?>


The pieces of code are on the same page.  Top piece works, bottom one doesn't.  Any help or explanation would be greatly appreciated.  Thank you...


Hmmm, Someone else mentioned this awhile back - I thought they were nutz.  I will check it out a later hopefully.  Its been crazy busy lately so I've not had time for support or finishing the new release.


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: Daworm on April 04, 2006, 04:39:44 PM
Ok - i've browsed through a lot of posts on here - but I can't seem to find the specific answer to my issue.

I have resolved a few other issues, for exampe that funny "call to non-function" or whatever it was, among other things.
But as yet - I can't get it to generate HTML and display my gallery.

I've tried editing a few files suchs as "cfimageget.php" and changing the urltocpm value, and ... there was one other change - but I can't quite remember it (it's 12:30AM here and I'm dead tired)

If you could even point me to a post that addresses this exact issue I'd be most grateful.

Using the latest "stable" release from the CpmFetch website - I've got it 'mostly' working. Just can't get the turn in part.  :(


Sorry, what was the original issue?  I went back a few pages and could not find other posts.

Thanks

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

dsnodgrass

Still looking for a way to display a specific album (in a non-randomized fashion) on another website using CpmFetch. Can it do this?

Daworm

Quote from: vuud on April 04, 2006, 04:57:53 PM

Sorry, what was the original issue?  I went back a few pages and could not find other posts.

Thanks


Ah whoops - sorry. 
Posted that about 5 minutes before I went to bed.

The issue is, I can't get it to pull any images from my gallery.

I'm advanced at computer knowledge, beginner when it comes to coding php - I know what code is doing when I look at it, but writing it from scratch?  I need to learn.

Here is my file

http://www.ariseguild.net/default.php

My Gallery

http://www.ariseguild.net/gallery

If you look at the coding of default.php you won't see any output of html coding or anything to display images from my gallery.
But the php coding is there in the file itself.
I've used the default example that was shown on another part of your site, and I edited it to show only 1 image.

--
There were people with other issues at the start of the thread which I used to resolve my other issues (that being errors) but can't find a specific post about it NOT generating any images.

vuud

Quote from: dsnodgrass on April 04, 2006, 10:30:01 PM
Still looking for a way to display a specific album (in a non-randomized fashion) on another website using CpmFetch. Can it do this?

"non-randomized fashon"

Can you word this differently.  What do you want?

Thanks
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