Can't get last images from certain category Can't get last images from certain category
 

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

Can't get last images from certain category

Started by iamfez, January 27, 2007, 05:59:11 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

iamfez

I'm using the newest versions of CPG and cpmFetch and I've been tampering with it the last couple of days.

I've got everything the way I like it, but for some reason I can't get it to fetch the last updated images from a certain category.

This is the code I'm using:

Quote<?php
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/regular");
$objCpm->cpm_viewLastAddedMediaFromCategory (1,3, "cat=5",array("windowtarget" => "_new"));
?>

Instead of images from category 5 showing up, it's images from category 3 which was the last update to the gallery I made. Is there anyway I can get it to show the last images from a specific category? Actually my ideal way for it to be would be to show in a row of three the last image each from three different categories. So it would be:

| image from category 3 | image from category 4 | image from category 5 |

I'd even using a table and add the code to each one if I couldn't just get them three in a row like I would like.

This is my site I'm using it on:

http://www.harryandginny.org/

But I'm also using a test page to try and get it to come up from three different categories.

http://www.harryandginny.org/test.php

Any help would be greatly appreciated!

vuud

Quote from: iamfez on January 27, 2007, 05:59:11 PM
I'm using the newest versions of CPG and cpmFetch and I've been tampering with it the last couple of days.

I've got everything the way I like it, but for some reason I can't get it to fetch the last updated images from a certain category.

This is the code I'm using:

Instead of images from category 5 showing up, it's images from category 3 which was the last update to the gallery I made. Is there anyway I can get it to show the last images from a specific category? Actually my ideal way for it to be would be to show in a row of three the last image each from three different categories. So it would be:

| image from category 3 | image from category 4 | image from category 5 |

I'd even using a table and add the code to each one if I couldn't just get them three in a row like I would like.

This is my site I'm using it on:

http://www.harryandginny.org/

But I'm also using a test page to try and get it to come up from three different categories.

http://www.harryandginny.org/test.php

Any help would be greatly appreciated!

I believe the syntax on that call is just the category number, not "cat=5", just a 5



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

iamfez

Okay, I've tried using this:

Quote$objCpm->cpm_viewLastAddedMedia (1,3, 5,array("windowtarget" => "_new"));
and
$objCpm->cpm_viewLastAddedMedia (1,3, "5",array("windowtarget" => "_new"));

But still it's the same. It will only give me the last images that I added which was to category 3. Plus when I now use

Quote$objCpm->cpm_viewLastAddedMediaFromCategory

Nothing appears now whatsoever.

I'm at a bit of a loss sorry.

vuud

Quote from: iamfez on January 28, 2007, 12:43:20 AM
Okay, I've tried using this:

But still it's the same. It will only give me the last images that I added which was to category 3. Plus when I now use

Nothing appears now whatsoever.

I'm at a bit of a loss sorry.

Hmmmm.  Which version exactly are you using of CpmFetch?

If you are on a newer development version you can try this one which is a newer version of the one you are using/

$objCpm->cpm_viewLastAddedMediaFrom("cat=5",1,3,array("windowtarget" => "_new"));

Someone older dev versions do it slightly differently

$objCpm->cpm_viewLastAddedMediaFrom(1,3,"cat=5",array("windowtarget" => "_new"));

Somewhere in the releasenotes it tells when that becomes a change.


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

iamfez

I'm still getting nothing. I'm using 1.6.4 which I think is the stable version. I think there was another newer one, right? I'll try downloading it and giving it a go.

I'll let you know how it turns out :)

iamfez

Installed version 1.9.8 into my gallery folder and when I ran the install all the images were broken.

iamfez

Actually I just found out why the install didn't work. Looking at the Debug information the path is wrong. My host has added security and puts a name into the path. Is there anyway I can change the path manually?

vuud

Quote from: iamfez on January 28, 2007, 02:09:11 PM
Actually I just found out why the install didn't work. Looking at the Debug information the path is wrong. My host has added security and puts a name into the path. Is there anyway I can change the path manually?

Sure.  Can you PM me a URL to your install, or PM me the output of the install script.  Thanks!

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

Quote from: iamfez on January 28, 2007, 02:09:11 PM
Actually I just found out why the install didn't work. Looking at the Debug information the path is wrong. My host has added security and puts a name into the path. Is there anyway I can change the path manually?

Well, your not the first person to have this issue.  Apparently its something new they are doing.

SCRIPT_FILENAME is showing up as this:  /dh/cgi-system/php.cgi

The work around, while I figure this out is:

1) Run the install
2) Figure out what the f/s path to your gallery is (DOCUMENT_ROOT,PATH_TRANSLATED work differently on different systems, but shoudl give you something)
3) Crack open cpmfetch_config.php
4) Find this line

// File system path to your Coppermine Photo Gallery
//  $cfg['filesystem_path_to_cpg'] = 'this part may be different for you';

5) Change to to reflect your installation, uncomment, add in the right path
// File system path to your Coppermine Photo Gallery
$cfg['filesystem_path_to_cpg'] = '/home/user/path/to/gallery';

6) Save the file, DO NOT run the install again, it will overwrite your changes.

That should get it going from other pages








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

iamfez

Did that and when I ran the test page it came up this:

