Esempio n. 1
0
<?php

/**
 * OhYesChat
 * @website Link: https://github.com/lianglee/OhYesChat
 * @Package Ohyes
 * @subpackage Chat
 * @author Liang Lee
 * @copyright All right reserved Liang Lee 2014.
 * @ide The Code is Generated by Liang Lee php IDE.
 */
$v = new OhYesChat();
$version = $v->checkUpdate();
?>
  <div class="module-message" style="padding:20px;">
         <?php 
echo elgg_echo($version[0], array($version[1]));
?>
 
   </div>
  
Esempio n. 2
0
<?php

/**
 * OhYesChat
 * @website Link: https://github.com/lianglee/OhYesChat
 * @Package Ohyes
 * @subpackage Chat
 * @author Liang Lee
 * @copyright All right reserved Liang Lee 2014.
 * @ide The Code is Generated by Liang Lee php IDE.
 */
header('Content-Type: application/json');
$message = OhYesChat::messageValidate(get_input('message'));
$reciever = get_input('friend');
$mobile = get_input('mobile');
$sender = elgg_get_logged_in_user_entity()->guid;
$SEND = new OhYesChat();
if ($mobile == 'true') {
    $icon = elgg_view("icon/default", array('entity' => elgg_get_logged_in_user_entity(), 'size' => 'small'));
} else {
    $icon = '';
}
if ($SEND->SendMessage($reciever, $message)) {
    echo json_encode(array('message' => elgg_view('ohyes/chat/message-item', array('message' => $message, 'sender' => $sender, 'icon' => $icon))));
} else {
    echo 'send:error';
}
Esempio n. 3
0
<?php

/**
 * OhYesChat
 * @website Link: https://github.com/lianglee/OhYesChat
 * @Package Ohyes
 * @subpackage Chat
 * @author Liang Lee
 * @copyright All right reserved Liang Lee 2014.
 * @ide The Code is Generated by Liang Lee php IDE.
 */
$from = get_user_by_username(get_input('msgfrom'));
$to = get_user_by_username(get_input('msgto'));
$var['to'] = $to;
$var['from'] = $from;
$var['messages'] = array_reverse(OhYesChat::getMessages($from->guid, $to->guid));
echo elgg_view('ohyes/chat/track', $var);
Esempio n. 4
0
<?php

/**
 * OhYesChat
 * @website Link: https://github.com/lianglee/OhYesChat
 * @Package Ohyes
 * @subpackage Chat
 * @author Liang Lee
 * @copyright All right reserved Liang Lee 2014.
 * @ide The Code is Generated by Liang Lee php IDE.
 */
$latest = OhYesChat::getLatest(4);
$chat = new OhYesChat();
foreach ($latest as $message) {
    $icon = elgg_view("icon/default", array('entity' => get_user($message->sender), 'size' => 'small'));
    ?>
  <div class="messages-item"  style="border-bottom: 1px solid #EEE;padding: 8px;">
      <div class="icon"  style="display:inline-table;">
        <?php 
    echo $icon;
    ?>
      </div>
      <div class="text" style="display:inline-table;position: absolute;padding: 10px;width:200px;">
      <?php 
    echo OhYesChat::replaceIcon($chat->sttl($message->message, 20));
    ?>
      </div>
  </div>
  
  <?php 
}
Esempio n. 5
0
 * Ohyes Theme
 * @website Link: https://github.com/lianglee/OhYesTheme
 * @Package Ohyes
 * @subpackage Theme
 * @author Liang Lee
 * @copyright All right reserved Liang Lee 2014.
 * @ide The Code is Generated by Liang Lee php IDE.
*/
$user = elgg_get_logged_in_user_entity()->guid;
$get = "SELECT DISTINCT sender FROM prefixes_ohyes_chat WHERE(reciever='{$user}' AND view='0')";
$messages = OhYesChat::Data($get, 'get');
foreach ($messages as $friend) {
    $friend = get_user($friend->sender);
    $icon = elgg_view("icon/default", array('entity' => $friend, 'size' => 'tiny'));
    ?>
      <div class="friends-list-item" onClick="OhYesChat.newTab(<?php 
    echo $friend->guid;
    ?>
);"> 
                  <div class="icon" style="display: inline-table;"> <?php 
    echo $icon;
    ?>
