Advanced search  

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]

Pages: 1 [2] 3   Go Down

Author Topic: basic cpmfetch code  (Read 25919 times)

0 Members and 1 Guest are viewing this topic.

bcddd214

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Re: basic cpmfetch code
« Reply #20 on: February 05, 2007, 01:00:52 am »

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

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: basic cpmfetch code
« Reply #21 on: February 05, 2007, 01:14:36 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.


Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Re: basic cpmfetch code
« Reply #22 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
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: basic cpmfetch code
« Reply #23 on: February 05, 2007, 09:33:42 am »

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

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: basic cpmfetch code
« Reply #24 on: February 05, 2007, 06:13:35 pm »

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.














Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: basic cpmfetch code
« Reply #25 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




Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: basic cpmfetch code
« Reply #26 on: March 26, 2007, 10:37:45 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,.


Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: basic cpmfetch code
« Reply #27 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
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: basic cpmfetch code
« Reply #28 on: March 27, 2007, 04:42:51 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?

Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: basic cpmfetch code
« Reply #29 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://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.
________________________________________________________-
« Last Edit: March 27, 2007, 08:34:31 pm by vuud »
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: basic cpmfetch code
« Reply #30 on: March 27, 2007, 06:39:06 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?

Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: basic cpmfetch code
« Reply #31 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
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: basic cpmfetch code
« Reply #32 on: March 27, 2007, 08:35:15 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
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: basic cpmfetch code
« Reply #33 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

Quote
include "./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

Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: basic cpmfetch code
« Reply #34 on: March 27, 2007, 10:39:35 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?



Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: basic cpmfetch code
« Reply #35 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.

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

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: basic cpmfetch code
« Reply #36 on: March 28, 2007, 02:59:14 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..



Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: basic cpmfetch code
« Reply #37 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
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: basic cpmfetch code
« Reply #38 on: March 28, 2007, 04:09:13 pm »

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.

Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: basic cpmfetch code
« Reply #39 on: March 28, 2007, 06:45:03 pm »

Thank you Vuud  :)
Logged
Pages: 1 [2] 3   Go Up
 

Page created in 0.03 seconds with 19 queries.