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 ... 47 48 49 50 [51] 52 53 54   Go Down

Author Topic: CpmFetch 1.4 On... Displaying data and images from CPG on your website  (Read 819280 times)

0 Members and 1 Guest are viewing this topic.

haribo85

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #1000 on: August 10, 2006, 04:12:17 pm »

Thanks for the link, but I am still lost.

Where do I make this change?

Thanks for your time!
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #1001 on: August 10, 2006, 04:19:47 pm »

Thanks for the link, but I am still lost.

Where do I make this change?

Thanks for your time!

In the Joomla or whatever file where you see that code... I don't use Joomla so I have no idea.

Read this if you still don't get what to do with the previous link and the $options entry there read this:
http://www.fistfullofcode.com/projects/copperminefetch/manual/ch06.html

That has everything you need


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

haribo85

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #1002 on: August 10, 2006, 04:26:00 pm »

So where as before I would have

Code: [Select]
echo "<center>";
include $cpmFetch."/cpmfetch.php";
$objCpm = new cpm($gallery);
$objCpm->cpm_viewRandomMedia(1,1, $options);
$objCpm->cpm_close();
echo "</center>";

Now I would have this? Please correct me if I'm wrong, Im a bit confused by this.

Code: [Select]
echo "<center>";
include $cpmFetch."/cpmfetch.php";
$objCpm = new cpm($gallery);
$objCpm->cpm_viewRandomMedia(1,1, imagelink => "none", $options);
$objCpm->cpm_close();
echo "</center>";

Thanks for your time.
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #1003 on: August 10, 2006, 04:44:10 pm »

So where as before I would have

Code: [Select]
echo "<center>";
include $cpmFetch."/cpmfetch.php";
$objCpm = new cpm($gallery);
$objCpm->cpm_viewRandomMedia(1,1, $options);
$objCpm->cpm_close();
echo "</center>";

Now I would have this? Please correct me if I'm wrong, Im a bit confused by this.

Code: [Select]
echo "<center>";
include $cpmFetch."/cpmfetch.php";
$objCpm = new cpm($gallery);
$objCpm->cpm_viewRandomMedia(1,1, imagelink => "none", $options);
$objCpm->cpm_close();
echo "</center>";

Thanks for your time.

Well, at least this shows some effort.

Anyway, you are close.  the $option variable is an array in my examples, so if you are using it already somewhere then you should add the imagelink to that.  If not you can create the array right there like so:

Code: [Select]
$objCpm->cpm_viewRandomMedia(1,1, array(imagelink => "none"));

Which is the same as

Code: [Select]
$options = array (imagelink => "none");
$objCpm->cpm_viewRandomMedia(1,1, $options);


You see?

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

haribo85

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #1004 on: August 10, 2006, 05:04:07 pm »

Thanks, working perfectly, i understand how its working now, just!

But if i want to add another option like image size and width, do i add another option array? I have read the page on image sizing and have seen if i just specify the imagewidth it will keep the ratio, so is it something like this?

Code: [Select]
echo "<center>";
include $cpmFetch."/cpmfetch.php";
$objCpm = new cpm($gallery);
$options = array (imagelink => "none");
$options2 = array ( imagewidth=> "20px");
$objCpm->cpm_viewRandomMedia(1,1, $options, $options2);
$objCpm->cpm_close();
echo "</center>";
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #1005 on: August 10, 2006, 05:12:25 pm »

Thanks, working perfectly, i understand how its working now, just!

But if i want to add another option like image size and width, do i add another option array? I have read the page on image sizing and have seen if i just specify the imagewidth it will keep the ratio, so is it something like this?

Code: [Select]
echo "<center>";
include $cpmFetch."/cpmfetch.php";
$objCpm = new cpm($gallery);
$options = array (imagelink => "none");
$options2 = array ( imagewidth=> "20px");
$objCpm->cpm_viewRandomMedia(1,1, $options, $options2);
$objCpm->cpm_close();
echo "</center>";


The www.php.net documentation would cover arrays in a much wider scope, but no you would not stack arrays.  The second one above would just be ignored.  You want to add it to the first one:

