CpmFetch - (OLD/LOCKED) stats/thumbnails/randoms/etc from outside CPG - Page 13 CpmFetch - (OLD/LOCKED) stats/thumbnails/randoms/etc from outside CPG - Page 13
 

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 - (OLD/LOCKED) stats/thumbnails/randoms/etc from outside CPG

Started by vuud, December 17, 2004, 10:19:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

FutschiKato

Hi there.

First of all thank you for your work on this hack. (gifts, girls, money...all yours!) :)

Would it be possible to use this coppermine hack to display a specific picture as direkt output like in the cfimageget.php example.
Something like cfimageget.php?album=7&pos=3, used inside a <img src=""> tag. That would be a hell of a dream!


The following, I tried with copperminefetch 1.0 and CPG 1.3.2.
I tried writing a new function for coppermine_dao.php which is nearly like the getRandomImageFromAlbum function only changing a bit on the SQL:

function getImagefromAlbumAndPosition ($albumid, $pos) {
$retval = "";
if (is_numeric($albumid) && is_numeric($pos)) {
          $sqlcode =     /*same SQL Code till: */    p.aid=$albumid limit $pos, $pos";
/*Same code for the rest of the functiion*/



Instead of searching for a random image, I only wanted to return the picture limited by the position given to the function (limit $pos, $pos)
Then I wanted to call that function the same way one uses the getRandomImageFromAlbum function from within cfimage.php.

if (array_key_exists('aid',$_GET) && array_key_exists('pos', $_GET)) {
   global $cpm;
$aid = $_GET['aid'];
$pos = $_GET['pos'];
$size=getSizeOption();
$results=$cpm->getImagefromAlbumAndPosition ($aid, $pos);
returnImageToBrowser($results,$size);
}
/*Rest of code the same as cfimage.php*/



Unfortenatly, this solution does not work out jet.

Do you have any hints on that?
If not, I would like to extend the feature request list with this issue!

Thank you
Georg
:)

peeps

Quote from: FutschiKato on February 14, 2005, 10:45:06 PM
Hi there.

First of all thank you for your work on this hack. (gifts, girls, money...all yours!) :)

Would it be possible to use this coppermine hack to display a specific picture as direkt output like in the cfimageget.php example.
Something like cfimageget.php?album=7&pos=3, used inside a <img src=""> tag. That would be a hell of a dream!


The following, I tried with copperminefetch 1.0 and CPG 1.3.2.
I tried writing a new function for coppermine_dao.php which is nearly like the getRandomImageFromAlbum function only changing a bit on the SQL:

function getImagefromAlbumAndPosition ($albumid, $pos) {
$retval = "";
if (is_numeric($albumid) && is_numeric($pos)) {
           $sqlcode =     /*same SQL Code till: */    p.aid=$albumid limit $pos, $pos";
/*Same code for the rest of the functiion*/



Instead of searching for a random image, I only wanted to return the picture limited by the position given to the function (limit $pos, $pos)
Then I wanted to call that function the same way one uses the getRandomImageFromAlbum function from within cfimage.php.

if (array_key_exists('aid',$_GET) && array_key_exists('pos', $_GET)) {
    global $cpm;
$aid = $_GET['aid'];
$pos = $_GET['pos'];
$size=getSizeOption();
$results=$cpm->getImagefromAlbumAndPosition ($aid, $pos);
returnImageToBrowser($results,$size);
}
/*Rest of code the same as cfimage.php*/



Unfortenatly, this solution does not work out jet.

Do you have any hints on that?
If not, I would like to extend the feature request list with this issue!

Thank you
Georg
:)

I don't understand...why not just hard code the link to the image if that is what you are wanting to do...

Tranz


FutschiKato

Thanks for your quick answers! Perhaps I will describe what should be the final result of my questions:

My goal would be a thing like it is used on the forums on www.airliners.net . They got a pictures database (non-Coppermine) and can use preview pics from that database in the forum like you will see in this thread:

http://www.airliners.net/discussions/general_aviation/read.main/1958918/
As you will see there, the picture is presented including picture data and the links will bring you directly to the pic IN the gallery....

And why all that? See here:
The next step would be a hack for a forum to include a picture with bbcode like   [pic]album=4&pos=2[/pic]

So, presenting a specific pic would be a step towards this goal, I wanted to start simple.  ;)
Perhaps, this kind of usage is not applicable with cfetch, but till now it is the best I know.

Let me know if you got something or if I was not able to give a good picture of what is my question. :)

Georg

peeps

Quote from: FutschiKato on February 15, 2005, 10:18:48 PM
Thanks for your quick answers! Perhaps I will describe what should be the final result of my questions:

My goal would be a thing like it is used on the forums on www.airliners.net . They got a pictures database (non-Coppermine) and can use preview pics from that database in the forum like you will see in this thread:

http://www.airliners.net/discussions/general_aviation/read.main/1958918/
As you will see there, the picture is presented including picture data and the links will bring you directly to the pic IN the gallery....

And why all that? See here:
The next step would be a hack for a forum to include a picture with bbcode like   [pic]album=4&pos=2[/pic]

