当前位置: 首页>>代码示例>>PHP>>正文


PHP functions::checkout方法代码示例

本文整理汇总了PHP中functions::checkout方法的典型用法代码示例。如果您正苦于以下问题:PHP functions::checkout方法的具体用法?PHP functions::checkout怎么用?PHP functions::checkout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在functions的用法示例。


在下文中一共展示了functions::checkout方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: mysql_result

 -----------------------------------------------------------------
 Выводим список файлов нужного раздела
 -----------------------------------------------------------------
 */
 $total = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_forum_files` WHERE " . (isset($_GET['new']) ? " `time` > '{$new}'" : " `filetype` = '{$do}'") . $sql), 0);
 if ($total > 0) {
     // Заголовок раздела
     echo '<div class="phdr">' . $caption . (isset($_GET['new']) ? '<br />' . $lng['new_files'] : '') . '</div>' . ($do ? '<div class="bmenu">' . $types[$do] . '</div>' : '');
     $req = mysql_query("SELECT `cms_forum_files`.*, `forum`.`user_id`, `forum`.`text`, `topicname`.`text` AS `topicname`\n            FROM `cms_forum_files`\n            LEFT JOIN `forum` ON `cms_forum_files`.`post` = `forum`.`id`\n            LEFT JOIN `forum` AS `topicname` ON `cms_forum_files`.`topic` = `topicname`.`id`\n            WHERE " . (isset($_GET['new']) ? " `cms_forum_files`.`time` > '{$new}'" : " `filetype` = '{$do}'") . ($rights >= 7 ? '' : " AND `del` != '1'") . $sql . "ORDER BY `time` DESC LIMIT {$start},{$kmess}");
     for ($i = 0; $res = mysql_fetch_assoc($req); ++$i) {
         $req_u = mysql_query("SELECT `id`, `name`, `sex`, `rights`, `lastdate`, `status`, `datereg`, `ip`, `browser` FROM `users` WHERE `id` = '" . $res['user_id'] . "'");
         $res_u = mysql_fetch_assoc($req_u);
         echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
         // Выводим текст поста
         $text = mb_substr($res['text'], 0, 500);
         $text = functions::checkout($text, 1, 0);
         $text = preg_replace('#\\[c\\](.*?)\\[/c\\]#si', '', $text);
         $page = ceil(mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `refid` = '" . $res['topic'] . "' AND `id` " . ($set_forum['upfp'] ? ">=" : "<=") . " '" . $res['post'] . "'"), 0) / $kmess);
         $text = '<b><a href="index.php?id=' . $res['topic'] . '&amp;page=' . $page . '">' . $res['topicname'] . '</a></b><br />' . $text;
         if (mb_strlen($res['text']) > 500) {
             $text .= '<br /><a href="index.php?act=post&amp;id=' . $res['post'] . '">' . $lng_forum['read_all'] . ' &gt;&gt;</a>';
         }
         // Формируем ссылку на файл
         $fls = @filesize('../files/forum/attach/' . $res['filename']);
         $fls = round($fls / 1024, 0);
         $att_ext = strtolower(functions::format('./files/forum/attach/' . $res['filename']));
         $pic_ext = array('gif', 'jpg', 'jpeg', 'png');
         if (in_array($att_ext, $pic_ext)) {
             // Если картинка, то выводим предпросмотр
             $file = '<div><a href="index.php?act=file&amp;id=' . $res['id'] . '">';
             $file .= '<img src="thumbinal.php?file=' . urlencode($res['filename']) . '" alt="' . $lng_forum['click_to_view'] . '" /></a></div>';
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:files.php

示例2: mysql_query

    $req = mysql_query("SELECT * FROM `cms_ads` WHERE `to` = '0' AND (`layout` = '{$layout}' or `layout` = '0') AND (`view` = '{$view}' or `view` = '0') ORDER BY  `mesto` ASC");
    if (mysql_num_rows($req)) {
        while (($res = mysql_fetch_assoc($req)) !== FALSE) {
            $name = explode("|", $res['name']);
            $name = htmlentities($name[mt_rand(0, count($name) - 1)], ENT_QUOTES, 'UTF-8');
            if (!empty($res['color'])) {
                $name = '<span style="color:#' . $res['color'] . '">' . $name . '</span>';
            }
            // Jika Anda mau mengatur font, dibawah settingannya..
            $font = $res['bold'] ? 'font-weight: bold;' : FALSE;
            $font .= $res['italic'] ? ' font-style:italic;' : FALSE;
            $font .= $res['underline'] ? ' text-decoration:underline;' : FALSE;
            if ($font) {
                $name = '<span style="' . $font . '">' . $name . '</span>';
            }
            @($cms_ads[$res['type']] .= '<a href="' . ($res['show'] ? functions::checkout($res['link']) : $set['homeurl'] . '/go.php?id=' . $res['id']) . '">' . $name . '</a><br/>');
            if ($res['day'] != 0 && time() >= $res['time'] + $res['day'] * 3600 * 24 || $res['count_link'] != 0 && $res['count'] >= $res['count_link']) {
                mysql_query("UPDATE `cms_ads` SET `to` = '1'  WHERE `id` = '" . $res['id'] . "'");
            }
        }
    }
}
/*
-----------------------------------------------------------------
Blok Iklan
-----------------------------------------------------------------
*/
if (isset($cms_ads[0])) {
    echo $cms_ads[0];
}
/*
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:head_shout.php

示例3: mysql_query

        // Проверяем, есть ли уже альбом с таким же именем?
        if (!$al && mysql_num_rows(mysql_query("SELECT * FROM `cms_album_cat` WHERE `name` = '" . mysql_real_escape_string($name) . "' AND `user_id` = '" . $user['id'] . "' LIMIT 1"))) {
            $error[] = $lng_profile['error_album_exists'];
        }
        if (!$error) {
            if ($al) {
                // Изменяем данные в базе
                mysql_query("UPDATE `cms_album_files` SET `access` = '{$access}' WHERE `album_id` = '{$al}' AND `user_id` = '" . $user['id'] . "'");
                mysql_query("UPDATE `cms_album_cat` SET\n                    `name` = '" . mysql_real_escape_string($name) . "',\n                    `description` = '" . mysql_real_escape_string($description) . "',\n                    `password` = '" . mysql_real_escape_string($password) . "',\n                    `access` = '{$access}'\n                    WHERE `id` = '{$al}' AND `user_id` = '" . $user['id'] . "'\n                ");
            } else {
                // Вычисляем сортировку
                $req = mysql_query("SELECT * FROM `cms_album_cat` WHERE `user_id` = '" . $user['id'] . "' ORDER BY `sort` DESC LIMIT 1");
                if (mysql_num_rows($req)) {
                    $res = mysql_fetch_assoc($req);
                    $sort = $res['sort'] + 1;
                } else {
                    $sort = 1;
                }
                // Заносим данные в базу
                mysql_query("INSERT INTO `cms_album_cat` SET\n                    `user_id` = '" . $user['id'] . "',\n                    `name` = '" . mysql_real_escape_string($name) . "',\n                    `description` = '" . mysql_real_escape_string($description) . "',\n                    `password` = '" . mysql_real_escape_string($password) . "',\n                    `access` = '{$access}',\n                    `sort` = '{$sort}'\n                ");
            }
            echo '<div class="gmenu"><p>' . ($al ? $lng_profile['album_changed'] : $lng_profile['album_created']) . '<br />' . '<a href="album.php?act=list&amp;user=' . $user['id'] . '">' . $lng['continue'] . '</a></p></div>';
            require '../incfiles/end.php';
            exit;
        }
    }
    if ($error) {
        echo functions::display_error($error);
    }
    echo '<div class="menu">' . '<form action="album.php?act=edit&amp;user=' . $user['id'] . '&amp;al=' . $al . '" method="post">' . '<p><h3>' . $lng['title'] . '</h3>' . '<input type="text" name="name" value="' . functions::checkout($name) . '" maxlength="30" /><br />' . '<small>Min. 2, Max. 30</small></p>' . '<p><h3>' . $lng['description'] . '</h3>' . '<textarea name="description" rows="' . $set_user['field_h'] . '">' . functions::checkout($description) . '</textarea><br />' . '<small>' . $lng['not_mandatory_field'] . '<br />Max. 500</small></p>' . '<p><h3>' . $lng['password'] . '</h3>' . '<input type="text" name="password" value="' . functions::checkout($password) . '" maxlength="15" /><br />' . '<small>' . $lng_profile['access_help'] . '<br />Min. 3, Max. 15</small></p>' . '<p><h3>Доступ</h3>' . '<input type="radio" name="access" value="4" ' . (!$access || $access == 4 ? 'checked="checked"' : '') . '/>&#160;' . $lng_profile['access_all'] . '<br />' . '<input type="radio" name="access" value="3" ' . ($access == 3 ? 'checked="checked"' : '') . '/>&#160;' . $lng_profile['access_friends'] . '<br />' . '<input type="radio" name="access" value="2" ' . ($access == 2 ? 'checked="checked"' : '') . '/>&#160;' . $lng_profile['access_by_password'] . '<br />' . '<input type="radio" name="access" value="1" ' . ($access == 1 ? 'checked="checked"' : '') . '/>&#160;' . $lng_profile['access_closed'] . '</p>' . '<p><input type="submit" name="submit" value="' . $lng['save'] . '" /></p>' . '</form></div>' . '<div class="phdr"><a href="album.php?act=list&amp;user=' . $user['id'] . '">' . $lng['cancel'] . '</a></div>';
}
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:edit.php

示例4: unset

/*
-----------------------------------------------------------------
Список альбомов юзера
-----------------------------------------------------------------
*/
if (isset($_SESSION['ap'])) {
    unset($_SESSION['ap']);
}
echo '<div class="phdr"><a href="album.php"><b>' . $lng['photo_albums'] . '</b></a> | ' . $lng['personal_2'] . '</div>';
$req = mysql_query("SELECT * FROM `cms_album_cat` WHERE `user_id` = '" . $user['id'] . "' " . ($user['id'] == $user_id || $rights >= 6 ? "" : "AND `access` > 1") . " ORDER BY `sort` ASC");
$total = mysql_num_rows($req);
if ($user['id'] == $user_id && $total < $max_album || $rights >= 7) {
    echo '<div class="topmenu"><a href="album.php?act=edit&amp;user=' . $user['id'] . '">' . $lng_profile['album_create'] . '</a></div>';
}
echo '<div class="user"><p>' . functions::display_user($user, array('iphide' => 1)) . '</p></div>';
if ($total) {
    $i = 0;
    while ($res = mysql_fetch_assoc($req)) {
        $count = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_album_files` WHERE `album_id` = '" . $res['id'] . "'"), 0);
        echo ($i % 2 ? '<div class="list2">' : '<div class="list1">') . '<img src="../images/album-' . $res['access'] . '.gif" width="16" height="16" class="left" />&#160;' . '<a href="album.php?act=show&amp;al=' . $res['id'] . '&amp;user=' . $user['id'] . '"><b>' . functions::checkout($res['name']) . '</b></a>&#160;(' . $count . ')';
        if ($user['id'] == $user_id || $rights >= 6 || !empty($res['description'])) {
            $menu = array('<a href="album.php?act=sort&amp;mod=up&amp;al=' . $res['id'] . '&amp;user=' . $user['id'] . '">' . $lng['up'] . '</a>', '<a href="album.php?act=sort&amp;mod=down&amp;al=' . $res['id'] . '&amp;user=' . $user['id'] . '">' . $lng['down'] . '</a>', '<a href="album.php?act=edit&amp;al=' . $res['id'] . '&amp;user=' . $user['id'] . '">' . $lng['edit'] . '</a>', '<a href="album.php?act=delete&amp;al=' . $res['id'] . '&amp;user=' . $user['id'] . '">' . $lng['delete'] . '</a>');
            echo '<div class="sub">' . (!empty($res['description']) ? '<div class="gray">' . functions::checkout($res['description'], 1, 1) . '</div>' : '') . ($user['id'] == $user_id || $rights >= 6 ? functions::display_menu($menu) : '') . '</div>';
        }
        echo '</div>';
        ++$i;
    }
} else {
    echo '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>';
}
echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:list.php

