Jump to content

[модуль] Редактирование записей как вк


Recommended Posts

Открыть \templates\Default\wall\one_record.tpl найти:

[owner]<div class="wall_delete" onMouseOver="myhtml.title('{rec-id}', 'Удалить запись', 'wall_del_')" onClick="wall.delet('{rec-id}'); return false" id="wall_del_{rec-id}"></div>[/owner]

Заменить на:

[owner]<div class="wall_delete" onMouseOver="myhtml.title('{rec-id}', '<b>Удалить запись</b>', 'wall_del_')" onClick="wall.delet('{rec-id}'); return false" id="wall_del_{rec-id}"></div>
[yesedit][yesedittime]<div class="editwall" onMouseOver="myhtml.title('{rec-id}', '<b>Редактировать</b>', 'wall_edit_')" onClick="wall.edit_form('{rec-id}'); return false" id="wall_edit_{rec-id}"></div>[/yesedittime][/yesedit][/owner]

В этом же файле найти:

<div class="walltext">{text}</div>

Заменить на:

<div class="walltext" id="edit_rec_{rec-id}">{text}</div>
<div id="edit_rec_cont_{rec-id}" class="no_display">
<textarea id="texts_{rec-id}" name="texts" class="inpst" style="width:530px;height:30px">{text_edit}</textarea>
<div class="button_blue fl_l" style="margin-top:2px;"><button style="" onClick="wall.save({rec-id}); return false">Сохранить изменения</button></div>
<div class="button_div_nostl fl_l margin_left" style="margin-top:2px;"><button onClick="wall.edit_close('{rec-id}'); return false">Отмена</button></div>
<div style="padding:12px"></div></div>

Тут же найти:

<div class="wall_fast_date fl_l">{date} [not-owner] -  <a href="#" onClick="wall.Answer('{rec-id}', '{comm-id}', '{name}'); return false" id="answer_lnk">Ответить</a>[/not-owner]</div>[owner]<a href="/" class="size10 fl_r no_display" id="fast_del_{comm-id}" onClick="wall.fast_comm_del('{comm-id}'); return false">Удалить</a>[/owner]

Ниже вставить:

[uowner][yesedit][yesedittime]<div class="editcomm" onMouseOver="myhtml.title('{comm-id}', '<b>Редактировать</b>', 'wall_edit_')" onClick="wall.edit_form('{comm-id}'); return false" id="wall_edit_{comm-id}"></div>[/yesedittime][/yesedit][/uowner]

Теперь найти и заменить:

[comment]<div class="wall_fast_block" id="wall_fast_comment_{comm-id}" onMouseOver="ge('fast_del_{comm-id}').style.display = 'block'" onMouseOut="ge('fast_del_{comm-id}').style.display = 'none'">
<div class="wall_fast_ava"><a href="/u{user-id}" onClick="Page.Go(this.href); return false"><img src="{ava}" alt="" /></a></div>
<div><a href="/u{user-id}" onClick="Page.Go(this.href); return false">{name}</a></div>
<div class="wall_fast_comment_text">{text}</div>
<div class="wall_fast_date">{date} [not-owner] -  <a href="#" onClick="wall.Answer('{rec-id}', '{comm-id}', '{name}'); return false" id="answer_lnk">Ответить</a>[/not-owner][owner]<a href="/" class="size10 fl_r no_display" id="fast_del_{comm-id}" onClick="wall.fast_comm_del('{comm-id}'); return false">Удалить</a>[/owner]</div>
[uowner][yesedit][yesedittime]<div class="editcomm" onMouseOver="myhtml.title('{comm-id}', '<b>Редактировать</b>', 'wall_edit_')" onClick="wall.edit_form('{comm-id}'); return false" id="wall_edit_{comm-id}"></div>[/yesedittime][/yesedit][/uowner]
<div class="clear"></div>
</div>[/comment]

На:

