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

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: jphahn on November 18, 2005, 01:11:55 PM
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

Things should not just stop working.  Something changed somewhere... maybe your provider revoked SSI rights or tightened down ,.htaccess configurations or something. 




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: guytoon on November 18, 2005, 06:55:08 PM
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


I could not help but notice you are running SMF... Are you bridging with CPG or anything?

When you bridge, a lot of times the bridge does not add users into the cpg database, but the photos get assigned new owner ID's... this breaks when we try to retrieve the information for them.

Let me know and we will take it from there.


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

Ralphfolkes

Quote from: vuud on November 18, 2005, 10:45:48 PM
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?











Coppermine Photo Gallery 1.3.3
and
copperminefetch-1.6.2


Uploads it is showing are batch uploads and I have since done both batch and normal uploads.

I am using mod to bridge user reg with phpbb and haven't added any other mods to CPG.

here is the entire code for that page.

<?php
// phpbb fetch
$phpbb_root_path './Forum/';
define ('IN_PHPBB'true);
if (!
file_exists($phpbb_root_path 'extension.inc'))
{
    die (
'<tt><b>phpBB Fetch All:</b>
          $phpbb_root_path is wrong and does not point to your forum.</tt>'
);
}
include_once (
$phpbb_root_path 'extension.inc');
include_once (
$phpbb_root_path 'common.' $phpEx);
include_once (
$phpbb_root_path 'includes/bbcode.' $phpEx);
include_once (
$phpbb_root_path 'mods/phpbb_fetch_all/common.' $phpEx);
include_once (
$phpbb_root_path 'mods/phpbb_fetch_all/posts.' $phpEx);
$userdata session_pagestart($user_ipPAGE_INDEX);
init_userprefs($userdata);
$news phpbb_fetch_posts();
phpbb_disconnect();
?>


<head>
<title>Isaiah Folkes :: Index</title>
<link rel="stylesheet" href="comicBook/comicBook.css" type="text/css" />
<style type="text/css">
<!--
.BODYLINE    { background-image: url(comicBook/images/cover_background.jpg) }
TD.cat      { background-image: url(comicBook/images/background.jpg) }
TD.rowpic   { background-image: url(comicBook/images/background.jpg) }
TD.catHead,TD.catSides,TD.catLeft,TD.catRight,TD.catBottom { background-image: url(comicBook/images/background.jpg) }
-->
</style>
</head>
</head>

<body bgcolor="#E5E5E5" text="#000000" link="#006699" vlink="#5493B4">
<table width="750" cellspacing="0" cellpadding="10" border="0" align="center">
<tr>
<td class="bodyline">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<a href="index.php"><img src="comicBook/images/logo_comic.jpg" border="0" alt="Pictures" vspace="1" /></a>
</td>
<td align="center" width="100%" valign="middle"><span class="bigmaintitle">Isaiah Folkes</span><br>
<table cellspacing="0" cellpadding="2" border="0" width="452">
<tr>
<td align="center" valign="top" nowrap="nowrap">&nbsp;<a href="http://isaiahfolkes.com/Gallery/" class="mainmenu">&nbsp;Pictures&nbsp;</a>&nbsp;
&nbsp;<a href="http://isaiahfolkes.com/Forum/" class="mainmenu">&nbsp;Discussion&nbsp;</a>&nbsp;&nbsp; </td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" cellpadding="2" cellspacing="1" border="0" >
  <tr>
  <td><?php

for ($i 0$i count($news); $i++) {

?>

<table border="1" width="100%">
  <tr>
    <th><?php echo $news[$i]['topic_title']; ?></th>
  </tr>
  <tr>
    <td align="left" width="100%">
Posted by
<a href="<?php echo append_sid($phpbb_root_path 'profile.php?mode=viewprofile&amp;u=' $news[$i]['user_id']); ?>">
<?php echo $news[$i]['username']; ?></a>
on <?php echo create_date($board_config['default_dateformat'], $news[$i]['post_time'], $board_config['board_timezone']);  ?>
<hr size="1">
<?php echo $news[$i]['post_text']; ?>
<hr size="1">
<div align="right">(<?php echo $news[$i]['topic_replies']; ?>)
<a href="<?php echo append_sid($phpbb_root_path 'viewtopic.php?t=' $news[$i]['topic_id']); ?>">
Comment<?php if ($news[$i]['topic_replies'] != 1) { echo 's'; } ?></a></div>
    </td>
  </tr>
</table>
<br>
<?php

}

