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

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.

vuud

Quote from: runaweigh on October 30, 2005, 02:03:30 AM
I am trying to display an image with (cpmfetch/cfig_random.php") on the index page, but I would like to display with a link to the photo album.  Currently I have the displayimage as (<a href="/photoalbum/displayimage.php?pos=-397" target="_blank") which is obviously giving me the same photo.  How do I link to the displayed image for cfig_random.php?
http://www.mycsailing.com/

Yeah, not going to happen.  There is just no code there to support the state between calls.  And if you are using cfig_random I assume you are calling from an IMG tag...  as such cfig_random returns image data only. 

The only way to do what I think you are asking would be to do it via cpmfetch SSI method and stuff...  but then you mind as well just do it the SSI way and skip the cfig_random all together.  If possible, that way really is the best way to go (if your setup and circumstances afford you this)




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: kreptil on October 29, 2005, 07:15:17 AM
Nice job, but how can I use the option "lastalb" (last updated albums) with this CpmFetch?

Thanks!.


Not sure I understand the question, but this may be helpful:

cpm_showAlbumsUpdatedOverLastDays($numberOfDays,$options="")

On this page:

http://www.fistfullofcode.com/projects/copperminefetch/manual/ch07s05.html

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

Babounet

Quote from: vuud on November 01, 2005, 12:08:46 AM
Quote from: kreptil on October 29, 2005, 07:15:17 AM
Nice job, but how can I use the option "lastalb" (last updated albums) with this CpmFetch?

Thanks!.


Not sure I understand the question, but this may be helpful:

cpm_showAlbumsUpdatedOverLastDays($numberOfDays,$options="")

On this page:

http://www.fistfullofcode.com/projects/copperminefetch/manual/ch07s05.html



Hello. How can provide a table with the 4 last updtated albums (with one pic from each album and his name below).
I've found a code on vuud's website (see below), but this provide only a text with date and album name and I have no idea how I can add a pic.

   $objCpm->cpm_setReturnType("resultset");
   $data = $objCpm->cpm_viewLastAddedMediaFrom(1000, 1000, "");
   $cnt = 0;       
   $arrayofalbums = array();
   foreach ($data as $row) {
       if (! in_array($row['aTitle'],$arrayofalbums)) {
          print date("d/m/y",$row['pCtime']);
      print "&nbsp;&nbsp;&nbsp;";
      print "";
           print $row['aTitle'];
      print "";   
      print "<br>";
      array_push($arrayofalbums,$row['aTitle']);
      $cnt++;
      if ($cnt == 4) break;   
      }
   }
?>

Please... HELP ME !!!!  :\'( :\'(

Many thanks
Seb

mpvvv

Hi,

I'm having the same problem, can anyone help?

Thanks

Quote from: Babounet on November 01, 2005, 12:44:36 PM
Quote from: vuud on November 01, 2005, 12:08:46 AM
Quote from: kreptil on October 29, 2005, 07:15:17 AM
Nice job, but how can I use the option "lastalb" (last updated albums) with this CpmFetch?

Thanks!.


Not sure I understand the question, but this may be helpful:

cpm_showAlbumsUpdatedOverLastDays($numberOfDays,$options="")

On this page:

http://www.fistfullofcode.com/projects/copperminefetch/manual/ch07s05.html



Hello. How can provide a table with the 4 last updtated albums (with one pic from each album and his name below).
I've found a code on vuud's website (see below), but this provide only a text with date and album name and I have no idea how I can add a pic.

   $objCpm->cpm_setReturnType("resultset");
   $data = $objCpm->cpm_viewLastAddedMediaFrom(1000, 1000, "");
   $cnt = 0;       
   $arrayofalbums = array();
   foreach ($data as $row) {
       if (! in_array($row['aTitle'],$arrayofalbums)) {
          print date("d/m/y",$row['pCtime']);
      print "&nbsp;&nbsp;&nbsp;";
      print "";
           print $row['aTitle'];
      print "";   
      print "<br>";
      array_push($arrayofalbums,$row['aTitle']);
      $cnt++;
      if ($cnt == 4) break;   
      }
   }
?>

Please... HELP ME !!!!  :\'( :\'(

Many thanks
Seb

vuud


The code shown below is a good starting point.  Right now, cpmfetch will not do what you are looking for, so you have to wrap it with more PHP code to get the images and display them and add the titles.

I don't have time to write it at this moment.  If someone else has done this, please post the code.

Its not terribly complicated, and if you insert a print_r($row) in there you can see all the wonderful data you have access to.


Quote from: mpvvv on November 01, 2005, 03:58:26 PM
Hi,

I'm having the same problem, can anyone help?

Thanks

Quote from: Babounet on November 01, 2005, 12:44:36 PM
Quote from: vuud on November 01, 2005, 12:08:46 AM
Quote from: kreptil on October 29, 2005, 07:15:17 AM
Nice job, but how can I use the option "lastalb" (last updated albums) with this CpmFetch?

Thanks!.


Not sure I understand the question, but this may be helpful:

cpm_showAlbumsUpdatedOverLastDays($numberOfDays,$options="")

On this page:

http://www.fistfullofcode.com/projects/copperminefetch/manual/ch07s05.html



Hello. How can provide a table with the 4 last updtated albums (with one pic from each album and his name below).
I've found a code on vuud's website (see below), but this provide only a text with date and album name and I have no idea how I can add a pic.

   $objCpm->cpm_setReturnType("resultset");
   $data = $objCpm->cpm_viewLastAddedMediaFrom(1000, 1000, "");
   $cnt = 0;       
   $arrayofalbums = array();
   foreach ($data as $row) {
       if (! in_array($row['aTitle'],$arrayofalbums)) {
          print date("d/m/y",$row['pCtime']);
      print "&nbsp;&nbsp;&nbsp;";
      print "";
           print $row['aTitle'];
      print "";   
      print "<br>";
      array_push($arrayofalbums,$row['aTitle']);
      $cnt++;
      if ($cnt == 4) break;   
      }
   }
?>

Please... HELP ME !!!!  :\'( :\'(

Many thanks
Seb
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

inn87

greetings !

I integrated cpmfetch to coppermine to display the latest added photos in my .shtml homepage. The photos are now just scattered in my homepage ' www.pickafish.com '. I would like the photos to be in a table  similar to the 'latest additions' table in my gallery ' "hardwired theme"  www.pickafish.com/gallery . ANy idea how ? help appreciated 

thanx

deejaymoni

Hi everyone,

I'm trying to display a list of whats been added recently within 10 days but...

<?php 
include "cpmfetch.php";
$objCpm = new cpm('/gallery');
$styleguide = array(
"linkstyle" => "photoclip",
"alttag" => "One of the last photos submitted",
"imagestyle" => "photoclip",
"imagesize" => 'thumb');

$objCpm->cpm_setReturnType('resultset');

$data $objCpm->cpm_listMediaAddedOverLastDays(10,$styleguide); 
foreach (
$data as $row) {
print $row['aTitle'] . "";
}
?>


this code shows me just a blank page??? ???

vuud

Quote from: deejaymoni on November 01, 2005, 09:59:58 PM
Hi everyone,

I'm trying to display a list of whats been added recently within 10 days but...

<?php 
include "cpmfetch.php";
$objCpm = new cpm('/gallery');
$styleguide = array(
"linkstyle" => "photoclip",
"alttag" => "One of the last photos submitted",
"imagestyle" => "photoclip",
"imagesize" => 'thumb');

$objCpm->cpm_setReturnType('resultset');

$data $objCpm->cpm_listMediaAddedOverLastDays(10,$styleguide); 
foreach (
$data as $row) {
print $row['aTitle'] . "";
}
?>


this code shows me just a blank page??? ???


One thing that leaps to mind is the time frame... have you added anything in the last ten days?  That got me once... 

if so, check the $row with a print_r to see what you are getting back for data

Let me know how that goes



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

bino

Quote from: vuud on November 01, 2005, 12:02:00 AM
Quote from: bino on October 29, 2005, 03:07:48 PM
Cpmfetch is a great feature. However, I have a question.
Is it normal when I use the latest added media code it only displays the images I added? (various other members have added images aswell but when using the code it doesn´t show them at all)


Are these other images in user galleries...  If so, you could be running into the non-private aspect...  This is the function that controls this... (Private to cpmfetch means anything that is not completely opened)

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 will try this when I get home but I´m not sure if that would slove my problem since I´m not running private albums. I create albums and batch upload images to them. Users that are part of a certain phpbb usergroup can single upload to them aswell.

Weird is that another admin using single upload doesn´t have his photo´s shown with the script and the one´s I uploaded with a testaccount (no admin, just right usergroup) do not cause any trouble.

Also, what do I put in as $bool?

vuud

Quote from: bino on November 02, 2005, 10:14:38 AM
Quote from: vuud on November 01, 2005, 12:02:00 AM
Quote from: bino on October 29, 2005, 03:07:48 PM
Cpmfetch is a great feature. However, I have a question.
Is it normal when I use the latest added media code it only displays the images I added? (various other members have added images aswell but when using the code it doesn´t show them at all)


Are these other images in user galleries...  If so, you could be running into the non-private aspect...  This is the function that controls this... (Private to cpmfetch means anything that is not completely opened)

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 will try this when I get home but I´m not sure if that would slove my problem since I´m not running private albums. I create albums and batch upload images to them. Users that are part of a certain phpbb usergroup can single upload to them aswell.

Weird is that another admin using single upload doesn´t have his photo´s shown with the script and the one´s I uploaded with a testaccount (no admin, just right usergroup) do not cause any trouble.

Also, what do I put in as $bool?


Bool is a boolean.  true or false

Well, the phpbb thing is probably your problem then.  the phpbb bridge does not create users in the cpg database, so it throws it off.  How many phpbb users do you have?  Essentially if you make a few cpg users then the photos will show up.

Essentially, the photo entry says "user #3 entered me" but the cpg user table has no user #3 cause its in the phpbb table.

There is a lot of talk about this in these forums already... search on phpbb and cpmfetch



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

deejaymoni

Quote from: vuud on November 01, 2005, 10:11:39 PM
Quote from: deejaymoni on November 01, 2005, 09:59:58 PM
Hi everyone,

I'm trying to display a list of whats been added recently within 10 days but...

<?php 
include "cpmfetch.php";
$objCpm = new cpm('/gallery');
$styleguide = array(
"linkstyle" => "photoclip",
"alttag" => "One of the last photos submitted",
"imagestyle" => "photoclip",
"imagesize" => 'thumb');

$objCpm->cpm_setReturnType('resultset');

$data $objCpm->cpm_listMediaAddedOverLastDays(10,$styleguide); 
foreach (
$data as $row) {
print $row['aTitle'] . "";
}
?>


this code shows me just a blank page??? ???


One thing that leaps to mind is the time frame... have you added anything in the last ten days?  That got me once... 

if so, check the $row with a print_r to see what you are getting back for data

Let me know how that goes


Hi thanks for your help but it still don't wanna work for me. It shows me a Parse error: parse error in fetchtest.php on line 15
I have tried different solutions but nothing happen.

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

$styleguide = array(
"linkstyle" => "photoclip",
"alttag" => "One of the last photos submitted",
"imagestyle" => "photoclip",
"imagesize" => 'thumb');

$objCpm->cpm_setReturnType('resultset');

$data $objCpm->cpm_listMediaAddedOverLastDays(10,$styleguide); 
foreach (
$data as $row) {
print_r $row['aTitle'] . "";
}
$objCpm->cpm_close();
?>

Babounet

Quote from: vuud on November 01, 2005, 04:18:48 PM

The code shown below is a good starting point.  Right now, cpmfetch will not do what you are looking for, so you have to wrap it with more PHP code to get the images and display them and add the titles.

I don't have time to write it at this moment.  If someone else has done this, please post the code.

Its not terribly complicated, and if you insert a print_r($row) in there you can see all the wonderful data you have access to.


Quote from: mpvvv on November 01, 2005, 03:58:26 PM
Hi,

I'm having the same problem, can anyone help?

Thanks

Quote from: Babounet on November 01, 2005, 12:44:36 PM
Quote from: vuud on November 01, 2005, 12:08:46 AM
Quote from: kreptil on October 29, 2005, 07:15:17 AM
Nice job, but how can I use the option "lastalb" (last updated albums) with this CpmFetch?

Thanks!.


Not sure I understand the question, but this may be helpful:

cpm_showAlbumsUpdatedOverLastDays($numberOfDays,$options="")

On this page:

http://www.fistfullofcode.com/projects/copperminefetch/manual/ch07s05.html



Hello. How can provide a table with the 4 last updtated albums (with one pic from each album and his name below).
I've found a code on vuud's website (see below), but this provide only a text with date and album name and I have no idea how I can add a pic.

   $objCpm->cpm_setReturnType("resultset");
   $data = $objCpm->cpm_viewLastAddedMediaFrom(1000, 1000, "");
   $cnt = 0;       
   $arrayofalbums = array();
   foreach ($data as $row) {
       if (! in_array($row['aTitle'],$arrayofalbums)) {
          print date("d/m/y",$row['pCtime']);
      print "&nbsp;&nbsp;&nbsp;";
      print "";
           print $row['aTitle'];
      print "";   
      print "<br>";
      array_push($arrayofalbums,$row['aTitle']);
      $cnt++;
      if ($cnt == 4) break;   
      }
   }
?>

Please... HELP ME !!!!  :\'( :\'(

Many thanks
Seb

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?

It would be very apreciated.
Many thanks
Seb

kegobeer

Quote from: BabounetCan someone explain me how I can use the print_r($row) function?

If you are looking for instructions on print_r, try php.net.

http://www.php.net/manual/en/function.print-r.php
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

vuud

Quote from: deejaymoni on November 02, 2005, 07:04:50 PM
Quote from: vuud on November 01, 2005, 10:11:39 PM
Quote from: deejaymoni on November 01, 2005, 09:59:58 PM
Hi everyone,

I'm trying to display a list of whats been added recently within 10 days but...

<?php 
include "cpmfetch.php";
$objCpm = new cpm('/gallery');
$styleguide = array(
"linkstyle" => "photoclip",
"alttag" => "One of the last photos submitted",
"imagestyle" => "photoclip",
"imagesize" => 'thumb');

$objCpm->cpm_setReturnType('resultset');

$data $objCpm->cpm_listMediaAddedOverLastDays(10,$styleguide); 
foreach (
$data as $row) {
print $row['aTitle'] . "";
}
?>


this code shows me just a blank page??? ???


One thing that leaps to mind is the time frame... have you added anything in the last ten days?  That got me once... 

if so, check the $row with a print_r to see what you are getting back for data

Let me know how that goes


Hi thanks for your help but it still don't wanna work for me. It shows me a Parse error: parse error in fetchtest.php on line 15
I have tried different solutions but nothing happen.

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

$styleguide = array(
"linkstyle" => "photoclip",
"alttag" => "One of the last photos submitted",
"imagestyle" => "photoclip",
"imagesize" => 'thumb');

$objCpm->cpm_setReturnType('resultset');

$data $objCpm->cpm_listMediaAddedOverLastDays(10,$styleguide); 
foreach (
$data as $row) {
print_r $row['aTitle'] . "";
}
$objCpm->cpm_close();
?>


print_r is a php function... It prints the contents of an array strictly to show you what it contains.  It was intended to help you get an idea of what data is coming back and what is in there.


try this:

foreach ($data as $row) {
        print "<pre>";
   print_r ($row);
        print "</pre>";

}

You can also look up print_r at www.php.net in the documentation.

It does not fix your original problem, but will help illustrate what is the row array










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








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: kegobeer on November 02, 2005, 07:26:08 PM
Quote from: BabounetCan someone explain me how I can use the print_r($row) function?

If you are looking for instructions on print_r, try php.net.

http://www.php.net/manual/en/function.print-r.php

Yeah, like he said.

Its a wonderful wonderful function!  Sure to save you much trouble down the line.

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

bino

Quote from: vuud on November 02, 2005, 04:14:16 PM
Bool is a boolean.  true or false

Well, the phpbb thing is probably your problem then.  the phpbb bridge does not create users in the cpg database, so it throws it off.  How many phpbb users do you have?  Essentially if you make a few cpg users then the photos will show up.

Essentially, the photo entry says "user #3 entered me" but the cpg user table has no user #3 cause its in the phpbb table.

There is a lot of talk about this in these forums already... search on phpbb and cpmfetch
I got it working. I looked at the pictures being uploaded by which user. I created those users with their phpbb id in the cp database and now it displays all latest pictures.

vuud

Quote from: bino on November 03, 2005, 05:59:22 PM
Quote from: vuud on November 02, 2005, 04:14:16 PM
Bool is a boolean.  true or false

Well, the phpbb thing is probably your problem then.  the phpbb bridge does not create users in the cpg database, so it throws it off.  How many phpbb users do you have?  Essentially if you make a few cpg users then the photos will show up.

Essentially, the photo entry says "user #3 entered me" but the cpg user table has no user #3 cause its in the phpbb table.

There is a lot of talk about this in these forums already... search on phpbb and cpmfetch
I got it working. I looked at the pictures being uploaded by which user. I created those users with their phpbb id in the cp database and now it displays all latest pictures.

Yeah, the phpBB integration has always been a problem like 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

fry

hi guys,

i wanted to include some random images from cpm in my blog, but im experiencing some problems...
i followed the instructions on the quickstart-page of the cpmfetch-page.
everything worked great, even the cftest.php did work without any error.

BUT:

then i tried to make up a test page with the code provided on the quickstart page.
i just edited the path to my gallery and uploadet it to the same directory in whicht the cpmfetch directory is.
and when i load the test.php in my browser, i get the following errors:

Warning: Unable to access cpmfetch_dao.php in /mnt/ja1/01/455/00000003/htdocs/scripte/cpmfetch/cpmfetch.php on line 25

Fatal error: Failed opening required 'cpmfetch_dao.php' (include_path='') in /mnt/ja1/01/455/00000003/htdocs/scripte/cpmfetch/cpmfetch.php on line 25


i completly dont get it....the cftest worked perfekt, but this test.php does not? and it seems to be script-internal?! i tried it with chmodding "cpmfetch_dao.php" to 777, but same error.

i have installed coppermine 1.3.5 and cpmfetch 1.6.2 on a sunOS apache 1.3.31

urls:
gallery: http://www.fryshaus.de/scripte/gallery/

test.php: http://www.fryshaus.de/scripte/test.php
which says: <?php 
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/scripte/gallery");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_close();
?>


cftest.php: http://www.fryshaus.de/scripte/cpmfetch/cftest.php

i woud sayi know the basics if php...


i hope i got the right threat for my problem, if not please move or tell me.
and i did use the search function, but did not get any results for: "Unable to access cpmfetch_dao.php"...

thanks a lot for help!


Babounet

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