</div>
                  <div class="name" style="display: inline-table;margin-top: -8px;margin-left: 5px;"><?php 
    echo OhYesChat::sttl($friend->name, 23);
    ?>
</div>  
                </div>
                
                <?php 
}
Esempio n. 6
0
<head>
<?php 
echo elgg_view('page/elements/head', $vars);
echo elgg_view('page/elements/ohyechead', $vars);
?>
</head>
<body>
<div class="ohyeschat-admin-header">
      <div class="left">
          OhYesChat
      </div>
</div>
<div class="ohyeschat-admin-menu-top">
    <div class="items">
       <?php 
echo OhYesChat::view_menu('admin', 'admin');
?>
     </div>
</div>
<div class="ohyeschat-admin-container">
<?php 
if ($messages) {
    ?>
 
  <div class="chat-system-message">
      <?php 
    echo $messages;
    ?>
      <div class="system-message-close">
          <a href="<?php 
    echo elgg_get_site_url();
Esempio n. 7
0
               <div class="ohyeschat-message-sending"><div class="OhYesChat-Icon-LoadingSmall"></div></div>
               <div class="options OhYesChat-Inline-Table" style="margin-left: 225px;height: 27px;margin-top: 2px;width: 22px;background: #FFF;position: absolute;">
                        <div class="OhYesChat-Inline-Table OhYesChat-Icon-Smilies" onClick="OhYesChat.ShowSmilies(<?php 
echo $vars['friend']['guid'];
?>
);" style="margin-top: 5px;"></div>
                </div>
               <input type="hidden" name="friend" value="<?php 
echo $vars['friend']['guid'];
?>
" />
               </form>
                </div>
                <div class="ohyeschat-new-message">
                              <div class="OhYesChat-Icon-NewMessage" style="display:inline-table;"></div>
                              <div class="text"  style="display:inline-table;"></div>
                        </div>     
            <div class="<?php 
echo OhYesChat::getStatusClass($vars['friend']['guid']);
?>
 ohyeschat-uinfo" id="ohyeschat-ustatus-<?php 
echo $vars['friend']['guid'];
?>
">
                        <div class="OhYesChat-Tab-Text" style="display:inline-table;"><?php 
echo OhYesChat::sttl($vars['friend']['name'], 17);
?>
</div>
            </div> 
          </div>
     </div>
Esempio n. 8
0
/**
 * User data
 * @note: Don't change anything if you don't know what you are doing;
 *
 * @return {Object}
 */ 