QuoteERROR: Path to Coppermine incorrect. (/path/to/domain.org./regular/cpmfetch/cpmfetch_config.php//include/config.inc.php)
Fatal error: Call to a member function on a non-object in /path/to/domain.org./cpmfetch/cpmfetch.php on line 532

I've got two folders running with cpmfetch at the moment. One in it's own folder on the root which I'm using at the moment which is 1.6.4 and the other 1.9.8 which is in the gallery as instructed which I'm testing on to get the cpmfetch to get images from specific categories so I don't disrupt my site.

I used this line to call on them:

Quote<?php
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("./regular/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia (1,3, 5,array("windowtarget" => "_new"));
?>

I'm not sure if the workaround has in fact worked or if I've gotten the $objCpm = new cpm line wrong. I tried also putting in the full path but still had the same error.

vuud

Quote from: iamfez on January 28, 2007, 05:58:20 PM
Did that and when I ran the test page it came up this:

I've got two folders running with cpmfetch at the moment. One in it's own folder on the root which I'm using at the moment which is 1.6.4 and the other 1.9.8 which is in the gallery as instructed which I'm testing on to get the cpmfetch to get images from specific categories so I don't disrupt my site.

I used this line to call on them:

I'm not sure if the workaround has in fact worked or if I've gotten the $objCpm = new cpm line wrong. I tried also putting in the full path but still had the same error.

Lets deal with 1.9.8 since, I won't be supporting 1.6.x for very much longer (if at all).

I am guessing from this, the test page is located in the root of your website, and the gallery folder is called "regular".  If those assumptions are correct, it seems your code is good - EXCEPT THAT YOU ARE MIXING VERSIONS.

<?php
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("./regular/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia (1,3, 5,array("windowtarget" => "_new"));
?>

The 1.6 and 1.9 versions are generally very compatible, except for starting them.

Your include is pulling the 1.6 code in, but your new cpm line is using the syntax for the 1.9 version.

Again, if regular is your gallery, then try this:


<?php
include "./regular/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./regular/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia (1,35,array("windowtarget" => "_new"));
?>








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

iamfez

Once I get this working I'll definitely be using 1.9.8 :) The only reason why I downloaded the older version was it was listed as stable.

Okay, yes Regular is my gallery and I used the code and now get this:

QuoteError in getImageTouse: Extension (strtolower): .jpg File://albums/gof/harry/thumb_c5gofhidef-0002357.jpg
Error in getImageTouse: Extension (strtolower): .jpg File://albums/gof/harry/thumb_c5gofhidef-0002369.jpg
Error in getImageTouse: Extension (strtolower): .jpg File://albums/gof/harry/thumb_c5gofhidef-0002319.jpg
Error in getImageTouse: Extension (strtolower): .jpg File://albums/gof/harry/thumb_c5gofhidef-0002357.jpg
Error in getImageTouse: Extension (strtolower): .jpg File://albums/gof/harry/thumb_c5gofhidef-0002369.jpg
Error in getImageTouse: Extension (strtolower): .jpg File://albums/gof/harry/thumb_c5gofhidef-0002319.jpg

Along with three broken images. They are still links though and when I clicked them they lead me to my last uploads which were in category 4. Still not pointing to category 5 for some reason.

Here's the test page I've been using:

http://www.harryandginny.org/test.php

I know this must seem like a pain, but thanks for all the help I've been receiving!

vuud

Quote from: iamfez on January 28, 2007, 09:19:16 PM
Once I get this working I'll definitely be using 1.9.8 :) The only reason why I downloaded the older version was it was listed as stable.

Okay, yes Regular is my gallery and I used the code and now get this:

Along with three broken images. They are still links though and when I clicked them they lead me to my last uploads which were in category 4. Still not pointing to category 5 for some reason.

Here's the test page I've been using:

http://www.harryandginny.org/test.php

I know this must seem like a pain, but thanks for all the help I've been receiving!

Oh good grief!

Do me a favor, run your install and tell me what SCRIPT_FILENAME shows up as.  I will be its something about php.cgi...


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

iamfez

It is.

QuoteSERVER SCRIPT_FILENAME: /dh/cgi-system/php.cgi

vuud

Quote from: iamfez on January 29, 2007, 10:52:05 AM
It is.


This is a, new to me, change in php and webservers...  I have not figured out what it is yet, but...

In the meantime, AFTER you run install, open your cpmfetch_config.php file and look for this line... (the path may be different)

Code:

// File system path to your Coppermine Photo Gallery
//  $cfg['filesystem_path_to_cpg'] = '/var/www/cpmfetch/htdocs';

Uncomment the second line and change it to your particular path
Code:

// File system path to your Coppermine Photo Gallery
$cfg['filesystem_path_to_cpg'] = '/home/my/path/to/gallery';


There are a few other variables you can look at in the install to get an idea... DOCUMENT_ROOT, SCRIPT_PATH_TRANSLATED (or something similar)

This is one of my highest priority bugs... I just can't find a good variable to get the info from...

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

iamfez

Okay I was messing about with it and finally got the images up on the install! :D

In cpmfetch_dao.php on line 75:

Quote$this->cfg['cfFilesystemPathToAlbums'] = $this->cfg['filesystem_path_to_cpg'] . "/" . $this->cfg['fullpath'];

I changed to:

Quote$this->cfg['cfFilesystemPathToAlbums'] = $this->cfg['filesystem_path_to_cpg'] . "/path/to/mygallery/" . $this->cfg['fullpath'];

And, it works! I'm just gonna try out the command now :)

iamfez

Okay still can't call images from the category I want. So I'm gonna play around with it some more.

vuud

Quote from: iamfez on January 29, 2007, 06:47:30 PM
Okay still can't call images from the category I want. So I'm gonna play around with it some more.

Can you paste up the code you are using now...

Also are you bridged?
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

iamfez

Not sure what bridged is, sorry.

This is the code:

Quote<?php
include "./regular/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./regular/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia (1,3, 5,array("windowtarget" => "_new"));
?>

vuud

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