コード例 #1
0
ファイル: ajax.php プロジェクト: venturepact/blog
     @set_time_limit(120);
 }
 //sleep(6);
 $i = 1;
 while ($i <= $iterations) {
     // update chats if they have timed out every 10 seconds
     if ($i % 10 == 0) {
         wplc_update_chat_statuses();
     }
     if ($_POST['wplc_update_admin_chat_table'] == 'false') {
         $old_chat_data = false;
     } else {
         $old_chat_data = $_POST['wplc_update_admin_chat_table'];
     }
     $pending = wplc_check_pending_chats();
     $new_chat_data = wplc_list_chats();
     if (stripslashes($new_chat_data) !== stripslashes($old_chat_data)) {
         $array['old_chat_data'] = $old_chat_data;
         $array['wplc_update_admin_chat_table'] = $new_chat_data;
         $array['pending'] = $pending;
         $array['action'] = "wplc_update_admin_chat";
     }
     if (isset($array)) {
         echo json_encode($array);
         break;
     }
     @ob_end_flush();
     if (defined('WPLC_DELAY_BETWEEN_LOOPS')) {
         usleep(WPLC_DELAY_BETWEEN_LOOPS);
     } else {
         usleep(500000);
コード例 #2
0
function wplc_admin_menu_layout_display()
{
    if (!isset($_GET['action'])) {
        ?>
        <div style='float:right; display:block; width:450px;  padding:10px; text-align:center; background-color: #EEE; border: 1px solid #E6DB55; margin:10px;'>
            <strong><?php 
        _e("Experiencing problems with the plugin?", "wplivechat");
        ?>
</strong>
            <br />
            <a href='http://wp-livechat.com/documentation/' title='WP Live Chat Support Documentation' target='_BLANK'><?php 
        _e("Review the documentation.", "wplivechat");
        ?>
</a> 
        <?php 
        _e("Or ask a question on our", "wplivechat");
        ?>
  <a href='http://wp-livechat.com/forums/forum/support/' title='WP Live Chat Support Forum' target='_BLANK'><?php 
        _e('Support forum.', 'wplivechat');
        ?>
</a>
        </div>
        <br/>
        <br/>
        <br/>
        <div class='wplc_page_title'>
            <h1><?php 
        _e("Chat sessions", "wplivechat");
        ?>
</h1>

            <p><?php 
        _e("Please note: This window must be open in order to receive new chat notifications.", "wplivechat");
        ?>
</p>
        </div>
        <div id="wplc_sound"></div>

        <!----->

        <div class="wplc_admin_dashboard_container">
            <div id="wplc_sound"></div>
            <div id="wplc_admin_chat_area">
        <?php 
        if (function_exists("wplc_register_pro_version")) {
            echo wplc_list_chats_pro();
        } else {
            echo wplc_list_chats();
        }
        ?>
            </div>
            <div id="wplc_admin_visitor_area">
                <h1><?php 
        _e("Visitors on site", "wplivechat");
        ?>
</h1>    
                <p>
                    <?php 
        _e("With the Pro add-on of WP Live Chat Support, you can", "wplivechat");
        ?>
 
                    <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=initiate1" title="<?php 
        _e("see who's online and initiate chats", "wplivechat");
        ?>
" target=\"_BLANK\">
                        <?php 
        _e("see who's online and initiate chats", "wplivechat");
        ?>
                    </a> <?php 
        _e("with your online visitors with the click of a button.", "wplivechat");
        ?>
 
                    <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=initiate2" title="<?php 
        _e("Buy the Pro add-on now for only \$19.95 once off. Free Updates FOREVER.", "wplivechat");
        ?>
" target=\"_BLANK\">
                        <strong>
                            <?php 
        _e("Buy the Pro add-on now for only \$19.95 once off. Free Updates Forever.", "wplivechat");
        ?>
                        </strong>
                    </a>
                </p>
            </div>
        </div>

        <?php 
    } else {
        if ($_GET['action'] == 'ac') {
            wplc_change_chat_status($_GET['cid'], 3);
            if (function_exists('wplc_ma_register')) {
                wplc_ma_update_agent_id($_GET['cid'], $_GET['agent_id']);
            }
            if (function_exists("wplc_register_pro_version")) {
                wplc_pro_draw_chat_area($_GET['cid']);
            } else {
                wplc_draw_chat_area($_GET['cid']);
            }
        }
    }
}