示例5: mysql_query

<?php

$roq = mysql_query("SELECT `qchat`.*, `users`.`name`, `users`.`rights`, `users`.`lastdate`, `users`.`sex`, `users`.`status`, `users`.`datereg`, `users`.`ip` , `users`.`browser`   FROM `qchat` LEFT JOIN `users` ON `qchat`.`user_id` = `users`.`id` ORDER BY `time` DESC LIMIT 3;");
while ($res = mysql_fetch_array($roq)) {
    echo ceil(ceil($i / 2) - $i / 2) == 0 ? '<div class="menu">' : '<div class="menu">';
    // icon seks
    global $set_user, $realtime, $user_id, $admp, $home;
    if (!empty($user_id) && $user_id != $res['user_id']) {
        echo '<a href="' . $set['homeurl'] . '/users/profile.php?user=' . $res['user_id'] . '"><b>' . $res['name'] . '</b></a> ';
    } else {
        echo '<b>' . $res['name'] . '</b>';
    }
    $ontimes = $res['lastdate'] + 600;
    if (time() > $ontimes) {
        echo '<span style="color: red"> <img src="' . $home . '/images/off.png" alt="[OFF]"></img></span>';
    } else {
        echo '<span style="color: green"> <img src="' . $home . '/images/on.png" alt="[ON]"></img></span>';
    }
    echo ' ';
    $post = functions::antilink(functions::checkout($res['text'], 0, 10));
    $post = functions::smileys($post, $res['rights'] >= 1 ? 1 : 0);
    // text
    if (mb_strlen($post) >= 100) {
        echo $post . ' ';
    } else {
        echo $post;
    }
    echo '</div>';
    ++$i;
}
$refr = rand(0, 999);
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:func_quick.php

