trying to find the code for using cpmfetch to pull one, possible 2 pictures.
No arrays
no html
nothing fancy
I want to open cpmfetch at the begining of the php file and then slap in an occasional picture in the file.
then close cpmfetch.
I have no categories in my coppermine, only albums and a pos number.
i.e.
http://www.boatcrafts.net/copper/displayimage.php?album=1&pos=182
PS,
I did read
http://www.fistfullofcode.com/projects/copperminefetch/manual/index.html
and
http://www.cponygo.com/copperminefetch-1.6.2/docs/
They do not help at all when you are working with 1 simgle picture.
plugging the img src> tag just gives you an error.
What else goes with it to make it work?
What if the only information you have to work with is the html page of the photo?
http://www.boatcrafts.net/copper/displayimage.php?album=1&pos=182
So, I have a album number and a pos number.
If people are going to start working with this technology, there NEEDS TO BE A LOT MORE DOCUMENTATION ON THE BASICS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Brad
Quote from: bcddd214 on February 04, 2007, 08:08:03 PM
PS,
I did read
http://www.fistfullofcode.com/projects/copperminefetch/manual/index.html
and
http://www.cponygo.com/copperminefetch-1.6.2/docs/
They do not help at all when you are working with 1 simgle picture.
plugging the img src> tag just gives you an error.
What else goes with it to make it work?
What if the only information you have to work with is the html page of the photo?
http://www.boatcrafts.net/copper/displayimage.php?album=1&pos=182
So, I have a album number and a pos number.
If people are going to start working with this technology, there NEEDS TO BE A LOT MORE DOCUMENTATION ON THE BASICS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Brad
Hi Brad,
Thanks for the thoughts and stuff on this.
To get a single photo you would just request 1 column and 1 row.
Pretty much what was on the quickstart I think... You just put the call to get the photo where you want it in your page. Put the open at the top, and the close at the bottom and whatever in between.
http://www.fistfullofcode.com/projects/copperminefetch/quickstart.php
Quote
If people are going to start working with this technology, there NEEDS TO BE A LOT MORE DOCUMENTATION ON THE BASICS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I think you mean beginners. And I would love nothing more that to have that level of help and documentation. I am such a firm believer that I have ordered my staff to spend approximately 75% of our profit from sales of CpmFetch into developing this level of documentation. I have also repeatedly offered to included user generated documenation and submissions to help people along - but they have really let you down in this area. I can understand how angry you must be with them! I have long argued with them that CpmFetch should be there to teach people how to use CSS, and how to use PHP!
I personally, can barely contain myself with rage.
We have recently brought in an outside think tank to analyze our position and determine where our company focus should be. After scrutizing our sales income, userbase and cost for providing support - they have determined that the best way for CpmFetch to stop losing as much money is to actually have less users! That's right! The less people that use it, the less time spent on supporting it and the less time spent on bug fixes and feature requests. I am told however, that in our current model we shall, alas, never be profitable.
So you see, that if we did make it so everyone would use it, we would be even less profitable. My hands are financially tied.
Regards,
Vuud
How do you cpmfetch by picture id?
Not by category,
It is not mentioned in any way shape or for in the quick start.
I do not want to pictures to randomly change
I do not want to pull up multiple galleries
I need to pull up one picture and one picture only, and it should be the same picture every time.
Quote from: bcddd214 on February 04, 2007, 09:56:07 PM
How do you cpmfetch by picture id?
Not by category,
It is not mentioned in any way shape or for in the quick start.
I do not want to pictures to randomly change
I do not want to pull up multiple galleries
I need to pull up one picture and one picture only, and it should be the same picture every time.
If I put every feature in the quickstart, it would not be the quickstart anymore it would be the documentation...
That feature especially is rarely used AFAIK...
where?
I see a img src reference, but that is for an entire category.
I have 100 pictures in that category.
That not going to do any good with a batch upload....
Quote from: bcddd214 on February 04, 2007, 10:09:55 PM
where?
I see a img src reference, but that is for an entire category.
I have 100 pictures in that category.
That not going to do any good with a batch upload....
Where is it in the documentation?
http://www.fistfullofcode.com/projects/copperminefetch/manual/ch07s03.html
can you possibly put it in example format?
my error
Unknown table 'u' in where clause
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/brads/public_html/cpmfetch/cpmfetch_dao.php on line 707
the code I got from the only example I could find
<?php
require_once('../cpmfetch/cpmfetch.php');
$objCpm = new cpm('/copper');
$image = 459;
$objCpm->cpm_viewMediaByPid($image,$options);
$objCpm->cpm_close();
?>
Quote from: bcddd214 on February 04, 2007, 10:39:34 PM
my error
Unknown table 'u' in where clause
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/brads/public_html/cpmfetch/cpmfetch_dao.php on line 707
the code I got from the only example I could find
<?php
require_once('../cpmfetch/cpmfetch.php');
$objCpm = new cpm('/copper');
$image = 459;
$objCpm->cpm_viewMediaByPid($image,$options);
$objCpm->cpm_close();
?>
Do you have a forum bridged with coppermine?
If so, that is the problem. The 1.6.x later releases ended up with a problem of sites that are bridged.
Let me know if you are bridged, and I will outline the solutions for you.
no, it is an indepentdent php page
I have not attempted this with the forums section of my website
baby steps!
new cleaner code
<?php
require_once('../cpmfetch/cpmfetch.php');
$objCpm = new cpm('/copper');
$pid = 459;
$objCpm->cpm_viewMediaByPid($pid);
$objCpm->cpm_close();
?>
my error
Unknown table 'u' in where clause
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/brads/public_html/cpmfetch/cpmfetch_dao.php on line 707
coppermine is the latest stable
cpmfetch is the latest stable.
Just installed both of them last night....
this code works perfect, but does not do the job needed because the pictures change.
<?php
include "../cpmfetch/cpmfetch.php";
$objCpm = new cpm('/copper');
$objCpm->cpm_viewRandomMedia(3,1);
$objCpm->cpm_close();
?>
this code does not
<?php
require_once('../cpmfetch/cpmfetch.php');
$objCpm = new cpm('/copper');
$pid = 459;
$objCpm->cpm_viewMediaByPid($pid);
$objCpm->cpm_close();
?>
Quote from: bcddd214 on February 04, 2007, 10:51:01 PM
coppermine is the latest stable
cpmfetch is the latest stable.
Just installed both of them last night....
Okay, good. That stuff helps. For the forum thing, I mean when you installed Coppermine Photo Gallery, did you enable it to be bridged with your forum?
The unknown table error is familar... What version of CPG exactly are you using, and what version exactly of cpmfetch?
The error is very reminicent of an older pre 1.4.x version of CPG with cpmfetch... The user table did not exist until 1.4 I believe.
Quote from: bcddd214 on February 04, 2007, 10:57:28 PM
this code works perfect, but does not do the job needed because the pictures change.
<?php
include "../cpmfetch/cpmfetch.php";
$objCpm = new cpm('/copper');
$objCpm->cpm_viewRandomMedia(3,1);
$objCpm->cpm_close();
?>
this code does not
<?php
require_once('../cpmfetch/cpmfetch.php');
$objCpm = new cpm('/copper');
$pid = 459;
$objCpm->cpm_viewMediaByPid($pid);
$objCpm->cpm_close();
?>
So only the second code block there gives you an error? The unknown table error?
copperminefetch-1.6.4.tar.gz
and
cpg1.4.10.zip
I am not using this in phpbb as of yet. I would like to later.
This is on a flat php file only right now.
I did not do anything concerning bridging during the install. I just followed the directions.....
Am I being a bit thick here? I cannot see the point of what you are trying to do.
Let me just get this straight, you want to put a single picture that will never change onto a page. Why do you not just copy the image to the page in question?
Quote from: phill104 on February 04, 2007, 11:49:27 PM
Am I being a bit thick here? I cannot see the point of what you are trying to do.
Let me just get this straight, you want to put a single picture that will never change onto a page. Why do you not just copy the image to the page in question?
Hi Phil,
I bit my tongue on that one for awhile, but then started thinking that sure it would be strange to do it for one specific photo, but if you wanted to show total views or comments or something under it, cpmfetch is your man (or program).
Quote from: bcddd214 on February 04, 2007, 11:15:04 PM
copperminefetch-1.6.4.tar.gz
and
cpg1.4.10.zip
I am not using this in phpbb as of yet. I would like to later.
This is on a flat php file only right now.
I did not do anything concerning bridging during the install. I just followed the directions.....
Okay, apparently there is a bug in that function in cpmfetch 1.6.4. Not a much used (or apparently tested) function.
You have two options:
#1) Upgrade to the lastest dev release (which is fraught by a lack of completed documentation)
#2) Edit your cpmfetch_dao.php file.
Find line 273 which looks like this:
$sqlcode = "SELECT " . $this->sqlPictureAlbumSelect . " FROM " . $this->cpm_table_prefix
And add this:
. $this->cpm_table_prefix . "users AS u, "
so it looks like so:
$sqlcode = "SELECT " . $this->sqlPictureAlbumSelect . " FROM " . $this->cpm_table_prefix . "users AS u, " . $this->cpm_table_prefix
Save it. If you get a SQL error, make sure it is exactly as I showed.
If you do the upgrade to the dev version, BE SURE TO READ THE INSTALL INSTRUCTIONS IN THE README THAT COMES WITH IT
Thank you Phil and Vuud.
First off, why I just do not put a picture on the pic.
Doesn't make sense if I already have a copy on the picture on a high performance database and coppermine. Why do it twice?
Easy of implementation into other webpages by just slapping in the call code putting resource demand on the end user instead of the server twice.
Security reason.
Plus a few more reasons.
I will try the code you offered.
Thanks guys!!!!
nope, didn't work.
Table 'copper.pictures' doesn't exist
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/brads/public_html/cpmfetch/cpmfetch_dao.php on line 707
code looks like this:
if (is_numeric($pid)) {
$sqlcode = "SELECT " . $this->sqlPictureAlbumSelect . " FROM " . $this->cpm_table_pref . $this->cpm_table_prefix . "users AS u, "
. "pictures AS p, " . $this->cpm_table_prefix . "albums AS a " . " WHERE p.aid = a.aid and p.pid = $pid AND p.owner_id = u.user_id " . $this->filetypefilter ." "
Quote from: bcddd214 on February 05, 2007, 12:45:52 AM
Thank you Phil and Vuud.
First off, why I just do not put a picture on the pic.
Doesn't make sense if I already have a copy on the picture on a high performance database and coppermine. Why do it twice?
Easy of implementation into other webpages by just slapping in the call code putting resource demand on the end user instead of the server twice.
Security reason.
Plus a few more reasons.
I will try the code you offered.
Thanks guys!!!!
If it is on the same web site you just need an <img src= tag in your html. There is no need to go after the picture at all... the images are publically accesssible if you know the names anyway. If you go into your gallery and right click on a photo and do properties - you will see the raw link to the photo.
But anyway, its possible to do it this way.
I need a thumbnail!
They can then click on the thumbnail to get the full size picture.
http://www.boatcrafts.net/how_to/aluminum.php
I am right now writing a "how to"
These same pictures will be used elsewhere on the website.
It does not make any sense to copy and paste the same picture all over the website.
a simple cpmfetch call in any of the places the picture is required.
Later, I will be looking to do the same thing in phpbb.
Baby steps right now......
Brad
But using the tag mentioned above does not copy them, it just points to the reference. If you just point to the thumbnail reference and then add a link to the full screen copy the job is done.
For my use, cpmfetch has been a very powerful and easy to use tool. The docs are great.
Quote from: bcddd214 on February 05, 2007, 01:21:24 AM
I need a thumbnail!
They can then click on the thumbnail to get the full size picture.
http://www.boatcrafts.net/how_to/aluminum.php
I am right now writing a "how to"
These same pictures will be used elsewhere on the website.
It does not make any sense to copy and paste the same picture all over the website.
a simple cpmfetch call in any of the places the picture is required.
Later, I will be looking to do the same thing in phpbb.
Baby steps right now......
Brad
If you are just going to the full size photo from the thumbnail, it makes no sense to use cpmfetch.
1) Complexity in the pages (easier for something to go wrong)
2) Inefficent, as fast as CpmFetch it, it is slower than a direct image tag
3) Page becomes dependent on your database and CPG installation
Like Phill104 said, an IMG tag does not copy the image everywhere, it simply points to it.
For example, this image is my gallery
http://www.fistfullofcode.com/photos//albums/2004_12_06/thumb_bo_img_1550.jpg as PID 522.
Now I can write a bunch of cpmfetch code to do this, at which time:
* I need to execute PHP code to run it
* cpmfetch loads all the libraries
* cpmfetch parses your request
* cpmfetch contacts the database
* cpmfetch queries the database for 522
* cpmfetch does some file searching to determine what to feed back
* cpmfetch builds a table
* cpmfetch displays it
* cpmfetch closes the db connection.
Or, as Phil and I are suggesting:
<a href="http://www.fistfullofcode.com/photos/albums/2004_12_06/bo_img_1550.jpg" target="_new">
<img src="http://www.fistfullofcode.com/photos/albums/2004_12_06/thumb_bo_img_1550.jpg" />
</a>
Which goes and gets the thumbnail, and if you click on it, goes and gets your large image.
Only one copy of the thumbnail exists, and one copy of the large image. there is no loss of security here, if you think there is, let me know and I will either conceed the point, or tell you where you are wrong.
Hello Vuud
I am having some problems too I tried and tried but finally decided to ask you.
I am using 1.1.2 Smf forum, I have coppermine 1.4 installed in to same data base as the forum and bridged that is working withouth any problems.
I installed your cpmfetch 1.6.4 and trying to display images in different parts of the forum but I get an error and am lost what to do.
((ERROR: Fatal error: Cannot instantiate non-existent class: cpm in /hsphere/local/home/ampmnet/ampmnet.net/Sources/Load.php(1726) : eval()'d code on line 254))
code I use :
echo '<div align="right">';
include "/php-lib/cpmfetch/cpmfetch.php";
$objCpm = new cpm("/copper2");
$objCpm->cpm_viewRandomMedia(1,1);
$objCpm->cpm_close();
echo '</div>';
(where it says copper2 originally said (photo) I tried with that too and got same error any help will be appriciated I spend a lot of hours bringing it to this point .
thank you
http:ampmnet.net/cpmfetch/cftest.php and rest you can see I also was never able to use the install as it did nothing. and I could not find anything in installation files about it.
I also made a file randomimages.php and that pulled the picturs too just cant line them up in my forum.
::) :o
Quote from: yelegen on March 26, 2007, 10:25:50 PM
Hello Vuud
I am having some problems too I tried and tried but finally decided to ask you.
I am using 1.1.2 Smf forum, I have coppermine 1.4 installed in to same data base as the forum and bridged that is working withouth any problems.
I installed your cpmfetch 1.6.4 and trying to display images in different parts of the forum but I get an error and am lost what to do.
((ERROR: Fatal error: Cannot instantiate non-existent class: cpm in /hsphere/local/home/ampmnet/ampmnet.net/Sources/Load.php(1726) : eval()'d code on line 254))
code I use :
echo '<div align="right">';
include "/php-lib/cpmfetch/cpmfetch.php";
$objCpm = new cpm("/copper2");
$objCpm->cpm_viewRandomMedia(1,1);
$objCpm->cpm_close();
echo '</div>';
(where it says copper2 originally said (photo) I tried with that too and got same error any help will be appriciated I spend a lot of hours bringing it to this point .
thank you
http:ampmnet.net/cpmfetch/cftest.php and rest you can see I also was never able to use the install as it did nothing. and I could not find anything in installation files about it.
I also made a file randomimages.php and that pulled the picturs too just cant line them up in my forum.
::) :o
The include statement is based on the file system, not the root of the web site. Besides that, it looks as though you are just copying the information from how mine works.
I would get and install the latest dev version 1.9.12.... it will help you. You can also then follow the installation instructions pdf, as it only applies to the dev versions,.
Thank you Vuud for a fast answer
I put you latest cpmfetch in to may coppermine directory and
I installed 1.9.12 and all worked till it said these pictures were chosen and if you dont see them there is a problem.
and I dont see tehem instead just their numbers.
at this address: http://ampmnet.net/Desktop.rar exact info I received after install and also I attached the config file too.
I tried anyway to install some suggested scripts as I really do not know how to put them together and offcourse gotten errors.
Could you please looking at the config and install files tell me what script I should use and put it where? so I can display the pictures in the middle, top and bottom.
Sorry to be a bother
thank you
Quote from: yelegen on March 27, 2007, 12:53:03 PM
Thank you Vuud for a fast answer
I put you latest cpmfetch in to may coppermine directory and
I installed 1.9.12 and all worked till it said these pictures were chosen and if you dont see them there is a problem.
and I dont see tehem instead just their numbers.
at this address: http://ampmnet.net/Desktop.rar exact info I received after install and also I attached the config file too.
I tried anyway to install some suggested scripts as I really do not know how to put them together and offcourse gotten errors.
Could you please looking at the config and install files tell me what script I should use and put it where? so I can display the pictures in the middle, top and bottom.
Sorry to be a bother
thank you
I cannot find your gallery... I also can't read the char set in one of the files in the rar (I had to go find RAR software to open this).
I am not sure how much help I can be in this case...
Where is your cpmfetch install.php file located?
Okay Vuud I am sorry
as I am really trying to make this work now it became an obsession :)
here are the addresses: http://xxxxxxxx is my site address !!
http://xxxxxxxxxxxxxx this address is from my forum to coppermine it is bridged.
http://xxxxxxxxxx/cpmfetch/install.php this is the address where cpmfetch is in and install as you can see.
________________________________________________________-
Quote from: yelegen on March 27, 2007, 05:19:59 PM
Okay Vuud I am sorry
as I am really trying to make this work now it became an obsession :)
here are the addresses: http://ampmnet.net is my site address !!
http://www.ampmnet.net/index.php?action=Coppermine this address is from my forum to coppermine it is bridged.
http://ampmnet.net/copper2/cpmfetch/install.php this is the address where cpmfetch is in and install as you can see.
________________________________________________________-
http://ampmnet.net/copper2/ is where the coppermine is
http://ampmnet.net/copper2/cpmfetch/ where the cpmfetch is.
The install shows photos... what is the problem?
Dear Vuud
yes it does show now appearently last install did it :D
you saw it before I did, okay to make this legitimate so you did helpme ;D can you please tell me exactly where to put those strings on install so the picture is in my main page.
and will you please delete these links too if possible, or should I delete the install file? security!!
very close now
Thank you
Quote from: yelegen on March 27, 2007, 07:38:13 PM
Dear Vuud
yes it does show now appearently last install did it :D
you saw it before I did, okay to make this legitimate so you did helpme ;D can you please tell me exactly where to put those strings on install so the picture is in my main page.
and will you please delete these links too if possible, or should I delete the install file? security!!
very close now
Thank you
If you are using a forum, you have to check with the forum people as to how to put in into the forum template...
If you are just using a php page, then I can tell you
I am using all PHP :) I can add where ever you think bottom top and middle is where I would like to put them.
I have index.temlate.php, display.template.php, boardindex.template.php all of them are .php
I put at the bottom of boardindex.template like here and it showed at the very top
Quoteinclude "./copper2/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./copper2/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia(2,9);
$objCpm->cpm_close();
?>
I was able to show at the top but I do not like the way it is some how I need to control the sizes, or I would love to put them like film strips if possible, also when we click on them it does take us out of the forum. and how often these pictures supposed to change?
sory always asking but maybe your answers here will help others too.
thank you
Quote from: yelegen on March 27, 2007, 09:42:30 PM
I am using all PHP :) I can add where ever you think bottom top and middle is where I would like to put them.
I have index.temlate.php, display.template.php, boardindex.template.php all of them are .php
I put at the bottom of boardindex.template like here and it showed at the very top
I was able to show at the top but I do not like the way it is some how I need to control the sizes, or I would love to put them like film strips if possible, also when we click on them it does take us out of the forum. and how often these pictures supposed to change?
sory always asking but maybe your answers here will help others too.
thank you
LastAddedMedia changes when you add new images... If you want Random, you want to use the functions for random
Not sure on your placement issue, that is something you have to deal with.
As for sizes, what do you mean by controlling them?
okay so far all your answers have helped :)
some more questions: one the pictures that show up they are irregular sizes same way in coppermine too how can I make them all same sizes.
also I saw some one had made it so these pictures were like in a film strip or how can I a put them in a frame.
and when I click on the picture it takes me out of the forum and in to coppermine which should still be wrapped in the forum.
I thank you very much for your time, for the great software and when the time come I will use your services at your site.
Quote from: yelegen on March 28, 2007, 12:25:34 AM
okay so far all your answers have helped :)
some more questions: one the pictures that show up they are irregular sizes same way in coppermine too how can I make them all same sizes.
Resize and crop before uploading to CPG?
Quote
also I saw some one had made it so these pictures were like in a film strip or how can I a put them in a frame.
I don't know. For a frame, check IFrames of Frames in HTML. Not a Cpmfetch question.
Quote
and when I click on the picture it takes me out of the forum and in to coppermine which should still be wrapped in the forum.
I thank you very much for your time, for the great software and when the time come I will use your services at your site.
Can you send me an example of what the link should look like? Maybe a custom link will work for you..
Dear Vuud
Again thank you for your help I really appriciated :)
I saw a gentlemens site http://takethu.com/ his begining and at the bottom moving film strip where its constantly changing the random pictures is what I am after.
Film strip may or may not move but pictures randomly changing in a filim strip is something I would like to accomplish
so basically top and bottom of my forum shoul have that feel.
Thank you
Quote from: yelegen on March 28, 2007, 11:04:05 AM
Dear Vuud
Again thank you for your help I really appriciated :)
I saw a gentlemens site http://takethu.com/ his begining and at the bottom moving film strip where its constantly changing the random pictures is what I am after.
Film strip may or may not move but pictures randomly changing in a filim strip is something I would like to accomplish
so basically top and bottom of my forum shoul have that feel.
Thank you
That is something in Flash. Not CpmFetch. I have no idea.
Thank you Vuud :)
Quote from: yelegen on March 28, 2007, 06:45:03 PM
Thank you Vuud :)
Search around the forum for flash... It's probably mentioned somewhere
Quote from: yelegen on March 28, 2007, 11:04:05 AM
I saw a gentlemens site http://takethu.com/ his begining and at the bottom moving film strip where its constantly changing the random pictures is what I am after.
You really shouldn't assume people's gender on the internet. I don't think my website indicates anywhere that I am male, which I am not. :P
http://forum.coppermine-gallery.net/index.php?topic=12299.0 is the mod.