update_index(); //check if owner or operator is online and not invisible $support_online = FALSE; $core->index->reset(); while ($core->index->next()) { $guid = $core->index->get("guid"); $status = $core->get_status($guid); if ( flag($status, CMS_CORE_STATUS_OWNER | CMS_CORE_STATUS_OPERATOR) && (! flag($status, CMS_CORE_STATUS_INVISIBLE)) ) { $support_online = TRUE; break; }; }; //chat window template $template = "
" . //title "

" . "Live-Support" . "

" . //close button "
" . "" . "" . "Schliessen" . "" . "" . "
" . "
" . //content "%s" . "
" . //move script "" . jscript("mv_register(\"div-livesupport\");"); //no operator online if (! $support_online) { //display info if (CMS_TEMPLATE_EDIT) echo(sprintf($template, "", "Der Live-Support wird nur angezeigt, " . "wenn ein Operator sichtbar angemeldet ist. " . "" . "Klicken Sie hier, um sich anzumelden." . " " . "Diese Nachricht ist nur im Editiermodus sichtbar.")); return; //exit }; $query = streq(CMS_USER, "anonymous") ? "?messenger_name=Gast_" . rx(CMS_USERID) : ""; //display chat echo(sprintf($template, "document.getElementById('iframe-livesupport').setAttribute('src'," . "'" . qx(CMS_MODULES_URL) . "messenger.php?messenger_display=disconnect');", "")); ?>