4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Loda on January 18, 2006, 10:35:11 AM

Title: [MOD] ACP Notice Field in Users Profile
Post 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:
Code: [Select]
// User's notice
$additional_user_fields['user_notice'] = array($lang['user_notice'], "textarea", 0);

3.  :arrow: insert in your lang/admin.php:
Code: [Select]
$lang['field_user_notice'] = "Notiz";
4. insert in your lang/main.php:
Code: [Select]
$lang['user_notice'] = "Notiz:";
5.  :arrow: in your page_header.php find this:
Code: [Select]
  "charset" => $lang['charset'],and add after it this:
Code: [Select]
  "lang_user_notice" => $lang['user_notice'],
6.1  :arrow: in the admin/user.php find this:
Code: [Select]
  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:
Code: [Select]
  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:
Code: [Select]
    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:
Code: [Select]
    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:
Code: [Select]
  echo "<td>".format_date($config['date_format']." ".$config['time_format'], $user_row[$user_table_fields['user_lastaction']])."</td>\n";
and add after it this:
Code: [Select]
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:
Code: [Select]
{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.

Title: Re: Notice field added in users profil
Post by: mawenzi on January 18, 2006, 05:21:44 PM
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 .
Code: [Select]
// 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
Title: Re: Notice field added in users profil
Post by: Stoleti on January 18, 2006, 05:54:56 PM
but this isn't the same of "Edit User" ??? :roll:
Title: Re: [MOD] APC Notice Field in Users Profile
Post by: Loda on January 18, 2006, 07:02:40 PM
hallo!
you are right! I've updated the codes! thank you!
Title: Re: [MOD] APC Notice Field in Users Profile
Post by: TheOracle on January 18, 2006, 07:22:05 PM
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 ?
Title: Re: [MOD] APC Notice Field in Users Profile
Post by: Stoleti on January 18, 2006, 11:57:58 PM
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 ????  :?:
Title: Re: [MOD] APC Notice Field in Users Profile
Post by: mawenzi on January 19, 2006, 12:26:57 AM
... 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:
Title: Re: [MOD] APC Notice Field in Users Profile
Post by: V@no on January 19, 2006, 12:38:31 AM
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
Code: [Select]
  $user_invisible = (isset($HTTP_POST_VARS['user_invisible'])) ? intval($HTTP_POST_VARS['user_invisible']) : 0;this line:
Code: [Select]
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"?
Title: Re: [MOD] APC Notice Field in Users Profile
Post by: TheOracle on January 19, 2006, 12:51:52 AM
Quote

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. ;)
Title: Re: [MOD] APC Notice Field in Users Profile
Post by: mawenzi on January 19, 2006, 12:55:03 AM
@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 ...
Title: Re: [MOD] APC Notice Field in Users Profile
Post by: V@no on January 19, 2006, 01:56:59 AM
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 ;)
Title: Re: [MOD] APC Notice Field in Users Profile
Post by: mawenzi on January 19, 2006, 02:03:14 AM
@V@no ... so, ok ...  :wink:
Title: Re: [MOD] ACP Notice Field in Users Profile
Post by: Loda on January 19, 2006, 02:08:27 AM
Hi,
@the oracle: doppelposting, uuups..
it doesn't work with your changes. and so i was a little bit confused.. sorry!
Title: Re: [MOD] ACP Notice Field in Users Profile
Post by: TheOracle on January 19, 2006, 05:19:03 AM
Quote

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. ;)
Title: Re: [MOD] ACP Notice Field in Users Profile
Post by: Loda on January 21, 2006, 04:46:55 PM
hallo!
i've insert the idea of Stoleti ...
Title: Re: [MOD] ACP Notice Field in Users Profile
Post by: TheOracle on January 21, 2006, 05:20:07 PM
Quote

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. :)
Title: Re: [MOD] ACP Notice Field in Users Profile
Post by: Loda on January 21, 2006, 05:23:35 PM
ohh.. sorry..
i add the step 7 in the first post!  :wink:
Title: Re: [MOD] ACP Notice Field in Users Profile
Post by: TheOracle on January 21, 2006, 05:24:41 PM
Excellent. Thanks for adding this. 8)
Title: Re: [MOD] ACP Notice Field in Users Profile
Post by: Stoleti on January 21, 2006, 05:32:42 PM
@ Loda :

Thanks  :D
Title: Re: [MOD] ACP Notice Field in Users Profile
Post by: TheOracle on January 21, 2006, 06:11:50 PM
@Loda:

Would it also be possible to see a screenshot of this MOD ? :)
Title: Re: [MOD] ACP Notice Field in Users Profile
Post by: Loda on January 21, 2006, 07:00:56 PM
@Loda:

Would it also be possible to see a screenshot of this MOD ? :)
yes!
Title: Re: [MOD] ACP Notice Field in Users Profile
Post by: TheOracle on January 21, 2006, 07:02:39 PM
Quote

is it ok for you?


Disgarding the fact it isn't my language, it is perfect. 8)
Title: Re: [MOD] ACP Notice Field in Users Profile
Post by: Stoleti on January 21, 2006, 07:22:15 PM
this MOD its perfect  8)
Title: Re: [MOD] ACP Notice Field in Users Profile
Post by: trez on February 13, 2006, 11:23:50 AM
How to show the notiz in the comment_bit under the username ? I tried using the tags for the profile, but nothing is shown
Title: Re: [MOD] ACP Notice Field in Users Profile
Post by: Loda on February 13, 2006, 11:46:27 AM
hi,
try this:
http://www.4homepages.de/forum/index.php?topic=10998.msg56191#msg56191

and than you can insert in your comment_bit:
Code: [Select]
{comment_user_notice}
i hope this works. i've never tested it. please let me know if it works.
Title: Re: [MOD] ACP Notice Field in Users Profile
Post by: trez on February 13, 2006, 11:49:00 AM
-----
thanks for the fast answer :) :) IT WORKS!
Title: Re: [MOD] ACP Notice Field in Users Profile
Post by: m.a on February 07, 2007, 02:46:30 AM
Hi Loda,
Thanks for this Mod!
Function = Perfect.


m.a
Title: Re: [MOD] ACP Notice Field in Users Profile
Post by: gustav on February 09, 2007, 10:41:18 AM
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....
Title: Re: [MOD] ACP Notice Field in Users Profile
Post by: m.a on November 16, 2007, 03:35:24 AM
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:
Code: [Select]
         {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:
Code: [Select]
{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