4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: eslack on September 14, 2007, 05:56:16 AM
-
how can i do this?:
i want the users be able to upload multiple files so then show that files on details.php
thnx!
-
1 - Please read this:
http://www.4homepages.de/forum/index.php?topic=8802.0
i want the users be able to upload multiple files so then show that files on details.php
2 - http://www.4homepages.de/forum/index.php?topic=8517.0 for multiupload MOD request.
-
@thunderstrike
that's wrong mod for request.
he want to add more pics for 1 IMAGE_ID
with "multiupload MOD" you will get 10 pics with 10 image_id's
@eslack,
i think not there is rightnow mod for that what you want. BUT maybe thunderstrike will have time to make one :)
-
he want to add more pics for 1 IMAGE_ID
I do with one of MOD. No point really ... more SQL ressource use for use many IDs of row ...
-
thunder,
no idea what you talking about. try to write a little bit clearer.
table images:
row1 : image_id, cat_id, image_name, image_media_file_1, image_media_file_2, image_media_file_3, image_thumb_file_1, image_thumb_file_2, image_thumb_file_3 and so on..
-
no idea what you talking about. try to write a little bit clearer.
I write clearer and clear I can write !
image_id
1 same image ID with 10 rows ? Think of 1000 images like that ...
-
on a good server that should not be a problem..
maybe he have one..
Our database contains: 2437 models in 22 categories.
site working fine for me
-
... without any copyright ... :!:
... and no 4images Copyright-Removal-Licence ... :!:
-
thanks,i already saw that mod, thunderstrike, but it is not what I am looking for..
i can add more images and raise them to the data folder
but i have no idea how to display that in details.php
maybe creating folders for each user?
how can i do that?
i ve tried to edit
define('MEDIA_DIR', '../data/media/');
to
define('MEDIA_DIR', '../data/media/$user_id');
but it doesnt work...
thank you!
-
What exacly you try do ? ... Look like some peace miss ... you say $user_id ... so something no say here ...
-
when a member uploads a new image a want the script to create a folder with that member id, and put the images there..
i tryed to change includes/constants.php with define('MEDIA_DIR', '../data/media/$user_id');
but i have no luck..
how can i do that?
for exmple, user eslack has ID 5, then, when he wants to upload a new image, i want the script to make a new folder with his user_id
something like /data/media/5/new_image.jpg
-
Hum ... quick but if:
define('MEDIA_DIR', '../data/media/$user_id');
for:
define('MEDIA_DIR', 'data/media/' . $user_info['user_id']);
but if do so, you need edit ALL PHP files use MEDIA_DIR ... I say use new define:
define('MEDIA_USER_DIR', 'data/media/' . $user_info['user_id']);
;)
-
mm, thath doesnt work, i tryed to put that in
constants.php with no luck
and in
upload.php
changing
$this->upload_path['media'] = MEDIA_PATH."/".$cat_id;
to
$this->upload_path['media'] = MEDIA_PATH."/". $user_info['user_id'];
with no better luck :(
-
You no say $this, you say define. You change foreach post !!!
$user_info need global in class for work. If no global, $user_info is no see by 4images.
-
thunderstrike, constants.php and upload.php are different files, you know...
i tryed in both...
constants.php is define('MEDIA_DIR', './data/media/');
i change that with no luck and changed that back to define('MEDIA_DIR', '../data/media/');
then i edit upload.php
with no luck too...
i only want to do what i say...
-
i only want to do what i say...
With post different ... how can I help if post different foreach post ? :?
-
i dont undestand what you r saying, i only want to change $cat_id to $user_id but it doesnt work, its a variable
i dont know how to do that....
$cat_id reads the category ID and puts all images in that folder
$user_id exists, but doest work like i want to
-
$cat_id reads the category ID and puts all images in that folder
False. $cat_id exist but work for GET or POST from file / action to destination. $cat_cache[$cat_id] is for read category ID. Global from global.php file.
$user_id exists, but doest work like i want to
False. $user_id exist but work for GET or POST from file / action to destination. $user_info['user_id'] is global from includes/sessions.php file.
-
ok, so, what file i ve to edit to do what i want to do?
member.php?
includes/upload.php?
includes/constants.php?
what i have to change?
if eslack (user id 5) uploads lalala.jpg i want to be uploaded to data/5/lalala.jpg
if thunderstrike (user id 150) uploads lalala.jpg i want to be uploaded to data/150/lalala.jpg
-
I no test this so make backup.
// Step 1
In includes/upload.php file,
find:
function upload_file($field_name, $image_type, $cat_id = 0, $file_name = "") {
replace:
function upload_file($field_name, $image_type, $cat_id = 0, $user_id = 0, $file_name = "") {
find:
if ($cat_id) {
$this->upload_path['thumb'] = THUMB_PATH."/".$cat_id;
$this->upload_path['media'] = MEDIA_PATH."/".$cat_id;
}
else {
$this->upload_path['thumb'] = THUMB_TEMP_PATH;
$this->upload_path['media'] = MEDIA_TEMP_PATH;
}
replace:
if ($cat_id) {
$this->upload_path['thumb'] = THUMB_PATH."/".$cat_id;
$this->upload_path['media'] = MEDIA_PATH."/".$cat_id;
} elseif ($user_id) {
if (!is_dir(ROOT_PATH . "data/" . $user_id) && @is_writable(ROOT_PATH . "data")) {
@mkdir(ROOT_PATH . "data/" . $user_id, CHMOD_DIRS);
@mkdir(ROOT_PATH . "data/" . $user_id . "/" . THUMB_PATH, CHMOD_DIRS);
@mkdir(ROOT_PATH . "data/" . $user_id . "/" . MEDIA_PATH, CHMOD_DIRS);
}
$this->upload_path['thumb'] = ROOT_PATH . "data/" . $user_id . "/" . THUMB_PATH;
$this->upload_path['media'] = ROOT_PATH . "data/" . $user_id . "/" . MEDIA_PATH;
}
else {
$this->upload_path['thumb'] = THUMB_TEMP_PATH;
$this->upload_path['media'] = MEDIA_TEMP_PATH;
}
// Step 2
In member.php file,
find:
$upload_cat = ($direct_upload) ? $cat_id : 0;
replace:
$upload_cat = ($direct_upload) ? $user_info['user_id'] : 0;
find:
$new_name = $site_upload->upload_file("media_file", "media", $upload_cat);
replace:
$new_name = $site_upload->upload_file("media_file", "media", "", $upload_cat);
find:
$new_thumb_name = $site_upload->upload_file("thumb_file", "thumb", $upload_cat, get_basefile($new_name));
replace:
$new_thumb_name = $site_upload->upload_file("thumb_file", "thumb", "", $upload_cat, get_basefile($new_name));
After upload, you need SELECT image from user. Right now, is IMAGES_TABLE, you need to find way for user. ;)
-
thanks man, it works perfect! :lol:
-
and the last one, its posible that details.php show that images?
how can details.php read a whole directory and show the images?
-
how can details.php read a whole directory and show the images?
Is what I say day before ... you find way for do so. ;)
-
i dont know anything about php or mysql :cry: anybody can help me?
maybe 3d export is using another external script?
-
Ok ... a bit more for help but is it ... IMAGES_TABLE is use all over script ... no can help for this large (axcept if contract). Is very large for edit.
So bit more ...
// Step 1
In includes/constants.php file,
add:
define('USERS_IMAGES_TABLE', $table_prefix.'users_images_table');
define('USERS_IMAGES_TEMP_TABLE', $table_prefix.'users_images_temp_table');
// Step 2
In member.php file,
find:
if ($direct_upload) {
$sql = "INSERT INTO ".IMAGES_TABLE."
(cat_id, user_id, image_name, image_description, image_keywords, image_date, image_active, image_media_file, image_thumb_file, image_download_url, image_allow_comments".$additional_field_sql.")
VALUES
($cat_id, ".$user_info['user_id'].", '$image_name', '$image_description', '$image_keywords', $current_time, $image_active, '$new_name', '$new_thumb_name', '$image_download_url', $image_allow_comments".$additional_value_sql.")";
$result = $site_db->query($sql);
$image_id = $site_db->get_insert_id();
if ($result) {
add after:
$sql = "INSERT INTO ".USERS_IMAGES_TABLE."
(cat_id, user_id, image_name, image_description, image_keywords, image_date, image_active, image_media_file, image_thumb_file, image_download_url, image_allow_comments".$additional_field_sql.")
VALUES
($cat_id, ".$user_info['user_id'].", '$image_name', '$image_description', '$image_keywords', $current_time, $image_active, '$new_name', '$new_thumb_name', '$image_download_url', $image_allow_comments".$additional_value_sql.")";
$result1 = $site_db->query($sql);
find:
}
else {
$sql = "INSERT INTO ".IMAGES_TEMP_TABLE."
(cat_id, user_id, image_name, image_description, image_keywords, image_date, image_media_file, image_thumb_file, image_download_url".$additional_field_sql.")
VALUES
($cat_id, ".$user_info['user_id'].", '$image_name', '$image_description', '$image_keywords', $current_time, '$new_name', '$new_thumb_name', '$image_download_url'".$additional_value_sql.")";
$result = $site_db->query($sql);
add after:
}
else {
$sql = "INSERT INTO ".USERS_IMAGES_TEMP_TABLE."
(cat_id, user_id, image_name, image_description, image_keywords, image_date, image_media_file, image_thumb_file, image_download_url".$additional_field_sql.")
VALUES
($cat_id, ".$user_info['user_id'].", '$image_name', '$image_description', '$image_keywords', $current_time, '$new_name', '$new_thumb_name', '$image_download_url'".$additional_value_sql.")";
$result1 = $site_db->query($sql);
// Step 3
Create new SQL table (same with IMAGES_TABLE and IMAGES_TEMP_TABLE field inside) in phpmyadmin by use your_table_prefix_users_images_table and your_table_prefix_users_images_temp_table (change your_table_prefix with real name).
// Step 4
In details.php file,
Re-select fields with new table (USERS_IMAGES_TABLE) but from data/user ID folder and see if work.
Is all I can do for you for this ... is very large.
-
thanks, but im lost :oops: it doesnt work like i want...
how much $$ do you want to make all the work? (multi upload for 1 id like in 3d export)
thanks man!
-
thanks, but im lost :oops: it doesnt work like i want...
Hard to know if no screenshot / post example URL of someone create this ...
how much $$ do you want to make all the work? (multi upload for 1 id like in 3d export)
thanks man!
If want this for finance, please post in request for paid in forum ...
-
@thunderstrike - pls help us with this mod
thx a lot