示例6: mysql_query

     if ($total > $kmess) {
         $out .= '<div class="topmenu">' . functions::display_pagination('index.php?act=systems&amp;', $start, $total, $kmess) . '</div>';
     }
     $req = mysql_query("SELECT * FROM `cms_mail` WHERE `from_id`='{$user_id}' AND `sys`='1' AND `delete`!='{$user_id}' ORDER BY `time` DESC LIMIT " . $start . "," . $kmess);
     $mass_read = array();
     for ($i = 0; ($row = mysql_fetch_assoc($req)) !== FALSE; ++$i) {
         $out .= $i % 2 ? '<div class="list1">' : '<div class="list2">';
         if ($row['read'] == 0 && $row['from_id'] == $user_id) {
             $mass_read[] = $row['id'];
         }
         $post = $row['text'];
         $post = functions::checkout($post, 1, 1);
         if ($set_user['smileys']) {
             $post = functions::smileys($post);
         }
         $out .= '<strong>' . functions::checkout($row['them']) . '</strong> (' . functions::display_date($row['time']) . ')<br />';
         $post = preg_replace_callback("/{TIME=(.+?)}/usi", 'time_parce', $post);
         //print_r($outmass);
         $out .= $post;
         $out .= '<div class="sub"><a href="index.php?act=delete&amp;id=' . $row['id'] . '">' . $lng['delete'] . '</a></div>';
         $out .= '</div>';
     }
     //Ставим метку о прочтении
     if ($mass_read) {
         $result = implode(',', $mass_read);
         mysql_query("UPDATE `cms_mail` SET `read`='1' WHERE `from_id`='{$user_id}' AND `sys`='1' AND `id` IN (" . $result . ")");
     }
 } else {
     $out .= '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>';
 }
 $out .= '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:systems.php

