cotonti.com : Extra fields https://www.cotonti.com Останні повідомлення в темі Cotonti en Tue, 16 Dec 2025 05:28:08 -0000 oc Сб, 03 Січ 2009 18:10:47 -0000 esclkm What I also do:
user_location user_irc user_msn user_icq user_website - I think that they are also must be editable extra_fields.

And may be description is also can be use: smth like this {PAGE_RELEASE_DATA_DESCRIPTION}

And what happened when I want to use new extra fields in USER_REGISTER,USERSLIST FORUM, PAGES -AUTORINFO )))]]>
Сб, 03 Січ 2009 17:31:53 -0000
medar changeset 128.

In changeset 240 i do this system more flexible for future tasks.

Extra fields may be added for any sql table now.
Table sed_extra_fields contains properities for extra fields (html displaying - column field_html, location of extra field (for example - "pages", "users") - column field_location).

Tags for output extra fields not contains _MY_ now.

If you create extra field "release_data" for pages, you can use the following tags on pages:
On page.*.tpl: {PAGE_RELEASE_DATA}
On page.add.*.tpl: {PAGEADD_FORM_RELEASE_DATA}
On page.edit.*.tpl: {PAGEEDIT_FORM_RELEASE_DATA}

If you create extra field "jabber" for users, you can use the following tags on pages:
On users.profile.tpl: {USERS_PROFILE_JABBER}
On users.edit.tpl: {USERS_EDIT_JABBER}
On users.details.tpl: {USERS_DETAILS_JABBER}

Default extra fields (extra1 - extra5 for pages and extra1 - extra9 for users) added to database and avaiable for editing/deleting.

API:
sed_extrafield_add($sql_table, $name, $type, $html, $variants="", $description="");
sed_extrafield_update($sql_table, $oldname, $name, $type, $html, $variants="", $description="");
sed_extrafield_remove($sql_table, $name);
returns true if success and false if not.

$sql_table - name of table, without "sed_" prefix.
$type - now supported "input", "textarea", "select", "checkbox"

Example:
sed_extrafield_add('pages', 'release_data', 'input', '<input class="text" type="text" maxlength="255" size="56" />', '', 'this is data of album release');]]>
Сб, 03 Січ 2009 15:04:14 -0000