function rhythm_display_random_featured_item_squarethumb() { $featuredItems = get_random_featured_items(1); $featuredItem = $featuredItems[0]; $html = '<h2>Featured <span class="type-featured">Item</span></h2>'; if ($featuredItem) { set_current_record('item', $featuredItem); // Needed for transparent access of item metadata. if (metadata('item', 'has thumbnail')) { $html .= link_to_item(item_square_thumbnail(), array('class' => 'image')); } // Grab the 1st Dublin Core description field (first 150 characters) $itemDescription = metadata('item', array('Dublin Core', 'Description'), array('snippet' => 150)); $html .= '<p><span class="title">' . link_to_item() . '</span> ' . $itemDescription . '</p>'; } else { $html .= '<p>No featured items are available.</p>'; } return $html; }
} elseif ($description = item('Dublin Core', 'Description')) { ?> <?php $shortdesc = $description; ?> <?php } ?> <td> <?php if (item_has_thumbnail()) { ?> <div class="item-img"> <?php echo link_to_item(item_square_thumbnail(array('alt' => item('Dublin Core', 'Title'), 'width' => '70', 'height' => '70'))); ?> </div> <?php } ?> </td> <td><div style="font-size: 1.1em;"><?php echo link_to_item(item('Dublin Core', 'Title'), array('class' => 'permalink', 'title' => $shortdesc)); ?> </div></td> <td>
<?php $head = array('bodyclass' => 'item-show-log primary', 'title' => 'Item Show Log'); head($head); ?> <h1>Item Show Log</h1> <?php $db = get_db(); $table = $db->getTable('ItemShowLogLog'); $rows = $table->fetchAll("SELECT item_id, count(id) AS count FROM `{$db->prefix}item_show_log_logs` GROUP BY `item_id` ORDER BY count DESC LIMIT 100;"); echo "<div class='item-show-log-most-shown'>"; foreach ($rows as $row) { echo "<div class='item-show-log-row'>"; $item = get_item_by_id($row['item_id']); set_current_item($item); echo "<span class='item-show-log-thumbnail'>" . item_square_thumbnail() . "</span>"; echo "<div class='item-show-log-title'><a href='" . item_uri() . "'>" . item('Dublin Core', 'Title') . '</a></div>'; echo "<span class='item-show-log-count'>Viewed " . $row['count'] . " times in public view</span>"; echo "</div>"; } echo "</div>";