Ejemplo n.º 1
0
function biblioSimpleList($criteria, $limit, $header_title)
{
    global $sysconf;
    global $dbs;
    $book_q = $dbs->query('SELECT biblio_id, title, notes, image FROM biblio ' . $criteria . ' LIMIT ' . $limit . '');
    $output = '';
    if ($book_q->num_rows > 0) {
        $output .= '<div class="slims-card slims-card--default slims-container slims-biblio-list">';
        $output .= '<div class="slims-card--header">';
        $output .= '<h4>' . $header_title . '</h4>';
        $output .= '</div>';
        while ($book = $book_q->fetch_assoc()) {
            // cover images var
            $image_cover = '';
            if ($sysconf['tg']['type'] == 'minigalnano') {
                if (!empty($book['image']) && !defined('LIGHTWEIGHT_MODE')) {
                    $book_image = urlencode($book['image']);
                    $image_loc = '../../images/docs/' . $book_image;
                } else {
                    $image_loc = '../../images/default/image.png';
                }
                $thumb_url = './lib/minigalnano/createthumb.php?filename=' . urlencode($image_loc) . '&width=120';
                $image_cover = '<img src="' . $thumb_url . '" class="img-thumbnail" itemprop="image" alt="' . $book['title'] . '" />';
            }
            $len = strlen($book['notes']);
            $lencut = 300;
            $notes = $book['notes'];
            if ($len > $lencut) {
                if (preg_match('/^.{1,300}\\b/s', $notes, $match)) {
                    $notes = $match[0] . ' ...';
                }
            }
            $output .= '<div class="slims-row">';
            $output .= '<div class="slims-12 item">';
            $output .= '<div class="cover-list">' . $image_cover . '</div>';
            $output .= '<div class="detail-list"><h4><a href="index.php?p=show_detail&id=' . $book['biblio_id'] . '">' . $book['title'] . '</a></h4>';
            $output .= '<div class="author">' . getAuthors($book['biblio_id']) . '</div>';
            $output .= '<div class="notes">' . $notes . '</div>';
            $output .= '</div></div></div>';
        }
        $output .= '</div>';
    }
    return $output;
}
Ejemplo n.º 2
0
<?php

$books = getBooks();
$authors = getAuthors();
?>

<div class="container">
		
		<h2> Libri presenti </h2>
		<table class="tableAuthor" id="tableAuthor">
			<thead>
				<th>
					Id Libro
				</th>
				<th>
					Titolo
				</th>
				<th>
					ISBN
				</th>
				<th colspan="2">
					Autore
				</th>
				<th>
					N.Pagine
				</th>
				<th>
					Disponibilità
				</th>
				<th>
					Prezzo
Ejemplo n.º 3
0
function searchAuthors()
{
    $result = array();
    // Get the search parameters.
    $key = $_GET["searchKey"];
    $value = $_GET['searchValue'];
    $start = isset($_GET['queryStart']) ? $_GET['queryStart'] : '0';
    $limit = isset($_GET['queryLimit']) ? $_GET['queryLimit'] : '5';
    // If no key or value is specified, return error.
    if (!isset($key) || !isset($value)) {
        $result = array("status" => 0, "error" => array("2", "Key or value NOT specified!"));
        packageResponse($result);
        return;
    }
    // Construct the query based on the key and value.
    if ($key == 'title') {
        // Get authors with a non-exact match of a title.
        $query = "SELECT DISTINCT ar.aguid AS guid FROM author_rel ar JOIN " . "papers p ON p.guid=ar.pguid WHERE MATCH(p.title) AGAINST('" . mysql_escape_string($value) . "' IN BOOLEAN MODE) LIMIT " . $start . ", " . $limit;
    } else {
        if ($key == 'date') {
            // Get authors with an exact match of a pubyear.
            $query = "SELECT DISTINCT ar.aguid AS guid FROM author_rel ar JOIN " . "papers p ON p.guid=ar.pguid WHERE p.pubyear = '" . mysql_escape_string($value) . "' LIMIT " . $start . ", " . $limit;
        } else {
            if ($key == 'abstract' || $key == 'subject') {
                // Get author with a non-exact match of an abstract or subject.
                $query = "SELECT DISTINCT ar.aguid AS guid FROM author_rel ar JOIN " . "papers p ON p.guid=ar.pguid WHERE MATCH(p." . $key . ") AGAINST('" . mysql_escape_string($value) . "') LIMIT " . $start . ", " . $limit;
            } else {
                // Get authors bassed on the author name.
                $query = "SELECT guid FROM `authors` WHERE MATCH(" . mysql_escape_string($key) . ") AGAINST ('" . mysql_escape_string($value) . "' IN BOOLEAN MODE) LIMIT " . $start . ", " . $limit;
            }
        }
    }
    // Get the authors.
    $authors = performQuery($query);
    // Get the GUIDs.
    $guids = array();
    while ($row = mysql_fetch_assoc($authors)) {
        array_push($guids, $row['guid']);
    }
    // Compile the author JSON.
    getAuthors($guids);
}
Ejemplo n.º 4
0
/**
 * prints page "about"
 */
