Advanced search  

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]

Pages: 1 ... 32 33 34 35 [36] 37 38 39 40 ... 54   Go Down

Author Topic: CpmFetch 1.4 On... Displaying data and images from CPG on your website  (Read 995168 times)

0 Members and 1 Guest are viewing this topic.

stuarta

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 88
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #700 on: March 22, 2006, 02:36:15 pm »

I've made a simple page using
Code: [Select]
require_once "./cpmfetch/cpmfetch.php";
$objCpm = new cpmfetch("/photos");

include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/coppermine");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_close();
and at first I had the error Unknown column 'u.user_website' in 'field list'.  On following another tip about changing the /* */ around I've lost the error but it's not displaying any images.

Can someone explain what I've done wrong or missed out please

Ok, I've tested the cftest.php and get the following problems.  If I leave the /* */ as they are then I get the following message

"Unknown column 'u.user_website' in 'field list'
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/ftp/simaviatorsuk.org/cpmfetch/cpmfetch_dao.php on line 710"

If I swap them both around to */ /* I get this error

"Parse error: parse error, unexpected '*', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/ftp/simaviatorsuk.org/cpmfetch/cpmfetch_dao.php on line 61"
« Last Edit: March 22, 2006, 03:44:27 pm by stuarta »
Logged
Comptia A+ / Network + certified

soldstatic

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 27
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #701 on: March 22, 2006, 05:11:22 pm »

stuarta, you shouldnt have */ /*... /* is a comment so youd basically be commenting out the rest of the code... instead you have comment out ie:

Code: [Select]
/*
commented stuff here
*/

certain parts of the code and un comment by totally deleting the /* and */ that is around other code.

HOWEVER

I too have the same problem where I switched the comments around, that got rid of the error msg, but now its just not showing any pics at all.

More specifically, as the cftest.php showed, my DOCUMENT_ROOT_PATH or whatever is "bad".
The Doc ROoT path that it displays was something ie:
Code: [Select]
/home/user/rootdirectory/
When I know that it needs to be:
Code: [Select]
/home/.otherthing/user/rootdirectory/
so where does DOCUMENT_ROOT_PATH get its value?? What do i need to change on this?
Logged

stuarta

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 88
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #702 on: March 22, 2006, 05:17:40 pm »

ok so how should the /*'s be?

 I to had nothing showing when I first changed them round but thought I better make sure that the cdtest was working first before I went any further which is when I came across these problems.
Logged
Comptia A+ / Network + certified

soldstatic

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 27
Logged

stuarta

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 88
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #704 on: March 22, 2006, 05:36:28 pm »

ok I've put it back to

Code: [Select]
// This is for CPG versions prior to 1.4
var $sqlPictureAlbumSelect = ' 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, u.user_website AS uUser_website, u.user_location AS uUser_location, u.user_interests AS uUser_interest, u.user_occupation AS uUser_occupation';


// This is for CPG v 1.4.1 beta 1
/*
var $sqlPictureAlbumSelect = ' 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';
*/

and get the message

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

I see that I have to comment and uncomment but at risk of being called a n00b, I'm unsure how to do this. :-[
Logged
Comptia A+ / Network + certified

soldstatic

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 27
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #705 on: March 22, 2006, 05:38:49 pm »

Code: [Select]
// This is for CPG versions prior to 1.4
var $sqlPictureAlbumSelect = ' 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, u.user_website AS uUser_website, u.user_location AS uUser_location, u.user_interests AS uUser_interest, u.user_occupation AS uUser_occupation';


// This is for CPG v 1.4.1 beta 1
/*
var $sqlPictureAlbumSelect = ' 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';
*/

should be

Code: [Select]
// This is for CPG versions prior to 1.4
/*
var $sqlPictureAlbumSelect = ' 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, u.user_website AS uUser_website, u.user_location AS uUser_location, u.user_interests AS uUser_interest, u.user_occupation AS uUser_occupation';
*/

// This is for CPG v 1.4.1 beta 1

var $sqlPictureAlbumSelect = ' 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';
Logged

stuarta

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 88
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #706 on: March 22, 2006, 05:41:20 pm »

right excellent that works thankyou.  Think I have it working now, just have dodgy thumbnails.  Think it is probably because my host is usng GD1.

Temp page I'm working on

http://www.simaviatorsuk.org/home6.php

« Last Edit: March 22, 2006, 06:04:03 pm by stuarta »
Logged
Comptia A+ / Network + certified

larronni

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #707 on: March 22, 2006, 11:10:08 pm »

