WordPress.org

Plugin Directory


Ignore:
Timestamp:
12/08/12 15:15:35 (5 years ago)
Author:
SriniG
Message:

Minor update to v1.5.7: +mk_MK, *fa_IR; code improvements; FAQ mods and adds

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quotes-collection/trunk/quotes-collection.php

    r566394 r635854  
    44Plugin URI: http://srinig.com/wordpress/plugins/quotes-collection/ 
    55Description: Quotes Collection plugin with Ajax powered Random Quote sidebar widget helps you collect and display your favourite quotes on your WordPress blog. 
    6 Version: 1.5.6 
     6Version: 1.5.7 
    77Author: Srini G 
    88Author URI: http://srinig.com/wordpress/ 
     
    1010*/ 
    1111 
    12 /*  Copyright 2007-2011 Srini G (email : srinig.com@gmail.com) 
     12/*  Copyright 2007-2012 Srini G (email : srinig.com@gmail.com) 
    1313 
    1414    This program is free software; you can redistribute it and/or modify 
     
    4444$quotescollection_admin_userlevel = 'edit_posts';  
    4545 
    46  
     46$quotescollection_version = '1.5.7'; 
    4747$quotescollection_db_version = '1.4';  
    4848 
     
    212212} 
    213213 
     214function quotescollection_output_format( $quote_data, $options = array('show_author' => 1, 'show_source' => 1) ) 
     215{ 
     216    $display = ""; 
     217 
     218    $quote_data = quotescollection_txtfmt($quote_data); 
     219 
     220    $display .= "<p><q>".$quote_data['quote']."</q>"; 
     221     
     222    $cite = ""; 
     223 
     224    if($options['show_author'] && $quote_data['author']) 
     225        $cite = '<span class="quotescollection_author">'. $quote_data['author'] .'</span>'; 
     226 
     227    if($options['show_source'] && $quote_data['source']) { 
     228        if($cite) $cite .= ", "; 
     229        $cite .= '<span class="quotescollection_source">'. $quote_data['source'] .'</span>'; 
     230    } 
     231 
     232    if($cite) $cite = " <cite>&mdash;&nbsp;{$cite}</cite>"; 
     233    $display .= $cite."</p>"; 
     234 
     235    return apply_filters( 'quotescollection_output_format', $display ); 
     236} 
     237 
    214238 
    215239function quotescollection_display_randomquote($show_author = 1, $show_source = 1, $ajax_refresh = 1, $random_quote = array())  
     
    280304    $random_quote  = quotescollection_txtfmt($random_quote); 
    281305                 
    282     $display = "<p><q>". $random_quote['quote'] ."</q>"; 
    283     $cite = ""; 
    284     if($options['show_author'] && $random_quote['author']) 
    285         $cite = '<span class="quotescollection_author">'. $random_quote['author'] .'</span>'; 
    286  
    287     if($options['show_source'] && $random_quote['source']) { 
    288         if($cite) $cite .= ", "; 
    289             $cite .= '<span class="quotescollection_source">'. $random_quote['source'] .'</span>'; 
    290     } 
    291     if($cite) $cite = " <cite>&mdash;&nbsp;{$cite}</cite>"; 
    292     $display .= $cite."</p>"; 
     306    $display = quotescollection_output_format($random_quote, $options); 
    293307     
    294308    // We don't want to display the 'next quote' link if there is no more than 1 quote 
     
    374388 
    375389 
    376 function quotescollection_css_head()  
    377 { 
    378     ?> 
    379     <link rel="stylesheet" type="text/css" href="<?php echo plugins_url(); ?>/quotes-collection/quotes-collection.css" /> 
    380     <?php 
    381 } 
    382  
    383  
    384 add_action('wp_head', 'quotescollection_css_head' ); 
    385  
     390function quotescollection_css_head() 
     391{ 
     392    global $quotescollection_version; 
     393    if ( !is_admin() ) { 
     394        wp_register_style( 'quotescollection-style', plugins_url('quotes-collection.css', __FILE__), false, $quotescollection_version ); 
     395        wp_enqueue_style( 'quotescollection-style' ); 
     396    } 
     397} 
     398add_action( 'wp_enqueue_scripts', 'quotescollection_css_head' ); 
    386399 
    387400 
Note: See TracChangeset for help on using the changeset viewer.