function printPageAbout()
{
    ?>
	<div class="subcontent">
		<h1 id="contact">Contact Details</h1>
		<p>
			Please use <a href="forum" title="Torrentflux-b4rt Forum">the torrentflux-b4rt forum</a> for any support related queries.<br/>
			For all other <strong>non-support</strong> related queries:<br/>
		</p>
		<ul><li><script language="javascript" type="text/javascript">printMailLink('tfb4rt[AT]gmail[DOT]com');</script><noscript>tfb4rt[AT]gmail[DOT]com</noscript></li></ul>
	</div>
<?php 
    $authors = getAuthors();
    if (strlen($authors) > 0) {
        ?>
				<div class="subcontent">
					<h1 id="authors">Torrentflux-b4rt Authors</h1>
					<p>
						Torrentflux-b4rt is written and maintained by:
					</p>
					<?php 
        echo $authors;
        ?>
					<p>
					A great debt is owed to the original Torrentflux's author - Qrome - as well as all the authors of the original hacks who are too numerous to mention here.  Whilst every single 'hack' has been engineered and tweaked by b4rt to be added into torrentflux-b4rt, without Qrome and the authors of the hacks many of those cool features and ideas might never have made it into torrentflux-b4rt.  With this, many thanks go out to Qrome and the numerous authors of hacks and mods to the original torrentflux.
					</p>
					<p>
						Please note that if you feel you wish to be quoted as an originating author of a feature that exists in torrentflux-b4rt, please contact us providing details of your involvement and we will endeavour to add your name to this page.
					</p>
				</div>
			<?php 
    }
    ?>
	<div class="subcontent">
		<h1 id="history">Torrentflux-b4rt History</h1>
		<p>
			<a href="images/screenshots/1.0-alpha7/profile.png" title="torrentflux-b4rt 1.0 alpha7: Profile-Page" target="_blank"><img src="images/10a7_profile_small.png" width="341" height="365" border="0" alt="torrentflux-b4rt 1.0 alpha7: Profile-Page" align="right" class="img_right" /></a>
		</p>
		<p>
			The <strong>Torrentflux-b4rt</strong> project started as an enhancement to the base <a href="http://www.torrentflux.com/" title="Torrentflux">TorrentFlux</a> 2.1 installation.
		</p>
		<p>
			Users began to submit their own 'hacks' or modifications to the base torrentflux system on the torrentflux forum, each of which provided enhanced functionality to the core system which was 'a great thing' &trade;.
		</p>
<br clear="all"/>
<br/>
		<p>
			However, for all the goodwill in the world, the method for modifying the base torrentflux system to 'install' these hacks was very unstructured by nature - at best a list of instructions:
		</p>
		<ol>
			<li>add this code here at line 12.</li>
			<li>change this code after line 33.</li>
			<li>rewrite this line 44 to read ...</li>
			<li>etc</li>
		</ol>
		<p>
			Pretty soon installing additional hacks became overwhelming because every time you added a new hack, the base system would be changed to such an extent that following any instructions for installing further hacks became just infeasible. With this in mind, torrentflux-b4rt was an attempt to sidestep the complicated mess of adding hacks and modifications to the base torrentflux system in a random way, as well as allowing users more choice in which BitTorrent clients they used with torrentflux.
		</p>
		<p>
			The first incarnation of torrentflux-b4rt was a branch from the original torrentflux codebase to include as many of the best user submitted hacks as possible and integration of other torrent clients other than torrentflux's default bittornado.  Importantly though, torrentflux-b4rt included administration settings to control most of the added modifications, something that few or none of the original hacks ever did.  With this it became a lot simpler, more secure and efficient to run a number of hacks together.
		</p>
	</div>

	<div class="subcontent">
		<h1 id="currentwork">Current Work On Torrentflux-b4rt</h1>
		<p>
			Around the start of 2007, the torrentflux-b4rt codebase was almost completely rewritten to address a number of issues:
		</p>
		<ul>
			<li>Allow easier integration of transfer clients - not necessarily just bittorrent.  <a href="features.html#protocols" title="Transfer protocols and software supported by Torrentflux-b4rt">This effort has seen the inclusion of other transfer clients such as wget, nzbperl and azureus.</a></li>
			<li>Allow scheduled tasks to run in the background via the Fluxd daemon.  <a href="features.html#fluxd" title="Use Fluxd to schedule rss downloads, queue management of torrents and more">Fluxd is a server that can be started from torrentflux-b4rt to run scheduled tasks on a server without the need to use cron.  Fluxd uses modules to perform each type of scheduled task.</a></li>
			<li>Allow the frontend to be redesigned more easily.  <a href="features.html#templating" title="Torrentflux-b4rt uses vlib templating engine to allow easier redesign of frontend">Torrentflux-b4rt now uses a templating engine to allow developers to redesign the look and feel of the torrentflux-b4rt frontend more easily.</a></li>
		</ul>
		<p>
			Somewhat confusingly, this latest incarnation of torrentflux-b4rt is named 'torrentflux-b4rt_1.0' (to indicate this is the first release of the newly rewritten b4rt codebase, whereas the older torrentflux-b4rt is named 'torrentflux_2.1-b4rt' (to indicate this is the b4rt codebase based on the original torrentflux 2.1).  Very confusing!
		</p>
		<p>
			Current work on torrentflux-b4rt is aimed at a 'final' or so-called 'production' release for the project - making the codebase as stable as possible, ironing out as many bugs as possible, making the user interface as easy to use as possible and getting a set of documentation together that will complement the project and make using torrentflux-b4rt as easy as possible.  Work is also under way to make the HTML in the frontend <a href="http://validator.w3.org/" title="W3C HTML Validation">XHTML compliant</a> which will make the interface easier to use, less cluttered and compatible on as many browsers and platforms as possible.
		</p>
	</div>

	<div class="subcontent">
		<h1 id="irc">Torrentflux-b4rt IRC Chat</h1>
		<p>
			The official Internet Relay Chat (IRC) server and channel for Torrentflux-b4rt are:<br/>
			<br/>
			Server: <b>chat.freenode.net</b><br/>
			Channel: <b>#tfb4rt</b><br/>
			<br/>
			<b>Notes:</b><br/>
			The Freenode IRC network has a large number of servers located around the world - you can use the domain name 'chat.freenode.net', but you will be connected to a random server which might not be geographically close to you.  To find one closest to you, see this page:<br/>
			<br/>
			<a href="http://freenode.net/irc_servers.shtml">Freenode IRC Server List</a><br/>
			<br/>
			Also, please consider registering a nickname on the Freenode network if you intend to spend a lot of time (idling!) there - for the benefits of and help with registering a nick, see these pages:<br/>
			<br/>
			<a href="http://freenode.net/faq.shtml#registering">Why should I register a nick on Freenode</a><br/>
			<a href="http://freenode.net/faq.shtml#nicksetup">Registering a nickname on Freenode</a><br/>
		</p>
	</div>
<?php 
}
Ejemplo n.º 5
0
<?php

$tiltle = 'Нова книга';
include './inc/header.php';
?>
<a href="index.php">Списък</a>

<form method="post" action="add_book.php">
    Име: <input type="text" name="book_name" />

    <?php 
$authors = getAuthors($db);
if ($authors === false) {
    echo 'грешка';
}
?>
    <div>Автори:
        <select name="authors[]" multiple style="width: 200px">
            <?php 
foreach ($authors as $row) {
    echo '<option value="' . $row['author_id'] . '">
                    ' . $row['author_name'] . '</option>';
}
?>

        </select>
    </div>
    <input type="submit" value="Добави" />    

</form>
Ejemplo n.º 6
0
function formatPost($post)
{
    foreach (getAuthors() as $author) {
        if ($post[1] == $author[0]) {
            $post["author"] = $author;
            break;
        }
    }
    foreach (getCategories() as $category) {
        if ($post[2] == $category[0]) {
            $post["category"] = $category;
            break;
        }
    }
    // make other changes to $post
    return $post;
}