示例7: mysql_query

 }
 if ($total) {
     $req = mysql_query("\n            SELECT *, MATCH (`" . ($search_t ? 'name' : 'text') . "`) AGAINST ('{$query}' IN BOOLEAN MODE) as `rel`\n            FROM `lib`\n            WHERE MATCH (`" . ($search_t ? 'name' : 'text') . "`) AGAINST ('{$query}' IN BOOLEAN MODE)\n            AND `type` = 'bk'\n            ORDER BY `rel` DESC\n            LIMIT {$start}, {$kmess}\n        ");
     $i = 0;
     while (($res = mysql_fetch_assoc($req)) !== false) {
         echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
         foreach ($array as $srch) {
             if (($pos = mb_strpos(strtolower($res['text']), strtolower(str_replace('*', '', $srch)))) !== false) {
                 break;
             }
         }
         if (!isset($pos) || $pos < 100) {
             $pos = 100;
         }
         $name = $res['name'];
         $text = functions::checkout(mb_substr($res['text'], $pos - 100, 400), 1);
         if ($search_t) {
             foreach ($array as $val) {
                 $name = ReplaceKeywords($val, $name);
             }
         } else {
             foreach ($array as $val) {
                 $text = ReplaceKeywords($val, $text);
             }
         }
         echo '<b><a href="index.php?id=' . $res['id'] . '">' . $name . '</a></b><br />' . $text . ' <div class="sub"><span class="gray">' . $lng_lib['added'] . ':</span> ' . $res['avtor'] . ' <span class="gray">(' . functions::display_date($res['time']) . ')</span><br />' . '<span class="gray">' . $lng_lib['reads'] . ':</span> ' . $res['count'] . '</div></div>';
         ++$i;
     }
 } else {
     echo '<div class="rmenu"><p>' . $lng['search_results_empty'] . '</p></div>';
 }
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:search.php

示例8: header

                header('Location: index.php?id=' . $res['refid'] . '&page=' . $page);
            } else {
                $msg_pre = functions::checkout($msg, 1, 1);
                if ($set_user['smileys']) {
                    $msg_pre = functions::smileys($msg_pre, $datauser['rights'] ? 1 : 0);
                }
                $msg_pre = preg_replace('#\\[c\\](.*?)\\[/c\\]#si', '<div class="quote">\\1</div>', $msg_pre);
                echo '<div class="phdr"><a href="' . $link . '"><b>' . $lng['forum'] . '</b></a> | ' . $lng_forum['edit_message'] . '</div>';
                if ($msg && !isset($_POST['submit'])) {
                    $user = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '" . $res['user_id'] . "' LIMIT 1"));
                    echo '<div class="list1">' . functions::display_user($user, array('iphide' => 1, 'header' => '<span class="gray">(' . functions::display_date($res['time']) . ')</span>', 'body' => $msg_pre)) . '</div>';
                }
                echo '<div class="rmenu"><form name="form" action="?act=editpost&amp;id=' . $id . '&amp;start=' . $start . '" method="post"><p>';
                if (!$is_mobile) {
                    echo bbcode::auto_bb('form', 'msg');
                }
                echo '<textarea rows="' . $set_user['field_h'] . '" name="msg">' . (empty($_POST['msg']) ? htmlentities($res['text'], ENT_QUOTES, 'UTF-8') : functions::checkout($_POST['msg'])) . '</textarea><br/>';
                if ($set_user['translit']) {
                    echo '<input type="checkbox" name="msgtrans" value="1" ' . (isset($_POST['msgtrans']) ? 'checked="checked" ' : '') . '/> ' . $lng['translit'];
                }
                echo '</p><p><input type="submit" name="submit" value="' . $lng['save'] . '" style="width: 107px; cursor: pointer;"/> ' . ($set_forum['preview'] ? '<input type="submit" value="' . $lng['preview'] . '" style="width: 107px; cursor: pointer;"/>' : '') . '</p></form></div>' . '<div class="phdr"><a href="../pages/faq.php?act=trans">' . $lng['translit'] . '</a> | <a href="../pages/faq.php?act=smileys">' . $lng['smileys'] . '</a></div>' . '<p><a href="' . $link . '">' . $lng['back'] . '</a></p>';
            }
    }
} else {
    /*
    -----------------------------------------------------------------
    Выводим сообщения об ошибках
    -----------------------------------------------------------------
    */
    echo functions::display_error($error);
}
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:editpost.php

