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
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...
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.
I fixed this now, let me know if you want the code i changed :)
No question. Please don't wait for others to ask for the code - just contribute it here.
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!
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
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
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.
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.
yes that would probably make sense :)