<?php 
$owner = elgg_get_logged_in_user_entity();
$online = OhYesChat::countOnline($owner);
$total_notifications = OhYesChat::countNew();
$new_all = OhYesChat::getNewAll(array('sender'));
$active_chat = $_SESSION['ohyes_chat'];
foreach ($active_chat as $friend) {
    $message = OhYesChat::getNew($friend);
    $icon = elgg_view("icon/default", array('entity' => get_user($friend), 'size' => 'small'));
    if (OhYesChat::userStatus($friend) == 'online') {
        $status = 'OhYesChat-Icon-Onine';
    } else {
        $status = 'OhYesChat-Icon-Offline';
    }
    $construct_active[$friend] = array('status' => $status);
    foreach ($message as $text) {
        if ($message->view == 0) {
            $new_messages[] = array('fid' => $friend, 'message' => elgg_view('ohyes/chat/message-item', array('icon' => $icon, 'message' => $text->message)), 'total' => count($message));
        }
    }
    if (!empty($message)) {
        $sound = "'<script>OhYesChat.playSound();</script>";
        $login = elgg_get_logged_in_user_entity()->guid;
        update_data("UPDATE {$CONFIG->dbprefix}ohyes_chat SET view='1' WHERE(sender='{$friend}' AND reciever='{$login}')");
    } else {
Esempio n. 9
0
<?php

/**
 * OhYesChat
 * @website Link: https://github.com/lianglee/OhYesChat
 * @Package Ohyes
 * @subpackage Chat
 * @author Liang Lee
 * @copyright All right reserved Liang Lee 2014.
 * @ide The Code is Generated by Liang Lee php IDE.
 */
$delete = new OhYesChat();
if ($delete->messagesDelete()) {
    $delete->forwardSystemMessage('Message has been deleted');
} else {
    $delete->forwardSystemMessage('Please try again later');
}
forward(REFERER);
Esempio n. 10
0
 /**
 * Register default menus
 * @access admin
 * @return arrays;
 */
 public static function RegisterMenus()
 {
     $menu = new OhYesChat();
     $url = elgg_get_site_url();
     $menu->register_menu_item('admin', array('text' => elgg_echo('ohyes:chat:home'), 'url' => "{$url}ohyeschat/admin"));
     $menu->register_menu_item('admin', array('text' => elgg_echo('ohyes:track:messages'), 'url' => "{$url}ohyeschat/admin/getuser"));
     $menu->register_menu_item('admin', array('text' => elgg_echo('ohyes:back:admin'), 'url' => "{$url}admin"));
     $menu->register_menu_item('admin', array('text' => elgg_echo('ohyes:bug:report'), 'url' => "http://github.com/lianglee/OhYesChat/issues"));
     $menu->register_menu_item('admin', array('text' => elgg_echo('ohyes:authors'), 'url' => "http://www.informatikon.com"));
     elgg_register_menu_item('page', array('name' => 'ohyeschat', 'href' => 'ohyeschat/admin', 'text' => elgg_echo('ohyeschat'), 'context' => 'admin', 'priority' => 1, 'section' => 'administer'));
 }
Esempio n. 11
0
<?php

/**
 * OhYesChat
 * @website Link: https://github.com/lianglee/OhYesChat
 * @Package Ohyes
 * @subpackage Chat
 * @author Liang Lee
 * @copyright All right reserved Liang Lee 2014.
 * @ide The Code is Generated by Liang Lee php IDE.
 */
$news = OhYesChat::checkNews();
echo '<h2>' . elgg_echo('ohyeschat:chat:welcome') . '</h2><br/>';
echo '<div class="ohyeschat-admin-dashboard" style="margin-left: 30px;">';
echo OhYesChat::newModule('green', elgg_echo('module:title:chat:update'), 'chat_update');
echo OhYesChat::newModule('red', elgg_echo('module:title:chat:total:messages'), 'total_messages');
echo OhYesChat::newModule('blue', elgg_echo('module:title:chat:latest:messages'), 'latest_messages');
echo '</div>';
echo '<h2>' . elgg_echo('ohyeschat:news') . '</h2>';
echo "<div class='ohyeschat-news'>{$news}</div>";
Esempio n. 12
0
<?php

/**
 * OhYesChat
 * @website Link: https://informatikon.com
 * @package Informatikon.Elgg
 * @subpackage Chat
 * @author $arsalanshah.informatikon
 * @copyright All right reserved Informatikon Technologies 2014.
 * @ide The Code is Generated by Liang Lee php IDE.
 */
$online_users = '<span id="ohyes-chat-count">' . OhYesChat::countOnline(elgg_get_logged_in_user_entity()) . '</span>';
?>
<div class="OhYesChat">
    <div class="ChatNotification">
          <div class="inner" onClick="OhYesChat.NotifShow(this);">
              <div class="OhYesChat-Icon-Notification"></div>
              <div class="text" id="chat-count-message"></div>
          </div>
           <div class="notification-window" style="display:none;">
               <div class="OhYesChat-Titles">
                   <div class="OhYesChat-Inline-Table text"><?php 
echo elgg_echo('ohyes:chat:notification');
?>
</div>
                   <div class="OhYesChat-Inline-Table options"> <div class="item"  onClick="OhYesChat.NotifHide(this, 1);"> X </div></div>
               </div>
            <div class="data">
			<?php 
echo elgg_view('ohyes/chat/messages', array('entity' => elgg_get_logged_in_user_entity()));
?>
Esempio n. 13
0
<?php

/**
 * OhYesChat
 * @website Link: https://github.com/lianglee/OhYesChat
 * @Package Ohyes
 * @subpackage Chat
 * @author Liang Lee
 * @copyright All right reserved Liang Lee 2014.
 * @ide The Code is Generated by Liang Lee php IDE.
 */
$action['is_action'] = true;
$action['text'] = 'Delete';
$action['href'] = 'action/ohyes/chat/deletemssages';
$url = elgg_view('output/url', $action);
?>
  <div class="module-message" style="padding:20px;">
         Total messages are <?php 
echo OhYesChat::getTotal();
?>
, delete messages older than one weak. This action is not reversable.
         <div class="button-yellow" style="margin-top:10px;"><?php 
echo $url;
?>
</div>
  </div>
  
Esempio n. 14
0
<?php

/**
 * OhYesChat
 * @website Link: https://github.com/lianglee/OhYesChat
 * @Package Ohyes
 * @subpackage Chat
 * @author Liang Lee
 * @copyright All right reserved Liang Lee 2014.
 * @ide The Code is Generated by Liang Lee php IDE.
 */
if (elgg_is_logged_in() && !OhYesChat::FromMobile()) {
    echo elgg_view('ohyes/chat/bar_contents');
}
Esempio n. 15
0
<style>
.ohyeschat-item-smiles{
	padding: 3px;
}
</style>
<?php 
foreach (OhYesChat::loadIcons() as $val => $Icon) {
    echo '<div class="OhYesChat-Inline-Table ohyeschat-item-smiles" title="' . $val . '" onClick=\'OhYesChat.InsertSmiles("' . $val . '",' . $vars['tab'] . ');\'>' . $Icon . '</div>';
}
Esempio n. 16
0
echo elgg_echo('track:user:chat:hist', array($vars['from']->name, $vars['to']->name));
?>
</h2>
<?php 
if (empty($vars['messages'])) {
    $vars['messages'] = array();
}
?>
<div class="ohyes-chat-expand" id="ohyes-chat-data-messages-expand">

<?php 
foreach ($vars['messages'] as $message) {
    $sender = $message->sender;
    $icon = elgg_view("icon/default", array('entity' => get_user($sender), 'size' => 'small'));
    ?>
  <div class="message-item-expand">
        <div class="icon">
        <?php 
    echo $icon;
    ?>
        </div>
        <div class="message">
        <?php 
    echo OhYesChat::replaceIcon($message->message);
    ?>
        </div>
  </div>
  <?php 
}
?>
</div>
Esempio n. 17
0
/**
* Setup Chat;
*
* @access system
* @return null;
*/
function ohyeschat_setup()
{
    $Setup = new OhYesChat();
    $Setup->Setup();
}
Esempio n. 18
0
<?php

/**
 * Ohyes Theme
 * @website Link: https://github.com/lianglee/OhYesTheme
 * @Package Ohyes
 * @subpackage Theme
 * @author Liang Lee
 * @copyright All right reserved Liang Lee 2014.
 * @ide The Code is Generated by Liang Lee php IDE.
*/
$friends = OhYesChat::OnlineFriends($vars['entity']);
foreach ($friends as $friend) {
    $icon = elgg_view("icon/default", array('entity' => get_user($friend->guid), 'size' => 'tiny'));
    if ($vars['mobile'] !== true) {
        $users[] = elgg_view('ohyes/chat/freinds-item', array('icon' => $icon, 'entity' => $friend));
    } elseif ($vars['mobile'] == true) {
        $users[] = elgg_view('ohyes/mobilechat/freinds-item', array('icon' => $icon, 'entity' => $friend));
    }
}
$users = implode('', $users);
if (empty($users)) {
    $users = '<p style="padding:10px;">' . elgg_echo('ohyes:chat:no:online') . '</p>';
}
echo $users;