So, presenting a specific pic would be a step towards this goal, I wanted to start simple.  ;)
Perhaps, this kind of usage is not applicable with cfetch, but till now it is the best I know.

Let me know if you got something or if I was not able to give a good picture of what is my question. :)

Georg

It seems like that would all be achievable with just a bbcode hack and smart creation of the picture database. The hack for the bbcode would need to just add an img code with the pic# to the end of a url and then the same for an link code, right? Just tell the users to look at the filename and use that as the pic#...

Tarique Sani

Abbas has a bbcode hack with which you can write [thumb=324] and it shows a thumbnail linked to the proper picture (and it also respects permissions) - I will see if he can be cajoled into releasing it :)
SANIsoft PHP applications for E Biz

FutschiKato

peeps: I never thougt that way round.
Tarique: That sounds a lot like a solution. I would really appreciate this.

Cheers
Georg  :)

vuud

Quote from: FutschiKato on February 16, 2005, 02:52:14 PM
peeps: I never thougt that way round.
Tarique: That sounds a lot like a solution. I would really appreciate this.

Cheers
Georg  :)

If you need to access the coppermine database from elsewhere, you can directly use the coppermine_dao object...  its undocumented really, but I wrote it so it will function standalone to make it easy to get the data without all the formatting stuff. 