?>

</td>
<td valign="top">
<?php 
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/Gallery");
$objCpm->cpm_viewLastaddedMedia(5,1);
$objCpm->cpm_viewRandomMedia(5,1);
$objCpm->cpm_close();
?>

</td>
  </tr>
</table>
</body>
</html>

burzum

cpmFetch displays NOTHING for me :(

Tried cpmFetch 1.6.0 and 1.6.2 - same problem (running 1.6.0. atm)
http://event-team-saar.de/cpmfetch/cftest.php

Coppermine 1.3.5. (using the SMF bridge)
php 4.3.10
SMF 1.1 RC1

I tried also my own testscript http://event-team-saar.de/test.php:

<?php 
error_reporting
(E_ALL);
ini_set('display_errors',1);  // 0 is off, 1 is on
###############################################################################
###############################################################################
include('cpmfetch/cpmfetch.php');
$objCpm = new cpm("/gallery");
$objCpm->cpm_setDebugMode(1);
$objCpm->cpm_setReturnType('html');
echo 
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_close();
?>


It returns no images, just an SQL-Query that works fine when i execute it directly, but it returns nothing! Why!? I have albums and images in the gallery.
http://event-team-saar.de/gallery/

<!-- 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, u.user_website AS uUser_website, u.user_location AS uUser_location, u.user_interests AS uUser_interest, u.user_occupation AS uUser_occupation FROM  cpg135_pictures as p, cpg135_albums as a, cpg135_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(586518) LIMIT 9
ROWS: 0
--><table  >
<tr>
<td>&nbsp;</td><td>&nbsp;</td>
</tr>

</table>


Any ideas how to solve this problem?

vuud

Quote from: Ralphfolkes on November 19, 2005, 01:46:14 AM

I am using mod to bridge user reg with phpbb and haven't added any other mods to CPG.


That is the problem.  See my next post explaining it.  (The next user probably has the same problem)

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: burzum on November 19, 2005, 03:06:52 AM
cpmFetch displays NOTHING for me :(

Tried cpmFetch 1.6.0 and 1.6.2 - same problem (running 1.6.0. atm)
http://event-team-saar.de/cpmfetch/cftest.php

Coppermine 1.3.5. (using the SMF bridge)
php 4.3.10
SMF 1.1 RC1

Any ideas how to solve this problem?

Okay, go back to 1.6.2  There is some fixes in there that you should have.

You and RalphFolkes have the same problem.  Bridging.  This is explained a bunch of times, but here it is again in summary.

CpmFetch tries to extract userdata about the user that submitted each image to use in making subtitles.  When you mod CPG and hook into other systems it does not know where to get the data from.  So, when it sees image A was added by user 6, and the CPG tables do not have a user #6, it nixes that as a bad result and skips it.

There is no way that I could have written CPG and anticpated every mod out there.  So thats the problem.  You modified the way CPG works and now this tool is not working since it cannot find data that is no longer where it should be.  Its perfectly reasonable. 

So, solutions?

1) Mod cpmfetch so that it knows where to find the user data or does not look for it.

2) Create fake users in the cpg to reflect the user #'s assigned to photos. 

3) Write a script that populates the cpg tables with userdata from the thing you are mod'ed too.  Then post the script up so the bunches of other people with this problem can use it too.

Personally I would recommend 2 if you only have a few board users, or #3 if you feel up to it, or have a lot of users. 

#1 will make it a pain for you to upgrade, and its a lot of little changes to take it out (otherwise I would just post the changes here)

Hope the explanation helps, sorry it breaks when you change the program its supposed to work with.  With the next version (1.7) I will probably insert a flag so you can tell it not to look up userdata at all.  This hurts your options for subtitles, but its better than it not working right :)  - the next version changes how it works to solve a lot of problems aside from this one due to funny configurations.

Let me know if you have any questions...

Vuud







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

Ralphfolkes


vuud

Quote from: Ralphfolkes on November 19, 2005, 06:15:34 AM
whooo hoo..

Thanks, 

got it working like I want....

Was I right about the problem?  My hand is just itching to pat myself on the back :p
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

Ralphfolkes

