4images Forum & Community
4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: Krali on November 22, 2010, 10:37:58 PM
-
Hello,
we are 5 users in our gallery and all have administrator rights.
We have a lot of subcategories now, so it is not ok to have the whole list of subcategories in the dropdown of checkimages.php.
I know how to get the user_id from the logged in user: $user_info['user_id']
And I know the start cat_id of each user, which should be used for the beginning of the sub categories.
So, what do I have to change to get only the sub-categories (cache?) from the logged in user in the dropdown of checkimages.php?
Thank you!
Kind regards,
Klaus
-
Hi,
out of the box 4images don't save category creator so never...
Maybe you can use the MOD where user can create there own
Subcategories, i don't know but maybe there is a db extension
who save's this.
Greetz X23
-
Hello,
I don't need an owner of a category.
Everyone of us has it's own first "root" - category. With the user_id I can set this "root-category" anywhere to get only all the subcategories of this "root-category".
Do you understand?
Kind regards,
Klaus
-
Hi,
try this:
checkimages.php find:
$desc = get_category_dropdown_check($cat_id);
replace $cat_id with an existing category id for example:
$desc = get_category_dropdown_check(1);
I've not tested that just try it, nothing will be broken...
If that work we need to extend the code around it
Greetz X23
-
Hello,
no, this will not work, I tried this before.
If you change this line, the dropdown has pre-selected the category, you write in this line.
But all other subcategories of all users are still there and if you have a second or more pages for one process for the next photos, it will not use the manually choosen category, but the preselected again.
Thank you
Kind regards,
Klaus
-
Assuming you are using 4images v1.7.8 or newer, in checkimages.php find:
$cat_id = (isset($HTTP_POST_VARS['cat_id_p'])) ? intval($HTTP_POST_VARS['cat_id_p']) : 0;
$cat_id_p = $cat_id;
Replace it with:
$cat_id = (isset($HTTP_POST_VARS['cat_id_p'])) ? intval($HTTP_POST_VARS['cat_id_p']) : $user_info['user_id'];
$cat_id_p = $cat_id;
-
Hello,
I am using 1.7.5.
I found two of these lines in checkimages.php:
$cat_id = (isset($HTTP_POST_VARS['cat_id_p'])) ? intval($HTTP_POST_VARS['cat_id_p']) : 0;
I changed both, but nothing has changed.
Thank you!
Kind regards,
Klaus
PS:
If I change:
if ($action == "checkimages")
{
$max_dimension = (isset($HTTP_POST_VARS['max_dimension'])) ? $HTTP_POST_VARS['max_dimension'] : $max_dimension_default;
$cat_id = (isset($HTTP_POST_VARS['cat_id_p'])) ? intval($HTTP_POST_VARS['cat_id_p']) : $user_info['user_id'];
to
if ($action == "checkimages")
{
$max_dimension = (isset($HTTP_POST_VARS['max_dimension'])) ? $HTTP_POST_VARS['max_dimension'] : $max_dimension_default;
$cat_id = (isset($HTTP_POST_VARS['cat_id_p'])) ? intval($HTTP_POST_VARS['cat_id_p']) : $user_info['user_id'];
Nothing happens, but if I change it to:
if ($action == "checkimages")
{
$max_dimension = (isset($HTTP_POST_VARS['max_dimension'])) ? $HTTP_POST_VARS['max_dimension'] : $max_dimension_default;
$cat_id = (isset($HTTP_POST_VARS['cat_id_p'])) ? intval($HTTP_POST_VARS['cat_id_p']) : 1;
The dropdown jumps directly to the Name of the user with user_id 1 in the dropdown, which is a first helpful way. But all the other users are still there with their subcategories and why is it not working with $user_info['user_id'] ?
Thank you
Kind regards,
Klaus
-
perhaps your user ids don't match with cat ids
-
perhaps your user ids don't match with cat ids
???
-
As I understood your original post is that your users have the same IDs as categories, so when you go to categories.php?cat_id=4 and then change url to member.php?action=showprofile&user_id=4 it would open page of the user of that category.
-
As I understood your original post is that your users have the same IDs as categories, so when you go to categories.php?cat_id=4 and then change url to member.php?action=showprofile&user_id=4 it would open page of the user of that category.
Hello,
no, that's not right.
It's like that:
if ($user_info['user_id'] == "2") {
$usercat = "2";
} elseif ($user_info['user_id'] == "3") {
$usercat = "3";
} elseif ($user_info['user_id'] == "4") {
$usercat = "1";
} elseif ($user_info['user_id'] == "5") {
$usercat = "111";
} elseif ($user_info['user_id'] == "6") {
$usercat = "390";
}
Thank you
Kind regards,
Klaus
-
Well, there you go, such a little, but crucial fact ;)
add that code below require('admin_global.php');
and then replace
if ($action == "checkimages") {
$cat_id = (isset($HTTP_POST_VARS['cat_id'])) ? intval($HTTP_POST_VARS['cat_id']) : 0;
with:
if ($action == "checkimages") {
$cat_id = (isset($HTTP_POST_VARS['cat_id'])) ? intval($HTTP_POST_VARS['cat_id']) : $usercat;
-
Hi,
ok, I have now:
if ($action == "checkimages")
{
$max_dimension = (isset($HTTP_POST_VARS['max_dimension'])) ? $HTTP_POST_VARS['max_dimension'] : $max_dimension_default;
$cat_id = (isset($HTTP_POST_VARS['cat_id_p'])) ? intval($HTTP_POST_VARS['cat_id_p']) : $usercat;
But all the other users and subcategories are still there, it is now just the Beginning of the user preselected.
Thank you
Kind regards,
Klaus
-
Try replace
$desc = get_category_dropdown($cat_id, 0, 4);
with:
$desc = get_category_dropdown($cat_id, $cat_id, 4);
-
Hi,
I only have this code:
$desc = get_category_dropdown_check($cat_id);
When I replace it with $desc = get_category_dropdown($cat_id, $cat_id, 4);
, there is no change.
Here is the file checkimages.php
Thank you
Kind regards,
Klaus
-
So you are using a mod, not original checkimages.php (should've mentioned this).
Remove all the changes except for what you added under admin_global.php line.
Then find:
$category .= get_category_dropdown_bits($cat_id);
Replace it with:
global $usercat;
$category .= get_category_dropdown_bits($cat_id, $usercat);
-
Hey,
GREAT, it works!!!
But I didn't have to delete anything :-)
Thank you very, very much!!!
Kind regards,
Klaus