Example #1
0
    <td><p><strong><?php 
echo "{$trackStr}:";
?>
</strong>
    <?php 
if ($catcomsep = GetSelectedTrackText($paperInfo->PaperID, &$err_message)) {
    echo $catcomsep;
} else {
    echo " <font color=\"#FF0000\"> Could not read Paper Track table. Try <a href='view_abstract.php?paperid=" . $_GET["paperid"] . "'>again</a>?</font>";
}
?>
</td>
  </tr>

<?php 
if (numCategories(&$err_message) > 0) {
    echo '<tr><td><p><strong>';
    echo "{$topicStr}(s):";
    echo '</strong>';
    if ($catcomsep = getSelectedCategoryCommaSeparated($paperInfo->PaperID, &$err_message)) {
        echo $catcomsep;
    } else {
        echo " <font color=\"#FF0000\"> Could not read Paper Category table. Try <a href='view_abstract.php?paperid=" . $_GET["paperid"] . "'>again</a>?</font>";
    }
    echo '</td></tr>';
}
?>

  <tr>
    <td>&nbsp;</td>
  </tr>
Example #2
0
function redisplay(&$paperid_array, &$process, &$dbprefix, $err_message = "")
{
    //Establish connection with database
    $db = adodb_connect(&$err_message);
    //global $_SESSION ;
    $i = 0;
    $array = array();
    reset($paperid_array);
    foreach ($paperid_array as $some => $paperID) {
        //Get the paper information
        if (($paperInfo = get_paper_info($paperID, &$err_message)) === false) {
            do_html_header("Update Paper Bids Failed", &$err_message);
            $err_message .= " Cannot retrieve information from database. <br>\n";
            $err_message .= "<br><br> Try <a href='" . $_SERVER["PHP_SELF"] . "?" . $_SERVER["QUERY_STRING"] . "'>again</a>?";
            do_html_footer(&$err_message);
            exit;
        }
        $array[$i]["paperid"] = $paperInfo->PaperID;
        $array[$i]["papertitle"] = stripslashes($paperInfo->Title);
        //Get the lastest file of the paper
        if (($FileIDData = get_latestFile($paperID, &$err_message)) === false) {
            do_html_header("Update Paper Bids Failed", &$err_message);
            $err_message .= " Could not execute \"get_latestFile\" in \"update_biddings.php\". <br>\n";
            $err_message .= "<br><br> Try <a href='" . $_SERVER["PHP_SELF"] . "?" . $_SERVER["QUERY_STRING"] . "'>again</a>?";
            do_html_footer(&$err_message);
            exit;
        }
        $array[$i]["fileid"] = $FileIDData->FileID;
        if ($catcomsep = getSelectedCategoryCommaSeparated($paperInfo->PaperID, &$err_message) || numCategories(&$err_message) == 0) {
            $array[$i]["cat"] = $catcomsep;
        } else {
            do_html_header("Update Paper Bids Failed", &$err_message);
            $err_message .= " Could not execute \"getSelectedCategoryCommaSeparated\" in \"update_biddings.php\". <br>\n";
            $err_message .= "<br><br> Try <a href='" . $_SERVER["PHP_SELF"] . "?" . $_SERVER["QUERY_STRING"] . "'>again</a>?";
            do_html_footer(&$err_message);
            exit;
        }
        if ($authors = retrieve_authors($paperInfo->PaperID, &$err_message)) {
            $array[$i]["author"] = $authors;
        } else {
            do_html_header("Update Paper Bids Failed", &$err_message);
            $err_message .= " Could not execute \"retrieve_authors\" in \"update_biddings.php\". <br>\n";
            $err_message .= "<br><br> Try <a href='" . $_SERVER["PHP_SELF"] . "?" . $_SERVER["QUERY_STRING"] . "'>again</a>?";
            do_html_footer(&$err_message);
            exit;
        }
        if ($process === "update") {
            $preferenceSQL = " SELECT PreferenceID FROM " . $GLOBALS["DB_PREFIX"] . "Selection ";
            $preferenceSQL .= " WHERE PaperID = " . $paperInfo->PaperID;
            $preferenceSQL .= " AND Membername = '" . $_SESSION["valid_user"] . "'";
            $preferenceResult = $db->Execute($preferenceSQL);
            if (!$preferenceResult) {
                do_html_header("Update Paper Bids Failed", &$err_message);
                $err_message .= " Could not query \"Selection\" table in database by \"redisplay()\" of \"update_biddings.php\". <br>\n";
                $err_message .= "<br><br> Try <a href='" . $_SERVER["PHP_SELF"] . "?" . $_SERVER["QUERY_STRING"] . "'>again</a>?";
                do_html_footer(&$err_message);
                exit;
            }
            $userPreference = $preferenceResult->FetchNextObj();
            $array[$i]["bidid"] = $userPreference->PreferenceID;
        }
        if ($bidtable = Generate_Preference_Radio_Input_Table($paperInfo->PaperID, $array[$i]["bidid"], &$err_message)) {
            $array[$i]["bid"] = $bidtable;
        } else {
            do_html_header("Update Paper Bids Failed", &$err_message);
            $err_message .= " Could not execute \"retrieve_authors\" in \"update_biddings.php\". <br>\n";
            $err_message .= "<br><br> Try <a href='" . $_SERVER["PHP_SELF"] . "?" . $_SERVER["QUERY_STRING"] . "'>again</a>?";
            do_html_footer(&$err_message);
            exit;
        }
        $i++;
    }
    //End of for loop
    return $array;
}
Example #3
0
/**
 * Show some basic stats:  Total This: XXXX, etc.
 *
 * @param string $output_method
 */
