コード例 #1
0
function GetComment($sname, $item)
{
    session_start();
    $objResponse = new xajaxResponse();
    $uid = get_uid(false);
    if (!$uid) {
        return $objResponse;
    }
    switch (strtolower($sname)) {
        case 'commune':
            require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/comments/CommentsCommune.php';
            $comments = new CommentsCommune($item, date('Y-m-d H:i:s'));
            break;
        case 'articles':
            require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/comments/CommentsArticles.php';
            $comments = new CommentsArticles($item, date('Y-m-d H:i:s'));
            break;
        case 'adminlog':
            require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/comments/CommentsAdminLog.php';
            $comments = new CommentsAdminLog($item, date('Y-m-d H:i:s'));
            break;
        default:
            return $objResponse;
    }
    $result = $comments->getData($item);
    $attach = $result['attach'];
    unset($result['attach']);
    $msg = $result;
    if ($comments->enableWysiwyg) {
        $msg['msgtext'] = str_replace('  ', '  ', $msg['msgtext']);
    } else {
        $msg['msgtext'] = str_replace(array('''), array('\''), $msg['msgtext']);
        $msg['msgtext'] = htmlspecialchars_decode($msg['msgtext']);
    }
    //    $msg['msgtext'] = preg_replace_callback("/<([^\s>]+)[^>](.*?)*>/si",
    //            create_function('$matches', 'return str_replace("&nbsp;", " ", $matches[0]);'),
    //        $msg['msgtext']);
    if ($comments->enableNewWysiwyg) {
        $msg['msgtext'] = html2wysiwyg($msg['msgtext']);
    }
    $objResponse->call('commentEditCallback', $msg, $attach);
    return $objResponse;
}
コード例 #2
0
ファイル: index.php プロジェクト: kapai69/fl-ru-damp
}
if ($sViweId) {
    $sLogId = $sViweId;
    $menu_item = 0;
}
if ($sLogId) {
    if (!preg_match('/^[\\d]+$/', $sLogId) || !$admin_log->getLogById($sLogId)) {
        header_location_exit('/404.php');
    }
    $aUTL = admin_log::getUserToLogInfo($uid, $sLogId);
    admin_log::setLogCLV($uid, $sLogId);
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/comments/CommentsAdminLog.php';
    $maxlevel = 10;
    $maxwidth = 460;
    $minus_level_width = 2;
    $comments = new CommentsAdminLog($sLogId, $aUTL['last_comment_view'], array('maxlevel' => $maxlevel, 'maxwidth' => $maxwidth, 'minus_level_width' => $minus_level_width, 'hidden_threads' => $aUTL['hidden_threads']));
    $comments->tpl_path = $_SERVER['DOCUMENT_ROOT'] . '/classes/comments/';
    $comments_html = $comments->render();
    $css_file[] = 'wysiwyg.css';
    $css_file[] = 'hljs.css';
    $js_file = array_merge($js_file, array('highlight.min.js', 'highlight.init.js', 'mooeditable.new/MooEditable.ru-RU.js', 'mooeditable.new/rangy-core.js', 'mooeditable.new/MooEditable.js', 'mooeditable.new/MooEditable.Pagebreak.js', 'mooeditable.new/MooEditable.UI.MenuList.js', 'mooeditable.new/MooEditable.Extras.js', 'mooeditable.new/init.js', 'comments.all.js', 'banned.js'));
}
$aDays = range(1, 31);
$aYears = array_reverse(range(2007, date('Y')));
$aMounth = array('01' => 'Января', '02' => 'Февраля', '03' => 'Марта', '04' => 'Апреля', '05' => 'Мая', '06' => 'Июня', '07' => 'Июля', '08' => 'Августа', '09' => 'Сентября', '10' => 'Октября', '11' => 'Ноября', '12' => 'Декабря');
$shifts = user_content::getShifts();
// admin_actions.id
$aRed = array(3, 5, 7, 9, 11, 13, 15, 18, 22, 24, 27, 29, 31);
$aYellow = array(1);
$aGreen = array(2, 4, 6, 8, 10, 12, 14, 16, 17, 19, 23, 25, 28, 30, 32);
// Ключи - admin_actions.obj_code