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


PHP functions::display_date方法代码示例

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


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

示例1: preg_replace

         echo '<p><a href="index.php?act=say&amp;id=' . $id . '&amp;yes&amp;cyt">' . $lng_forum['agree'] . '</a> | <a href="index.php?id=' . $type1['refid'] . '">' . $lng_forum['not_agree'] . '</a></p>';
         require '../incfiles/end.php';
         exit;
     }
 }
 $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"><b>' . $lng_forum['topic'] . ':</b> ' . $th1['text'] . '</div>';
 $qt = str_replace("<br/>", "\r\n", $qt);
 $qt = trim(preg_replace('#\\[c\\](.*?)\\[/c\\]#si', '', $qt));
 $qt = functions::checkout($qt, 0, 2);
 if (!empty($_POST['msg']) && !isset($_POST['submit'])) {
     echo '<div class="list1">' . functions::display_user($datauser, array('iphide' => 1, 'header' => '<span class="gray">(' . functions::display_date(time()) . ')</span>', 'body' => $msg_pre)) . '</div>';
 }
 echo '<form name="form" action="index.php?act=say&amp;id=' . $id . '&amp;start=' . $start . (isset($_GET['cyt']) ? '&amp;cyt' : '') . '" method="post"><div class="gmenu">';
 if (isset($_GET['cyt'])) {
     // Форма с цитатой
     echo '<p><b>' . $type1['from'] . '</b> <span class="gray">(' . $vr . ')</span></p>' . '<p><h3>' . $lng_forum['cytate'] . '</h3>' . '<textarea rows="' . $set_user['field_h'] . '" name="citata">' . (empty($_POST['citata']) ? $qt : functions::checkout($_POST['citata'])) . '</textarea>' . '<br /><small>' . $lng_forum['cytate_help'] . '</small></p>';
 } else {
     // Форма с репликой
     echo '<p><h3>' . $lng_forum['reference'] . '</h3>' . '<input type="radio" value="0" ' . (!$txt ? 'checked="checked"' : '') . ' name="txt" />&#160;<b>' . $type1['from'] . '</b>,<br />' . '<input type="radio" value="2" ' . ($txt == 2 ? 'checked="checked"' : '') . ' name="txt" />&#160;<b>' . $type1['from'] . '</b>, ' . $lng_forum['reply_1'] . ',<br />' . '<input type="radio" value="3" ' . ($txt == 3 ? 'checked="checked"' : '') . ' name="txt" />&#160;<b>' . $type1['from'] . '</b>, ' . $lng_forum['reply_2'] . ' (<a href="index.php?act=post&amp;id=' . $type1['id'] . '">' . $vr . '</a>) ' . $lng_forum['reply_3'] . ',<br />' . '<input type="radio" value="4" ' . ($txt == 4 ? 'checked="checked"' : '') . ' name="txt" />&#160;<b>' . $type1['from'] . '</b>, ' . $lng_forum['reply_4'] . '</p>';
 }
 echo '<p><h3>' . $lng_forum['post'] . '</h3>';
 if (!$is_mobile) {
     echo '</p><p>' . bbcode::auto_bb('form', 'msg');
 }
 echo '<textarea rows="' . $set_user['field_h'] . '" name="msg">' . (empty($_POST['msg']) ? '' : functions::checkout($_POST['msg'])) . '</textarea></p>' . '<p><input type="checkbox" name="addfiles" value="1" ' . (isset($_POST['addfiles']) ? 'checked="checked" ' : '') . '/> ' . $lng_forum['add_file'];
 if ($set_user['translit']) {
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:say.php

示例2: while

      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>';
          echo '<p><form action="index.php" method="get">
 <input type="hidden" name="act" value="comments"/>
 <input type="hidden" name="id" value="' . $id . '"/>
 <input type="text" name="page" size="2"/>
 <input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/></form></p>';
      }
  } else {
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:comments.php

示例3: imageJpeg

             case "jpeg":
                 $imagnam = "temp/{$namefile}.temp.jpg";
                 imageJpeg($im1, $imagnam, $quality);
                 echo "<img src='" . $imagnam . "' alt=''/><br/>";
                 break;
             case "png":
                 $imagnam = "temp/{$namefile}.temp.png";
                 imagePng($im1, $imagnam, $quality);
                 echo "<img src='" . $imagnam . "' alt=''/><br/>";
                 break;
         }
         imagedestroy($im);
         imagedestroy($im1);
         $kom = mysql_query("select * from `gallery` where type='km' and refid='" . $newf['id'] . "';");
         $kom1 = mysql_num_rows($kom);
         echo "</a><br/>" . $lng['date'] . ': ' . functions::display_date($newf['time']) . '<br/>' . $lng['description'] . ": {$newf['text']}<br/>";
         $al = mysql_query("select * from `gallery` where type = 'al' and id = '" . $newf['refid'] . "';");
         $al1 = mysql_fetch_array($al);
         $rz = mysql_query("select * from `gallery` where type = 'rz' and id = '" . $al1['refid'] . "';");
         $rz1 = mysql_fetch_array($rz);
         echo '<a href="index.php?id=' . $al1['id'] . '">' . $rz1['text'] . '&#160;/&#160;' . $al1['text'] . '</a></div>';
     }
     ++$i;
 }
 if ($totalnew > 10) {
     echo "<hr/>";
     $ba = ceil($totalnew / 10);
     if ($start != 0) {
         echo '<a href="index.php?act=new&amp;page=' . ($page - 1) . '">&lt;&lt;</a> ';
     }
     $asd = $start - 10;
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:new.php

示例4: mysql_query

                mysql_query("UPDATE `cms_album_files` SET `views` = '{$views}' WHERE `id` = '" . $res['id'] . "'");
            }
        } else {
            /*
            -----------------------------------------------------------------
            Предпросмотр изображения в списке
            -----------------------------------------------------------------
            */
            echo '<a href="album.php?act=show&amp;al=' . $al . '&amp;img=' . $res['id'] . '&amp;user=' . $user['id'] . '&amp;view"><img src="../files/users/album/' . $user['id'] . '/' . $res['tmb_name'] . '" /></a>';
        }
        if (!empty($res['description'])) {
            echo '<div class="gray">' . functions::smileys(functions::checkout($res['description'], 1)) . '</div>';
        }
        echo '<div class="sub">';
        if ($user['id'] == $user_id || core::$user_rights >= 6) {
            echo functions::display_menu(array('<a href="album.php?act=image_edit&amp;img=' . $res['id'] . '&amp;user=' . $user['id'] . '">' . $lng['edit'] . '</a>', '<a href="album.php?act=image_move&amp;img=' . $res['id'] . '&amp;user=' . $user['id'] . '">' . $lng['move'] . '</a>', '<a href="album.php?act=image_delete&amp;img=' . $res['id'] . '&amp;user=' . $user['id'] . '">' . $lng['delete'] . '</a>'));
            if ($user['id'] == $user_id && $view) {
                echo ' | <a href="album.php?act=show&amp;al=' . $al . '&amp;user=' . $user['id'] . '&amp;view&amp;img=' . $res['id'] . '&amp;profile">' . $lng_profile['photo_profile'] . '</a>';
            }
        }
        echo vote_photo($res) . '<div class="gray">' . $lng['count_views'] . ': ' . $res['views'] . ', ' . $lng['count_downloads'] . ': ' . $res['downloads'] . '</div>' . '<div class="gray">' . $lng['date'] . ': ' . functions::display_date($res['time']) . '</div>' . '<a href="album.php?act=comments&amp;img=' . $res['id'] . '">' . $lng['comments'] . '</a> (' . $res['comm_count'] . ')<br />' . '<a href="album.php?act=image_download&amp;img=' . $res['id'] . '">' . $lng['download'] . '</a>' . '</div></div>';
        ++$i;
    }
} else {
    echo '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>';
}
echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
if ($total > $kmess) {
    echo '<div class="topmenu">' . functions::display_pagination('album.php?act=show&amp;al=' . $al . '&amp;user=' . $user['id'] . '&amp;' . ($view ? 'view&amp;' : ''), $start, $total, $kmess) . '</div>' . '<p><form action="album.php?act=show&amp;al=' . $al . '&amp;user=' . $user['id'] . ($view ? '&amp;view' : '') . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/>' . '</form></p>';
}
echo '<p><a href="album.php?act=list&amp;user=' . $user['id'] . '">' . $lng_profile['album_list'] . '</a></p>';
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:show.php