I have installed CpmFetch and it is working just fine  :)
But now I want to do more.... I like to view the last xxx pictures from an album, and view the title on all the images.
So made a page, and entered : (And some more...)
$options = array("subtitle" => " %t",);
$objCpm1->cpm_viewLastAddedMediaFrom(6,4,32,$options);

But what I can't figure out, is how to get the picture and the title into a tabel.... Like :
|--------------|
|  Picture  |
|              |
| title        |
|--------------|
What I get from this code, is the picture, and the title under the picture.. So if the title is long, the picture moves to the right.....
Is it possbile to do this ??
Logged

stuarta

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 88
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #708 on: March 23, 2006, 01:39:03 am »

ok think I've just messed it up.

I decided to change my coppermine folder name to gallery.  I've changed the path in CP admin and the fetch test works fine, but my html page is now showing

ERROR: Path to Coppermine incorrect. (/var/www/html/simaviatorsuk.org/coppermine//include/config.inc.php)

It's still looking for the coppermine/include/config.inc.php file but not sure which file is looking for it.
Logged
Comptia A+ / Network + certified

soldstatic

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 27
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #709 on: March 23, 2006, 02:25:01 am »

did you change the path that the html page is looking for to the new path to cpmfetch and/or coppermine?
Logged

stuarta

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 88
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #710 on: March 23, 2006, 10:50:35 am »

ok, I feel a prat now lol.  I've just opened up the php file I created and the path hadn't saved, changed it back and it works. Sure I saved it last night, but then it was 1.30am lol

Just got the colours to sort now.
Logged
Comptia A+ / Network + certified

soldstatic

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 27
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #711 on: March 24, 2006, 06:11:24 am »

so your cpm fetch works fine and you see the pics???

*beep* is wrong with mine...
Logged

stuarta

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 88
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #712 on: March 24, 2006, 09:47:22 am »

yep works fine thankyou. Just got bad thumbnails which I'm assuming is down to GD1
Logged
Comptia A+ / Network + certified

mcm

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #713 on: March 26, 2006, 11:16:21 am »

OK .. I'm pulling my hair out over this .. hope someone can help!

I have coppermine in a subdomain called http://thaiexpat.mcmweb.info .. so I put the following in the index.php of the subdomain.

<?php   
include "cpmfetch/cpmfetch.php";
$objCpm = new cpm('/gallery');
$objCpm->cpm_viewRandomMedia (1,6);
$objCpm->cpm_close();
?>

And I get the error of ...

ERROR: Path to Coppermine incorrect. (/home/content/m/c/m/mcm58/html/gallery//include/config.inc.php)

It thinks the gallery folder is in the main site .. i.e  "http://mcmweb.info/gallery" .. and also .. I don't understand why there are two slashes after "gallery"

So I changed it to ...

<?php   
include "cpmfetch/cpmfetch.php";
$objCpm = new cpm('/thaiexpat/gallery');
$objCpm->cpm_viewRandomMedia (1,6);
$objCpm->cpm_close();
?>

Now it can find the coppermine gallery .. but no thumbnails show and I just get links with incorrect urls. That is.. it sticks in an extra folder called "thaiexpat"

It thinks the url to the gallery is "http://thaiexpat.mcmweb.info/thaiexpat/gallery/"

instead of "http://thaiexpat.mcmweb.info/gallery"

I tried a test page in the root directory (http://mcmweb.info) with ..

<?php   
include "thaiexpat/cpmfetch/cpmfetch.php";
$objCpm = new cpm('/thaiexpat/gallery');
$objCpm->cpm_viewRandomMedia (1,6);
$objCpm->cpm_close();
?>

and that works perfectly.

Anyone know how I can get it to work in the index.php of the subdomain????? HELP!!!

Thanks
 ;D
Logged

stuarta

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 88
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #714 on: March 28, 2006, 01:24:54 am »

ok to get round a problem of my host not support GD2, i've temporarily installed coppermine and fetch on a free host.  I'm having difficulty though linking across to it. Is this possible?

My main site is www.simaviatorsuk.org, but I've temporarily installed coppermine to http://stuarttest.awardspace.com/gallery and http://stuarttest.awardspace.com/cpmfetch.

Thanks
Logged
Comptia A+ / Network + certified

dsnodgrass

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Displaying whole album from CPG
« Reply #715 on: March 30, 2006, 06:18:48 pm »

There are many very elegant things that CPMFetch does but actually, I don't need them right now. All I want to do is display a Coppermine album complete, intact, and UNrandomized on a different web page.

Can anyone point me to some code fragment that will do this?  I have looked through the docs and these pages and seem to have missed how to do something rather simple.

Logged

doktor k

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #716 on: April 01, 2006, 05:51:47 am »

I just installed cpmfetch and ran the test page and got the following results and error message:

http://www.mypreciouspaws.net/cpmfetch/cpmfetch/cftest.php

5   You set your partial URL to /photos   PASS
10   No dots in partial url   PASS
15   coppermine.php not present   PASS
20   coppermine_dao.php not present   PASS
25   cpmfetch.php found   PASS
30   cpmfetch_dao.php found   PASS
35   Server OS = FreeBSD hostingprod.com 4.10-YAHOO-20040606 FreeBSD 4.10-YAHOO-20040606 #0: i386   INFO
40   WebServer = Apache/1.3.33 (Unix) FrontPage/5.0.2.2510 mod_fastcgi/2.4.2   INFO
45   PHP Version = 4.3.11   INFO
55   DOCUMENT_ROOT: /   INFO
60   C_DOCUMENT_ROOT: Not found   INFO
65   doc_root: Not found (IIS Servers only)   INFO
70   SCRIPT_FILENAME: /cpmfetch/cpmfetch/cftest.php   INFO
75   DOCUMENT_ROOT is a good match   PASS
80   Found CPG config file   PASS

Trying to display some images:

Your installation seems correct so far, you should see a small grid of thumbnails from your gallery
Unknown column 'u.user_website' in 'field list'
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /cpmfetch/cpmfetch/cpmfetch_dao.php on line 710

 do I need to do some with MySQL page or do something else

Thanks in advance for your assistance

Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #717 on: April 01, 2006, 03:33:07 pm »

I just installed cpmfetch and ran the test page and got the following results and error message:

http://www.mypreciouspaws.net/cpmfetch/cpmfetch/cftest.php
...

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

...

doktor k,
This is a well documented problem in both the provided doc and this thread...  A change is needed in the dao file if running CPG 1.4.
...
look at lines 55-65 in the dao file you will find these lines

// This is for CPG versions prior to 1.4
/*
   var $sqlPictureAlbumSelect = ' 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, u.user_website AS uUser_website, u.user_location AS uUser_location, u.user_interests AS uUser_interest, u.user_occupation AS uUser_occupation';
*/

// This is for CPG v 1.4.1 beta 1   

   var $sqlPictureAlbumSelect = ' 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';


switch these   /* */  to the opposite one and it will fix it.

vuud,
any plans for a more permanent fix for this?  or at least inverting the default so current version cpg users don't run into this?

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

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #718 on: April 01, 2006, 05:58:33 pm »

I need some help here too please....
(pulling my hair out too mcm...)

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

Using supplied cftest.php script which is issuing:
Code: [Select]
$objCpm->cpm_viewRandomMedia(2,3,$styleguide);
and producing output in page source of:
Code: [Select]
<p><span class='subtitle'>Trying to display some images:</span></p>
<p>Your installation seems correct so far, you should see a small grid of thumbnails from your gallery</p><!-- SQL : 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
ROWS: 0
 --><table  >
<tr>

</tr>
<tr>

</tr>

</table>
Similar results in other tests as well...

Galley is at http://gallery.gmcdesign/com
Test script is at http://gallery.gmcdesign.com/cpmfetch/cftest.php

Not sure where to look next - can't find any differences between my two installs...  Help is greatly appreciated....

(Edit addition.... One difference I just thought of... the failing site is my OLDEST cpg install... While they are all running 1.4.3 now - the failing site is the only one that used to be 1.2.1...  Could there be something between 1.2.1 and 1.4.3 that didn't get applied properly during the upgrade that CPMFETCH depends on???  Was a direct upgrade from 1.2 to 1.4.3...)

(Still getting incorrectly formed img and link statements on another site... but at least getting output there....)

Thanks,
Greg
« Last Edit: April 01, 2006, 07:06:39 pm by gmc »
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

MDkai

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #719 on: April 01, 2006, 06:34:38 pm »

Just a small hint:


I had the same problem like doktor K
Quote
Your installation seems correct so far, you should see a small grid of thumbnails from your gallery
Unknown column 'u.user_website' in 'field list'
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /cpmfetch/cpmfetch/cpmfetch_dao.php on line 710

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
Logged
Pages: 1 ... 32 33 34 35 [36] 37 38 39 40 ... 54   Go Up
 

Page created in 0.035 seconds with 20 queries.