yes,  I added some dummy entries in the users table in CPG and it worked.   This works for this installation since there will be very few (wife and I) users that will be uploading pictures that I want to show.  I have another much larger installation with many many users that I would like to get it to work with, but I can wait till you get something functional in the base code.

guytoon

Quote from: vuud on November 18, 2005, 10:51:48 PM
Quote from: guytoon on November 18, 2005, 06:55:08 PM
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


I could not help but notice you are running SMF... Are you bridging with CPG or anything?

When you bridge, a lot of times the bridge does not add users into the cpg database, but the photos get assigned new owner ID's... this breaks when we try to retrieve the information for them.

Let me know and we will take it from there.
Yes I confirm I'm bridging with SMF. I added the principal uploaders and it works fine.

Thanks for your help.

burzum

Quote from: vuud on November 19, 2005, 05:23:19 AM
So, solutions?

1) Mod cpmfetch so that it knows where to find the user data or does not look for it.

2) Create fake users in the cpg to reflect the user #'s assigned to photos. 

3) Write a script that populates the cpg tables with userdata from the thing you are mod'ed too.  Then post the script up so the bunches of other people with this problem can use it too.

Thanks for your fast answer!

#1 Is it enough to point cpmFetch from the cpg135_users table to smf_members and change the according fieldnames?

#2 I create just some new users for uploading? Nothing more? Hrmm maybe a solution. I have to talk with my client.

#3 I would do so, but its impossible. Coppermine saves the passwords in plaintext smf doesnt. :( So i cant convert the passwords.

I guess i'll have to stand with solution #2.

vuud

Quote from: burzum on November 19, 2005, 05:38:39 PM
Quote from: vuud on November 19, 2005, 05:23:19 AM
So, solutions?

1) Mod cpmfetch so that it knows where to find the user data or does not look for it.

2) Create fake users in the cpg to reflect the user #'s assigned to photos. 

3) Write a script that populates the cpg tables with userdata from the thing you are mod'ed too.  Then post the script up so the bunches of other people with this problem can use it too.

Thanks for your fast answer!

#1 Is it enough to point cpmFetch from the cpg135_users table to smf_members and change the according fieldnames?

#2 I create just some new users for uploading? Nothing more? Hrmm maybe a solution. I have to talk with my client.

#3 I would do so, but its impossible. Coppermine saves the passwords in plaintext smf doesnt. :( So i cant convert the passwords.

I guess i'll have to stand with solution #2.


The problem is its looking for field names.

I would do #3.... All you need to is make the records with the user id number and the usersname.  Heck, does not even have to be valid data.  You just need a user entry in there for the user ids assigned to photos.

Don't need to deal with passwords.

If you only have a few, just go into cpg admin and create some users.  Does not matter who or what since no one will use them anyway, but the addition of those records will make things work again.


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

burzum

Ahhh, ok, after a further look into the database i understood :)

I've added just one user "test" and it works now. Perfect! Thank you!

vuud

Quote from: burzum on November 19, 2005, 07:47:32 PM
Ahhh, ok, after a further look into the database i understood :)

I've added just one user "test" and it works now. Perfect! Thank you!

Depending on how many people you have adding them, you may need to add more.  YMMV

Good to hear its working

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

michaelkent

I have Coppermine 1.3.5 phpbb2.0.18 and cmpfetch 1.6.2 (I think, downloaded it 2 days ago)

The Coppermine/phpbb integration seems to work fine, but I have problems getting cmpfetch to work.

I have added the following to my homepage

                <?php
                
include './cpmfetch/cpmfetch.php';
                
$objCpm = new cpm('/coppermine');
                
$objCpm->cpm_viewRandomMedia (1,4);
                
$objCpm->cpm_viewLastAddedMedia (2,4);
                
$objCpm->cpm_formatStats("Here is a percent sign %% There are %f files in %c categories containing %a albums, having served %v views and getting %n comments");
                
$objCpm->cpm_close();
                
?>


I get

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.bletchley-reunion.org.uk%2Fsample.jpg&hash=21bdee8e0ccf62064a026f193542b1cbe88b5766)
The pics don't display but it gets the stats, which I assume means the cmpfetch installation is OK but there's something dodgy about my coppermine install??

Coppermine, phpbb2 and cmpfetch are all in discrete directories under the homepage, the cmpfetch test page shows all passes, and I've RTFM till my eyes nip.