[comment]<div class="wall_fast_block" id="wall_fast_comment_{comm-id}" onMouseOver="ge('fast_del_{comm-id}').style.display = 'block'" onMouseOut="ge('fast_del_{comm-id}').style.display = 'none'">
<div class="wall_fast_ava"><a href="/id{user-id}" onClick="Page.Go(this.href); return false"><img src="{ava}" alt="" /></a></div>
<div><a href="/id{user-id}" onClick="Page.Go(this.href); return false">{name}</a></div>[owner]<div class="comm_delete" onMouseOver="myhtml.title('{comm-id}', '<b>Удалить</b>', 'wall_del_')" onClick="wall.fast_comm_del('{comm-id}'); return false" id="wall_del_{comm-id}"></div>[/owner]
[uowner][yesedit][yesedittime]<div class="editcomm" onMouseOver="myhtml.title('{comm-id}', '<b>Редактировать</b>', 'wall_edit_')" onClick="wall.edit_form('{comm-id}'); return false" id="wall_edit_{comm-id}"></div>[/yesedittime][/yesedit][/uowner]
<div class="wall_fast_comment_text" id="edit_rec_{comm-id}">{text}</div>
<div id="edit_rec_cont_{comm-id}" class="no_display">
<textarea id="texts_{comm-id}" name="texts" class="inpst" style="width:500px;height:30px">{text_edit}</textarea>
<div class="button_blue fl_l" style="margin-top:2px;margin-left:37px"><button style="" onClick="wall.save({comm-id}); return false">Сохранить изменения</button></div>
<div class="button_div_nostl fl_l margin_left" style="margin-top:2px;"><button onClick="wall.edit_close('{comm-id}'); return false">Отмена</button></div>
<div style="padding:15px"></div></div>
<div class="wall_fast_date fl_l">{date}</div>
<div class="clear"></div>
</div>[/comment]

Открыть \templates\Default\wall\record.tpl найти:

[owner]<div class="wall_delete" onMouseOver="myhtml.title('{rec-id}', 'Удалить запись', 'wall_del_')" onClick="wall.delet('{rec-id}'); return false" id="wall_del_{rec-id}"></div>[/owner]

Заменить на:

[owner]<div class="wall_delete" onMouseOver="myhtml.title('{rec-id}', '<b>Удалить запись</b>', 'wall_del_')" onClick="wall.delet('{rec-id}'); return false" id="wall_del_{rec-id}"></div>[/owner]
[yesedit][yesedittime]<div class="editwall" onMouseOver="myhtml.title('{rec-id}', '<b>Редактировать</b>', 'wall_edit_')" onClick="wall.edit_form('{rec-id}'); return false" id="wall_edit_{rec-id}"></div>[/yesedittime][/yesedit]

В этом же файле найти:

<div class="walltext">{text}</div>

Заменить на:

<div class="walltext" id="edit_rec_{rec-id}" >{text}</div>
<div class="walltext" id="new_text_{rec-id}"  style="display:none">{text_edit}</div>
<div id="edit_rec_cont_{rec-id}" class="no_display">
<textarea id="texts_{rec-id}" name="texts" class="inpst" style="width:321px;height:30px">{text_edit}</textarea>
{attach}
<div class="button_blue fl_l" style="margin-top:2px;"><button style="" onClick="wall.save({rec-id}); return false">Сохранить изменения</button></div>
<div class="button_div_nostl fl_l margin_left" style="margin-top:2px;"><button onClick="wall.edit_close('{rec-id}'); return false">Отмена</button></div>
<div style="padding:12px"></div></div>

Тут же найти:

<div class="wall_fast_date">{date} [not-owner] -  <a href="#" onClick="wall.Answer('{rec-id}', '{comm-id}', '{name}'); return false" id="answer_lnk">Ответить</a>[/not-owner][owner]<a href="/" class="size10 fl_r no_display" id="fast_del_{comm-id}" onClick="wall.fast_comm_del('{comm-id}'); return false">Удалить</a>[/owner]</div>

Ниже вставить:

[uowner][yesedit][yesedittime]<div class="editcomm" onMouseOver="myhtml.title('{comm-id}', '<b>Редактировать</b>', 'wall_edit_')" onClick="wall.edit_form('{comm-id}'); return false" id="wall_edit_{comm-id}"></div>[/yesedittime][/yesedit][/uowner]

Теперь найти и заменить:

