problem with new favs feature problem with new favs feature
 

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

problem with new favs feature

Started by nickfzx, July 02, 2007, 03:36:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nickfzx

When using the new favorites feature I have encountered a problem.

If you specify a username of a member who has no favorites the parameter is ignored completely

so if i do this:
$objCpm->cpm_viewLastAddedMediaFrom("favorites=4",5,1,$options2);
and user with id 4 has no favorite images then it is completely ignored and just becomes a lastAddedMediaFrom and images are shown that aren't favorite's of anyone.

what I would prefer is if it returns no images at all if user id 4 has no favorites.

this is the case with the category selection i think...if you select a category with no images in then no images are shown.

thanks for your help...cpmfetch rules  ;D

vuud

Quote from: nickfzx on July 02, 2007, 03:36:11 PM
When using the new favorites feature I have encountered a problem.

If you specify a username of a member who has no favorites the parameter is ignored completely

so if i do this:
$objCpm->cpm_viewLastAddedMediaFrom("favorites=4",5,1,$options2);
and user with id 4 has no favorite images then it is completely ignored and just becomes a lastAddedMediaFrom and images are shown that aren't favorite's of anyone.

what I would prefer is if it returns no images at all if user id 4 has no favorites.

this is the case with the category selection i think...if you select a category with no images in then no images are shown.

thanks for your help...cpmfetch rules  ;D

Hmmm, yeah - your suggestion makes sense.  Lemme check it tonight...


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

nickfzx

hey vuud...just wandering if you got round to fixing this in the end?

If not I will just fix it myself as I am going to need it to be working in around a week.

nickfzx

I fixed this now, let me know if you want the code i changed  :)

Joachim Müller

No question. Please don't wait for others to ask for the code - just contribute it here.

vuud

Quote from: nickfzx on August 12, 2007, 03:04:51 AM
I fixed this now, let me know if you want the code i changed  :)

Yeah definately!

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

nickfzx

open cpmfetch_dao.php

find:
if (sizeof($pidlist)) {
$sourceSql .= " p.pid IN ('" . implode("','", $pidlist) . "') OR ";
}

replace with:
if (sizeof($pidlist)) {
$sourceSql .= " p.pid IN ('" . implode("','", $pidlist) . "') OR ";
}
else{
$sourceSql .= " p.pid IN ('" . implode("','", $pidlist) . "') OR ";
}


that should do it.

There is another problem that I'm having with this feature that I'll post in a new topic

vuud

Quote from: nickfzx on August 12, 2007, 03:10:47 PM
open cpmfetch_dao.php

find:
if (sizeof($pidlist)) {
$sourceSql .= " p.pid IN ('" . implode("','", $pidlist) . "') OR ";
}

replace with:
if (sizeof($pidlist)) {
$sourceSql .= " p.pid IN ('" . implode("','", $pidlist) . "') OR ";
}
else{
$sourceSql .= " p.pid IN ('" . implode("','", $pidlist) . "') OR ";
}


that should do it.

There is another problem that I'm having with this feature that I'll post in a new topic

What makes it different?  The if/else runs the exact same code... 

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

nickfzx

yep...but without the else bit it would ignore the favorites bit altogether and just show the last uploaded images...that is if the user had no images in their favorites.

vuud

Quote from: nickfzx on August 16, 2007, 12:35:48 AM
yep...but without the else bit it would ignore the favorites bit altogether and just show the last uploaded images...that is if the user had no images in their favorites.

If you are going to have the same code in the if as you do in the else, you mind as well just remove the if...

I think - I am pretty burned out right now, that guy with that took the shotgun to the internet has caused me to have an interesting week.

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

nickfzx

yes that would probably make sense :)