示例9: __construct

 function __construct($arg = array())
 {
     global $mod, $start, $kmess;
     $this->comments_table = $arg['comments_table'];
     $this->object_table = !empty($arg['object_table']) ? $arg['object_table'] : false;
     if (!empty($arg['sub_id_name']) && !empty($arg['sub_id'])) {
         $this->sub_id = $arg['sub_id'];
         $this->url = $arg['script'] . '&amp;' . $arg['sub_id_name'] . '=' . $arg['sub_id'];
     } else {
         //TODO: Доработать на режим без sub_id
         $this->url = $arg['script'];
     }
     $this->item = isset($_GET['item']) ? abs(intval($_GET['item'])) : false;
     // Получаем данные пользователя
     if (core::$user_id) {
         $this->user_id = core::$user_id;
         $this->rights = core::$user_rights;
         $this->ban = core::$user_ban;
     }
     // Назначение пользовательских прав
     if (isset($arg['owner'])) {
         $this->owner = $arg['owner'];
         if (core::$user_id && $arg['owner'] == core::$user_id && !$this->ban) {
             $this->access_delete = isset($arg['owner_delete']) ? $arg['owner_delete'] : false;
             $this->access_reply = isset($arg['owner_reply']) ? $arg['owner_reply'] : false;
             $this->access_edit = isset($arg['owner_edit']) ? $arg['owner_edit'] : false;
         }
     }
     // Открываем доступ для Администрации
     if ($this->rights >= $this->access_level) {
         $this->access_reply = true;
         $this->access_edit = true;
         $this->access_delete = true;
     }
     switch ($mod) {
         case 'reply':
             /*
             -----------------------------------------------------------------
             Отвечаем на комментарий
             -----------------------------------------------------------------
             */
             if ($this->item && $this->access_reply && !$this->ban) {
                 echo '<div class="phdr"><a href="' . $this->url . '"><b>' . $arg['title'] . '</b></a> | ' . core::$lng['reply'] . '</div>';
                 $req = mysql_query("SELECT * FROM `" . $this->comments_table . "` WHERE `id` = '" . $this->item . "' AND `sub_id` = '" . $this->sub_id . "' LIMIT 1");
                 if (mysql_num_rows($req)) {
                     $res = mysql_fetch_assoc($req);
                     $attributes = unserialize($res['attributes']);
                     if (!empty($res['reply']) && $attributes['reply_rights'] > $this->rights) {
                         echo functions::display_error(core::$lng['error_reply_rights'], '<a href="' . $this->url . '">' . core::$lng['back'] . '</a>');
                     } elseif (isset($_POST['submit'])) {
                         $message = $this->msg_check();
                         if (empty($message['error'])) {
                             $attributes['reply_id'] = $this->user_id;
                             $attributes['reply_rights'] = $this->rights;
                             $attributes['reply_name'] = core::$user_data['name'];
                             $attributes['reply_time'] = time();
                             mysql_query("UPDATE `" . $this->comments_table . "` SET\n                                    `reply` = '" . mysql_real_escape_string($message['text']) . "',\n                                    `attributes` = '" . mysql_real_escape_string(serialize($attributes)) . "'\n                                    WHERE `id` = '" . $this->item . "'\n                                ");
                             header('Location: ' . str_replace('&amp;', '&', $this->url));
                         } else {
                             echo functions::display_error($message['error'], '<a href="' . $this->url . '&amp;mod=reply&amp;item=' . $this->item . '">' . core::$lng['back'] . '</a>');
                         }
                     } else {
                         $text = '<a href="' . core::$system_set['homeurl'] . '/users/profile.php?user=' . $res['user_id'] . '"><b>' . $attributes['author_name'] . '</b></a>' . ' (' . functions::display_date($res['time']) . ')<br />' . functions::checkout($res['text']);
                         $reply = functions::checkout($res['reply']);
                         echo $this->msg_form('&amp;mod=reply&amp;item=' . $this->item, $text, $reply) . '<div class="phdr"><a href="' . $this->url . '">' . core::$lng['back'] . '</a></div>';
                     }
                 } else {
                     echo functions::display_error(core::$lng['error_wrong_data'], '<a href="' . $this->url . '">' . core::$lng['back'] . '</a>');
                 }
             }
             break;
         case 'edit':
             /*
             -----------------------------------------------------------------
             Редактируем комментарий
             -----------------------------------------------------------------
             */
             if ($this->item && $this->access_edit && !$this->ban) {
                 echo '<div class="phdr"><a href="' . $this->url . '"><b>' . $arg['title'] . '</b></a> | ' . core::$lng['edit'] . '</div>';
                 $req = mysql_query("SELECT * FROM `" . $this->comments_table . "` WHERE `id` = '" . $this->item . "' AND `sub_id` = '" . $this->sub_id . "' LIMIT 1");
                 if (mysql_num_rows($req)) {
                     $res = mysql_fetch_assoc($req);
                     $attributes = unserialize($res['attributes']);
                     $user = functions::get_user($res['user_id']);
                     if ($user['rights'] > core::$user_rights) {
                         echo functions::display_error(core::$lng['error_edit_rights'], '<a href="' . $this->url . '">' . core::$lng['back'] . '</a>');
                     } elseif (isset($_POST['submit'])) {
                         $message = $this->msg_check();
                         if (empty($message['error'])) {
                             $attributes['edit_id'] = $this->user_id;
                             $attributes['edit_name'] = core::$user_data['name'];
                             $attributes['edit_time'] = time();
                             if (isset($attributes['edit_count'])) {
                                 ++$attributes['edit_count'];
                             } else {
                                 $attributes['edit_count'] = 1;
                             }
                             mysql_query("UPDATE `" . $this->comments_table . "` SET\n                                    `text` = '" . mysql_real_escape_string($message['text']) . "',\n                                    `attributes` = '" . mysql_real_escape_string(serialize($attributes)) . "'\n                                    WHERE `id` = '" . $this->item . "'\n                                ");
                             header('Location: ' . str_replace('&amp;', '&', $this->url));
                         } else {
//.........这里部分代码省略.........
开发者ID:chegestar,项目名称:catroxs,代码行数:101,代码来源:comments.php

示例10: library_map

 private function library_map()
 {
     global $rootpath, $set;
     $file = $rootpath . 'files/cache/' . $this->cache_lib_file . '.dat';
     if (file_exists($file) && filemtime($file) > time() - $this->cache_lib_map * 3600) {
         return file_get_contents($file);
     } else {
         $req = mysql_query("SELECT * FROM `lib` WHERE `type` = 'cat' AND `ip` = '0'");
         if (mysql_num_rows($req)) {
             while (($res = mysql_fetch_assoc($req)) !== false) {
                 $count = mysql_result(mysql_query("SELECT COUNT(*) FROM `lib` WHERE `refid` = '" . $res['id'] . "' AND `type` = 'bk' AND `moder` = '1'"), 0);
                 if ($count) {
                     $text = html_entity_decode($res['text']);
                     $text = mb_substr($text, 0, 40);
                     $pages = ceil($count / $this->links_count);
                     if ($pages > 1) {
                         for ($i = 0; $i < $pages; $i++) {
                             $out[] = '<a href="' . $set['homeurl'] . '/library/contents.php?id=' . $res['id'] . '&amp;p=' . $i . '">' . functions::checkout($text) . ' (' . ($i + 1) . ')</a>';
                         }
                     } else {
                         $out[] = '<a href="../library/contents.php?id=' . $res['id'] . '">' . functions::checkout($text) . '</a>';
                     }
                 }
             }
             if (isset($out)) {
                 return file_put_contents($file, implode('<br />' . "\r\n", $out)) ? implode('<br />', $out) : 'Library cache error';
             }
         }
     }
     return false;
 }
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:sitemap.php

示例11: mysql_query

if ($datauser['journal_forum']) {
    echo '<div class="topmenu">Notifikasi Baru : ' . $datauser['journal_forum'] . '</div>';
    mysql_query("UPDATE `users` SET `journal_forum`='0' WHERE `id` = '{$user_id}'");
}
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `id_user`='{$user_id}'" . ($rights >= 7 ? "" : " AND `close` != '1'")), 0);
if ($total) {
    $req = mysql_query("SELECT `forum`.*, `users`.`sex`, `users`.`rights`, `users`.`lastdate`, `users`.`status`, `users`.`datereg`\n     \tFROM `forum` LEFT JOIN `users` ON `forum`.`user_id` = `users`.`id`\n      \tWHERE `forum`.`type` = 'm' AND `forum`.`id_user`='{$user_id}'" . ($rights >= 7 ? "" : " AND `forum`.`close` != '1'") . " ORDER BY `forum`.`id` DESC LIMIT {$start}, {$kmess}");
    while (($res = mysql_fetch_assoc($req)) !== false) {
        if ($res['close']) {
            echo '<div class="rmenu">';
        } else {
            echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
        }
        $theme = mysql_fetch_assoc(mysql_query("SELECT `text` FROM `forum` WHERE `id` = '" . $res['refid'] . "' ORDER BY `id` ASC LIMIT 1"));
        echo 'Nick / User <a href="profile.php?user=' . $res['user_id'] . '"><b>' . $res['from'] . '</b></a> telah menjawab postingan anda pada Thread <a href="../forum/index.php?id=' . $res['refid'] . '">' . $theme['text'] . '</a>' . ' <span class="gray">(' . date("d.m.Y / H:i", $res['time'] + $set_user['sdvig'] * 3600) . ')</span><div class="menu"><small>' . '<a href="../forum/index.php?act=post&amp;id=' . $res['id'] . '">Baca Jawaban</a> ' . '<a href="../forum/index.php?act=say&amp;id=' . $res['id'] . '"> ' . $lng_forum['reply_btn'] . '</a> ' . '<a href="../forum/index.php?act=say&amp;id=' . $res['id'] . '&amp;cyt"> ' . $lng_forum['cytate_btn'] . '</a> </small></div><div class="menu"><small>';
        $text = bbcode::notags(functions::checkout(mb_substr($res['text'], 0, 150), 1, 1));
        if (mb_strlen($res['text']) > 300) {
            $text .= ' <span style="color:green;">...</span>';
        }
        if ($res['kedit']) {
            $text .= '<br /><span class="gray"><small>' . $lng_forum['edited'] . ' <b>' . $res['edit'] . '</b> (' . date("d.m /H:i", $res['tedit'] + $set_user['sdvig'] * 3600) . ') <b>[' . $res['kedit'] . ']</b></small></span>';
        }
        echo $text;
        $file_req = mysql_query("SELECT * FROM `cms_forum_files` WHERE `post` = '" . $res['id'] . "'");
        if (mysql_num_rows($file_req) > 0) {
            $file_res = mysql_fetch_assoc($file_req);
            $file_ile_size = round(@filesize('../files/forum/attach/' . $file_res['filename']) / 1024, 2);
            echo '<br /><span class="gray">' . $lng_forum['attached_file'] . ':';
            $att_ext = strtolower(functions::format('./files/forum/attach/' . $file_res['filename']));
            $pic_ext = array('gif', 'jpg', 'jpeg', 'png');
            if (in_array($att_ext, $pic_ext)) {
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:journal.php

示例12: unset

 */
 unset($_SESSION['ref']);
 $req_a = mysql_query("SELECT * FROM `cms_album_cat` WHERE `id` = '" . $res_obj['album_id'] . "'");
 $res_a = mysql_fetch_assoc($req_a);
 if ($res_a['access'] == 1 && $owner['id'] != $user_id && $rights < 6 || $res_a['access'] == 2 && (!isset($_SESSION['ap']) || $_SESSION['ap'] != $res_a['password']) && $owner['id'] != $user_id) {
     // Если доступ закрыт
     require '../incfiles/head.php';
     echo functions::display_error($lng['access_forbidden']) . '<div class="phdr"><a href="album.php?act=list&amp;user=' . $owner['id'] . '">' . $lng_profile['album_list'] . '</a></div>';
     require '../incfiles/end.php';
     exit;
 }
 $context_top = '<div class="phdr"><a href="album.php"><b>' . $lng['photo_albums'] . '</b></a> | ' . '<a href="album.php?act=list&amp;user=' . $owner['id'] . '">' . $lng['personal_2'] . '</a></div>' . '<div class="menu"><a href="album.php?act=show&amp;al=' . $res_obj['album_id'] . '&amp;img=' . $img . '&amp;user=' . $owner['id'] . '&amp;view"><img src="../files/users/album/' . $owner['id'] . '/' . $res_obj['tmb_name'] . '" /></a>';
 if (!empty($res_obj['description'])) {
     $context_top .= '<div class="gray">' . functions::smileys(functions::checkout($res_obj['description'], 1)) . '</div>';
 }
 $context_top .= '<div class="sub">' . '<a href="profile.php?user=' . $owner['id'] . '"><b>' . $owner['name'] . '</b></a> | ' . '<a href="album.php?act=show&amp;al=' . $res_a['id'] . '&amp;user=' . $owner['id'] . '">' . functions::checkout($res_a['name']) . '</a>';
 if ($res_obj['access'] == 4 || $rights >= 7) {
     $context_top .= vote_photo($res_obj) . '<div class="gray">' . $lng['count_views'] . ': ' . $res_obj['views'] . ', ' . $lng['count_downloads'] . ': ' . $res_obj['downloads'] . '</div>' . '<a href="album.php?act=image_download&amp;img=' . $res_obj['id'] . '">' . $lng['download'] . '</a>';
 }
 $context_top .= '</div></div>';
 /*
 -----------------------------------------------------------------
 Параметры комментариев
 -----------------------------------------------------------------
 */
 $arg = array('comments_table' => 'cms_album_comments', 'object_table' => 'cms_album_files', 'script' => 'album.php?act=comments', 'sub_id_name' => 'img', 'sub_id' => $img, 'owner' => $owner['id'], 'owner_delete' => true, 'owner_reply' => true, 'owner_edit' => false, 'title' => $lng['comments'], 'context_top' => $context_top, 'context_bottom' => '');
 /*
 -----------------------------------------------------------------
 Ставим метку прочтения
 -----------------------------------------------------------------
 */
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:comments.php

示例13: foreach

     if (!in_array($symbol_1, $array_symbol)) {
         $array_symbol[] = $symbol_1;
         $array_menu[] = $symbol && $symbol_1 == $symbol ? '<b>' . $symbol_1 . '</b>' : '<a href="?act=languages&amp;mod=phrases&amp;language=' . $language . '&amp;module=' . $name_module . '&amp;symbol=' . $symbol_1 . '">' . $symbol_1 . '</a>';
     }
     if (isset($search) && (stristr($key, $search) || stristr($val, $search))) {
         ++$total;
         if ($total > $start && $total < $start + $kmess) {
             $array_result[$key] = $val;
         }
     }
 }
 $array_menu[] = '<b>' . $lng['search'] . '</b>';
 $lng_module = $array_result;
 echo '<div class="phdr"><b>' . $lng_list[$language] . '</b>: <a href="index.php?act=languages&amp;mod=module&amp;language=' . $language . '"><b>' . $lng['modules'] . '</b></a> | ' . $name_module . ': ' . $lng['search'] . '</div>';
 echo '<div class="topmenu">' . functions::display_menu($array_menu) . '</div>';
 echo '<div class="gmenu"><form action="?act=languages&amp;mod=search&amp;language=' . $language . '&amp;module=' . $name_module . '" method="post">' . '<p><input type="text" value="' . ($search ? functions::checkout($search) : '') . '" name="search" />' . '<input type="submit" value="' . $lng['search'] . '" name="submit" />' . '</p></form></div>';
 $i = 0;
 $reset = false;
 if ($total) {
     echo '<form action="?act=languages&amp;mod=massdel_phrase&amp;language=' . $language . '&amp;module=' . $name_module . '&amp;symbol=' . $symbol . '&amp;start=' . $start . '" method="post">';
     foreach ($lng_module as $key => $val) {
         $search = str_replace('*', '', $search);
         $search_key = mb_strlen($search) < 3 ? $key : preg_replace('|(' . preg_quote($search, '/') . ')|siu', '<span style="background-color: #FFFF33">$1</span>', $key);
         $search_val = mb_strlen($search) < 3 ? $val : preg_replace('|(' . preg_quote($search, '/') . ')|siu', '<span style="background-color: #FFFF33">$1</span>', $val);
         echo is_integer($i / 2) ? '<div class="list1">' : '<div class="list2">';
         echo $search_key . '<br />' . $search_val . '<div class="sub">';
         if (isset($lng_edit[$name_module]) && in_array($key, array_keys($lng_edit[$name_module]))) {
             echo '<input type="checkbox" name="delch[]" value="' . $key . '"/>&#160;';
         }
         echo '<a href="?act=languages&amp;mod=edit_phrase&amp;language=' . $language . '&amp;module=' . $name_module . '&amp;key=' . $key . '&amp;symbol=' . $symbol . '&amp;start=' . $start . '">' . $lng['edit'] . '</a>';
         if (isset($lng_edit[$name_module]) && in_array($key, array_keys($lng_edit[$name_module]))) {
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:languages.php

示例14: mysql_result

 $total = mysql_result(mysql_query("SELECT COUNT(*) FROM `animes_comments` WHERE `refid`='{$id}';"), 0);
 if ($total) {
     if ($total > $kmess) {
         echo '<div class="topmenu">' . functions::display_pagination('index.php?act=comments&amp;id=' . $id . '&amp;', $start, $total, $kmess) . '</div>';
     }
     $i = 1;
     $req = mysql_query("SELECT `animes_comments`.*, `animes_comments`.`time` as `mtime`, `animes_comments`.`id` as `mid`, `users`.* FROM `animes_comments` LEFT JOIN `users` ON `animes_comments`.`user_id`=`users`.`id` WHERE `animes_comments`.`refid`='{$id}' ORDER BY `animes_comments`.`time` DESC LIMIT " . $start . "," . $kmess);
     while (($row = mysql_fetch_assoc($req)) !== false) {
         echo $i % 2 ? '<div class="list1">' : '<div class="list2">';
         $post = $row['text'];
         $post = functions::checkout($post, 1, 1);
         if ($set_user['smileys']) {
             $post = functions::smileys($post, $row['rights'] >= 1 ? 1 : 0);
         }
         if ($row['reply']) {
             $post .= '<div class="reply">' . functions::checkout($row['reply'], 1, 1) . '</div>';
         }
         if ($rights >= 7) {
             $subtext = '<a href="index.php?act=comments&amp;mod=replay&amp;id=' . $id . '&amp;com=' . $row['mid'] . '">Jawab</a> | <a href="index.php?act=comments&amp;mod=delete&amp;id=' . $id . '&amp;com=' . $row['mid'] . '">Hapus</a>';
         } else {
             $subtext = '';
         }
         $text = ' <span class="gray">(' . functions::display_date($row['mtime']) . ')</span>';
         $arg = array('header' => $text, 'body' => $post, 'sub' => $subtext);
         echo functions::display_user($row, $arg);
         echo '</div>';
         ++$i;
     }
     echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
     if ($total > $kmess) {
         echo '<div class="topmenu">' . functions::display_pagination('index.php?act=comments&amp;id=' . $id . '&amp;', $start, $total, $kmess) . '</div>';
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:comments.php

示例15: defined

* @link        http://johncms.com
* @copyright   Copyright (C) 2008-2011 JohnCMS Community
* @license     LICENSE.txt (see attached file)
* @version     VERSION.txt (see attached file)
* @author      http://johncms.com/about
*/
defined('_IN_JOHNADM') or die('Error: restricted access');
$error = array();
$search_post = isset($_POST['search']) ? trim($_POST['search']) : false;
$search_get = isset($_GET['search']) ? rawurldecode(trim($_GET['search'])) : false;
$search = $search_post ? $search_post : $search_get;
if (isset($_GET['ip'])) {
    $search = trim($_GET['ip']);
}
$menu = array(!$mod ? '<b>' . $lng['ip_actual'] . '</b>' : '<a href="index.php?act=search_ip&amp;search=' . rawurlencode($search) . '">' . $lng['ip_actual'] . '</a>', $mod == 'history' ? '<b>' . $lng['ip_history'] . '</b>' : '<a href="index.php?act=search_ip&amp;mod=history&amp;search=' . rawurlencode($search) . '">' . $lng['ip_history'] . '</a>');
echo '<div class="phdr"><a href="index.php"><b>' . $lng['admin_panel'] . '</b></a> | ' . $lng['ip_search'] . '</div>' . '<div class="topmenu">' . functions::display_menu($menu) . '</div>' . '<form action="index.php?act=search_ip" method="post"><div class="gmenu"><p>' . '<input type="text" name="search" value="' . functions::checkout($search) . '" />' . '<input type="submit" value="' . $lng['search'] . '" name="submit" /><br />' . '</p></div></form>';
if ($search) {
    if (strstr($search, '-')) {
        /*
        -----------------------------------------------------------------
        Обрабатываем диапазон адресов
        -----------------------------------------------------------------
        */
        $array = explode('-', $search);
        $ip = trim($array[0]);
        if (!core::ip_valid($ip)) {
            $error[] = $lng['error_firstip'];
        } else {
            $ip1 = ip2long($ip);
        }
        $ip = trim($array[1]);
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:search_ip.php


注:本文中的functions::checkout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。