PHP-Fusion
v.7.01
AP-Fusion
v7.02.04
Pimped-Fusion-AP
v0.09.03
мая 23 2012 06:26:30
Навигация
· Новости
· Статьи
· Скачать
· Форум
· Ссылки
· Категории новостей
· Обратная связь
· Галерея
· Поиск
· Гостевая
· Коллекция аватар
· CMS AP-Fusion. Отличия от PHP-Fusion
· Javascript справочник
· Разное
· Техника
Сейчас на сайте
· Гостей: 5

· Пользователей: 0

· Всего пользователей: 447
· Новый пользователь: whitelo
Информеры
Загрузка файлов  +  -
Бытовая техника:  +  
Лента alipapa.ru
Карпаты. Верховина.
Карпаты. Драгобрат.
Карпаты. Яремче, Яблунецкий перевал.
dbForge Studio for MySQL вместо PHPMyAdmin
Облачные технологии - насколько это серьезно?
Как распределяется вес по сайту

Совместимость CMS
Solomono.ru - сервис для веб-мастера
Микроразметка веб-страниц.
АГС - не приговор.

Немного о политике.
Что такое АГС и как с ним бороться?
Долгожданный АП PR

PR Google: 9 месяцев без апдейта
Поведенческий фактор - модная тенденция?
Wi-Fi дома. Что делать, если 192.168.0.1 занято?

Ускоренная переиндексация страниц в Яндексе
Как я ставил винду на нетбук.
ROOKEE - инструмент оптимизатора.
Строим рейтинг-каталог
Ссылки  +  -
Блоги
Alipapa
» Блог Алипапы
lom
» Блог Лома
Последние активные темы форума
  Темы Просмотров Ответов Последние сообщения
TinyMCE
Вопросы по работе
8190 52 gimmi
21-05-2012 11:11
Первая версия
Blog System
1395 18 Alipapa
15-05-2012 14:47
Какие права должны стоять н...
Вопросы по работе
228 3 Alipapa
11-05-2012 13:04
Как закрепить несколько нов...
Вопросы по работе
282 7 Медвед
10-05-2012 11:45
Как определить оптимальную ...
Вопросы по работе
591 12 Медвед
10-05-2012 11:42
Гостевая книга
Моды, плагины
350 6 lom
10-05-2012 11:33
Статьи не работают
Вопросы по работе
312 6 lom
10-05-2012 11:30
RSS
Вопросы по работе
150 6 vesuvius
21-04-2012 20:02
Pimped-Fusion. Первые впеча...
Ошибки, баги, глюки
4135 109 Alipapa
09-04-2012 21:02
[Опрос] PHP-Fusion-Themes.ru - Гене...
Моды, плагины
295 6 Vveb--ws
03-04-2012 01:43

hw_Modifyobject

(PHP 3>= 3.0.7, PHP 4 )

hw_Modifyobject -- Modifies object record

Description

int hw_modifyobject ( int connection, int object_to_change, array remove, array add [, int mode] )

This command allows to remove, add, or modify individual attributes of an object record. The object is specified by the Object ID object_to_change. The first array remove is a list of attributes to remove. The second array add is a list of attributes to add. In order to modify an attribute one will have to remove the old one and add a new one. hw_modifyobject() will always remove the attributes before it adds attributes unless the value of the attribute to remove is not a string or array.

The last parameter determines if the modification is performed recursively. 1 means recursive modification. If some of the objects cannot be modified they will be skipped without notice. hw_error() may not indicate an error though some of the objects could not be modified.

The keys of both arrays are the attributes name. The value of each array element can either be an array, a string or anything else. If it is an array each attribute value is constructed by the key of each element plus a colon and the value of each element. If it is a string it is taken as the attribute value. An empty string will result in a complete removal of that attribute. If the value is neither a string nor an array but something else, e.g. an integer, no operation at all will be performed on the attribute. This is necessary if you want to to add a completely new attribute not just a new value for an existing attribute. If the remove array contained an empty string for that attribute, the attribute would be tried to be removed which would fail since it doesn't exist. The following addition of a new value for that attribute would also fail. Setting the value for that attribute to e.g. 0 would not even try to remove it and the addition will work.

If you would like to change the attribute 'Name' with the current value 'books' into 'articles' you will have to create two arrays and call hw_modifyobject().

Пример 1. modifying an attribute

<?php
       
// $connect is an existing connection to the Hyperwave server
       // $objid is the ID of the object to modify
       
$remarr = array( "Name" => "books" );
       
$addarr = array( "Name" => "articles" );
       
$hw_modifyobject ( $connect , $objid , $remarr , $addarr );
?>
In order to delete/add a name=value pair from/to the object record just pass the remove/add array and set the last/third parameter to an empty array. If the attribute is the first one with that name to add, set attribute value in the remove array to an integer.

