예제 #1
0
파일: index.php 프로젝트: sudogem/brcms
            } else {
                $sponsoredlinks .= '<li><a href="http://' . $links[$i]->website . '">' . $links[$i]->website . '</a></li>';
            }
        }
    }
}
###################################################
# get station segments here
$rs = get_table_data('news_segments');
while ($data = mysql_fetch_assoc($rs)) {
    $segments .= '<li><a href="segments.php?segmentID=' . $data['autoNumber'] . '">' . $data['segmentTitle'] . '</li>';
}
/*
 * Generate random quote
 */
$quote = new quote_of_the_day();
$result = $quote->generate_random_quote();
$quote_author = $result[0]->quote_author;
$quote_message = $result[0]->quote_message;
/**
 * Get the poll of the day
 */
//get the current date
$date = date('Y-m-d');
$sql = "SELECT * FROM poll_topic";
$sql .= " WHERE topic_date = '{$date}' OR '{$date}' BETWEEN topic_date AND expiry_date ";
//echo $sql;
if (!($result = $db->query($sql))) {
    die('Error:' . $db->error());
}
$poll = array();
예제 #2
0
include 'configuration.php';
require 'coreclass.php';
session_start();
// if user is not login..redirect him to login page
if (!isset($_SESSION['login'])) {
    header('Location: login.php');
}
if (isset($_SESSION['login'])) {
    $userID = $_SESSION['userID'];
    $usertypeID = $_SESSION['usertypeID'];
}
//print_r($_POST);
$quote = $_POST['quote'];
$author = $_POST['author'];
$quoteID = $_SESSION['quoteID'];
$q = new quote_of_the_day();
if (isset($_POST['cancel'])) {
    header('Location: quote_manager.php');
    exit;
} else {
    // modify the existing quote
    if ($_POST['task'] == 'edit') {
        $result = $q->update_quote($quoteID, $author, $quote);
        if ($result) {
            // Log the activity
            $action = new activity();
            $action->track_activity($userID, $action->saving_quote, 'Saving the quote  ' . $quote);
        }
        $_SESSION['task'] = 'edit';
        $_SESSION['title'] = $quote;
        if ($result) {
예제 #3
0
<?php

include 'configuration.php';
require 'coreclass.php';
session_start();
// if user is not login..redirect him to login page
if (!isset($_SESSION['login'])) {
    header('Location: login.php');
}
if (isset($_SESSION['login'])) {
    $userID = $_SESSION['userID'];
    $usertype = $_SESSION['usertype'];
}
$quoteID = $_GET['quoteID'];
$q = new quote_of_the_day();
$quotes = $q->view_quote($quoteID);
$quote_message = $quotes[0]->quote_message;
$quote_author = $quotes[0]->quote_author;
$_SESSION['quoteID'] = $quoteID;
$_SESSION['quote_message'] = $quote_message;
$_SESSION['quote_author'] = $quote_author;
// Log the activity
$action = new activity();
$action->track_activity($userID, $action->viewing_quotes, 'Viewing the category detail of ' . $category_name);
// start compiling the page..
$tpl = new template_parser("../templates/view_quote_detail.tpl.php");
$tags = array('{QUOTE}' => $quote_message, '{AUTHOR}' => $quote_author, '{SITENAME}' => 'CMS Adminss', '{HEADER}' => ' ', '{TOPNAV}' => 'top_menu.php', '{CONTENT}' => $row_data, '{FOOTER}' => 'footer.php');
$tpl->parse_template($tags);
print $tpl->display();
예제 #4
0
    $userID = $_SESSION['userID'];
    $usertype = $_SESSION['usertype'];
}
if (isset($_SESSION['task']) && $_SESSION['task'] != '') {
    switch ($_SESSION['task']) {
        case 'edit':
            $message = 'Changes of "' . $_SESSION['title'] . '" was succesfully saved ';
            break;
        case 'add':
            $message = 'Successfully saved quote "' . $_SESSION['title'] . '"';
            break;
    }
    unset($_SESSION['title']);
    unset($_SESSION['task']);
}
$quote = new quote_of_the_day();
$allquotes = $quote->view_all_quotes();
$totalrows = count($allquotes);
$limit = 5;
$paging = ceil($totalrows / $limit);
$scroll = 1;
$scrollnumber = 5;
if (isset($_GET['page'])) {
    $page = $_GET['page'];
} else {
    $page = 1;
}
$start = $page * $limit - $limit;
$pagelink = new paging($page, $totalrows, $limit, $paging, $scroll, $scrollnumber);
//$allmessages = $msg->view_all_messages_limit ( $userID, $start, $limit );
//print_r( $allmessages );