Support » Plugin: Wordpress File Upload » Change User Field
Change User Field
-
Hi @nickboss
Is it possible to change the user field of view log to another field? Nickname, First or Last Name …
Would it also be possible to use this data in the shortcode for the notification by email? %user% as First name, for example.
Thank you very much!
-
Hi, do you mean editing the additional user data? You can do this as administrator. If you click on a file shown in View Log, it will take you to the file edit page. There you can see details about the uploaded file and change the additional user fields’ values.
You can add the values inside the email like this: %userdata1% for first field, %userdata2% for the second and so on.
Regards
Nickolas
Hi, @nickboss;
I mean in View Log. There is a field called “User” between “File” and “Remarks”. It shows the username and I would like to show another field of the user there, like the nickname or first name. Would this be possible?
Thank you very much.
Well if you want to do it then you will have to slightly change the code of a plugin function. I can guide you to this.
Nickolas
Go ahead, @nickboss, I would greatly appreciate it.
You need to edit file /lib/wfu_admin_log.php found in plugin’s folder.
Locate the following line:
$echo_str .= "\n\t\t\t\t\t".'<td style="padding: 5px 5px 5px 10px; text-align:center;">'.wfu_get_username_by_id($filerec->userid).'</td>';
and replace it with the following lines:
$user = get_user_by('id', $filerec->userid); if ( $user == false && $id > 0 ) $username = 'unknown'; elseif ( $user == false && $id == -999 ) $username = 'system'; elseif ( $user == false ) $username = 'guest'; else $username = $user->user_nicename; $echo_str .= "\n\t\t\t\t\t".'<td style="padding: 5px 5px 5px 10px; text-align:center;">'.$username.'</td>
Nickolas
- This reply was modified 6 years, 1 month ago by nickboss.
Hi, @nickboss;
I get the following error:
Parse error: syntax error, unexpected ‘style’ (T_STRING)
Kind regards.
Hi, when do you get this error?
Nickolas
Hi, @nickboss;
When I try to replace the code:
$echo_str .= “\n\t\t\t\t\t\t”.’‘.$filerec->filepath.’‘; $echo_str .= “\n\t\t\t\t\t”.'</td>’; $user = get_user_by(‘id’, $filerec->userid); if ( $user == false && $id > 0 ) $username = ‘unknown’; elseif ( $user == false && $id == -999 ) $username = ‘system’; elseif ( $user == false ) $username = ‘guest’; else $username = $user->user_nicename; $echo_str .= “\n\t\t\t\t\t”.'<td style=”padding: 5px 5px 5px 10px; text-align:center;”>’.$username.'</td> }
Kind regards.
- This reply was modified 6 years, 1 month ago by Marius L. J..
- This reply was modified 6 years, 1 month ago by Marius L. J.. Reason: Fixed code block
the error must also mention the line number… which is the specific line with the error?
I also see strange characters “ and ‘’
these are not the normal double and single quotes and maybe the can cause problems, can you check your code?Nickolas
Hi, @nickboss;
First of all, thank you very much for your help. When I tried it the first time I got an error. Now I have the blank screen. I just copied and pasted the code from your message:
} $echo_str .= "\n\t\t\t\t\t".'</td>'; $user = get_user_by('id', $filerec->userid); if ( $user == false && $id > 0 ) $username = 'unknown'; elseif ( $user == false && $id == -999 ) $username = 'system'; elseif ( $user == false ) $username = 'guest'; else $username = $user->user_nicename; $echo_str .= "\n\t\t\t\t\t".'<td style="padding: 5px 5px 5px 10px; text-align:center;">'.$username.'</td> } $echo_str .= "\n\t\t\t\t\t".'<td style="padding: 5px 5px 5px 10px; text-align:left;"'.( $otheraction ? ' colspan="3"' : '' ).'>'; $echo_str .= $remarks; $echo_str .= "\n\t\t\t\t\t".'</td>'; $echo_str .= "\n\t\t\t\t".'</tr>'; }
How could I fix the code?
Kind regards.
Please copy the code of the whole file inside a txt file and send it to me at info@iptanus.com to see what is wrong.
Regards
Nickolas
Its possible use the additional data from additionals fields to show its at beside of to the files in a photo gallery for example?, or in other words how i can show that datas in a page of my website? not just on the file browser, wich only can see the administrator, and what i want is show to the public?
For example what im doing first is allow to users to upload photo files to a folder, next im using a pluggin what take that files and make automatic gallery from that folder, but what i want in addiotion is the data coleected on adiotional fields appear in some part beside to the photo or file, please help, and thanks.
Regards,- This reply was modified 5 years, 9 months ago by rexonaoriginal.
Hi, you can do the following:
1. Open visual editor of the shortcode, go to Interoperability tab and activate option “Add Uploaded Files to Media”, so that uploaded files are added to Media library of your website.
2. Go to Dashboard / Settings / WordPress File Upload / Settings and activate option “Show Custom Fields in Media Library”.
This way additional user fields will be added to the Media Library file as custom fields. Then your Gallery plugin can grab them if it can display custom fields of Media library images.
Regards
Nickolas
- The topic ‘Change User Field’ is closed to new replies.