function get_price($listing_price) { global $es_settings; $currency_sign = get_currency_sign(); $price_format = explode("|", $es_settings->price_format); if ($es_settings->price != 1) { return ''; } $price = number_format($listing_price, 0, $price_format[1], $price_format[2]); return $es_settings->currency_sign_place == 'before' ? "{$currency_sign}{$price}" : "{$price}{$currency_sign}"; }
echo "<li class=\"pvs\">"; $comments_count = $post->countComments(); $text = elgg_echo("comments") . " ({$comments_count})"; $comments_link = elgg_view('output/url', array('href' => $post->getURL() . '#vouchers-comments', 'text' => $text)); $voucher_img = elgg_view('output/url', array('href' => "vouchers/view/{$post->guid}/" . elgg_get_friendly_title($post->title), 'text' => elgg_view('vouchers/thumbnail', array('voucher_guid' => $post->guid, 'size' => 'small')))); $dformat = trim(elgg_get_plugin_setting('default_dateformat', 'vouchers')); if (empty($dformat) || $dformat == '') { $dformat = 'F j, Y'; } $date_display_until = date($dformat, $post->valid_until); if ($post->amount_type === 'Currency') { $currency = get_currency_sign($vouchers->currency) . $post->amount; } else { $currency = $post->amount . '%'; } $subtitle = '<strong>' . elgg_echo('vouchers:widget:amount') . ' :</strong>' . $currency; if ($post->price) { $adprice = get_currency_sign($post->currency) . ' ' . $post->price; $subtitle .= ', <strong>' . elgg_echo('vouchers:widget:price') . ":</strong> {$adprice}"; } $subtitle .= '<br/><strong>' . elgg_echo('vouchers:widget:validuntil') . ': </strong>' . $date_display_until; $subtitle .= "<br>{$author_text} {$date} {$comments_link}"; $params = array('entity' => $post, 'metadata' => $metadata, 'subtitle' => $subtitle, 'tags' => $tags, 'content' => $excerpt); $params = $params + $vars; $list_body = elgg_view('object/elements/summary', $params); echo elgg_view_image_block($voucher_img, $list_body); echo "</li>"; } } echo "</ul>"; }
$voucher_img = elgg_view('output/url', array('href' => "vouchers/view/{$vouchers->guid}/" . elgg_get_friendly_title($vouchers->title), 'text' => elgg_view('vouchers/thumbnail', array('voucher_guid' => $vouchers->guid, 'size' => $thumbsize, 'tu' => $tu)))); $content = ''; // add star to featured posts if ($vouchers->featured) { $content .= '<div class="star_right"><img src="' . elgg_get_site_url() . 'mod/vouchers/graphics/star.png" width="30" height="30" alt="' . elgg_echo('vouchers:featured') . '" /></div>'; } if ($vouchers->excerpt) { $content .= '' . $vouchers->excerpt . '<br />'; } $content .= $vcode; $content .= '<strong>' . elgg_echo('vouchers:addvoucher:amount') . '</strong>: ' . $currency . '<br />'; if (($vouchers->price || $vouchers->points) && !$print) { $content .= '<div class="print" style="clear:both;">' . $buybuttton . '</div>'; } if ($vouchers->price) { $content .= '<strong>' . elgg_echo('vouchers:addvoucher:price') . '</strong>: ' . get_currency_sign($vouchers->currency) . ' ' . $vouchers->price . '<br />'; } if ($vouchers->points && !$isbuyer) { $content .= '<div>'; $content .= elgg_echo('vouchers:addvoucher:pointsrequired', array($vouchers->points)); if (elgg_is_logged_in()) { $content .= elgg_echo('vouchers:addvoucher:pointsrequired:subtracted'); } $content .= '</div>'; } if ($date_display_from) { $content .= '<strong>' . elgg_echo('vouchers:addvoucher:validfrom') . '</strong>: ' . $date_display_from . '<br />'; } $content .= '<strong>' . elgg_echo('vouchers:addvoucher:validuntil') . '</strong>: ' . $date_display_until . '<br />'; if (is_numeric($vouchers_howmany)) { $content .= '<div><strong>' . elgg_echo('vouchers:addvoucher:howmany') . '</strong>: ' . $vouchers_howmany . '</div><br />';