示例5: mysql_query

 if (!$search_t) {
     // Поиск только в тексте
     $req_t = mysql_query("SELECT `id`,`text` FROM `forum` WHERE `id` = '" . $res['refid'] . "'");
     $res_t = mysql_fetch_assoc($req_t);
     echo '<b>' . $res_t['text'] . '</b><br />';
 } else {
     // Поиск в названиях тем
     $req_p = mysql_query("SELECT `text` FROM `forum` WHERE `refid` = '" . $res['id'] . "' ORDER BY `id` ASC LIMIT 1");
     $res_p = mysql_fetch_assoc($req_p);
     foreach ($array as $val) {
         $res['text'] = ReplaceKeywords($val, $res['text']);
     }
     echo '<b>' . $res['text'] . '</b><br />';
 }
 echo '<a href="../users/profile.php?user=' . $res['user_id'] . '">' . $res['from'] . '</a> ';
 echo ' <span class="gray">(' . functions::display_date($res['time']) . ')</span><br/>';
 $text = $search_t ? $res_p['text'] : $res['text'];
 foreach ($array as $srch) {
     if (($pos = mb_strpos(strtolower($res['text']), strtolower(str_replace('*', '', $srch)))) !== false) {
         break;
     }
 }
 if (!isset($pos) || $pos < 100) {
     $pos = 100;
 }
 $text = preg_replace('#\\[c\\](.*?)\\[/c\\]#si', '<div class="quote">\\1</div>', $text);
 $text = functions::checkout(mb_substr($text, $pos - 100, 400), 1);
 if (!$search_t) {
     foreach ($array as $val) {
         $text = ReplaceKeywords($val, $text);
     }
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:search.php

示例6: mysql_query

if ($total > $kmess) {
    echo '<div class="topmenu">' . functions::display_pagination('index.php?act=online&amp;' . ($mod ? 'mod=' . $mod . '&amp;' : ''), $start, $total, $kmess) . '</div>';
}
if ($total) {
    $req = mysql_query($sql_list . "{$start}, {$kmess}");
    $i = 0;
    while (($res = mysql_fetch_assoc($req)) !== false) {
        if ($res['id'] == core::$user_id) {
            echo '<div class="gmenu">';
        } else {
            echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
        }
        $arg['stshide'] = 1;
        $arg['header'] = ' <span class="gray">(';
        if ($mod == 'history') {
            $arg['header'] .= functions::display_date($res['sestime']);
        } else {
            $arg['header'] .= $res['movings'] . ' - ' . functions::timecount(time() - $res['sestime']);
        }
        $arg['header'] .= ')</span><br /><img src="../images/info.png" width="16" height="16" align="middle" />&#160;' . functions::display_place($res['id'], $res['place']);
        echo functions::display_user($res, $arg);
        echo '</div>';
        ++$i;
    }
} else {
    echo '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>';
}
echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
if ($total > $kmess) {
    echo '<div class="topmenu">' . functions::display_pagination('index.php?act=online&amp;' . ($mod ? 'mod=' . $mod . '&amp;' : ''), $start, $total, $kmess) . '</div>' . '<p><form action="index.php?act=online' . ($mod ? '&amp;mod=' . $mod : '') . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/>' . '</form></p>';
}
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:online.php

示例7: preg_replace

        if (!isset($_GET['yes'])) {
            $lng_faq = core::load_lng('faq');
            echo '<p>' . $lng_faq['forum_rules_text'] . '</p>';
            echo '<p><a href="index.php?act=nt&amp;id=' . $id . '&amp;yes">' . $lng_forum['agree'] . '</a> | <a href="index.php?id=' . $id . '">' . $lng_forum['not_agree'] . '</a></p>';
            require '../incfiles/end.php';
            exit;
        }
    }
    $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="index.php?id=' . $id . '"><b>' . $lng['forum'] . '</b></a> | ' . $lng_forum['new_topic'] . '</div>';
    if ($msg && $th && !isset($_POST['submit'])) {
        echo '<div class="list1"><img src="../theme/default/images/op.gif" border="0" alt="op" /> <span style="font-weight: bold">' . $th . '</span></div>' . '<div class="list2">' . functions::display_user($datauser, array('iphide' => 1, 'header' => '<span class="gray">(' . functions::display_date(time()) . ')</span>', 'body' => $msg_pre)) . '</div>';
    }
    echo '<form name="form" action="index.php?act=nt&amp;id=' . $id . '" method="post">' . '<div class="gmenu">' . '<p><h3>' . $lng['section'] . '</h3>' . '<a href="index.php?id=' . $res_c['id'] . '">' . $res_c['text'] . '</a> | <a href="index.php?id=' . $res_r['id'] . '">' . $res_r['text'] . '</a></p>' . '<p><h3>' . $lng_forum['new_topic_name'] . '</h3>';
    echo '<select name="tiento">
			<option value="0">No Prefix</option>
			<option value="1">Discuss</option>
			<option value="2">Share</option>
			<option value="3">Info</option>
			<option value="4">Tutorial</option>
			<option value="5">Help</option>
			<option value="6">Ask</option>
			<option value="7">Request</option>
			<option value="8">Movie</option>
			<option value="9">Ongoing</option>
			<option value="10">Completed</option>
		</select>
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:nt.php

