basic cpmfetch code - Page 2 basic cpmfetch code - Page 2
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

basic cpmfetch code

Started by bcddd214, February 04, 2007, 06:56:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bcddd214

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

vuud

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.


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

bcddd214

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

phill104

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.
It is a mistake to think you can solve any major problems just with potatoes.

vuud

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:

&lt;a href="http://www.fistfullofcode.com/photos/albums/2004_12_06/bo_img_1550.jpg" target="_new"&gt;
&lt;img src="http://www.fistfullofcode.com/photos/albums/2004_12_06/thumb_bo_img_1550.jpg" /&gt;
&lt;/a&gt;

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.














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

yelegen

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





vuud

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


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

yelegen

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

vuud

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?

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

yelegen

#29
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.
________________________________________________________-

vuud

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?

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

yelegen

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

vuud

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

yelegen

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


vuud

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?



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

yelegen

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.

vuud

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



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

yelegen

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

vuud

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.

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

yelegen