[comment]<div class="wall_fast_block" id="wall_fast_comment_{comm-id}" onMouseOver="ge('fast_del_{comm-id}').style.display = 'block'" onMouseOut="ge('fast_del_{comm-id}').style.display = 'none'">
<div class="wall_fast_ava"><a href="/u{user-id}" onClick="Page.Go(this.href); return false"><img src="{ava}" alt="" /></a></div>
<div><a href="/u{user-id}" onClick="Page.Go(this.href); return false">{name}</a></div>
<div class="wall_fast_comment_text">{text}</div>
<div class="wall_fast_date">{date} [not-owner] -  <a href="#" onClick="wall.Answer('{rec-id}', '{comm-id}', '{name}'); return false" id="answer_lnk">Ответить</a>[/not-owner][owner]<a href="/" class="size10 fl_r no_display" id="fast_del_{comm-id}" onClick="wall.fast_comm_del('{comm-id}'); return false">Удалить</a>[/owner]</div>
[uowner][yesedit][yesedittime]<div class="editcomm" onMouseOver="myhtml.title('{comm-id}', '<b>Редактировать</b>', 'wall_edit_')" onClick="wall.edit_form('{comm-id}'); return false" id="wall_edit_{comm-id}"></div>[/yesedittime][/yesedit][/uowner]
<div class="clear"></div>
</div>[/comment]

На:

[comment]<div class="wall_fast_block" id="wall_fast_comment_{comm-id}" onMouseOver="ge('fast_del_{comm-id}').style.display = 'block'" onMouseOut="ge('fast_del_{comm-id}').style.display = 'none'">
<div class="wall_fast_ava"><a href="/id{user-id}" onClick="Page.Go(this.href); return false"><img src="{ava}" alt="" /></a></div>
<div><a href="/id{user-id}" onClick="Page.Go(this.href); return false">{name}</a></div>[owner]<div class="comm_delete" onMouseOver="myhtml.title('{comm-id}', '<b>Удалить</b>', 'wall_del_')" onClick="wall.fast_comm_del('{comm-id}'); return false" id="wall_del_{comm-id}"></div>[/owner]
[uowner][yesedit][yesedittime]<div class="editcomm" onMouseOver="myhtml.title('{comm-id}', '<b>Редактировать</b>', 'wall_edit_')" onClick="wall.edit_form('{comm-id}'); return false" id="wall_edit_{comm-id}"></div>[/yesedittime][/yesedit][/uowner]
<div class="wall_fast_comment_text" id="edit_rec_{comm-id}">{text}</div>
<div class="walltext" id="new_text_{comm-id}"  style="display:none">{text_edit}</div>
<div id="edit_rec_cont_{comm-id}" class="no_display">
<textarea id="texts_{comm-id}" name="texts" class="inpst" style="width:291px;height:30px">{text_edit}</textarea>
<div class="button_blue fl_l" style="margin-top:2px;margin-left:37px"><button style="" onClick="wall.save({comm-id}); return false">Сохранить изменения</button></div>
<div class="button_div_nostl fl_l margin_left" style="margin-top:2px;"><button onClick="wall.edit_close('{comm-id}'); return false">Отмена</button></div>
<div style="padding:12px"></div></div>
<div class="wall_fast_date fl_l">{date}</div>
<div class="clear"></div>
</div>[/comment]

Открыть \system\classes\wall.php после:

//Тег Owner означает показ записей только для владельца страницы или для того кто оставил запись
                        if($user_id == $row_wall['author_user_id'] OR $user_id == $id){
                                $tpl->set('[owner]', '');
                                $tpl->set('[/owner]', '');
                        } else
                                $tpl->set_block("'\\[owner\\](.*?)\\[/owner\\]'si","");
                               
Вставить:

//Тег YesEdit разрешает редактировать записи
                        if($row_wall['noedit'] == 0 AND $user_id == $row_wall['author_user_id']){
                                $tpl->set('[yesedit]', '');
                                $tpl->set('[/yesedit]', '');                       
                        } else
                                $tpl->set_block("'\\[yesedit\\](.*?)\\[/yesedit\\]'si","");               

                        if(($server_time-$row_wall['add_date'])<86400){
                                $tpl->set('[yesedittime]', '');
                                $tpl->set('[/yesedittime]', '');                       
                        } else
                                $tpl->set_block("'\\[yesedittime\\](.*?)\\[/yesedittime\\]'si","");               
                               