Thanks everyone for handling this question - I painted the room my computer is in a few days ago and the fumes are nasty.  That and I have stopped getting email notifications for some reason :(

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

mrmike987

I need some help. Does anyone have the code that does this:
(From page1  post1)

Since Friday, December 10 2004 we've added about 355 images
Category name Album New count
Haley - The early years (1999-2002) 2000 Haley - the second year 17 new
1999 Haley - the first year 69 new
2001 Haley - the third year 30 new
Haley, Christi and me Our furry friends 18 new
May 2003 - Beckett Trip 15 new
Misc - Just don't fit anywhere 11 new


I've tried everything and just can't get it to work.
Thanks
Mike

vuud


Hey Mike,

I emailed you the code to accomplish that.  Let me know if you did not get it...

Quote from: mrmike987 on February 16, 2005, 09:18:36 PM
I need some help. Does anyone have the code that does this:
(From page1  post1)

Since Friday, December 10 2004 we've added about 355 images
Category name Album New count
Haley - The early years (1999-2002) 2000 Haley - the second year 17 new
1999 Haley - the first year 69 new
2001 Haley - the third year 30 new
Haley, Christi and me Our furry friends 18 new
May 2003 - Beckett Trip 15 new
Misc - Just don't fit anywhere 11 new


I've tried everything and just can't get it to work.
Thanks
Mike

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

boboli

Hi vuud, thank you for the mod..
Big Problem:
can't have the test page to work:
here is the link
http://boboli.altervista.org/cpmfetch/cftest.php

if you click on the "Click on this link to get into your coppermine gallery. it should not work, but the path shown in the web browser should help you to find what the correct one should be." it works so I presume the
$ChangeThisToYourPartialUrlToCPG = "/gallery"; is correct

the strange is
ERROR: Path to Coppermine incorrect. (/var/www/html/gallery//include/config.inc.php) where I see 2 slashes after gallery...

any idea ???
thanx
Roberto - Italy

deltafun

Hi,

A few suggestions for this mod, I will probably implement these myself.

* Ability to show image title and description with the image - One site I am using coppermine for I am using Coppermine to allow users to administrate albums, however the presentation of the photos and site is required to be presented in a much less "community" based way.

* With the CFIMAGEGET.PHP the ability to specify a users favourites could be very usefull - One site I use coppermine on has a community aspect, and a commercial aspect. Currently one of the girls at the company administers large parts of the site using phpBB, i.e specific posts are pulled onto specific php pages. What I would like to be able to do is for the company/community to have ALL photos visible within the gallery section, but then for the admin girl to browse the photos and maintain her own favourites list, this favourites list would be all the photos that she (the company) are happy to have on the main site pages. I could then simply replace all images on all pages with the cfimageget.php call for an image, allowing the site to have a dynamic feel in many areas with rotating images from the admin users favourites.
Sort of making a site much more interesting for the visitor, and giving the company a lot more control, whilst giving the web designer less hassle.
I`m aware there are otherways this could be accomplished, however I think making use of the favourites feature within Coppermine would be the best way to go. The reason for wanting to do it from a specific users favourites rather than the most viewed or most voted for etc is wanting those two features to exisit within coppermine untouched, allowing the community to vote/view photos without affecting the main site pages. Obviously the most viewed and most voted for images, might differ a lot from images a company would want to present as its main visibility.

Its a great mod, very usefull :)

micro

i'm having some problems trying to get images posted to another site,,thought  copperminefetch (cfimageget.php) would be the solution but i'm getting error messages..

Warning: main(../photos/include/config.inc.php): failed to open stream: No such file or directory in /home/micropr/public_html/copperminefetch/cpmfetch/cfimageget.php on line 28

Warning: main(../photos/include/config.inc.php): failed to open stream: No such file or directory in /home/micropr/public_html/copperminefetch/cpmfetch/cfimageget.php on line 28

Warning: main(): Failed opening '../photos/include/config.inc.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/micropr/public_html/copperminefetch/cpmfetch/cfimageget.php on line 28
No Database SelectedNo Database Selected
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/micropr/public_html/copperminefetch/cpmfetch/cfimageget.php on line 112

Warning: Cannot modify header information - headers already sent by (output started at /home/micropr/public_html/copperminefetch/cpmfetch/cfimageget.php:28) in /home/micropr/public_html/copperminefetch/cpmfetch/cfimageget.php on line 145

Warning: Cannot modify header information - headers already sent by (output started at /home/micropr/public_html/copperminefetch/cpmfetch/cfimageget.php:28) in /home/micropr/public_html/copperminefetch/cpmfetch/cfimageget.php on line 146


tried changing file permissions.

/photos   is the correct path
running coppermine 1.3.2
copperminefetch 1.0

thanks

lilcgt

help please here is my erroe mess.

Notice: Undefined index: DOCUMENT_ROOT in C:\Inetpub\wwwroot\cpmfetch\coppermine.php on line 87
ERROR: Path to Coppermine incorrect. (photo//include/config.inc.php)
Fatal error: Call to a member function on a non-object in C:\Inetpub\wwwroot\cpmfetch\cftest.php on line 5

and this is my test file

<?php
include "../cpg132drop/include/config.inc.php";
include "coppermine.php";
$objCpm = new cpm($CONFIG['dbname'], $CONFIG['dbserver'], $CONFIG['dbuser'],$CONFIG['dbpass'], $CONFIG['TABLE_PREFIX'], '../cpg132drop');
$objCpm->cpm_viewRandomMediaFromCategory(1,1,9);
$objCpm->cpm_close();
?>

i have in following dir
/cpmfetch    this program
/cpg132drop  my coppermine photo gallery

i have tried several diff things and no luck i tried the test which comes with it and it gave some errors has well im a newbie so
SHOOT me

katharsis

I've got cfimageget working.  I've read through all this thread but I don't see where anyone has asked or explained how to get a result like cfimageget but rather than random, have it display a single thumb of the last image added to the gallery.  That's all I want, just a single image, not even a link.  I can't figure out where I should butcher the code. I'm suffering from option paralysis.


katharsis

QuoteTried this?
cpm_viewLastAddedMedia (1, 1);
Well...I have NOW.
Thanks!

BZRK

Very nice work, I'm using it to show a random image on my page.

But how can I prevent the image shown from displaying an alternate text? I don't like that much, since it just shows somestupidnumber.jpg

thx

vuud

Quote from: BZRK on February 25, 2005, 06:19:31 PM
Very nice work, I'm using it to show a random image on my page.

But how can I prevent the image shown from displaying an alternate text? I don't like that much, since it just shows somestupidnumber.jpg

thx

You can probably just override the alt with a blank - although I am not sure.  Try this:

$cpmobj->cpm_viewRandomMedia(1,1,array("alttag" => ""));

That should just add an empty alttag

Hope that helps


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


Sorry for the delay... the first one is already done... check the latest dev versions for the subtitle features.

CFImageget is being completely rewritten and will be very extensible after I am done.  You could be able to add this sort of functionality without changing the core application (leaving you open to upgrades).  Although that feature would get into the coppermine_dao library and need changes there.  I have not done anything with favorites, but if you get something going in that respect, send me a diff or patch so I can add it in here. 

Thanks!

Quote from: deltafun on February 21, 2005, 01:04:07 AM
Hi,

A few suggestions for this mod, I will probably implement these myself.

* Ability to show image title and description with the image - One site I am using coppermine for I am using Coppermine to allow users to administrate albums, however the presentation of the photos and site is required to be presented in a much less "community" based way.

* With the CFIMAGEGET.PHP the ability to specify a users favourites could be very usefull - One site I use coppermine on has a community aspect, and a commercial aspect. Currently one of the girls at the company administers large parts of the site using phpBB, i.e specific posts are pulled onto specific php pages. What I would like to be able to do is for the company/community to have ALL photos visible within the gallery section, but then for the admin girl to browse the photos and maintain her own favourites list, this favourites list would be all the photos that she (the company) are happy to have on the main site pages. I could then simply replace all images on all pages with the cfimageget.php call for an image, allowing the site to have a dynamic feel in many areas with rotating images from the admin users favourites.
Sort of making a site much more interesting for the visitor, and giving the company a lot more control, whilst giving the web designer less hassle.
I`m aware there are otherways this could be accomplished, however I think making use of the favourites feature within Coppermine would be the best way to go. The reason for wanting to do it from a specific users favourites rather than the most viewed or most voted for etc is wanting those two features to exisit within coppermine untouched, allowing the community to vote/view photos without affecting the main site pages. Obviously the most viewed and most voted for images, might differ a lot from images a company would want to present as its main visibility.

Its a great mod, very usefull :)

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