<?php

// $Id$
/**
 * @file
 * Template to render a Ting collection of books.
 */
// updated so we show ALL objects in the collection in the search result
/*dsm($collection);
*/
foreach ($collection->objects as $obj) {
    if ($obj->type == 'Lydbog (online)' || 1 == 1) {
        // we asume now that every collection has only this one piece of material
        $lydbogObj = $obj;
        //		$lydbogObj = ting_get_object_by_id($obj->id);
        elib_book_cover($lydbogObj);
        $alttext = t('@titel af @forfatter', array('@titel' => $lydbogObj->title, '@forfatter' => $lydbogObj->creators_string));
        ?>


  <li class="display-book ting-collection ruler-after line clear-block">
    <div class="picture unit">
      <?php 
        $image_url = ting_covers_collection_url($lydbogObj, '80_x');
        ?>
      <?php 
        if ($image_url) {
            ?>
        <div class="inner left">
        <?php 
            print l(theme('image', $image_url, $alttext, $alttext, null, false), $lydbogObj->url, array('html' => true));
Exemple #2
0
<?php

// $Id$
/**
 * @file ting_object.tpl.php
 *
 * Template to render objects from the Ting database.
 *
 * Available variables:
 * - $object: The TingClientObject instance we're rendering.
 */
/*logic for rating */
elib_book_cover($object);
//dsm($object);
if (!($n = node_load(array('title' => $object->id, 'type' => 'bookrating')))) {
    $n = new stdClass();
    $n->type = 'bookrating';
    $n->title = $object->id;
    node_save($n);
}
$n = node_build_content($n);
?>
<!-- ting_object.tpl -->
<div id="ting-object" class="line rulerafter">

  <div class="picture unit ">
  <?php 
$image_url = ting_covers_collection_url($object, '170_x');
?>
  
  <?php 
<?php

// $Id$
/**
 * @file
 * Template to render a Ting collection of books.
 */
elib_book_cover($collection->objects[0]);
$image_url = ting_covers_collection_url($collection->objects[0], '170_x');
$alttext = t('@titel af @forfatter', array('@titel' => $collection->title, '@forfatter' => $collection->creators_string));
?>
<li class="unit size1of5">
  <div class="inner display-book">
    
    <?php 
if (strpos($image_url, 'imagecache')) {
    ?>
    <div class="picture">
      <?php 
    print l(theme('image', $image_url, $alttext, $alttext, null, false), $collection->url, array('html' => true));
    ?>
    </div>
    <?php 
} else {
    ?>
    <div class="picture nopicture">
      <?php 
    print l('se bogen', $collection->url, array());
    ?>
    </div>
    <?php