Пример 2. adding a completely new attribute

<?php
       
// $connect is an existing connection to the Hyperwave server
       // $objid is the ID of the object to modify
       
$remarr = array( "Name" => 0 );
       
$addarr = array( "Name" => "articles" );
       
$hw_modifyobject ( $connect , $objid , $remarr , $addarr );
?>

Замечание: Multilingual attributes, e.g. 'Title', can be modified in two ways. Either by providing the attributes value in its native form 'language':'title' or by providing an array with elements for each language as described above. The above example would than be:

Пример 3. modifying Title attribute

<?php
       $remarr
= array( "Title" => "en:Books" );
       
$addarr = array( "Title" => "en:Articles" );
       
$hw_modifyobject ( $connect , $objid , $remarr , $addarr );
?>
or

Пример 4. modifying Title attribute

<?php
       $remarr
= array( "Title" => array( "en" => "Books" ));
       
$addarr = array( "Title" => array( "en" => "Articles" , "ge" => "Artikel" ));
       
$hw_modifyobject ( $connect , $objid , $remarr , $addarr );
?>
This removes the English title 'Books' and adds the English title 'Articles' and the German title 'Artikel'.

Пример 5. removing attribute

<?php
       $remarr
= array( "Title" => "" );
       
$addarr = array( "Title" => "en:Articles" );
       
$hw_modifyobject ( $connect , $objid , $remarr , $addarr );
?>

Замечание: This will remove all attributes with the name 'Title' and adds a new 'Title' attribute. This comes in handy if you want to remove attributes recursively.

Замечание: If you need to delete all attributes with a certain name you will have to pass an empty string as the attribute value.

Замечание: Only the attributes 'Title', 'Description' and 'Keyword' will properly handle the language prefix. If those attributes don't carry a language prefix, the prefix 'xx' will be assigned.

Замечание: The 'Name' attribute is somewhat special. In some cases it cannot be complete removed. You will get an error message 'Change of base attribute' (not clear when this happens). Therefore you will always have to add a new Name first and than remove the old one.

Замечание: You may not surround this function by calls to hw_getandlock() and hw_unlock(). hw_modifyobject() does this internally.

Возвращает TRUE в случае успешного завершения или FALSE в случае возникновения ошибки.

Все функции PHP:
Авторизация
Логин

Пароль



Вы не зарегистрированы?
Нажмите здесь для регистрации.

Забыли пароль?
Запросите новый здесь.
Мини-чат
Вы должны авторизироваться, чтобы добавить сообщение.

12/04/2012 22:03
Это, в общем-то, нехороший признак

29/03/2012 18:52
Иногда хочется написать большими красными буквами, чтобы доходило быстрее Smile


29/03/2012 16:29
На форуме вопросы в основном ко мне, а я дальтоник

29/03/2012 15:31
Alipapa, а почему на форуме не включены цвета текста?

24/03/2012 18:38
Мультиблогом люди интересуются. Что имеется у нас?


02/03/2012 14:34
Как их запретить? Что-то в админке я не нашел, придется код править


23/02/2012 04:21
А ещё в голосованиях невозможно отредактировать опцию


23/02/2012 04:18
Alipapa, посмотри ГОЛОСОВАНИЯ НА ФОРУМЕ - почему у тебя там стоят по две кнопки "Обновить"?


23/02/2012 04:16
Желательно. Прилично.

21/02/2012 20:48
а это обязательно?

21/02/2012 19:23
Почему нет логотипа вверху на шапке? [img]http://ap-fus
ion.ru/images/news
_cats/ap-fusion.gi
f[/img]

13/02/2012 15:04
Всех влюблённых с праздником!!!

04/02/2012 09:08
Еще раз прошу всех. Если вопрос не личный, пишите в форум. В личке, аське, скайпе, мейле и т.д. не консультирую



продажа опель астра и астра лучший бесплатный сайт москва .
14/01/2012 18:45
avisei, пиши в форум, а не шли мне личные посланья

31/12/2011 16:01
С праздником Нового Года! Успехов, счастья, богатства!


08/12/2011 16:13
MySQL нужен. Инструкция вот: [url]http://ap-fus
ion.ru/downloads.p
hp?download_id=58[
/url]

08/12/2011 16:03
Я канеш дико извиняюсь, но где на этом сайте статья по установке fusion, нужен ему MySql или нет? Smile


07/12/2011 11:03
ОК)

07/12/2011 11:02
этот - для 7.0

07/12/2011 11:00
Я устанавливаю, как в инструкции. Куча ошибок. Не могу сделать upgrade!

Анонс
Последние статьи
· О стабилизаторах нап...
· СМС и Вебмани
· TinyMCE для пользова...
· PCRE (Perl Compatibl...
· PCRE (Perl Compatibl...
4,783,088 уникальных посетителей Iceberg by Harly