<?php /* || #################################################################### || || # ArrowChat # || || # ---------------------------------------------------------------- # || || # Copyright ©2010-2012 ArrowSuites LLC. All Rights Reserved. # || || # This file may not be redistributed in whole or significant part. # || || # ---------------- ARROWCHAT IS NOT FREE SOFTWARE ---------------- # || || # http://www.arrowchat.com | http://www.arrowchat.com/license/ # || || #################################################################### || */ /** * READ THIS FIRST * * The variables in ALL CAPS are filled out during the installation process to help with this part * so that the getFriendsList function typically needs almost no customization. * * TABLE_PREFIX = The prefix your database tables use * DB_USERTABLE = The name of the user's table * DB_USERTABLE_USERID = The field for the user ID in the user's table * DB_USERTABLE_NAME = The field for the username in the user's table * DB_USERTABLE_AVATAR = The field (if applicable) for the avatar * DB_FRIENDSTABLE = The name of the friend's table * DB_FRIENDSTABLE_USERID = The field for the user ID in the friend's table * DB_FRIENDSTABLE_FRIENDID = The field for the relationship/friend ID in the firned's table * DB_FRIENDSTABLE_FRIENDS = The field (if applicable) to check if the users are friends * * All the friends stuff is optional. If your site does not have a friend's list, just copy the * getOnlineList function and place it in your getFriendsList function. * * PLEASE VISIT OUR DOCUMENTATION FOR ADDITIONAL HELP: http://www.arrowchat.com/documentation/ */ /** * This function returns the user ID of the logged in user on your site. Technical support will not * help you with this for stand-alone installations. You must purchase the professional installation * if you are having trouble. * * Suggestion: Check out the other integration files in the functions/integrations directory for * many examples of how this can be done. The easiest way is to get the user ID through a cookie. * * @return the user ID of the logged in user or NULL if not logged in */ function get_user_id() { $userid = NULL; { $userid = $_COOKIE['userid']; } return $userid; } /** * This function returns the SQL statement for the buddylist of the user. You should retrieve * all ONLINE friends that the user is friends with. Do not retrieve offline users. You can use * global $online_timeout to get the online timeout. * ex: AND (arrowchat_status.session_time + 60 + " . $online_timeout . ") > " . time() . " * * @param userid the user ID of the person receiving the buddylist * @param the time of the buddylist request * @return the SQL statement to retrieve the user's friend list */ function get_friend_list($userid, $time) { global $db; global $online_timeout; $sql = (" SELECT DISTINCT " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_USERID . " userid, " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_NAME . " username, arrowchat_status.session_time lastactivity, " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_AVATAR . " avatar, " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_USERID . " link, arrowchat_status.is_admin, arrowchat_status.status FROM " . TABLE_PREFIX . DB_FRIENDSTABLE . " JOIN " . TABLE_PREFIX . DB_USERTABLE . " ON " . TABLE_PREFIX . DB_FRIENDSTABLE . "." . DB_FRIENDSTABLE_FRIENDID . " = " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_USERID . " LEFT JOIN arrowchat_status ON " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_USERID . " = arrowchat_status.userid WHERE " . TABLE_PREFIX . DB_FRIENDSTABLE . "." . DB_FRIENDSTABLE_USERID . " = '" . $db->escape_string($userid) . "' AND " . TABLE_PREFIX . DB_FRIENDSTABLE . "." . DB_FRIENDSTABLE_FRIENDS . " = 1 ORDER BY " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_NAME . " ASC "); return $sql; } /** * This function returns the SQL statement for all online users. You should retrieve * all ONLINE users regardless of friend status. Do not retrieve offline users. You can use * global $online_timeout to get the online timeout. * ex: AND (arrowchat_status.session_time + 60 + " . $online_timeout . ") > " . time() . " * * @param userid the user ID of the person receiving the buddylist * @param the time of the buddylist request * @return the SQL statement to retrieve all online users */ function get_online_list($userid, $time) { global $db; global $online_timeout; $sql = (" SELECT DISTINCT " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_USERID . " userid, " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_NAME . " username, arrowchat_status.session_time lastactivity, " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_AVATAR . " avatar, " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_USERID . " link, arrowchat_status.is_admin, arrowchat_status.status FROM " . TABLE_PREFIX . DB_USERTABLE . " JOIN arrowchat_status ON " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_USERID . " = arrowchat_status.userid AND " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_USERID . " <> '" . $db->escape_string($userid) . "' ORDER BY " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_NAME . " ASC "); return $sql; } /** * This function returns the SQL statement to get the user details of a specific user. You should * get the user's ID, username, last activity time in unix, link to their profile, avatar, and status. * * @param userid the user ID to get the details of * @return the SQL statement to retrieve the user's defaults */ function get_user_details($userid) { global $db; $sql = (" SELECT " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_USERID . " userid, " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_NAME . " username, arrowchat_status.session_time lastactivity, " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_USERID . " link, " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_AVATAR . " avatar, arrowchat_status.is_admin, arrowchat_status.status FROM " . TABLE_PREFIX . DB_USERTABLE . " LEFT JOIN arrowchat_status ON " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_USERID . " = arrowchat_status.userid WHERE " . TABLE_PREFIX . DB_USERTABLE . "." . DB_USERTABLE_USERID . " = '" . $db->escape_string($userid) . "' "); return $sql; } /** * This function returns the profile link of the specified user ID. * * @param userid the user ID to get the profile link of * @return the link of the user ID's profile */ function get_link($link, $user_id) { global $base_url; return $base_url . '../users.php?id=' . $link; } /** * This function returns the URL of the avatar of the specified user ID. * * @param userid the user ID of the user * @param image if the image includes more than just a user ID, this param is passed * in from the avatar row in the buddylist and get user details functions. * @return the link of the user ID's profile */ function get_avatar($image, $user_id) { global $base_url; { return $base_url . '../images/' . $image . '.gif'; } else { return $base_url . AC_FOLDER_ADMIN . "/images/img-no-avatar.gif"; } } /** * This function returns the name of the logged in user. You should not need to * change this function. * * @param userid the user ID of the user * @return the name of the user */ function get_username($userid) { global $db; global $language; global $show_full_username; $users_name = $language[83]; $result = $db->execute(" SELECT " . DB_USERTABLE_NAME . " name
Помогут бесплатно но нужно написать доходчиво что нужноникто вам здесь не поможет бесплатно
eoleg, я понял так: весь исходный код который дал ТС, нужно перевести в стандартный icms формат.
Да исходный код что я дал нужно переделать под icms
работа действительно плевая но я не программист к сожалению, но структура базы и таблиц есть и можно разобратся, время конечно больше у вас уйдет чем у того кто это часто делаетВ чем она объемная? В том чтоб сделать правильно три get запроса(профиль, статус, друзья)?
а какая у тебя версия чата? а то как бы там бесплатный только триал на 10 дней, интегрировать можно, но не для одного же человека делать...
Версия чата последняя нуленая (с русс языком) после того как сделаю интеграцию и проверю на работоспособность выложу сюда для всех
Я бы тоже вложился в интеграцию...
Так помогай если можешь Общими силами соберем
По ходу ни кто не поможет :(
Походу что да(