Developer.Sloopy Posted February 9, 2015 Report Share Posted February 9, 2015 От самого автора, т.е. меня. Открываем profile.php Над: //Проверка естьли запрашиваемый юзер в закладках у юзера который смотрит стр Ставим: $check = $db->super_query("SELECT for_user_id FROM `".PREFIX."_friends_demands` WHERE for_user_id = '{$id}' AND from_user_id = '{$user_info['user_id']}'"); if(!$check){ $tpl->set('[yesf]', ''); $tpl->set('[/yesf]', ''); $tpl->set_block("'\\[nof\\](.*?)\\[/nof\\]'si",""); } else { $tpl->set('[nof]', ''); $tpl->set('[/nof]', ''); $tpl->set_block("'\\[yesf\\](.*?)\\[/yesf\\]'si",""); } Открываем profile.tpl От [no-friends] до [/no-friends] Заменяем на [no-friends][blacklist][yesf]<div class="button_blue fl_l" style="margin-top:10px;line-height:15px"><button onClick="friends.add({user-id}); return false" style="width:174px">Добавить в друзья</button></div> <div class="clear"></div>[/yesf][nof]Вы уже отправили заявку, ждите, пока {name} подтвердит ее.[/nof][/blacklist][/no-friends] 2 1 Quote Link to comment Share on other sites More sharing options...
AdVest Posted July 23, 2015 Report Share Posted July 23, 2015 От самого автора, т.е. меня. Открываем profile.php Над: //Проверка естьли запрашиваемый юзер в закладках у юзера который смотрит стр Ставим: $check = $db->super_query("SELECT for_user_id FROM `".PREFIX."_friends_demands` WHERE for_user_id = '{$id}' AND from_user_id = '{$user_info['user_id']}'"); if(!$check){ $tpl->set('[yesf]', ''); $tpl->set('[/yesf]', ''); $tpl->set_block("'\\[nof\\](.*?)\\[/nof\\]'si",""); } else { $tpl->set('[nof]', ''); $tpl->set('[/nof]', ''); $tpl->set_block("'\\[yesf\\](.*?)\\[/yesf\\]'si",""); } Открываем profile.tpl От [no-friends] до [/no-friends] Заменяем на [no-friends][blacklist][yesf]<div class="button_blue fl_l" style="margin-top:10px;line-height:15px"><button onClick="friends.add({user-id}); return false" style="width:174px">Добавить в друзья</button></div> <div class="clear"></div>[/yesf][nof]Вы уже отправили заявку, ждите, пока {name} подтвердит ее.[/nof][/blacklist][/no-friends] Огромное спасибо всё работает! Quote Link to comment Share on other sites More sharing options...
Why Not Posted July 29, 2015 Report Share Posted July 29, 2015 Работать то работает, но вот после нажатия добавить в друзья не обновляется кнопка. Она обновляется только после обновления страницы. А это не есть хорошо... Quote Link to comment Share on other sites More sharing options...
Shaman Daniels Posted July 29, 2015 Report Share Posted July 29, 2015 Работать то работает, но вот после нажатия добавить в друзья не обновляется кнопка. Она обновляется только после обновления страницы. А это не есть хорошо... Попробуй это. Quote Link to comment Share on other sites More sharing options...
Why Not Posted July 29, 2015 Report Share Posted July 29, 2015 И все же проблема не решена. Quote Link to comment Share on other sites More sharing options...
Developer.Sloopy Posted July 29, 2015 Author Report Share Posted July 29, 2015 И все же проблема не решена. Правь js, что бы кнопка обновилась сразу же. Quote Link to comment Share on other sites More sharing options...
viiprogrammer Posted July 30, 2015 Report Share Posted July 30, 2015 И все же проблема не решена.Через $().html(); делай замену кнопки Quote Link to comment Share on other sites More sharing options...
wenjiro Posted January 14, 2016 Report Share Posted January 14, 2016 Через $().html(); делай замену кнопки Подскажи как? Quote Link to comment Share on other sites More sharing options...
viiprogrammer Posted January 14, 2016 Report Share Posted January 14, 2016 Подскажи как? http://api.jquery.com/html/ Quote Link to comment Share on other sites More sharing options...
wenjiro Posted February 7, 2016 Report Share Posted February 7, 2016 http://api.jquery.com/html/ Мда уж. Сильно помог Quote Link to comment Share on other sites More sharing options...
Shaman Daniels Posted February 7, 2016 Report Share Posted February 7, 2016 Мда уж. Сильно помог Раз ты о таких вещах думаешь, то и в этом сообразишь... Quote Link to comment Share on other sites More sharing options...
Disy Posted December 6, 2019 Report Share Posted December 6, 2019 В 09.02.2015 в 12:15, Developer.Sloopy сказал: От самого автора, т.е. меня. Открываем profile.php Над: //Проверка естьли запрашиваемый юзер в закладках у юзера который смотрит стр Ставим: $check = $db->super_query("SELECT for_user_id FROM `".PREFIX."_friends_demands` WHERE for_user_id = '{$id}' AND from_user_id = '{$user_info['user_id']}'"); if(!$check){ $tpl->set('[yesf]', ''); $tpl->set('[/yesf]', ''); $tpl->set_block("'\\[nof\\](.*?)\\[/nof\\]'si",""); } else { $tpl->set('[nof]', ''); $tpl->set('[/nof]', ''); $tpl->set_block("'\\[yesf\\](.*?)\\[/yesf\\]'si",""); } Открываем profile.tpl От [no-friends] до [/no-friends] Заменяем на [no-friends][blacklist][yesf]<div class="button_blue fl_l" style="margin-top:10px;line-height:15px"><button onClick="friends.add({user-id}); return false" style="width:174px">Добавить в друзья</button></div> <div class="clear"></div>[/yesf][nof]Вы уже отправили заявку, ждите, пока {name} подтвердит ее.[/nof][/blacklist][/no-friends] Quote Link to comment Share on other sites More sharing options...
Disy Posted December 6, 2019 Report Share Posted December 6, 2019 Как это же сделать в поиске по людям? что еще нужно добавить этого кода мало.. ??? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.