4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Loda on January 18, 2006, 10:35:11 AM
-
hi,
here is a little addon for the acp.
1. :arrow: add a new field in your database in the table 4images_users called user_notice, VARCHAR 255, notnull
2. :arrow: insert in the db_field_definitions.php:
// User's notice
$additional_user_fields['user_notice'] = array($lang['user_notice'], "textarea", 0);
3. :arrow: insert in your lang/admin.php:
$lang['field_user_notice'] = "Notiz";
4. insert in your lang/main.php:
$lang['user_notice'] = "Notiz:";
5. :arrow: in your page_header.php find this:
"charset" => $lang['charset'],
and add after it this:
"lang_user_notice" => $lang['user_notice'],
6.1 :arrow: in the admin/user.php find this:
show_form_header("users.php", "removeuser", "form");
echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\" align=\"center\"><tr><td class=\"tableborder\">\n<table cellpadding=\"3\" cellspacing=\"1\" border=\"0\" width=\"100%\">\n";
if ($countusers['users'] > 0) {
$sql = "SELECT ".get_user_table_field("", "user_id").get_user_table_field(", ", "user_name").get_user_table_field(", ", "user_email").get_user_table_field(", ", "user_joindate").get_user_table_field(", ", "user_lastaction")."
and replace it with tis:
show_form_header("users.php", "removeuser", "form");
echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\" align=\"center\"><tr><td class=\"tableborder\">\n<table cellpadding=\"3\" cellspacing=\"1\" border=\"0\" width=\"100%\">\n";
if ($countusers['users'] > 0) {
$sql = "SELECT ".get_user_table_field("", "user_id").get_user_table_field(", ", "user_name").get_user_table_field(", ", "user_email").get_user_table_field(", ", "user_joindate").get_user_table_field(", ", "user_lastaction").", user_notice
6.2 :arrow: then in the same file find this:
echo "<td class=\"tableseparator\">".$lang['field_username']."</td>\n<td class=\"tableseparator\">".$lang['field_email']."</td>\n<td class=\"tableseparator\">".$lang['field_joindate']."</td>\n<td class=\"tableseparator\">".$lang['field_lastaction']."</td>\n<td class=\"tableseparator\">".$lang['options']."</td>\n</tr>\n";
and replace it with this:
echo "<td class=\"tableseparator\">".$lang['field_username']."</td>\n<td class=\"tableseparator\">".$lang['field_email']."</td>\n<td class=\"tableseparator\">".$lang['field_joindate']."</td>\n<td class=\"tableseparator\">".$lang['field_lastaction']."</td>\n<td class=\"tableseparator\">".$lang['field_user_notice']."</td>\n<td class=\"tableseparator\">".$lang['options']."</td>\n</tr>\n";
6.3 :arrow: in the same file find this:
echo "<td>".format_date($config['date_format']." ".$config['time_format'], $user_row[$user_table_fields['user_lastaction']])."</td>\n";
and add after it this:
echo "<td>".$user_row['user_notice']."</td>\n";
ready!
then you can go to your acp and modify/edit any user. you can see a new field called "Notiz" . here you can write any thing in the field. for example: " userxy is my best friend or pay me 50dollars for my site etc." :wink:
if you search in acp users you can see the new field with your notice.
sorry about my bad english..
a little modification:
if you want to show the notice to a user in his profile anywhere you want:
7. :arrow: insert in templates/your_template/member_editprofil.html:
{if user_notice} {lang_user_notice} {user_notice} {endif user_notice}
if you want to show it in the users profil insert the same code in the templates/your_template/member_profil.html ! but remember then all users can see the notiz. thanks to Stoleti for the idea.
-
Hallo Loda,
nette Erweiterung des ACP ... :D
da es sich aber um ein Notizfeld handelt, würde ich aus dem "Text-Feld" ein "Textarea-Feld" machen .
// User's notice
$additional_user_fields['user_notice'] = array($lang['user_notice'], "textarea", 0);
Werde das Thema nach Mods & Plugins (Publishing & Support) verschieben .
Bitte ändere noch die Überschrift in : [MOD] ACP Notice Field in Users Profile um das Thema eindeutig zu machen .
danke ... mawenzi
-
but this isn't the same of "Edit User" ??? :roll:
-
hallo!
you are right! I've updated the codes! thank you!
-
I'm a little bit confused ... you posted twice you made the changes but still see the field the same way as before ... is there something I'm missing ?
-
so this is can be used to post " some warning msg" for some user/profile (i.e "you must delete XX image !!") , i'm correct !? using {user_notice} in member_profile ???? :?:
-
... not yet ... now is it only in ACP for admin memory ... but it is possible to use "user_notice" in member profile ... just a few code lines more ... :wink:
-
Basicaly you dont need step 6.x unless you want to see the value of your new field in the memberlist after the search in ACP.
@Stoleti:
Good idea! yes, you can do that with this mod ;) If you are planning to use new field for messages that only admin can modify, then you also should add in member.php below $user_invisible = (isset($HTTP_POST_VARS['user_invisible'])) ? intval($HTTP_POST_VARS['user_invisible']) : 0;
this line:unset($HTTP_POST_VARS['user_notice']);
this will ensure that member will not be able alter the value of that field ;)
@mawenzi:
Step 5 needed if you want to show the value of that field in any templates ;)
In the mean time, I might be wrong but
No, get_user_table_field() function can be used only for "default" fields. For custom fields it not only will not work, but it just not needed ;)
get_user_table_field() function needed only for compability with other software integration, which uses same database.
P.S.
"APC" in the name of this topic, shouldnt it be "ACP"?
-
No, get_user_table_field() function can be used only for "default" fields. For custom fields it not only will not work, but it just not needed Wink
get_user_table_field() function needed only for compability with other software integration, which uses same database.
Ah ! outstanding then. ;)
-
@mawenzi:
Step 5 needed if you want to show the value of that field in any templates ;)
of course ... but ... :roll: ... I did not say anything to step 5 ...
-
I was referring to this:
... not yet ... now is it only in ACP for admin memory ... but it is possible to use "user_notice" in member profile ... just a few code lines more ... :wink:
There are no more changes to the code needed, exept for adding new tags in the templates ;)
-
@V@no ... so, ok ... :wink:
-
Hi,
@the oracle: doppelposting, uuups..
it doesn't work with your changes. and so i was a little bit confused.. sorry!
-
it doesn't work with your changes. and so i was a little bit confused.. sorry!
Since specifications of this VERY KNOWN unexplicit bolded term was already explained above, I guess I won't have to ask once more. ;)
-
hallo!
i've insert the idea of Stoleti ...
-
I've insert the idea of Stoleti
Would it be possible to share what you inserted from Stoleti ? Perhaps others would also like to add it. :)
-
ohh.. sorry..
i add the step 7 in the first post! :wink:
-
Excellent. Thanks for adding this. 8)
-
@ Loda :
Thanks :D
-
@Loda:
Would it also be possible to see a screenshot of this MOD ? :)
-
@Loda:
Would it also be possible to see a screenshot of this MOD ? :)
yes!
-
is it ok for you?
Disgarding the fact it isn't my language, it is perfect. 8)
-
this MOD its perfect 8)
-
How to show the notiz in the comment_bit under the username ? I tried using the tags for the profile, but nothing is shown
-
hi,
try this:
http://www.4homepages.de/forum/index.php?topic=10998.msg56191#msg56191
and than you can insert in your comment_bit:
{comment_user_notice}
i hope this works. i've never tested it. please let me know if it works.
-
-----
thanks for the fast answer :) :) IT WORKS!
-
Hi Loda,
Thanks for this Mod!
Function = Perfect.
3²
m.a
-
Is it possible to add a button to the end of the message, that will delete the message? So that a user can get ridd of the messege after he has read it....
.... and maybe a second thing like "automatically delete message, if message is older than x days"... so the function to display the message checks the date of the message and erases it if older than x days...
Cause it will get hard to keep track of all messages as an admin... and this all will make sure the users don't see some obsulete stuff for too long....
-
Is it possible to add a button to the end of the message, that will delete the message? So that a user can get ridd of the messege after he has read it....
.... and maybe a second thing like "automatically delete message, if message is older than x days"... so the function to display the message checks the date of the message and erases it if older than x days...
Cause it will get hard to keep track of all messages as an admin... and this all will make sure the users don't see some obsulete stuff for too long....
Hi gustav,
I dont have exactly understood which you mean, but I think the fact that it is which you means and needs (probably)!
in member_editprofile.html
add this:
{if user_notice}
<tr>
<td class="row2" valign="top"><b> {lang_user_notice}</b><br>{user_notice}</td>
<td class="row2">
<textarea type="text" name="user_notice" value="{user_notice}" cols="12" rows="7" wrap="virtual" class="textarea" />{user_notice}</textarea>
</td>
</tr>
{endif user_notice}
and in member_profile.html
add this:
{if user_notice}
<tr>
<td class="row2" valign="top"><b> {lang_user_notice}</b></td>
<td class="row2"><b>{user_notice}</b>
</td>
</tr>
{endif user_notice}
m.a