示例8: foreach

            }
            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>';
    }
    echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
    if ($total > $kmess) {
        echo '<div class="topmenu">' . functions::display_pagination('search.php?' . ($search_t ? 't=1&amp;' : '') . 'search=' . urlencode($search) . '&amp;', $start, $total, $kmess) . '</div>' . '<p><form action="search.php?' . ($search_t ? 't=1&amp;' : '') . 'search=' . urlencode($search) . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/>' . '</form></p>';
    }
} else {
    if ($error) {
        echo functions::display_error($error);
    }
    echo '<div class="phdr"><small>' . $lng['search_help'] . '</small></div>';
}
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:search.php

示例9: mysql_query

         }
     }
     // Удаляем посты
     mysql_query("DELETE FROM `forum` WHERE `type` = 'm' AND `close` = '1' {$sort}");
     header('Location: index.php?act=forum&mod=hposts');
 } else {
     $total = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type` = 'm' AND `close` = '1' {$sort}"), 0);
     if ($total > $kmess) {
         echo '<div class="topmenu">' . functions::display_pagination('index.php?act=forum&amp;mod=hposts&amp;', $start, $total, $kmess) . '</div>';
     }
     $req = mysql_query("SELECT `forum`.*, `forum`.`id` AS `fid`, `forum`.`user_id` AS `id`, `forum`.`from` AS `name`, `forum`.`soft` AS `browser`, `users`.`rights`, `users`.`lastdate`, `users`.`sex`, `users`.`status`, `users`.`datereg`\n            FROM `forum` LEFT JOIN `users` ON `forum`.`user_id` = `users`.`id`\n            WHERE `forum`.`type` = 'm' AND `forum`.`close` = '1' {$sort} ORDER BY `forum`.`id` DESC LIMIT {$start}, {$kmess}");
     if (mysql_num_rows($req)) {
         $i = 0;
         while ($res = mysql_fetch_assoc($req)) {
             $res['ip'] = ip2long($res['ip']);
             $posttime = ' <span class="gray">(' . functions::display_date($res['time']) . ')</span>';
             $page = ceil(mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `refid` = '" . $res['refid'] . "' AND `id` " . ($set_forum['upfp'] ? ">=" : "<=") . " '" . $res['fid'] . "'"), 0) / $kmess);
             $text = mb_substr($res['text'], 0, 500);
             $text = functions::checkout($text, 1, 0);
             $text = preg_replace('#\\[c\\](.*?)\\[/c\\]#si', '<div class="quote">\\1</div>', $text);
             $theme = mysql_fetch_assoc(mysql_query("SELECT `id`, `text` FROM `forum` WHERE `id` = '" . $res['refid'] . "'"));
             $text = '<b>' . $theme['text'] . '</b> <a href="../forum/index.php?id=' . $theme['id'] . '&amp;page=' . $page . '">&gt;&gt;</a><br />' . $text;
             $subtext = '<span class="gray">' . $lng_forum['filter_to'] . ':</span> ';
             $subtext .= '<a href="index.php?act=forum&amp;mod=hposts&amp;tsort=' . $theme['id'] . '">' . $lng_forum['by_theme'] . '</a> | ';
             $subtext .= '<a href="index.php?act=forum&amp;mod=hposts&amp;usort=' . $res['user_id'] . '">' . $lng_forum['by_author'] . '</a>';
             echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
             echo functions::display_user($res, array('header' => $posttime, 'body' => $text, 'sub' => $subtext));
             echo '</div>';
             ++$i;
         }
         if ($rights == 9) {
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:forum.php

示例10: mysql_query

                    $q3 = mysql_query("SELECT `id`, `refid`, `text` FROM `forum` WHERE `type` = 'r' AND `id` = '" . $res['refid'] . "' LIMIT 1");
                    $razd = mysql_fetch_assoc($q3);
                    $q4 = mysql_query("SELECT `id`, `text` FROM `forum` WHERE `type`='f' AND `id` = '" . $razd['refid'] . "' LIMIT 1");
                    $frm = mysql_fetch_assoc($q4);
                    $colmes = mysql_query("SELECT `from`, `time` FROM `forum` WHERE `refid` = '" . $res['id'] . "' AND `type` = 'm'" . ($rights >= 7 ? '' : " AND `close` != '1'") . " ORDER BY `time` DESC");
                    $colmes1 = mysql_num_rows($colmes);
                    $cpg = ceil($colmes1 / $kmess);
                    $nick = mysql_fetch_assoc($colmes);
                    // Значки
                    $icons = array(isset($np) ? !$res['vip'] ? '<img src="../theme/' . $set_user['skin'] . '/images/op.gif" alt=""/>' : '' : '<img src="../theme/' . $set_user['skin'] . '/images/np.gif" alt=""/>', $res['vip'] ? '<img src="../theme/' . $set_user['skin'] . '/images/pt.gif" alt=""/>' : '', $res['realid'] ? '<img src="../theme/' . $set_user['skin'] . '/images/rate.gif" alt=""/>' : '', $res['edit'] ? '<img src="../theme/' . $set_user['skin'] . '/images/tz.gif" alt=""/>' : '');
                    echo functions::display_menu($icons, '&#160;', '&#160;');
                    echo '<a href="index.php?id=' . $res['id'] . ($cpg > 1 && $set_forum['upfp'] && $set_forum['postclip'] ? '&amp;clip' : '') . ($set_forum['upfp'] && $cpg > 1 ? '&amp;page=' . $cpg : '') . '">' . $res['text'] . '</a>&#160;[' . $colmes1 . ']';
                    if ($cpg > 1) {
                        echo '&#160;<a href="index.php?id=' . $res['id'] . (!$set_forum['upfp'] && $set_forum['postclip'] ? '&amp;clip' : '') . ($set_forum['upfp'] ? '' : '&amp;page=' . $cpg) . '">&gt;&gt;</a>';
                    }
                    echo '<div class="sub">' . $res['from'] . ($colmes1 > 1 ? '&#160;/&#160;' . $nick['from'] : '') . ' <span class="gray">(' . functions::display_date($nick['time']) . ')</span><br />' . '<a href="index.php?id=' . $frm['id'] . '">' . $frm['text'] . '</a>&#160;/&#160;<a href="index.php?id=' . $razd['id'] . '">' . $razd['text'] . '</a>' . '</div></div>';
                }
            } else {
                echo '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>';
            }
            echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
            if ($total > $kmess) {
                echo '<div class="topmenu">' . functions::display_pagination('index.php?act=new&amp;', $start, $total, $kmess) . '</div>' . '<p><form action="index.php" method="get">' . '<input type="hidden" name="act" value="new"/>' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/>' . '</form></p>';
            }
            echo '<p>';
            if ($total) {
                echo '<a href="index.php?act=new&amp;do=reset">' . $lng_forum['unread_reset'] . '</a><br/>';
            }
            echo '<a href="index.php?act=new&amp;do=select">' . $lng_forum['unread_show_for_period'] . '</a></p>';
    }
} else {
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:new.php

示例11: __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

示例12: defined

* @dev 			agssbuzz@catroxs.org
*/
defined('_IN_JOHNCMS') or die('Error: restricted access');
require '../incfiles/head.php';
if (empty($_GET['id'])) {
    echo functions::display_error($lng['error_wrong_data']);
    require '../incfiles/end.php';
    exit;
}
// pesan permintaan
$req = mysql_query("SELECT `forum`.*, `users`.`sex`, `users`.`rights`, `users`.`lastdate`, `users`.`status`, `users`.`datereg`\nFROM `forum` LEFT JOIN `users` ON `forum`.`user_id` = `users`.`id`\nWHERE `forum`.`type` = 'm' AND `forum`.`id` = '{$id}'" . ($rights >= 7 ? "" : " AND `forum`.`close` != '1'") . " LIMIT 1");
$res = mysql_fetch_array($req);
// Query Alat
$them = mysql_fetch_array(mysql_query("SELECT * FROM `forum` WHERE `type` = 't' AND `id` = '" . $res['refid'] . "'"));
echo '<div class="phdr"><b>' . $lng_forum['topic'] . ':</b> ' . $them['text'] . '</div><div class="list1">';
echo '<table width="100%" cellpadding="0" cellspacing="0" class="phdr"><tr>' . '<td width="auto"><img src="' . $home . '/images/file.png"> </img> (' . functions::display_date($res['time']) . ')</td>' . '</tr></table><div class="newsx">';
if ($set_user['avatar']) {
    echo '<table width="100%"><tr><td width="40px" align="left" valign="top">';
    if (file_exists('../files/users/avatar/' . $res['user_id'] . '.png')) {
        echo '<img src="../files/users/avatar/' . $res['user_id'] . '.png" width="32" height="32" alt="' . $res['from'] . '" />&#160;';
    } else {
        echo '<img src="../images/empty.png" width="32" height="32" alt="' . $res['from'] . '" />&#160;';
    }
    echo '</td>';
}
// jenis kelamin
if ($res['sex']) {
    echo '<img src="../theme/' . $set_user['skin'] . '/images/' . ($res['sex'] == 'm' ? 'm' : 'w') . '.png" alt=""  width="16" height="16"/>&#160;';
} else {
    echo '<img src="../images/del.png" width="12" height="12" />&#160;';
}
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:post.php

示例13: defined

 * @license     LICENSE.txt (see attached file)
 * @version     VERSION.txt (see attached file)
 * @author      http://johncms.com/about
 */
defined('_IN_JOHNCMS') or die('Error: restricted access');
echo '<div class="phdr"><b>' . $lng_lib['new_articles'] . '</b></div>';
$req = mysql_query("SELECT COUNT(*) FROM `lib` WHERE `time` > '" . (time() - 259200) . "' AND `type` = 'bk' AND `moder` = '1'");
$total = mysql_result($req, 0);
if ($total > 0) {
    $req = mysql_query("SELECT * FROM `lib` WHERE `time` > '" . (time() - 259200) . "' AND `type` = 'bk' AND `moder` = '1' ORDER BY `time` DESC LIMIT " . $start . "," . $kmess);
    $i = 0;
    while ($newf = mysql_fetch_array($req)) {
        echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
        echo '<b><a href="?id=' . $newf['id'] . '">' . htmlentities($newf['name'], ENT_QUOTES, 'UTF-8') . '</a></b><br/>';
        echo htmlentities($newf['announce'], ENT_QUOTES, 'UTF-8') . '<br />';
        echo $lng_lib['added'] . ': ' . $newf['avtor'] . ' (' . functions::display_date($newf['time']) . ')<br/>';
        $nadir = $newf['refid'];
        $dirlink = $nadir;
        $pat = "";
        while ($nadir != "0") {
            $dnew = mysql_query("select * from `lib` where type = 'cat' and id = '" . $nadir . "';");
            $dnew1 = mysql_fetch_array($dnew);
            $pat = $dnew1['text'] . '/' . $pat;
            $nadir = $dnew1['refid'];
        }
        $l = mb_strlen($pat);
        $pat1 = mb_substr($pat, 0, $l - 1);
        echo '[<a href="index.php?id=' . $dirlink . '">' . $pat1 . '</a>]</div>';
        ++$i;
    }
    echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:new.php

示例14: round

         $text = functions::smileys($text, $res['rights'] ? 1 : 0);
     }
     //seo
     //echo bbcode::notags($text) . '...<br /><a href="index.php?act=post&amp;id=' . $res['id'] . '">' . $lng_forum['read_all'] . ' &gt;&gt;</a>';
     echo bbcode::notags($text) . '...<br /><a href="' . $home . '/forum/' . functions::seo($type1['text']) . '_p' . $res['id'] . '.html">' . $lng_forum['read_all'] . ' &gt;&gt;</a>';
 } else {
     // Или, обрабатываем тэги и выводим весь текст
     $text = functions::checkout($text, 1, 1);
     if ($set_user['smileys']) {
         $text = functions::smileys($text, $res['rights'] ? 1 : 0);
     }
     echo $text;
 }
 if ($res['kedit']) {
     // Если пост редактировался, показываем кем и когда
     echo '<br /><span class="gray"><small>' . $lng_forum['edited'] . ' <b>' . $res['edit'] . '</b> (' . functions::display_date($res['tedit']) . ') <b>[' . $res['kedit'] . ']</b></small></span>';
 }
 // Если есть прикрепленный файл, выводим его описание
 $freq = mysql_query("SELECT * FROM `cms_forum_files` WHERE `post` = '" . $res['id'] . "'");
 if (mysql_num_rows($freq) > 0) {
     $fres = mysql_fetch_assoc($freq);
     $fls = round(@filesize('../files/forum/attach/' . $fres['filename']) / 1024, 2);
     echo '<br /><span class="gray">' . $lng_forum['attached_file'] . ':';
     // Предпросмотр изображений
     $att_ext = strtolower(functions::format('./files/forum/attach/' . $fres['filename']));
     $pic_ext = array('gif', 'jpg', 'jpeg', 'png');
     if (in_array($att_ext, $pic_ext)) {
         echo '<div><a href="index.php?act=file&amp;id=' . $fres['id'] . '">';
         echo '<img src="thumbinal.php?file=' . urlencode($fres['filename']) . '" alt="' . $lng_forum['click_to_view'] . '" /></a></div>';
     } else {
         echo '<br /><a href="index.php?act=file&amp;id=' . $fres['id'] . '">' . $fres['filename'] . '</a>';
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:index.php

示例15: mysql_result

        /*
        -----------------------------------------------------------------
        Список постов Форума
        -----------------------------------------------------------------
        */
        $total = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `user_id` = '" . $user['id'] . "' AND `type` = 'm'" . ($rights >= 7 ? '' : " AND `close`!='1'")), 0);
        echo '<div class="phdr"><b>' . $lng['forum'] . '</b>: ' . $lng['messages'] . '</div>';
        if ($total > $kmess) {
            echo '<div class="topmenu">' . functions::display_pagination('profile.php?act=activity&amp;user=' . $user['id'] . '&amp;', $start, $total, $kmess) . '</div>';
        }
        $req = mysql_query("SELECT * FROM `forum` WHERE `user_id` = '" . $user['id'] . "' AND `type` = 'm' " . ($rights >= 7 ? '' : " AND `close`!='1'") . " ORDER BY `id` DESC LIMIT {$start}, {$kmess}");
        if (mysql_num_rows($req)) {
            $i = 0;
            while ($res = mysql_fetch_assoc($req)) {
                $topic = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum` WHERE `id` = '" . $res['refid'] . "'"));
                $section = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum` WHERE `id` = '" . $topic['refid'] . "'"));
                $category = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum` WHERE `id` = '" . $section['refid'] . "'"));
                $text = mb_substr($res['text'], 0, 300);
                $text = functions::checkout($text, 2, 1);
                $text = preg_replace('#\\[c\\](.*?)\\[/c\\]#si', '<div class="quote">\\1</div>', $text);
                echo ($i % 2 ? '<div class="list2">' : '<div class="list1">') . '<a href="' . $set['homeurl'] . '/forum/index.php?id=' . $topic['id'] . '">' . $topic['text'] . '</a>' . '<br />' . $text . '...<a href="' . $set['homeurl'] . '/forum/index.php?act=post&amp;id=' . $res['id'] . '"> &gt;&gt;</a>' . '<div class="sub">' . '<a href="' . $set['homeurl'] . '/forum/index.php?id=' . $category['id'] . '">' . $category['text'] . '</a> | ' . '<a href="' . $set['homeurl'] . '/forum/index.php?id=' . $section['id'] . '">' . $section['text'] . '</a>' . '<br /><span class="gray">(' . functions::display_date($res['time']) . ')</span>' . '</div></div>';
                ++$i;
            }
        } else {
            echo '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>';
        }
}
echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
if ($total > $kmess) {
    echo '<div class="topmenu">' . functions::display_pagination('profile.php?act=activity' . ($mod ? '&amp;mod=' . $mod : '') . '&amp;user=' . $user['id'] . '&amp;', $start, $total, $kmess) . '</div>' . '<p><form action="profile.php?act=activity&amp;user=' . $user['id'] . ($mod ? '&amp;mod=' . $mod : '') . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' &gt;&gt;"/>' . '</form></p>';
}
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:activity.php


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