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

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 1 Guest are viewing this topic.

vuud

Quote from: cgc0202 on May 29, 2006, 08:54:46 AM

While it will be quite different from page to page, as well as more complex and elaborate, all the actual applications I will have for CPMFetch  are already outlined in  CPM Test Page #2c for TOTI (Album- & Category-specific Photos, Variable sizes, and Photo-framing):

http://mmedia.treasuresoftheinternet.org/cpmfetch-tutorials/toti-test2c.php

In this sense, what I wanted to do is now technical feasible.  In relation to this project, my next project would be to attempt to port CPMFetch  to Joomla.  Would it be possible to show you some relevant information from Joomla random photos "module" to get some ideas from you on how I can use that to port  CPMFetch  to Joomla?

I doubt I would be much help in getting it to work in Joomba.  Mostly because I have no real idea about joomba, 2) I have no real desire to learn about Joomba, and for the next month I will be incredibly busy with some life type stuff.  It gives me a headache to even think about it.  Also, my notebook just suffered a "sudden decelartion bug" which has rendered it near useless (runs for about 20 seconds at a time) thus reducing the amount of play time I have for this stuff.

Ah, but I would suggest figuring out how joomba templating works and figure out how to execute php code in it.  Cpmfetch should be easy from there.

Good luck with 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

buchananben