I'm stumped!

I've not used the default table prefixes for Coppermine or phpbb2 but cmpfetch seems to pick these up from the config file so I don't think that's it.

Any help much appreciated

runaweigh

I guess I'm just not getting it, but the test page works well, and I can create a php file with different displays.  My question is likely elementary, but how do I call the file up to display on other pages on my website.  Do I href the php page or do I drop the code directly into the page I want.  Either way, I can't get it to work.

vuud

Quote from: michaelkent on November 25, 2005, 12:33:49 AM
I have Coppermine 1.3.5 phpbb2.0.18 and cmpfetch 1.6.2 (I think, downloaded it 2 days ago)

The Coppermine/phpbb integration seems to work fine, but I have problems getting cmpfetch to work.

I have added the following to my homepage

                <?php
                
include './cpmfetch/cpmfetch.php';
                
$objCpm = new cpm('/coppermine');
                
$objCpm->cpm_viewRandomMedia (1,4);
                
$objCpm->cpm_viewLastAddedMedia (2,4);
                
$objCpm->cpm_formatStats("Here is a percent sign %% There are %f files in %c categories containing %a albums, having served %v views and getting %n comments");
                
$objCpm->cpm_close();
                
?>


I get

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.bletchley-reunion.org.uk%2Fsample.jpg&hash=21bdee8e0ccf62064a026f193542b1cbe88b5766)
The pics don't display but it gets the stats, which I assume means the cmpfetch installation is OK but there's something dodgy about my coppermine install??

Coppermine, phpbb2 and cmpfetch are all in discrete directories under the homepage, the cmpfetch test page shows all passes, and I've RTFM till my eyes nip.

I'm stumped!

I've not used the default table prefixes for Coppermine or phpbb2 but cmpfetch seems to pick these up from the config file so I don't think that's it.

Any help much appreciated


The problem is with the fact the phpbb will not create users in coppermine (cause it uses its own).  You need to add some users to the coppermine user table so that cpmfetch can build the resultset. 

If you only have a few users in phpbb, just go into coppermine and add that many.  You can match the names if you want, but it only needs user entries that match the numbers assigned the photos.

This has been talked about mostly in the other thread on embedding.  There are many ways to fix this.    Just add a few users, or go and make a script that copies over phpbb2 users.




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: runaweigh on November 25, 2005, 03:59:17 AM
I guess I'm just not getting it, but the test page works well, and I can create a php file with different displays.  My question is likely elementary, but how do I call the file up to display on other pages on my website.  Do I href the php page or do I drop the code directly into the page I want.  Either way, I can't get it to work.


You just drop the code into the php page you want to display stuff on.  See the quickstart at cpmfetch.fistfullofcode.com

If you still cant get it to work, post what you put in here


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

CPG Guru

Hi Dear

Ive jusgt updated my 1.3.4. to 1.4.2 stable successfully, But now i face  the following error on my index page

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

Earlier it was working fine but now it isnt

vuud

Quote from: CPG Guru on November 25, 2005, 06:50:15 PM
Hi Dear

Ive jusgt updated my 1.3.4. to 1.4.2 stable successfully, But now i face  the following error on my index page

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

Earlier it was working fine but now it isnt


Hello,

The release notes with the recent versions of cpmfetch include instructions for this problem.

Well they are for the beta, but this includes the new verions also

QuoteThe Coppermine Dev's have (in what I would would say was a logical move) changed some of the internal database structure, and replaced a few fields with generic fields.  So instead of user web site, you have a few placeholder fields you can define into anything you want. 

This of course breaks a bit of my code and stops CpmFetch from working.  I am going to work out a permanent solution, but for the short term, if you really want to use CPG BETA 1.4.1 (and the dev's would appreciate you doing so, so would I) you must edit the top of the cpmfetch_dao.php file.  There are two sections around line 54 and line 59.  You need to comment out the one at line 54, and uncomment the one at line 59.  Comment it by placing /* before it and */ after it.  Uncomment by removing the same from the other section.  If you are on a version prior to 1.4 you DO NOT NEED TO DO ANYTHING.

I am working on the next version of cpmfetch, but it keeps getting bumped due to this annoying thing called life.  So hopefully I can get that out soon - which addresses many other "oddity" level problems also.

In the meantime a recent cpmfetch and the brief changes above are all thats needed to fix it.






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