Sorry, disregard the above. I know just enough PHP to be dangerous. Hiding the author is not a feature of the shortcode; it is only supported for the template function. Do not do what I just suggested; it will cause the “author” and “source” attributes to fail.
But here is some code that is working for me. It adds three new attributes to the shortcode function of the plugin: “show_author”, “show_source”, and “show_blockquote”. Set them to “1” for on and “0” for off. For example the shortcode “[quotcoll orderby=”random” tags=”tagline” limit=1 show_author=0 show_source=0 show_blockquote=0]” displays a single random quote with the tag “tagline” and does not show the author, source, or blockquote HTML tag.
To make this work, replace the first two functions in quotes-collection-shortcodes.php as follows:
function quotescollection_shortcode_output_format($quotes, $options)
{
$display = "";
foreach($quotes as $quote_data) {
//* Show blockquote
if($options['show_blockquote'])
$display .= "<blockquote class=\"quotescollection\" id=\"quote-".$quote_data['quote_id']."\">";
$quote_data = quotescollection_txtfmt($quote_data);
$display .= "<p><q>".$quote_data['quote']."</q>";
//* Show author and source
$cite = "";
if($options['show_author'] && $quote_data['author'])
$cite = '<span class="quotescollection_author">'. $quote_data['author'] .'</span>';
if($options['show_source'] && $quote_data['source']) {
if($cite) $cite .= ", ";
$cite .= '<span class="quotescollection_source">'. $quote_data['source'] .'</span>';
}
if($cite) $cite = " <cite>— {$cite}</cite>";
$display .= $cite."</p>";
if($options['show_blockquote'])
$display .= "</blockquote>\n";
}
return apply_filters( 'quotescollection_shortcode_output_format', $display );
}
function quotescollection_shortcodes($atts = array())
{
extract( shortcode_atts( array(
'limit' => 0,
'id' => 0,
'author' => '',
'source' => '',
'tags' => '',
'orderby' => 'quote_id',
'order' => 'ASC',
'paging' => false,
'limit_per_page' => 10,
'show_author' => 1,
'show_source' => 1,
'show_blockquote' => 1
), $atts ) );
//* Show author, source, and blockquote
$options = array(
'show_author' => $show_author,
'show_source' => $show_source,
'show_blockquote' => $show_blockquote
);
$condition = " WHERE public = 'yes'";
if(isset($quote_id) && is_numeric($quote_id)) $id = $quote_id;
if($id && is_numeric($id)) {
$condition .= " AND quote_id = ".$id;
if ($quote = quotescollection_get_quotes($condition))
return quotescollection_shortcode_output_format($quote);
else
return "";
}
if($author)
$condition .= " AND author = '".$author."'";
if($source)
$condition .= " AND source = '".$source."'";
if ($tags) {
$tags = html_entity_decode($tags);
if(!$tags)
break;
$taglist = explode(',', $tags);
$tags_condition = "";
foreach($taglist as $tag) {
$tag = trim($tag);
if($tags_condition) $tags_condition .= " OR ";
$tags_condition .= "tags = '{$tag}' OR tags LIKE '{$tag},%' OR tags LIKE '%,{$tag},%' OR tags LIKE '%,{$tag}'";
}
if($tags_condition) $condition .= " AND ".$tags_condition;
}
if($orderby == 'id' || !$orderby) $orderby = 'quote_id';
else if ($orderby == 'date_added') $orderby = 'time_added';
else if($orderby == 'random' || $orderby == 'rand') {
$orderby = 'RAND(UNIX_TIMESTAMP(NOW()))';
$order = '';
$paging = false;
};
$order = strtoupper($order);
if($order && $order != 'DESC')
$order = 'ASC';
$condition .= " ORDER BY {$orderby} {$order}";
if($paging == true || $paging == 1) {
$num_quotes = quotescollection_count($condition);
$total_pages = ceil($num_quotes / $limit_per_page);
if(!isset($_GET['quotes_page']) || !$_GET['quotes_page'] || !is_numeric($_GET['quotes_page']))
$page = 1;
else
$page = $_GET['quotes_page'];
if($page > $total_pages) $page = $total_pages;
if($page_nav = quotescollection_pagenav($total_pages, $page, 0, 'quotes_page'))
$page_nav = '<div class="quotescollection_pagenav">'.$page_nav.'</div>';
$start = ($page - 1) * $limit_per_page;
$condition .= " LIMIT {$start}, {$limit_per_page}";
// return $condition;
if($quotes = quotescollection_get_quotes($condition))
return $page_nav.quotescollection_shortcode_output_format($quotes, $options).$page_nav;
else
return "";
}
else if($limit && is_numeric($limit))
$condition .= " LIMIT ".$limit;
// return $condition;
if($quotes = quotescollection_get_quotes($condition))
return quotescollection_shortcode_output_format($quotes, $options);
else
return "";
}
That should do the trick.