Code: [Select]
$options = array ('imagelink' => 'none', 'imagewidth'=> '20px');
I also personally always single quote them all.  Double quotes are interpreted for variables.  I also do the first one simply because it is a good habit to be in.  Anyway YMMV on that one depending on who you ask.








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

marian

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 160
    • BYM Photo Gallery
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #1006 on: August 10, 2006, 06:33:42 pm »

You could also be insane.
Are you thinking of rss_lastadded.php ?

This is no specific way to do that, but if you trace through the cfrssget.php file adding in a source should not be too hard.  I would make a copy of the rss_lastadded.php to a new name (like rss_myfeed.php or somethign more descriptive.)

Then modify that line that looks like:

$cfrss->addLastAddedMedia($totalToShow);

To include a source entry:

$cfrss->addLastAddedMedia($totalToShow,"cat=5");

That will do category 5... I think, I did not test it... just peaked at the code quickly.

You've got it, I'm completely nuts. Don't know how anyone can look at code for a couple of hours and be anything else!  ;D
Yesterday, I created an RSS feed from the whole gallery, using Tarique's script, and to my utter amazement it worked first time. Snag was that, straight away, we had folks saying "Can we just have latest Yacht Racing pix?", so here I came!!!
Have tried your trick and when I put www.bymnews.com/cpmfetch/rss_yachtrace.php in Feed Reader I got No RSS URLs found. I then checked with last added and got the same result, so I've obviously screwed something.
?????????
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #1007 on: August 10, 2006, 07:54:45 pm »

You've got it, I'm completely nuts. Don't know how anyone can look at code for a couple of hours and be anything else!  ;D
Yesterday, I created an RSS feed from the whole gallery, using Tarique's script, and to my utter amazement it worked first time. Snag was that, straight away, we had folks saying "Can we just have latest Yacht Racing pix?", so here I came!!!
Have tried your trick and when I put www.bymnews.com/cpmfetch/rss_yachtrace.php in Feed Reader I got No RSS URLs found. I then checked with last added and got the same result, so I've obviously screwed something.
?????????

I don't know what you did wrong.  If the Tarique script works for you then stick with that - does not bother me which one you use.

Did you change this line in the top of the file?
$ENABLED =false;

to

$ENABLED = true;

Does that help?

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

scifirocket21

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 58
Confused
« Reply #1008 on: August 12, 2006, 04:40:26 am »

