Exemple #1
0
$access->canPublish = $acl->acl_check('action', 'publish', 'users', $my->usertype, 'content', 'all');
$task = mosGetParam($_REQUEST, 'task', "");
$id = mosGetParam($_REQUEST, 'id', 0);
$Itemid = intval(mosGetParam($_REQUEST, 'Itemid', 0));
$limitstart = intval(mosGetParam($_REQUEST, 'limitstart', 0));
if (file_exists("components/com_bible/language/" . $mosConfig_lang . ".php")) {
    include_once "components/com_bible/language/" . $mosConfig_lang . ".php";
} else {
    include_once "components/com_bible/language/brazilian_portuguese.php";
}
switch (strtolower($task)) {
    case "viewbooks":
        showBooks($Itemid);
        break;
    case "viewbook":
        showBook($Itemid, $id, $limitstart);
        break;
    default:
        showBooks($Itemid);
        break;
}
function showBooks($Itemid)
{
    global $database, $mainframe, $mosConfig_offset;
    $noauth = !$mainframe->getCfg('shownoauth');
    $database->setQuery("SELECT ordering, bookName, location " . "\nFROM #__bible_book" . "\nORDER BY location desc, ordering, bookName ");
    $books = $database->loadObjectList();
    HTML_bible::showBooksList($books, $Itemid);
}
function showBook($Itemid, $id, $limitstart)
{
Exemple #2
0
    $query = "SELECT * FROM books WHERE topic = {$topic} AND isbn != {$isbn};";
    $results = mysql_query($query, $connection);
    if (!$results) {
        return;
    }
    echo "\n      <table>\n      <tr>\n      <th>ISBN</th>\n      <th>Title</th>\n      </tr>";
    while ($row = mysql_fetch_assoc($results)) {
        echo "\n        <tr>\n        <td><a href='show_book.php?isbn={$row['isbn']}'>{$row['isbn']}</a></td>\n        <td>{$row['title']}</td>\n        </tr>";
    }
    echo "</table>";
}
// FIXME: show image
function showBook()
{
    if (empty($_GET['isbn'])) {
        echo "<p class='center'>No book is specified.</p>";
        return;
    }
    $isbn = $_GET['isbn'];
    $connection = connect();
    $topic = showBookDetails($connection, $isbn);
    showReview($connection, $isbn);
    showRelatedBooks($connection, $isbn, $topic);
    mysql_close($connection);
}
showHeader('Book Details');
showBook();
showFooter();
?>