I have setup cpmfetch in /cpmfetch/ and my coppermine installation is running in /gallery/ . I have tried loading cftest.php (http://www.nightcats.org/cpmfetch/cftest.php), but no thumbails are displayed despite it passing all the tests. I don't know where to start as no error messages are displayed. I am using the latest coppermine and cpmfetch versions. I have done the commenting/uncommenting in the cpmfetch_dao.php file for cpg1.4.6 , and I have changed line 5 in cftest.php to reflect my install.

My only thought is that it is linked to the fact that I have bridging active with punBB.

Any help is much appreciated. Let me know what other info you need.
Regards
Ben

vuud

Quote from: buchananben on May 30, 2006, 09:24:10 AM
I have setup cpmfetch in /cpmfetch/ and my coppermine installation is running in /gallery/ . I have tried loading cftest.php (http://www.nightcats.org/cpmfetch/cftest.php), but no thumbails are displayed despite it passing all the tests. I don't know where to start as no error messages are displayed. I am using the latest coppermine and cpmfetch versions. I have done the commenting/uncommenting in the cpmfetch_dao.php file for cpg1.4.6 , and I have changed line 5 in cftest.php to reflect my install.

My only thought is that it is linked to the fact that I have bridging active with punBB.

Any help is much appreciated. Let me know what other info you need.
Regards
Ben

Bridging is probably the culprit.  Try adding a few test users to CPG through the admin panel.  If you start seeing some items then its probably the issue. 

The next version will make it easier to handle the bridging problem - but since my recent crash, impending wedding, etc... I am not sure when that will be.  There were suggestions here for removing the code from the sql queries to not access that information...  search back a bit and you will find some posted code.


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

Sy

Hi,
  I had everything working under test conditions but then I deleted the test images and uploaded the proper ones in different categories.  Now no thumbnails are shown on the page where they used to :(

I'm using CPG v 1.4.6

CMF v 1.6.2

The gallery is located http://www.hayley-louise.co.uk/portfolio/ and the thumbnails of the latest uploaded images should be showing in the bottom box which can be found http://www.hayley-louise.co.uk/home.php

I've messed about with SQL & php quite a bit in the past but I am far from an expert...or even good lol

My host uses an Apache server running 1.3.34 (Unix)

The code I'm using on the home page to pull the latest uploaded images from CPG is
<?php $objCpm->cpm_viewLastAddedMedia(1,4,array("tablestyle" => "cpmf","imagestyle" => "cpmf")); ?>

I've added in the debug code and enabled it but no errors are produced.  As CPF is bridged with phpBB I have also added in the 2nd admin account which is how I got things working in test state.

Can anyone shed any light on this please as my girlfriend wants her site up ASAP and is moaning like mad lol ;)

Thanks for any help or advice

Sy

thomasmedi

Hi,

I have tried to search solution but haven't find it. I'm running the latest version of Coppermine (1.4.6), the test runs ok but I get this error message in the end:

Fatal error: Call to a member function getRandomImageFrom() on a non-object in /var/www/gallery/cpmfetch/cpmfetch.php on line 770

Here is the test:

5 You set your partial URL to  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 = Linux pinokio 2.6.10-1.771_FC2 #1 Mon Mar 28 00:50:14 EST 2005 i686 INFO
40 WebServer = Apache/1.3.33 (Unix) PHP/5.0.3 mod_accounting/0.5 FrontPage/5.0.2.2635 mod_perl/1.29 mod_deflate/1.0.21 mod_ssl/2.8.22 OpenSSL/0.9.7a INFO
45 PHP Version = 5.0.4 INFO
55 DOCUMENT_ROOT: /var/www/gallery INFO
60 C_DOCUMENT_ROOT: Not found INFO
65 doc_root: Not found (IIS Servers only) INFO
70 SCRIPT_FILENAME: /var/www/gallery/cpmfetch/cftest.php INFO
75 DOCUMENT_ROOT is a good match PASS
80 Found CPG config file PASS

Thanks for your help.

thomasmedi

Ok. I got the last problem figured out myself and cftest runs ok now. Now I got another error when I try to install the thing to my blog sidebar.php.

ERROR: Path to Coppermine incorrect. (/var/www/blog/index.php/gallery//include/config.inc.php)
Fatal error: Call to a member function getLastAddedMediaFrom() on a non-object in /var/www/blog/cpmfetch/cpmfetch.php on line 532


No matter what I write inside the $objCpm = new cpm(' '); the system adds the /var/www/blog/index.php to the beginning. I just can't figure out where and what I should change and how should I change it. I have tried everything.

This shows the pictures if I just add it to the selfmade test.php and upload it to the root:

<?php
include "cpmfetch/cpmfetch.php";
$objCpm = new cpm('/gallery');
$styleguide = array(
//"TABLESTYLE" => "photoclip",
//"rowstyle" => "photoclip",
"cellstyle" => "photoclip",
"linkstyle" => "photoclip",
"alttag" => "Uusimmat kuvat",
"imagestyle" => "photoclip",
"imagesize" => 'thumb',
"imagewidth" => '80');
$objCpm->cpm_viewLastAddedMedia (2,2,$styleguide); 
$objCpm->cpm_close(); ?>



But when I add it to the sidebar or anywhere else in my site, it doesn't work.

Anyone? I have now spend two days with this plugin and I'm about to change from the Coppermine to Gallery2 since I just want to have the latest pictures somewhere inside my blog sidebar. I'm pretty frustrated. Thanks for help.


- Tuomas
Finland 

Sy

Quote from: thomasmedi on June 05, 2006, 12:45:34 PM
ERROR: Path to Coppermine incorrect. (/var/www/blog/index.php/gallery//include

Not an expert at all but I'd guess that you have an extra trailing forward slash in your coding when calling the object from the directory gallery.  Try changing it from '/gallery/' to '/gallery' and hopefully that will resolve it for you.

Sy

thomasmedi

Thanks Sy. It wasn't the problem. I had no slash in the gallery, I tried that too.

I didn't get it to work like it was supposed to but I got it functioning some other way. I want to share this if someone has similar problems as I did.

I just figured out that maybe I could fetch the data from the working test.php somehow. The test.php which I made worked alright when I put it to the root.

All I have in the test.php is this code:

<?php
include "cpmfetch/cpmfetch.php";
$objCpm = new cpm('/gallery');
$styleguide = array(
//"TABLESTYLE" => "photoclip",
//"rowstyle" => "photoclip",
"cellstyle" => "photoclip",
"linkstyle" => "photoclip",
"alttag" => "Uusimmat kuvat",
"imagestyle" => "photoclip",
"imagesize" => 'thumb',
"imagewidth" => '80');
$objCpm->cpm_viewLastAddedMedia (2,2,$styleguide); 
$objCpm->cpm_close(); ?>


I uploaded the test.php to the root of my site with ftp. Then I added this script to my site (in this case I put it to sidebar.php):

<?php
$ch = curl_init("http://myblog.domain.com/test.php");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
?>

That script fetches all the data written to the test.php and just puts it to my site.

If someone has similar problems as I had and wants to use it, go ahead. I found the script from some website. It works alright and is pretty useful in other things too. It just fetches all the data, information and images - I mean everything -  and includes it to your website. Coolio!  8)

- Tuomas
Finland

Jurrie

Quote from: Jurrie on April 24, 2006, 09:58:51 PM
Installed Coppermine 1.4.5 & CPMFetch 1.6.2. I've tried to comment/uncomment those lines. And it "works"...........a bit.

See this link: http://gallery.nederland1940-1945.nl/cpmfetch/cftest.php

There is one picture in the gallery, but it is not displayed. Has this got to do anything with this code-fixing or is there another problem?

Greetz,

Jurrie

I'm still having this problem (see 3 pages back). Anyone? When you click on the not-working-thumbnail, the correct picture is displayed.

I don't get it..hope you do ;)

Greetz,

Jurrie

zanary

I got this error... please help =)

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

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


LooneyToonDad

I hope this is the right thread for my two questions. I have tried searching the forum (CPM Fetch specifically) and keep getting "Query not specific enough"(something like that). Anyway, I am using CPMFetch for simply showing the most recent 6 images. That's it. Nothing more. Here are my two questions.

1. Where do I change the function/variable to only show certain media types. In other words, I only want photos to show up (.jpg, .png, .gif, etc) but not videos (.wmv, etc). I read the docs and know there is a function to do this, but I am unsure of what/where to change, and whether I list what I don't want seen, or do want seen.

2. Is there a way to limit the amount of characters shown when using the option "subtitle" => "%t"? If the image title is too long, I want to only show a set amount of characters so it doesn't throw the cell size off too much, and makes it easier to align the thumbnail with the title. Not sure if this can be done through CPMFetch, or if it would be a CSS thing.

ANy help would be appreciated. Thanks for creating this tool. It's great, especially since it's fairly easy for us newbies :).


SuperJETT

I'm using Coppermine in bridged mode with vBulletin 3.5, everything works great.  I'm also using cpmfetch on the forum index page to pull random images, that works great too.

Now, I'm trying to pull from a specific album (or category, either would work for my need) but as soon as I specify one or the other, no image.

After reading much I'm sure it's related to running in bridged mode, so I wanted to look at the queries to see if I can make a modification to work for my specific need, but I can't enable debug mode.

Here is my working file, but no debug output:
<?php
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/gallery");
$debug true;
$objCpm->cpm_setDebugMode($debug);
$options = array('windowtarget' => '_blank');
$objCpm->cpm_viewRandomMediaFrom(1,1,"","");
$objCpm->cpm_close();
?>


Searching turned up nothing pertinent.

Does debug mode work or am I trying to enable it improperly?

Titan85

I am not 100% sure that this was not asked before, but i searched and looked through the first 5 pages of this thread, with no sucess and don't have time to look through 43 pages  :o. But anyways, my question is this: When I run the test for cpmfetch, it comes back with this error:
Unknown column 'u.user_website' in 'field list'
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /hsphere/local/home/jbalcomb/echoefx.com/fetch/cpmfetch/cpmfetch_dao.php on line 710

Any idea what is wrong?

SuperJETT

Quote from: Titan85 on June 14, 2006, 02:36:14 AM
I am not 100% sure that this was not asked before, but i searched and looked through the first 5 pages of this thread, with no sucess and don't have time to look through 43 pages  :o. But anyways, my question is this: When I run the test for cpmfetch, it comes back with this error:
Unknown column 'u.user_website' in 'field list'
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /hsphere/local/home/jbalcomb/echoefx.com/fetch/cpmfetch/cpmfetch_dao.php on line 710

Any idea what is wrong?

You should have kept reading, but the answer is in the cpmfetch_dao file, comment out one line and uncomment the other, lines 57/62 I believe.

Titan85

Quote from: SuperJETT on June 14, 2006, 02:43:39 AM
You should have kept reading, but the answer is in the cpmfetch_dao file, comment out one line and uncomment the other, lines 57/62 I believe.
I am new to all this and don't really get what you said. What do you mean by comment out and uncomment?

LooneyToonDad

Quote from: Titan85 on June 14, 2006, 02:46:36 AM
I am new to all this and don't really get what you said. What do you mean by comment out and uncomment?

You have to edit the PHP file "cpmfetch_dao.php" (using something like Dreamweaver or another editor). On line 54 you need to put /*..... */ around the line to comment it out (where ..... is the actual code), and on line 59 you need to get rid of the /*..... */  surrounding it. I had the same problem and it worked for me. I had read a post somewhere on here that explained it nicely, but I can't find it again.

Titan85

Quote from: LooneyToonDad on June 14, 2006, 03:55:22 AM
You have to edit the PHP file "cpmfetch_dao.php" (using something like Dreamweaver or another editor). On line 54 you need to put /*..... */ around the line to comment it out (where ..... is the actual code), and on line 59 you need to get rid of the /*..... */  surrounding it. I had the same problem and it worked for me. I had read a post somewhere on here that explained it nicely, but I can't find it again.
When I went to do that I found the code on line 54 (var $topPercentForMostViewed = 25;) and edited it (/*var $topPercentForMostViewed = 25;*/), but when I went to change line 59 I found a blank line. I tried it when i just had line 54 edited and I got the same error. Could the code be on another line? I also tried line 57 and 62 as SuperJETT suggested and I got the same error again.

LooneyToonDad

Quote from: Titan85 on June 14, 2006, 04:04:55 AM
Could the code be on another line?

Look for the following:

// 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';*/

You'll want to comment out the line under "This is for CPG versions prior to 1.4" and remove the comment from the line "This is for CPG v 1.4.1 beta 1". I think the line numbers are different based on what editor you use. (My ftp program shows 54 and 59). Again, this is what worked for me.

Titan85

Quote from: LooneyToonDad on June 14, 2006, 02:10:23 PM
Look for the following:

// 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';*/

You'll want to comment out the line under "This is for CPG versions prior to 1.4" and remove the comment from the line "This is for CPG v 1.4.1 beta 1". I think the line numbers are different based on what editor you use. (My ftp program shows 54 and 59). Again, this is what worked for me.

Ok, I did what you said to do but I got a different error: Parse error: parse error, unexpected '=', expecting T_VARIABLE in /hsphere/local/home/jbalcomb/echoefx.com/fetch/cpmfetch/cpmfetch_dao.php on line 57. My line 57 looks like this: 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 I tried to remove the "=" but then I got this error: Parse error: "parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting T_VARIABLE in /hsphere/local/home/jbalcomb/echoefx.com/fetch/cpmfetch/cpmfetch_dao.php on line 57". I know it is something simple know but I don't know much at all  about PHP. I think its just that equal sign, but I don't know what to do with it. What should I do?

LooneyToonDad

Quote from: Titan85 on June 14, 2006, 04:38:38 PM
My line 57 looks like this: 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

In order to comment out the line you nee to put the /* before the start of the line's code and */ after the end of the line's code.

Put /* before the word "var" and put */ after the semicolon. It should look like this:

/* 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'; */