function ssi_boardStats($output_method = 'echo')
{
    global $txt, $scripturl, $modSettings;
    if (!allowedTo('view_stats')) {
        return;
    }
    require_once SUBSDIR . '/Boards.subs.php';
    require_once SUBSDIR . '/Stats.subs.php';
    $totals = array('members' => $modSettings['totalMembers'], 'posts' => $modSettings['totalMessages'], 'topics' => $modSettings['totalTopics'], 'boards' => countBoards(), 'categories' => numCategories());
    if ($output_method != 'echo') {
        return $totals;
    }
    echo '
		', $txt['total_members'], ': <a href="', $scripturl . '?action=memberlist">', comma_format($totals['members']), '</a><br />
		', $txt['total_posts'], ': ', comma_format($totals['posts']), '<br />
		', $txt['total_topics'], ': ', comma_format($totals['topics']), ' <br />
		', $txt['total_cats'], ': ', comma_format($totals['categories']), '<br />
		', $txt['total_boards'], ': ', comma_format($totals['boards']);
}
Example #4
0
 /**
  * Load some general statistics of the forum
  */
 public function loadGeneralStatistics()
 {
     global $scripturl, $modSettings, $context;
     require_once SUBSDIR . '/Boards.subs.php';
     // Get averages...
     $averages = getAverages();
     // This would be the amount of time the forum has been up... in days...
     $total_days_up = ceil((time() - strtotime($averages['date'])) / (60 * 60 * 24));
     $date = strftime('%Y-%m-%d', forum_time(false));
     // General forum stats
     $context['general_statistics']['left'] = array('total_members' => allowedTo('view_mlist') ? '<a href="' . $scripturl . '?action=memberlist">' . comma_format($modSettings['totalMembers']) . '</a>' : comma_format($modSettings['totalMembers']), 'total_posts' => comma_format($modSettings['totalMessages']), 'total_topics' => comma_format($modSettings['totalTopics']), 'total_cats' => comma_format(numCategories()), 'users_online' => comma_format(onlineCount()), 'most_online' => array('number' => comma_format($modSettings['mostOnline']), 'date' => standardTime($modSettings['mostDate'])), 'users_online_today' => comma_format(mostOnline($date)));
     if (!empty($modSettings['hitStats'])) {
         $context['general_statistics']['left'] += array('num_hits' => comma_format($averages['hits'], 0));
     }
     $context['general_statistics']['right'] = array('average_members' => comma_format(round($averages['registers'] / $total_days_up, 2)), 'average_posts' => comma_format(round($averages['posts'] / $total_days_up, 2)), 'average_topics' => comma_format(round($averages['topics'] / $total_days_up, 2)), 'total_boards' => comma_format(countBoards('all', array('include_redirects' => false))), 'latest_member' => &$context['common_stats']['latest_member'], 'average_online' => comma_format(round($averages['most_on'] / $total_days_up, 2)), 'emails_sent' => comma_format(round($averages['email'] / $total_days_up, 2)));
     if (!empty($modSettings['hitStats'])) {
         $context['general_statistics']['right'] += array('average_hits' => comma_format(round($averages['hits'] / $total_days_up, 2)));
     }
 }