I uploaded the files, and got as far as being able to make the test work (see it here: http://www.mydpnet.com/cpmfetch/cftest.php).  Now I have no idea what to do next.  I read documentation for this, but I just got more and more confused the more i read it. 

What I'm trying to accomplish is getting this mod to show the newest photo uploaded to the gallery on my HTML coded home page found at www.mydpnet.com

Any help would be greatly appricated. 
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Confused
« Reply #1009 on: August 12, 2006, 06:06:50 am »

I uploaded the files, and got as far as being able to make the test work (see it here: http://www.mydpnet.com/cpmfetch/cftest.php).  Now I have no idea what to do next.  I read documentation for this, but I just got more and more confused the more i read it. 

What I'm trying to accomplish is getting this mod to show the newest photo uploaded to the gallery on my HTML coded home page found at www.mydpnet.com

Any help would be greatly appricated. 

http://cpmfetch.fistfullofcode.com/projects/copperminefetch/quickstart.php
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

scifirocket21

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 58
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #1010 on: August 12, 2006, 08:09:31 am »

Ok, I feel silly.  I did read that thing before I started, but it was a path error.  Everything is working the way I want it to, except one thing.  How do I get it to appear on a HTML page that is not in the same directory as CPMFETCH.
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #1011 on: August 12, 2006, 04:12:56 pm »

Ok, I feel silly.  I did read that thing before I started, but it was a path error.  Everything is working the way I want it to, except one thing.  How do I get it to appear on a HTML page that is not in the same directory as CPMFETCH.

For an HTML (non-php) page you cannot do that as it is... I've got a few work arounds in here that you can use depending on what you want to do.

1.  You can use cfimageget - but that limits you to one image

2.  You can use Server Side Includes to include a php file that executes the cpmfetch commands

3.  Make your .HTML pages .PHP pages

Probably #2 you want
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

GuTe

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #1012 on: August 13, 2006, 08:51:29 am »

Hi all,

I'm having problems with displaying the images on my website. When i run cftest.php it fails to find the config.inc.php file (http://www.nordisktfiske.se/cpmfetch/cftest.php)

I have cpmfetch in a sperate folder and the copperimne gallery is in /photos.

In order to display the images on my site i use this code:

Code: [Select]
<?php 
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/photos");
$objCpm->cpm_viewRandomMedia(1,1,array("windowtarget" => "_blank","imagestyle" => "imgborder""imagewidth" => "140"));
$objCpm->cpm_close();
?>

All of this work on an other website I had but not on this one. Can someone see what the problem is?
I've been looking thru the forum, but with no luck.
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #1013 on: August 13, 2006, 05:54:51 pm »

Hi all,

I'm having problems with displaying the images on my website. When i run cftest.php it fails to find the config.inc.php file (http://www.nordisktfiske.se/cpmfetch/cftest.php)

I have cpmfetch in a sperate folder and the copperimne gallery is in /photos.

In order to display the images on my site i use this code:

Code: [Select]
<?php 
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/photos");
$objCpm->cpm_viewRandomMedia(1,1,array("windowtarget" => "_blank","imagestyle" => "imgborder""imagewidth" => "140"));
$objCpm->cpm_close();
?>

All of this work on an other website I had but not on this one. Can someone see what the problem is?
I've been looking thru the forum, but with no luck.


Your server is returning a document_root that is not the same as your own document root.

Try this (and I have no idea if it will work, but I will get a good laugh if it does):

Code: [Select]
$objCpm = new cpm("../../home/nordisktfiske.se/www/photos");
Like I said, no idea what that will do (won't break anything of course)

Lemme know what happens



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

GuTe

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #1014 on: August 13, 2006, 06:14:58 pm »

Really strange...

I tried with your solution, but it turned out like this:
Path to Coppermine incorrect. (/var/www../../home/nordisktfiske.se/www/photos//include/config.inc.php)

Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #1015 on: August 13, 2006, 07:25:11 pm »

Really strange...

I tried with your solution, but it turned out like this:
Path to Coppermine incorrect. (/var/www../../home/nordisktfiske.se/www/photos//include/config.inc.php)



Code: [Select]
$objCpm = new cpm("/../../home/nordisktfiske.se/www/photos");

Sorry, I was off.  This may work... (added a leading slash)


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

GuTe

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #1016 on: August 13, 2006, 07:28:29 pm »

Thanks for the help, but I still get an error:

ERROR: Path to Coppermine incorrect. (/var/www/../../home/nordisktfiske.se/www/photos//include/config.inc.php)

It looks like I wont be able to use this on the site.
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #1017 on: August 13, 2006, 07:37:17 pm »

Thanks for the help, but I still get an error:

ERROR: Path to Coppermine incorrect. (/var/www/../../home/nordisktfiske.se/www/photos//include/config.inc.php)

It looks like I wont be able to use this on the site.

yeah, just not as easily...

Open cpmfetch.php find this line

Somewhere around 75

Code: [Select]
if (array_key_exists("DOCUMENT_ROOT",$_SERVER )) {
$this->filepathtocpm = $_SERVER['DOCUMENT_ROOT'] . $urltocpm_;
} elseif (ini_get("doc_root") != "") {

Change the middle line to look like this:

   
Code: [Select]
$this->filepathtocpm = "/home/nordisktfiske.se/www/photos/";
If that does not work, you need to figure out what your path is to you web directory... that should be it.

Hope this helps.




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

GuTe

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #1018 on: August 13, 2006, 07:48:15 pm »

Woohoo!!!

Now I got something different:

Unknown column 'u.user_website' in 'field list'
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/nordisktfiske.se/www/cpmfetch/cpmfetch_dao.php on line 710

but it looks like it will work :)
Logged

GuTe

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: CpmFetch 1.4 On... Displaying data and images from CPG on your website
« Reply #1019 on: August 13, 2006, 08:02:05 pm »

I found it while searching the forum and I change the big sql statement in cpmfetch_dao.php.

Now I get Error in getImageTouse: Extension (strtolower): .jpg

The server has GD 2 installed.
Logged
Pages: 1 ... 47 48 49 50 [51] 52 53 54   Go Up
 

Page created in 0.05 seconds with 20 queries.