コード例 #1
0
ファイル: viewtopic.php プロジェクト: rhertzog/lcs
    }
}
$out .= $dialogBox->render();
//display edit form if any
if (isset($form)) {
    $formBox = new DialogBox();
    $formBox->form($form->render());
    $out .= $formBox->render() . '<hr />';
}
//display topic review if any
if ($topicSettingList) {
    // get post and use pager
    if (!$viewall) {
        $postLister = new postLister($topicId, $start, get_conf('posts_per_page'));
    } else {
        $postLister = new postLister($topicId, $start, get_total_posts($topicId, 'topic'));
        $incrementViewCount = false;
    }
    // get post and use pager
    $postList = $postLister->get_post_list();
    $totalPosts = $postLister->sqlPager->get_total_item_count();
    $pagerUrl = claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?topic=' . $topicId));
    //increment topic view count if required
    if ($incrementViewCount) {
        increase_topic_view_count($topicId);
        $claro_notifier->is_a_notified_ressource(claro_get_current_course_id(), $claro_notifier->get_notification_date(claro_get_current_user_id()), claro_get_current_user_id(), claro_get_current_group_id(), claro_get_current_tool_id(), $forumId . "-" . $topicId);
        //$claroline->notifier->event( 'forum_read_topic', array( 'data' => array( 'topic_id' => $topicId ) ) );
    }
    if ($is_postAllowed) {
        $cmdList = get_forum_toolbar_array('viewtopic', $forumSettingList['forum_id'], $forumSettingList['cat_id'], $topicId);
        if (count($postList) > 2) {
コード例 #2
0
ファイル: editpost.php プロジェクト: Jireck-npds/npds_dune
         forumerror('0001');
     }
     $sql = "UPDATE " . $NPDS_Prefix . "forumtopics SET topic_title = '{$subject}', topic_time = '" . date("Y-m-d H:i:s", time() + $gmt * 3600) . "', current_poster='" . $userdata['uid'] . "' WHERE topic_id = '" . $row['topic_id'] . "'";
     if (!($result = sql_query($sql))) {
         forumerror('0020');
     }
     redirect_url("{$hrefX}?topic=" . $row['topic_id'] . "&forum={$forum}");
 } else {
     $indice = sql_num_rows(sql_query("select post_id from " . $NPDS_Prefix . "posts where post_idH='{$post_id}'"));
     if (!$indice) {
         $sql = "DELETE FROM " . $NPDS_Prefix . "posts WHERE post_id='{$post_id}'";
         if (!($r = sql_query($sql))) {
             forumerror('0001');
         }
         control_efface_post("forum_npds", $post_id, "", "");
         if (get_total_posts($forum, $row['topic_id'], "topic", $Mmod) == 0) {
             $sql = "DELETE FROM " . $NPDS_Prefix . "forumtopics WHERE topic_id = '" . $row['topic_id'] . "'";
             if (!($r = sql_query($sql))) {
                 forumerror('0001');
             }
             $sql = "DELETE FROM " . $NPDS_Prefix . "forum_read WHERE topicid = '" . $row['topic_id'] . "'";
             @sql_query($sql);
             redirect_url("viewforum.php?forum={$forum}");
             die;
         } else {
             $result = sql_query("SELECT post_time, poster_id FROM " . $NPDS_Prefix . "posts where topic_id='" . $row['topic_id'] . "' ORDER BY post_id DESC limit 0,1");
             $rowX = sql_fetch_row($result);
             $sql = "UPDATE " . $NPDS_Prefix . "forumtopics SET topic_time = '{$rowX['0']}', current_poster='{$rowX['1']}' WHERE topic_id = '" . $row['topic_id'] . "'";
             if (!($r = sql_query($sql))) {
                 forumerror('0001');
             }
コード例 #3
0
ファイル: index.php プロジェクト: un1coin/ovn-space
<?php

// Get started
require_once 'admin.php';
require_once BB_PATH . BB_INC . 'functions.bb-statistics.php';
// Get counts and format numbers
$rn_forums = number_format(get_total_forums());
$rn_forums = sprintf(__ngettext('<span>%s</span> forum', '<span>%s</span> forums', $rn_forums), $rn_forums);
$rn_topics = number_format(get_total_topics());
$rn_topics = sprintf(__ngettext('<span>%s</span> topic', '<span>%s</span> topics', $rn_topics), $rn_topics);
$rn_posts = number_format(get_total_posts());
$rn_posts = sprintf(__ngettext('<span>%s</span> post', '<span>%s</span> posts', $rn_posts), $rn_posts);
$rn_users = number_format(bb_get_total_users());
$rn_users = sprintf(__ngettext('<span>%s</span> user', '<span>%s</span> users', $rn_users), $rn_users);
$rn_topic_tags = number_format(bb_get_total_topic_tags());
$rn_topic_tags = sprintf(__ngettext('<span>%s</span> tag', '<span>%s</span> tags', $rn_topic_tags), $rn_topic_tags);
$rn_topics_average = number_format(get_topics_per_day());
$rn_topics_average = sprintf(__ngettext('<span>%s</span> topic', '<span>%s</span> topics', $rn_topics_average), $rn_topics_average);
$rn_posts_average = number_format(get_posts_per_day());
$rn_posts_average = sprintf(__ngettext('<span>%s</span> post', '<span>%s</span> posts', $rn_posts_average), $rn_posts_average);
$rn_users_average = number_format(get_registrations_per_day());
$rn_users_average = sprintf(__ngettext('<span>%s</span> user', '<span>%s</span> users', $rn_users_average), $rn_users_average);
$rn_topic_tags_average = number_format(bb_get_topic_tags_per_day());
$rn_topic_tags_average = sprintf(__ngettext('<span>%s</span> tag', '<span>%s</span> tags', $rn_topic_tags_average), $rn_topic_tags_average);
// Filter the numbers
$rn = apply_filters('bb_admin_right_now', array('forums' => array($rn_forums, '-'), 'topics' => array($rn_topics, $rn_topics_average), 'posts' => array($rn_posts, $rn_posts_average), 'topic_tags' => array($rn_topic_tags, $rn_topic_tags_average), 'users' => array($rn_users, $rn_users_average)));
$bb_admin_body_class = ' bb-admin-dashboard';
bb_get_admin_header();
?>

<div class="wrap">
コード例 #4
0
ファイル: viewforum.php プロジェクト: npds/npds_dune
 }
 if ($ibid = theme_image("forum/icons/posticon.gif")) {
     $imgtmpP = $ibid;
 } else {
     $imgtmpP = "images/forum/icons/posticon.gif";
 }
 if ($ibid = theme_image("box/right.gif")) {
     $imgtmpRi = $ibid;
 } else {
     $imgtmpRi = "images/download/right.gif";
 }
 if ($myrow = sql_fetch_assoc($result)) {
     $linked = "onmouseover=\"this.className='lignb'; this.style.cursor='default';\" " . " onmouseout=\"this.className='ligna';\"";
     do {
         echo '<tr>';
         $replys = get_total_posts($forum, $myrow['topic_id'], "topic", $Mmod);
         $replys--;
         if ($replys >= 0) {
             global $smilies;
             if ($smilies) {
                 $rowQ1 = Q_Select("SELECT image FROM " . $NPDS_Prefix . "posts WHERE topic_id='" . $myrow['topic_id'] . "' AND forum_id='{$forum}' LIMIT 0,1", 86400);
                 $image_subject = $rowQ1[0]['image'];
             }
             if ($user) {
                 $sqlR = "SELECT rid FROM " . $NPDS_Prefix . "forum_read WHERE forum_id='{$forum}' AND uid='{$userR['0']}' AND topicid='" . $myrow['topic_id'] . "' AND status!='0'";
                 if ($replys >= $hot_threshold) {
                     if (sql_num_rows(sql_query($sqlR)) == 0) {
                         $image = '<i class="fa fa-lg fa-file-text"></i>';
                     } else {
                         $image = '<i class="fa fa-lg fa-file"></i>';
                     }
コード例 #5
0
/**
 * Get the average number of posts per day
 *
 * @since 0.7.2
 *
 * @return int|float
 */
function get_posts_per_day()
{
    return get_total_posts() / ceil((time() - bb_get_inception('timestamp')) / 3600 / 24);
}
コード例 #6
0
ファイル: newtopic.php プロジェクト: kostastzo/openeclass
 }
 $message = purify($message);
 $poster_ip = $_SERVER['REMOTE_ADDR'];
 $time = date("Y-m-d H:i:s");
 $topic_id = Database::get()->query("INSERT INTO forum_topic (title, poster_id, forum_id, topic_time) VALUES (?s, ?d, ?d, ?t)", $subject, $uid, $forum_id, $time)->lastInsertID;
 Indexer::queueAsync(Indexer::REQUEST_STORE, Indexer::RESOURCE_FORUMTOPIC, $topic_id);
 $post_id = Database::get()->query("INSERT INTO forum_post (topic_id, post_text, poster_id, post_time, poster_ip) VALUES (?d, ?s, ?d, ?t, ?s)", $topic_id, $message, $uid, $time, $poster_ip)->lastInsertID;
 Indexer::queueAsync(Indexer::REQUEST_STORE, Indexer::RESOURCE_FORUMPOST, $post_id);
 $forum_user_stats = Database::get()->querySingle("SELECT COUNT(*) as c FROM forum_post \n                        INNER JOIN forum_topic ON forum_post.topic_id = forum_topic.id\n                        INNER JOIN forum ON forum.id = forum_topic.forum_id\n                        WHERE forum_post.poster_id = ?d AND forum.course_id = ?d", $uid, $course_id);
 Database::get()->query("DELETE FROM forum_user_stats WHERE user_id = ?d AND course_id = ?d", $uid, $course_id);
 Database::get()->query("INSERT INTO forum_user_stats (user_id, num_posts, course_id) VALUES (?d,?d,?d)", $uid, $forum_user_stats->c, $course_id);
 Database::get()->query("UPDATE forum_topic\n                    SET last_post_id = ?d\n                WHERE id = ?d\n                AND forum_id = ?d", $post_id, $topic_id, $forum_id);
 Database::get()->query("UPDATE forum\n                    SET num_topics = num_topics+1,\n                    num_posts = num_posts+1,\n                    last_post_id = ?d\n\t\tWHERE id = ?d", $post_id, $forum_id);
 $topic = $topic_id;
 $total_forum = get_total_topics($forum_id);
 $total_topic = get_total_posts($topic) - 1;
 // subtract 1 because we want the number of replies, not the number of posts.
 // --------------------------------
 // notify users
 // --------------------------------
 $subject_notify = "{$logo} - {$langNewForumNotify}";
 $category_id = forum_category($forum_id);
 $cat_name = category_name($category_id);
 $c = course_code_to_title($course_code);
 $name = uid_to_name($uid);
 $title = course_id_to_title($course_id);
 $forum_message = "-------- {$langBodyMessage} ({$langSender}: {$name})\n{$message}--------";
 $plain_forum_message = q(html2text($forum_message));
 $body_topic_notify = "{$langBodyForumNotify} {$langInForums} '" . q($forum_name) . "' \n                               {$langInCat} '" . q($cat_name) . "' {$langTo} {$langCourseS} '{$c}' <br /><br />" . q($forum_message) . "<br />\n                               <br />{$gunet}<br /><a href='{$urlServer}courses/{$course_code}'>{$urlServer}courses/{$course_code}</a>";
 $plain_body_topic_notify = "{$langBodyForumNotify} {$langInForums} '" . q($forum_name) . "' {$langInCat} '" . q($cat_name) . "' {$langTo} {$langCourseS} '{$c}' \n\n{$plain_forum_message} \n\n{$gunet}\n<a href='{$urlServer}courses/{$course_code}'>{$urlServer}courses/{$course_code}</a>";
 $linkhere = "&nbsp;<a href='{$urlServer}main/profile/emailunsubscribe.php?cid={$course_id}'>{$langHere}</a>.";
コード例 #7
0
ファイル: index.new.php プロジェクト: severnaya99/Sg-2010
include XOOPS_ROOT_PATH."/header.php";

$xoopsTpl->assign('xoops_pagetitle', $xoops_pagetitle);
$xoopsTpl->assign('xoops_module_header', $xoops_module_header);
$xoopsTpl->assign('forum_index_title', $xforum_index_title);
if ($xoopsModuleConfig['wol_enabled']){
	$online_handler =& xoops_getmodulehandler('online', 'xforum');
	$online_handler->init();
    $xoopsTpl->assign('online', $online_handler->show_online());
}

/* display forum stats */
$xoopsTpl->assign(array(
	"lang_welcomemsg" => sprintf(_MD_WELCOME, htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)), 
	"total_topics" => get_total_topics(), 
	"total_posts" => get_total_posts(), 
	"lang_lastvisit" => sprintf(_MD_LASTVISIT,formatTimestamp($last_visit)), 
	"lang_currenttime" => sprintf(_MD_TIMENOW,formatTimestamp(time(),"m"))));

$xforum_handler =& xoops_getmodulehandler('forum', 'xforum');
$xforums_obj = $xforum_handler->getForumsByCategory(array_keys($categories), "access");
$xforums_array = $xforum_handler->display($xforums_obj);
unset($xforums_obj);

if(count($xforums_array)>0){
    foreach ($xforums_array[0] as $parent => $xforum) {
        if (isset($xforums_array[$xforum['forum_id']])) {
            $xforum['subforum'] =& $xforums_array[$xforum['forum_id']];
        }
        $xforumsByCat[$xforum['forum_cid']][] = $xforum;
    }
コード例 #8
0
ファイル: index.php プロジェクト: abc2mit/abc2mit.github.io
<?php

require_once 'admin.php';
require_once BB_PATH . BB_INC . 'functions.bb-statistics.php';
$rn_forums = get_total_forums();
$rn_forums = sprintf(__ngettext('<span>%d</span> forum', '<span>%d</span> forums', $rn_forums), $rn_forums);
$rn_topics = get_total_topics();
$rn_topics = sprintf(__ngettext('<span>%d</span> topic', '<span>%d</span> topics', $rn_topics), $rn_topics);
$rn_posts = get_total_posts();
$rn_posts = sprintf(__ngettext('<span>%d</span> post', '<span>%d</span> posts', $rn_posts), $rn_posts);
$rn_users = bb_get_total_users();
$rn_users = sprintf(__ngettext('<span>%d</span> user', '<span>%d</span> users', $rn_users), $rn_users);
$rn_topic_tags = bb_get_total_topic_tags();
$rn_topic_tags = sprintf(__ngettext('<span>%d</span> tag', '<span>%d</span> tags', $rn_topic_tags), $rn_topic_tags);
$rn_topics_average = get_topics_per_day();
$rn_topics_average = sprintf(__ngettext('<span>%d</span> topic', '<span>%d</span> topics', $rn_topics_average), $rn_topics_average);
$rn_posts_average = get_posts_per_day();
$rn_posts_average = sprintf(__ngettext('<span>%d</span> post', '<span>%d</span> posts', $rn_posts_average), $rn_posts_average);
$rn_users_average = get_registrations_per_day();
$rn_users_average = sprintf(__ngettext('<span>%d</span> user', '<span>%d</span> users', $rn_users_average), $rn_users_average);
$rn_topic_tags_average = bb_get_topic_tags_per_day();
$rn_topic_tags_average = sprintf(__ngettext('<span>%d</span> tag', '<span>%d</span> tags', $rn_topic_tags_average), $rn_topic_tags_average);
$bb_admin_body_class = ' bb-admin-dashboard';
bb_get_admin_header();
?>

<div class="wrap">
	<h2><?php 
_e('Dashboard');
?>
</h2>
コード例 #9
0
ファイル: reply.php プロジェクト: kostastzo/openeclass
    $forum_message = "-------- {$langBodyMessage} ({$langSender}: {$name} )\n{$message}--------";
    $plain_forum_message = q(html2text($forum_message));
    $body_topic_notify = "<br>{$langBodyTopicNotify} {$langInForum} '" . q($topic_title) . "' {$langOfForum} '" . q($forum_name) . "' \n                                {$langInCat} '" . q($cat_name) . "' {$langTo} {$langCourseS} '{$c}'  <br />\n                                <br />" . q($forum_message) . "<br /><br />{$gunet}<br />\n                                <a href='{$urlServer}{$course_code}'>{$urlServer}{$course_code}</a>";
    $plain_body_topic_notify = "{$langBodyTopicNotify} {$langInForum} '" . q($topic_title) . "' {$langOfForum} " . q($forum_name) . "' {$langInCat} '" . q($cat_name) . "' {$langTo} {$langCourseS} '{$c}' \n\n{$plain_forum_message} \n\n{$gunet}\n<a href='{$urlServer}{$course_code}'>{$urlServer}{$course_code}</a>";
    $linkhere = "&nbsp;<a href='{$urlServer}main/profile/emailunsubscribe.php?cid={$course_id}'>{$langHere}</a>.";
    $unsubscribe = "<br /><br />{$langNote}: " . sprintf($langLinkUnsubscribe, $title);
    $plain_body_topic_notify .= $unsubscribe . $linkhere;
    $body_topic_notify .= $unsubscribe . $linkhere;
    foreach ($sql as $r) {
        if (get_user_email_notification($r->user_id, $course_id)) {
            $emailaddr = uid_to_email($r->user_id);
            send_mail_multipart('', '', '', $emailaddr, $subject_notify, $plain_body_topic_notify, $body_topic_notify, $charset);
        }
    }
    // end of notification
    $total_posts = get_total_posts($topic);
    if ($total_posts > $posts_per_page) {
        $page = '&start=' . $posts_per_page * intval(($total_posts - 1) / $posts_per_page);
    } else {
        $page = '';
    }
    $_SESSION['message'] = "<div class='alert alert-success'>{$langStored}</div>";
    header("Location: {$urlServer}modules/forum/viewtopic.php?course={$course_code}&topic={$topic}&forum={$forum_id}" . $page);
    exit;
} else {
    // Topic review
    $tool_content .= action_bar(array(array('title' => $langBack, 'url' => "viewtopic.php?course={$course_code}&topic={$topic}&forum={$forum_id}", 'icon' => 'fa-reply', 'level' => 'primary-label')));
    if (!isset($reply)) {
        $reply = "";
    }
    $tool_content .= "\n    <div class='form-wrapper'>\n        <form class='form-horizontal' role='form' action='{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;topic={$topic}&forum={$forum_id}' method='post'>\n            <input type='hidden' name='parent_post' value='{$parent_post}'>\n            <fieldset>\n            <div class='form-group'>\n              <label for='message' class='col-sm-2 control-label'>{$langBodyMessage}:</label>\n              <div class='col-sm-10'>\n                " . rich_text_editor('message', 15, 70, $reply) . "\n              </div>\n            </div>\n            <div class='form-group'>\n                <div class='col-sm-10 col-sm-offset-2'>\n                    <input class='btn btn-primary' type='submit' name='submit' value='{$langSubmit}'>\n                    <a class='btn btn-default' href='viewtopic.php?course={$course_code}&topic={$topic}&forum={$forum_id}'>{$langCancel}</a>\n                </div>\n            </div>              \n        </fieldset>\n\t</form>\n    </div>";
コード例 #10
0
ファイル: footer.php プロジェクト: BogusCurry/Luna
    ?>
</div>
								</div>
							</div>
						</div>
						<div class="col-md-4 col-sm-6 col-xs-12 statistics">
							<div class="row">
								<div class="col-xs-6">
									<div class="statistic-item"><?php 
    total_posts();
    ?>
</div>
								</div>
								<div class="col-xs-6">
									<div class="statistic-item-stat"><?php 
    echo _n('Post', 'Posts', get_total_posts(), 'luna');
    ?>
</div>
								</div>
							</div>
						</div>
						<div class="col-md-4 col-sm-6 col-xs-12 statistics">
							<div class="row">
								<div class="col-xs-6">
									<div class="statistic-item"><?php 
    newest_user();
    ?>
</div>
								</div>
								<div class="col-xs-6">
									<div class="statistic-item-stat"><?php 
コード例 #11
0
ファイル: footer.php プロジェクト: istrwei/Luna
    ?>
</div>
								</div>
							</div>
						</div>
						<div class="col-md-4 col-sm-6 col-xs-12 statistics">
							<div class="row">
								<div class="col-xs-6">
									<div class="statistic-item"><?php 
    total_posts();
    ?>
</div>
								</div>
								<div class="col-xs-6">
									<div class="statistic-item-stat"><?php 
    echo _n('Comment', 'Comments', get_total_posts(), 'luna');
    ?>
</div>
								</div>
							</div>
						</div>
						<div class="col-md-4 col-sm-6 col-xs-12 statistics">
							<div class="row">
								<div class="col-xs-6">
									<div class="statistic-item"><?php 
    newest_user();
    ?>
</div>
								</div>
								<div class="col-xs-6">
									<div class="statistic-item-stat"><?php 
コード例 #12
0
ファイル: index.php プロジェクト: BackupTheBerlios/soopa
    redirect_header($url, 2, _MD_ALL_FORUM_MARKED . ' ' . $markresult);
}
$xoopsOption['template_main'] = 'newbb_index.html';
include XOOPS_ROOT_PATH . "/header.php";
if (!empty($xoopsModuleConfig['rss_enable'])) {
    $xoops_module_header .= '<link rel="alternate" type="application/xml+rss" title="' . $xoopsModule->getVar('name') . '" href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/rss.php" />';
}
$xoopsTpl->assign('xoops_module_header', $xoops_module_header);
if ($xoopsModuleConfig['wol_enabled']) {
    $online_handler =& xoops_getmodulehandler('online', 'newbb');
    $online_handler->init();
    $xoopsTpl->assign('online', $online_handler->show_online());
    $xoopsTpl->assign('color_admin', $xoopsModuleConfig['wol_admin_col']);
    $xoopsTpl->assign('color_mod', $xoopsModuleConfig['wol_mod_col']);
}
$xoopsTpl->assign(array("lang_welcomemsg" => sprintf(_MD_WELCOME, htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)), "total_topics" => get_total_topics(), "total_posts" => get_total_posts(0, 'all'), "lang_lastvisit" => sprintf(_MD_LASTVISIT, formatTimestamp($last_visit)), "lang_currenttime" => sprintf(_MD_TIMENOW, formatTimestamp(time(), "m"))));
$viewcat = !empty($_GET['cat']) ? intval($_GET['cat']) : 0;
$category_handler =& xoops_getmodulehandler('category', 'newbb');
if (!$viewcat) {
    $categories =& $category_handler->getAllCats("access");
    $xoopsTpl->assign('forum_index_title', '');
} else {
    $cat =& $category_handler->get($viewcat);
    if ($category_handler->getPermission($cat)) {
        $categories = array($cat);
    } else {
        $categories = array();
    }
    $xoopsTpl->assign('forum_index_title', sprintf(_MD_FORUMINDEX, htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)));
}
if (count($categories) == 0) {
コード例 #13
0
ファイル: statistic_functions.php プロジェクト: istrwei/Luna
function total_posts()
{
    echo get_total_posts();
}
コード例 #14
0
ファイル: abla.php プロジェクト: Jireck-npds/npds_dune
        if ($myrow = sql_fetch_assoc($sub_result)) {
            echo "<tbody><tr><td class=\"active\" colspan=\"7\">" . stripslashes($cat_title) . "</td></tr>";
            do {
                $num_for++;
                $last_post = get_last_post($myrow['forum_id'], "forum", "infos", true);
                echo "<tr>";
                $total_topics = get_total_topics($myrow['forum_id']);
                echo "<td><i class=\"fa fa-lg fa-file-text-o\"></i></td>";
                $name = stripslashes($myrow['forum_name']);
                $xfile .= "\$xforum[{$num_for}][1] = \"{$name}\";\n";
                $xfile .= "\$xforum[{$num_for}][2] = {$total_topics};\n";
                echo "<td><a href=\"viewforum.php?forum=" . $myrow['forum_id'] . "\" class=\"noir\"><span class=\"rouge\">" . $xforum[$num_for][1] . "</span> -/- {$name} </a>\n";
                $desc = stripslashes($myrow['forum_desc']);
                echo "<br />{$desc}</td>\n";
                echo "<td><span class=\"rouge\">" . $xforum[$num_for][2] . "</span> -/- {$total_topics}</td>\n";
                $total_posts = get_total_posts($myrow['forum_id'], "", "forum", false);
                $xfile .= "\$xforum[{$num_for}][3] = {$total_posts};\n";
                echo "<td><span class=\"rouge\">" . $xforum[$num_for][3] . "</span> -/- {$total_posts}</td>\n";
                echo "<td>{$last_post}</td>\n";
            } while ($myrow = sql_fetch_assoc($sub_result));
        }
    }
    echo "</tr></tbody></table>";
    $file = fopen("abla.log.php", "w");
    $xfile .= "?>\n";
    fwrite($file, $xfile);
    fclose($file);
    include "footer.php";
} else {
    redirect_url("index.php");
}
コード例 #15
0
ファイル: viewtopic.php プロジェクト: npds/npds_dune
    $userX = base64_decode($user);
    $userdata = explode(':', $userX);
}
$moderator = get_moderator($mod);
$moderator = explode(' ', $moderator);
$Mmod = false;
if (isset($user)) {
    for ($i = 0; $i < count($moderator); $i++) {
        if ($userdata[1] == $moderator[$i]) {
            $Mmod = true;
            break;
        }
    }
}
$sql = "SELECT topic_title, topic_status, topic_poster FROM " . $NPDS_Prefix . "forumtopics WHERE topic_id = '{$topic}'";
$total = get_total_posts($forum, $topic, "topic", $Mmod);
if ($total > $posts_per_page) {
    $times = 0;
    $current_page = 0;
    for ($x = 0; $x < $total; $x += $posts_per_page) {
        if ($x >= $start and $current_page == 0) {
            $current_page = $times + 1;
        }
        $times++;
    }
    $pages = $times;
}
if (!($result = sql_query($sql))) {
    forumerror('0001');
}
$myrow = sql_fetch_assoc($result);
コード例 #16
0
ファイル: index.php プロジェクト: severnaya99/Sg-2010
 echo "</div>";
 echo "<div style='padding: 8px;'>" . _AM_XFORUM_ATTACHPATH . ": ";
 $attach_path = XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/';
 $path_status = forum_admin_getPathStatus($attach_path);
 echo $attach_path . ' ( ' . $path_status . ' )';
 echo "<br />" . _AM_XFORUM_THUMBPATH . ": ";
 $thumb_path = $attach_path . 'thumbs/';
 // be careful
 $path_status = forum_admin_getPathStatus($thumb_path);
 echo $thumb_path . ' ( ' . $path_status . ' )';
 echo "</div>";
 echo "</fieldset><br />";
 echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XFORUM_BOARDSUMMARY . "</legend>";
 echo "<div style='padding: 12px;'>";
 echo _AM_XFORUM_TOTALTOPICS . " <strong>" . get_total_topics() . "</strong> | ";
 echo _AM_XFORUM_TOTALPOSTS . " <strong>" . get_total_posts() . "</strong> | ";
 echo _AM_XFORUM_TOTALVIEWS . " <strong>" . get_total_views() . "</strong></div>";
 echo "</fieldset><br />";
 $report_handler =& xoops_getmodulehandler('report', 'xforum');
 echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XFORUM_REPORT . "</legend>";
 echo "<div style='padding: 12px;'><a href='admin_report.php'>" . _AM_XFORUM_REPORT_PENDING . "</a> <strong>" . $report_handler->getCount(new Criteria("report_result", 0)) . "</strong> | ";
 echo _AM_XFORUM_REPORT_PROCESSED . " <strong>" . $report_handler->getCount(new Criteria("report_result", 1)) . "</strong>";
 echo "</div>";
 echo "</fieldset><br />";
 if ($xoopsModuleConfig['email_digest'] > 0) {
     $digest_handler =& xoops_getmodulehandler('digest', 'xforum');
     echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XFORUM_DIGEST . "</legend>";
     $due = $digest_handler->checkStatus() / 60;
     // minutes
     $prompt = $due > 0 ? sprintf(_AM_XFORUM_DIGEST_PAST, $due) : sprintf(_AM_XFORUM_DIGEST_NEXT, abs($due));
     echo "<div style='padding: 12px;'><a href='index.php?op=senddigest'>" . $prompt . "</a> | ";
コード例 #17
0
ファイル: index.php プロジェクト: BackupTheBerlios/soopa
 echo "</div>";
 echo "<div style='padding: 8px;'>" . _AM_NEWBB_ATTACHPATH . ": ";
 $attach_path = XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/';
 $path_status = newbb_admin_getPathStatus($attach_path);
 echo $attach_path . ' ( ' . $path_status . ' )';
 echo "<br />" . _AM_NEWBB_THUMBPATH . ": ";
 $thumb_path = $attach_path . 'thumbs/';
 // be careful
 $path_status = newbb_admin_getPathStatus($thumb_path);
 echo $thumb_path . ' ( ' . $path_status . ' )';
 echo "</div>";
 echo "</fieldset><br />";
 echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_NEWBB_BOARDSUMMARY . "</legend>";
 echo "<div style='padding: 12px;'>";
 echo _AM_NEWBB_TOTALTOPICS . " <strong>" . get_total_topics() . "</strong> | ";
 echo _AM_NEWBB_TOTALPOSTS . " <strong>" . get_total_posts(0, 'all') . "</strong> | ";
 echo _AM_NEWBB_TOTALVIEWS . " <strong>" . get_total_views() . "</strong></div>";
 echo "</fieldset><br />";
 $report_handler =& xoops_getmodulehandler('report', 'newbb');
 echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_NEWBB_REPORT . "</legend>";
 echo "<div style='padding: 12px;'><a href='admin_report.php'>" . _AM_NEWBB_REPORT_PENDING . "</a> <strong>" . $report_handler->getReportCount(0) . "</strong> | ";
 echo _AM_NEWBB_REPORT_PROCESSED . " <strong>" . $report_handler->getReportCount(1) . "</strong>";
 echo "</div>";
 echo "</fieldset><br />";
 if ($xoopsModuleConfig['email_digest'] > 0) {
     $digest_handler =& xoops_getmodulehandler('digest', 'newbb');
     echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_NEWBB_DIGEST . "</legend>";
     $due = $digest_handler->checkStatus() / 60;
     // minutes
     $prompt = $due > 0 ? sprintf(_AM_NEWBB_DIGEST_PAST, $due) : sprintf(_AM_NEWBB_DIGEST_NEXT, abs($due));
     echo "<div style='padding: 12px;'><a href='index.php?op=senddigest'>" . $prompt . "</a> | ";
コード例 #18
0
ファイル: viewtopic.php プロジェクト: koki-h/xoops_utf8
    if (isset($arr[$key]['replies']) && !empty($arr[$key]['replies'])) {
        $prefix .= "&nbsp;&nbsp;";
        foreach ($arr[$key]['replies'] as $replykey) {
            $current = $current == 0 ? $replykey : $current;
            showTree($arr, $current, $replykey, $prefix, $foundusers);
        }
    }
}
if ($order == 'DESC') {
    $xoopsTpl->assign(array('order_current' => 'DESC', 'order_other' => 'ASC', 'lang_order_other' => _OLDESTFIRST));
} else {
    $xoopsTpl->assign(array('order_current' => 'ASC', 'order_other' => 'DESC', 'lang_order_other' => _NEWESTFIRST));
}
// initialize the start number of select query
$start = !empty($_GET['start']) ? intval($_GET['start']) : 0;
$total_posts = get_total_posts($topic_id, 'topic');
if ($total_posts > 50) {
    $viewmode = "flat";
    // hide link to theaded view
    $xoopsTpl->assign('lang_threaded', "");
    $xoopsTpl->assign('lang_flat', _FLAT);
} else {
    $xoopsTpl->assign(array('lang_threaded' => _THREADED, 'lang_flat' => _FLAT));
}
if ($can_post == 1) {
    $xoopsTpl->assign(array('viewer_can_post' => true, 'forum_post_or_register' => "<a href=\"newtopic.php?forum=" . $forum . "\"><img src=\"" . $bbImage['post'] . "\" alt=\"" . _MD_POSTNEW . "\" /></a>"));
} else {
    $xoopsTpl->assign('viewer_can_post', false);
    if ($show_reg == 1) {
        $xoopsTpl->assign('forum_post_or_register', '<a href="' . XOOPS_URL . '/user.php?xoops_redirect=' . htmlspecialchars($xoopsRequestUri) . '">' . _MD_REGTOPOST . '</a>');
    } else {
コード例 #19
0
ファイル: viewforum.php プロジェクト: nikosv/openeclass
          <a href='$nexturl' aria-label='Next'>
            <span aria-hidden='true'>&raquo;</span>
          </a>
        </li>
      </ul>
    </nav>
    ";

}

// delete topic
if (($is_editor) and isset($_GET['topicdel'])) {
    if (isset($_GET['topic_id'])) {
        $topic_id = intval($_GET['topic_id']);
    }
    $number_of_posts = get_total_posts($topic_id);
    $sql = Database::get()->queryArray("SELECT id,poster_id,post_text FROM forum_post WHERE topic_id = ?d", $topic_id);
    $post_authors = array();
    foreach ($sql as $r) {
        $post_authors[] = $r->poster_id;
        //delete abuse_reports for forum_posts and log actions
        $result = Database::get()->queryArray("SELECT * FROM abuse_report WHERE `rid` = ?d AND `rtype` = ?s", $r->id, 'forum_post');
        foreach ($result as $res) {
            Log::record($res->course_id, MODULE_ID_ABUSE_REPORT, LOG_DELETE,
                array('id' => $res->id,
                     'user_id' => $res->user_id,
                     'reason' => $res->reason,
                     'message' => $res->message,
                     'rtype' => 'forum_post',
                     'rid' => $r->id,
                     'rcontent' => $r->post_text,
コード例 #20
0
ファイル: index.php プロジェクト: amjadtbssm/website
// Author: Kazumi Ono (AKA onokazu)                                          //
// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
// Project: The XOOPS Project                                                //
// ------------------------------------------------------------------------- //
include "header.php";
// this page uses smarty template
// this must be set before including main header.php
$xoopsOption['template_main'] = 'newbb_index.html';
include XOOPS_ROOT_PATH . "/header.php";
$myts =& MyTextSanitizer::getInstance();
$sql = 'SELECT c.* FROM ' . $xoopsDB->prefix('bb_categories') . ' c, ' . $xoopsDB->prefix("bb_forums") . ' f WHERE f.cat_id=c.cat_id GROUP BY c.cat_id, c.cat_title, c.cat_order ORDER BY c.cat_order';
if (!($result = $xoopsDB->query($sql))) {
    redirect_header(XOOPS_URL . '/', 1, _MD_ERROROCCURED);
    exit;
}
$xoopsTpl->assign(array("lang_welcomemsg" => sprintf(_MD_WELCOME, $xoopsConfig['sitename']), "lang_tostart" => _MD_TOSTART, "lang_totaltopics" => _MD_TOTALTOPICSC, "lang_totalposts" => _MD_TOTALPOSTSC, "total_topics" => get_total_topics(), "total_posts" => get_total_posts(0, 'all'), "lang_lastvisit" => sprintf(_MD_LASTVISIT, formatTimestamp($last_visit)), "lang_currenttime" => sprintf(_MD_TIMENOW, formatTimestamp(time(), "m")), "lang_forum" => _MD_FORUM, "lang_topics" => _MD_TOPICS, "lang_posts" => _MD_POSTS, "lang_lastpost" => _MD_LASTPOST, "lang_moderators" => _MD_MODERATOR));
$viewcat = !empty($HTTP_GET_VARS['cat']) ? intval($HTTP_GET_VARS['cat']) : 0;
$categories = array();
while ($cat_row = $xoopsDB->fetchArray($result)) {
    $categories[] = $cat_row;
}
$sql = 'SELECT f.*, u.uname, u.uid, p.topic_id, p.post_time, p.subject, p.icon FROM ' . $xoopsDB->prefix('bb_forums') . ' f LEFT JOIN ' . $xoopsDB->prefix('bb_posts') . ' p ON p.post_id = f.forum_last_post_id LEFT JOIN ' . $xoopsDB->prefix('users') . ' u ON u.uid = p.uid';
if ($viewcat != 0) {
    $sql .= ' WHERE f.cat_id = ' . $viewcat;
    $xoopsTpl->assign('forum_index_title', sprintf(_MD_FORUMINDEX, $xoopsConfig['sitename']));
} else {
    $xoopsTpl->assign('forum_index_title', '');
}
$sql .= ' ORDER BY f.cat_id, f.forum_id';
if (!($result = $xoopsDB->query($sql))) {
    exit("Error");