00vlad Posted November 15, 2019 Report Share Posted November 15, 2019 Как сделать автоматическую добавление в друзья при регистрации по id Link to comment Share on other sites More sharing options...
KirKMS Posted November 15, 2019 Report Share Posted November 15, 2019 В файле register.php Добавить выше //Вставляем лог в бд Это //Добавляем себе $db->query("INSERT INTO `".PREFIX."_friends` SET user_id = '1', friend_id = '{$id}', friends_date = NOW()"); //Добавляем себя $db->query("INSERT INTO `".PREFIX."_friends` SET user_id = '{$id}', friend_id = '1', friends_date = NOW()"); //Обновляем кол-во друзей усебя $db->query("UPDATE `".PREFIX."_users` SET user_friends_num = user_friends_num+1 WHERE user_id = '1'"); //У того кого добавили $db->query("UPDATE `".PREFIX."_users` SET user_friends_num = user_friends_num+1 WHERE user_id = '{$id}'"); //Записываем пользователя в кеш файл друзей $openMyList = mozg_cache("user_1/friends"); mozg_create_cache("user_1/friends", $openMyList."u{$id}|"); $openTakeList = mozg_cache("user_{$id}/friends"); mozg_create_cache("user_{$id}/friends", $openTakeList."u1|"); Где 1 там твой id 1 Link to comment Share on other sites More sharing options...
00vlad Posted November 16, 2019 Author Report Share Posted November 16, 2019 не то что-то Link to comment Share on other sites More sharing options...
KirKMS Posted November 16, 2019 Report Share Posted November 16, 2019 2 минуты назад, 00vlad сказал: не то что-то А ЧТО ИМЕННО НАДО? Добавлять тебя в друзья новому пользователю? Link to comment Share on other sites More sharing options...
00vlad Posted November 16, 2019 Author Report Share Posted November 16, 2019 2 часа назад, Kir KMS сказал: А ЧТО ИМЕННО НАДО? Добавлять тебя в друзья новому пользователю? Ну оно не срабатывает Link to comment Share on other sites More sharing options...
KirKMS Posted November 16, 2019 Report Share Posted November 16, 2019 14 минут назад, 00vlad сказал: Ну оно не срабатывает Изменил пост.Пробуй Link to comment Share on other sites More sharing options...
00vlad Posted November 16, 2019 Author Report Share Posted November 16, 2019 4 часа назад, Kir KMS сказал: Изменил пост.Пробуй Не работает Link to comment Share on other sites More sharing options...
KirKMS Posted November 16, 2019 Report Share Posted November 16, 2019 3 минуты назад, 00vlad сказал: Не работает Да всё там работает.Ты что-то делаешь не так.Скинь свой файл register.php и скажи свой id на твоем сайте Link to comment Share on other sites More sharing options...
00vlad Posted November 16, 2019 Author Report Share Posted November 16, 2019 2 часа назад, Kir KMS сказал: Да всё там работает.Ты что-то делаешь не так.Скинь свой файл register.php и скажи свой id на твоем сайте Ты его не поймёшь он я его переписал на свой Link to comment Share on other sites More sharing options...
KirKMS Posted November 16, 2019 Report Share Posted November 16, 2019 Только что, 00vlad сказал: Ты его не поймёшь он я его переписал на свой Так скинь сюда свой файл.Сейчас сделаю Link to comment Share on other sites More sharing options...
00vlad Posted November 16, 2019 Author Report Share Posted November 16, 2019 2 часа назад, Kir KMS сказал: Так скинь сюда свой файл.Сейчас сделаю я понял почему у меня не работает Link to comment Share on other sites More sharing options...
00vlad Posted November 16, 2019 Author Report Share Posted November 16, 2019 2 часа назад, Kir KMS сказал: Так скинь сюда свой файл.Сейчас сделаю Спасибо что помог!! Link to comment Share on other sites More sharing options...
KirKMS Posted November 16, 2019 Report Share Posted November 16, 2019 @00vlad У нас для благодарности есть кнопка Link to comment Share on other sites More sharing options...
00vlad Posted November 16, 2019 Author Report Share Posted November 16, 2019 2 часа назад, Kir KMS сказал: @00vlad У нас для благодарности есть кнопка уже Link to comment Share on other sites More sharing options...
Recommended Posts