Ejemplo n.º 1
0
global $awsS3Bucket;
global $dbServer, $dbName, $dbUser, $dbPassword;
$author = isset($_GET["author"]) ? $_GET["author"] : NULL;
$count = isset($_GET["count"]) ? $_GET["count"] : 0;
if (!$author || !is_numeric($count)) {
    header("HTTP/1.0 400 Bad Request");
    header('Content-type: text/html');
    if (!$author) {
        echo "<html><body>Missing \"author\" parameter</body></html>";
    } else {
        echo "<html><body>Parameter \"count\" must be a number</body></html>";
    }
    die;
}
$db = new DB($dbServer, $dbName, $dbUser, $dbPassword);
$list = $db->getBooksByAuthor($author, $count);
if ($list === false) {
    header("HTTP/1.0 500 Internal Server Error");
    header('Content-type: text/html');
    echo "<html><body>Internal Error</body></html>";
    die;
}
header('HTTP/1.0 200 OK');
header('Content-type: text/xml');
// generate rss xml
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo '<rss version="2.0">';
echo '<channel>';
echo "<title>{$author}</title>";
for ($i = 0; $i < count($list); $i++) {
    $title = $list[$i]["title"];
Ejemplo n.º 2
0
$active_menu = 'books';
include 'menu.inc.php';
?>

    <div id="tab_box">
        <b class="xtop"><b class="xb1"></b><b class="xb2"></b><b class="xb3"></b><b class="xb4"></b></b>
        <div class="tab_box_content">
        
            <?php 
require_once 'awscfg.php';
require_once 'db.php';
require_once 'utils.php';
global $awsS3Bucket;
global $dbServer, $dbName, $dbUser, $dbPassword;
$db = new DB($dbServer, $dbName, $dbUser, $dbPassword);
$list = $db->getBooksByAuthor($author, 0);
if ($list) {
    echo "<div class=\"author\"><br/>{$author}</div>";
    //echo "<img src=\"images/lg_px.gif\" class=\"line\"/>";
    echo "<img src=\"images/green_px.gif\" class=\"line\"/>";
    $count = count($list);
    $MAX_COLS = 2;
    $MAX_ROWS = floor(($count + $MAX_COLS - 1) / $MAX_COLS);
    for ($col = $MAX_COLS - 1; $col >= 0; $col--) {
        if ($col == 0) {
            echo '<div class="left_book">';
        } else {
            echo '<div class="right_book">';
        }
        for ($row = 0; $row < $MAX_ROWS; $row++) {
            $i = $col * $MAX_ROWS + $row;