В этом же файле после:

//Сообственно выводим комменты
                                        foreach($sql_comments as $row_comments){
                                                $tpl->set('{name}', $row_comments['user_search_pref']);
                                                if($row_comments['user_photo'])
                                                        $tpl->set('{ava}', '/uploads/users/'.$row_comments['author_user_id'].'/50_'.$row_comments['user_photo']);
                                                else
                                                        $tpl->set('{ava}', '{theme}/images/no_ava_50.png');
                       
                                                $tpl->set('{rec-id}', $row_wall['id']);
                                                $tpl->set('{comm-id}', $row_comments['id']);
                                                $tpl->set('{user-id}', $row_comments['author_user_id']);
                                               
Вставить:

//Тег YesEdit разрешает редактировать записи
                        if($row_comments['noedit'] == 0){
                                $tpl->set('[yesedit]', '');
                                $tpl->set('[/yesedit]', '');                       
                        } else
                                $tpl->set_block("'\\[yesedit\\](.*?)\\[/yesedit\\]'si","");               

                        if(($server_time-$row_comments['add_date'])<86400){
                                $tpl->set('[yesedittime]', '');
                                $tpl->set('[/yesedittime]', '');                       
                        } else
                                $tpl->set_block("'\\[yesedittime\\](.*?)\\[/yesedittime\\]'si","");       
                               
Тут же (ниже) после:

//Сообственно выводим комменты
                        foreach($this->comm_query as $row_comments){
                                $tpl->set('{name}', $row_comments['user_search_pref']);
                                if($row_comments['user_photo'])
                                        $tpl->set('{ava}', $config['home_url'].'uploads/users/'.$row_comments['author_user_id'].'/50_'.$row_comments['user_photo']);
                                else
                                        $tpl->set('{ava}', '{theme}/images/no_ava_50.png');
                                $tpl->set('{comm-id}', $row_comments['id']);
                                $tpl->set('{user-id}', $row_comments['author_user_id']);
                               
Вставить:

//Тег YesEdit разрешает редактировать записи
                        if($row_comments['noedit'] == 0){
                                $tpl->set('[yesedit]', '');
                                $tpl->set('[/yesedit]', '');                       
                        } else
                                $tpl->set_block("'\\[yesedit\\](.*?)\\[/yesedit\\]'si","");               

                        if(($server_time-$row_comments['add_date'])<86400){
                                $tpl->set('[yesedittime]', '');
                                $tpl->set('[/yesedittime]', '');                       
                        } else
                                $tpl->set_block("'\\[yesedittime\\](.*?)\\[/yesedittime\\]'si","");               
                               
                                include ROOT_DIR.'core/classes/forwall.php';
                        $parse = new parse();
                               
ищем:

$tpl->set('{text}', stripslashes($row_wall['text']));

заменить на:

//include ROOT_DIR.'/core/classes/forwall.php';
                        $parse = new parse();
                        $tpl->set('{text_edit}', $parse->BBdecode(stripslashes(myBrRn($row_wall['text']))));

ищем:

$tpl->set('{text}', stripslashes($row_comments['text']));

заменить на:

$tpl->set('{text}', $parse->BBparse(stripslashes($row_wall['text'])));
                        $tpl->set('{attach}', $attach_result);

ищем:

$tpl->set('{text}', stripslashes($row_comments['text']));

заменить на:

$tpl->set('{text}', $parse->BBparse(stripslashes(myBrRn($row_comments['text']))));
$tpl->set('{text_edit}', $parse->BBdecode(stripslashes(myBrRn($row_comments['text']))));
                       
ищем:

        $expBR2 = explode('<br />', $row_comments['text']);
                                $textLength2 = count($expBR2);
                                $strTXT2 = strlen($row_comments['text']);
                                if($textLength2 > 6 OR $strTXT2 > 470)
                                        $row_comments['text'] = '<div class="wall_strlen" id="hide_wall_rec'.$row_comments['id'].'" style="max-height:102px"">'.$row_comments['text'].'</div><div class="wall_strlen_full" onMouseDown="wall.FullText('.$row_comments['id'].', this.id)" id="hide_wall_rec_lnk'.$row_comments['id'].'">Показать полностью..</div>';
                                       

ниже вставить

$tpl->set('{text}', $parse->BBparse(stripslashes(myBrRn($row_comments['text']))));
$tpl->set('{text_edit}', $parse->BBdecode(stripslashes(myBrRn($row_comments['text']))));
                                                                       

В этом же файле после:

megaDate($row_comments['add_date']);
                                                if($user_id == $row_comments['author_user_id'] || $user_id == $id){
                                                        $tpl->set('[owner]', '');
                                                        $tpl->set('[/owner]', '');
                                                } else
                                                        $tpl->set_block("'\\[owner\\](.*?)\\[/owner\\]'si","");

Вставить:

if($user_id == $row_comments['author_user_id']){
                                        $tpl->set('[uowner]', '');
                                        $tpl->set('[/uowner]', '');
                                    } else
                                         $tpl->set_block("'\\[uowner\\](.*?)\\[/uowner\\]'si","");

Найти и после:

megaDate($row_comments['add_date']);
                               
                                if(!$id)
                                        $id = $for_user_id;
                                       
                                if($user_id == $row_comments['author_user_id'] || $user_id == $id){
                                        $tpl->set('[owner]', '');
                                        $tpl->set('[/owner]', '');
                                } else
                                        $tpl->set_block("'\\[owner\\](.*?)\\[/owner\\]'si","");

Вставить:       

if($user_id == $row_comments['author_user_id']){
                                $tpl->set('[uowner]', '');
                                $tpl->set('[/uowner]', '');
                                } else
                                $tpl->set_block("'\\[uowner\\](.*?)\\[/uowner\\]'si","");                               
                               
Добаавить в \templates\Default\style\style.css после:

.wall_vote_proc_bg{background:#DAE1E8;height:15px;text-align:center}
.wall_rec_autoresize{float:left;width:500px;margin-left:0px}

Вставить:

.editwall{background: url("../images/icons/edit.png") no-repeat;width:12px;height:11px;float:right;margin-right:5px;margin-top:2px;cursor:pointer;filter: alpha(opacity=20);opacity: 0.2;}
.editwall:hover{background: url("../images/icons/edit.png") no-repeat;filter: alpha(opacity=85);opacity: 0.85;}
.editcomm{background: url("../images/icons/edit.png") no-repeat;width:12px;height:11px;float:right;margin-right:20px;margin-top:-15px;cursor:pointer;filter: alpha(opacity=20);opacity: 0.2;}
.editcomm:hover{background: url("../images/icons/edit.png") no-repeat;filter: alpha(opacity=85);opacity: 0.85;}
.comm_delete{background: url("../images/close_a_wall.png") no-repeat;width:11px;height:11px;float:right;margin-right:5px;margin-top:-15px;cursor:pointer}
.comm_delete:hover{background: url("../images/close2.png") no-repeat}
.inpst_wall{width:490px;}
.inpst_wall_com{width:490px;}

Открыть \templates\Default\profile.tpl добавить после:

$('body').append('<div id="addStyleClass"><style type="text/css" media="all">.wallrecord{width:770px;margin-left:-210px}

Это:

.inpst_wall{width:688px}.inpst_wall_com{width:688px}

Найти:

.wall_fast_date{margin-left:57px;font-size:11px}

Заменить на:

.wall_fast_date{margin-left:0px;font-size:11px}

Скопировать edit.png в \templates\Default\images\icons\

Открыть \templates\Default\js\profile.js после:

FullText: function(rid){
                $('#hide_wall_rec'+rid).css('max-height', 'none');
                $('#hide_wall_rec_lnk'+rid).hide();
        },
       
Вставить:

edit_form: function(id){
                $('#edit_rec_'+id).hide();
                $('#type'+id).hide();
                $('#new_text_'+id).hide();
                $('#edit_rec_cont_'+id).show();
                $('#edittext_'+id).show();
        },
        edit_close: function(id){
                $('#edit_rec_'+id).show();
                $('#type_'+id).show();
                $('#edit_rec_cont_'+id).hide();
                $('#edittext_'+id).hide();
        },
        save: function(id){
                $('#texts_save_'+id).text($('#texts_'+id).val());
                $.post('/index.php?go=wall&act=save', {id: id, texts: $('#texts_'+id).val()}, function(d){
                       
                        $('#new_text_'+id).text($('#texts_'+id).val());
                        $('#new_text_'+id).show();
                        $('#edit_rec_'+id).hide();
                        $('#edit_rec_cont_'+id).hide();
                        $('#edittext_'+id).hide();
                });
        },
       
Открыть \system\modules\wall.php после:

ищем:

case "send":
NoAjaxQuery();

ниже ищем

$wall_text = ajax_utf8(textFilter($_POST['wall_text']));

заменить на

//Подключаем парсер
                        include ENGINE_DIR.'/classes/forwall.php';
                        $parse = new parse();               
                        $wall_text = $parse->BBparse(ajax_utf8(textFilter($_POST['wall_text'])));
                       
ищем

                msgbox('', $lang['wall_no_rec'], 'info_2');
                                }

                                if(!$CheckBlackList){                                       
                                        include ENGINE_DIR.'/classes/wall.php';
                                        $wall = new wall();       
                                       
ниже вставить

include ENGINE_DIR.'/classes/forwall.php';
                                        $parse = new parse();



ищем

//удаляем из ленты новостей
                                $db->query("DELETE FROM `".PREFIX."_news` WHERE obj_id = '{$rid}' AND action_time = '{$row['add_date']}' AND action_type = {$action_type}");
                        }
                       
                        die();
                break;
               
ниже Вставить:

case "save":
                        NoAjaxQuery();
                        $id = intval($_POST['id']);
                        //Подключаем парсер
                        include ENGINE_DIR.'/classes/forwall.php';
                        $parse = new parse();               
                        $texts = $parse->BBparse(ajax_utf8(textFilter($_POST['texts'])));
                        $action_type = 1;
                        $edit = $db->super_query("SELECT id, author_user_id FROM `wall` WHERE id = '{$id}'");
                        $row = $db->super_query("SELECT add_date FROM `wall` WHERE id = '{$id}'");
                        if($edit['author_user_id'] == $user_id){                       
                        if($id){
                        if($texts !== '') {
                                $db->query("UPDATE `wall` SET text = '{$texts}' WHERE id = '{$id}'");                                                                       
                                $db->query("UPDATE `news` SET action_text = '{$texts}' WHERE obj_id = '{$id}' AND action_time = '{$row['add_date']}' AND action_type = {$action_type}");                                                                       
                        }
                        }
                        }
                        exit();
                break;

////////////////////////////Не надо               
Найти и после:

//Вставляем саму запись в БД
$db->query("INSERT INTO `".PREFIX."_wall` SET author_user_id = '{$user_id}', for_user_id = '{$for_user_id}', text = '{$wall_text}', add_date = '{$str_date}', fast_comm_id = '{$fast_comm_id}', attach = '".$attach_files."',
                                                       
Добавить:

', noedit = '1'");
///////////////////////////////


Добавить в запросы:

if($user_privacy['val_wall1'] == 1 OR $user_privacy['val_wall1'] == 2 AND $check_friend OR $user_id == $for_user_id)
                                                $wall->query("SELECT tb1.id, author_user_id, text, add_date, fasts_num, likes_num, likes_users, type, tell_uid, tell_date, public, attach, tell_comm, tb2.user_photo, user_search_pref, user_last_visit, user_logged_mobile FROM `".PREFIX."_wall` tb1, `".PREFIX."_users` tb2 WHERE tb1.id < '{$last_id}' AND for_user_id = '{$for_user_id}' AND tb1.author_user_id = tb2.user_id AND tb1.fast_comm_id = '0' ORDER by `add_date` DESC LIMIT 0, {$limit_select}");
                                        else
                                                $wall->query("SELECT tb1.id, author_user_id, text, add_date, fasts_num, likes_num, likes_users, type, tell_uid, tell_date, public, attach, tell_comm, tb2.user_photo, user_search_pref, user_last_visit, user_logged_mobile FROM `".PREFIX."_wall` tb1, `".PREFIX."_users` tb2 WHERE tb1.id < '{$last_id}' AND for_user_id = '{$for_user_id}' AND tb1.author_user_id = tb2.user_id AND tb1.fast_comm_id = '0' AND tb1.author_user_id = '{$for_user_id}' ORDER by `add_date` DESC LIMIT 0, {$limit_select}");
                                               
Это:

noedit,

В запрос:

//Всталвяем себе на стену
$db->query("INSERT INTO `".PREFIX."_wall` SET author_user_id = '{$user_id}', for_user_id = '{$user_id}', text = '{$row['text']}', add_date = '{$server_time}', fast_comm_id = 0, tell_uid = '{$row['author_user_id']}', tell_date = '{$row['add_date']}', public = '{$row['public']}', attach = '{$row['attach']}'");

Вставляем:

, noedit = '1'");

В запросы:

if($user_privacy['val_wall1'] == 1 OR $user_privacy['val_wall1'] == 2 AND $check_friend OR $user_id == $id)
                                                        $wall->query("SELECT SQL_CALC_FOUND_ROWS tb1.id, author_user_id, text, add_date, noedit, fasts_num, likes_num, likes_users, tell_uid, type, tell_date, public, attach, tell_comm, tb2.user_photo, user_search_pref, user_last_visit, user_sex FROM `".PREFIX."_wall` tb1, `".PREFIX."_users` tb2 WHERE for_user_id = '{$id}' AND tb1.author_user_id = tb2.user_id AND tb1.fast_comm_id = 0 {$where_sql} ORDER by `add_date` DESC LIMIT {$limit_page}, {$limit_select}");
                                                elseif($wallAuthorId['author_user_id'] == $id)
                                                        $wall->query("SELECT SQL_CALC_FOUND_ROWS tb1.id, author_user_id, text, add_date, noedit, fasts_num, likes_num, likes_users, tell_uid, type, tell_date, public, attach, tell_comm, tb2.user_photo, user_search_pref, user_last_visit, user_sex FROM `".PREFIX."_wall` tb1, `".PREFIX."_users` tb2 WHERE for_user_id = '{$id}' AND tb1.author_user_id = tb2.user_id AND tb1.fast_comm_id = 0 {$where_sql} ORDER by `add_date` DESC LIMIT {$limit_page}, {$limit_select}");
                                                else {
                                                        $wall->query("SELECT SQL_CALC_FOUND_ROWS tb1.id, author_user_id, text, add_date, noedit, fasts_num, likes_num, likes_users, tell_uid, type, tell_date, public, attach, tell_comm, tb2.user_photo, user_search_pref, user_last_visit, user_sex FROM `".PREFIX."_wall` tb1, `".PREFIX."_users` tb2 WHERE for_user_id = '{$id}' AND tb1.author_user_id = tb2.user_id AND tb1.fast_comm_id = 0 AND tb1.author_user_id = '{$id}' ORDER by `add_date` DESC LIMIT {$limit_page}, {$limit_select}");
                                                        if($wallAuthorId['author_user_id'])
                                                                $Hacking = true;
                                                }

Вставляем:

noedit,                                                                               
               
Скопировать forwall.php в \system\classes\

В базу данных в таблицу vii_wall добавить поле:
noedit (int) 11

Найти \system\modules\editprofile.php и добавить в запрос:

$db->query("INSERT INTO `".PREFIX."_wall` SET author_user_id = '

Это:
, noedit = '1'"


В \system\modules\repost.php в запрос:

//Всталвяем себе на стену
$db->query("INSERT INTO `".PREFIX."_wall` SET author_user_id

Добавить:

, noedit = '1'"

Автор Developer.Sloopy

004935w4tm7tnfqi099it4.png

[модуль] Редактирование записей.rar

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...