Plugin Directory

Changeset 871162


Ignore:
Timestamp:
03/07/2014 11:00:19 AM (12 years ago)
Author:
laura20
Message:

v1.5

Location:
after-content/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • after-content/trunk/after-content.php

    r841374 r871162  
    1 <?php
    2 /*
    3 Plugin Name: After content
     1<?php 
     2/* 
     3Plugin Name: After content 
    44Description: Add more content after post content: related content, author info, post pagination, social sharing buttons, post meta, image, text
    5 Version:1.0
    6 Author: Genethick
    7 Author URI: http://www.codetocode-developments.com
    8 Plugin URI: http://www.codetocode-developments.com/wp-plugins/after-content-plugin-documentation/
    9 License: GPLv2
    10 License URI: http://www.gnu.org/licenses/gpl-2.0.html
    11 */ 
    12 
    13 global $smof_data;
    14 
    15 include ('post-pagination.php');
    16 include ('related.php');
    17 include ('author.php');
    18 include ('social-profiles.php');
    19 include ('social-sharing.php');
    20 include ('post-meta.php');
    21 include ('text.php');
    22 include ('img.php');
    23 include ('banner.php');
    24 include ('admin/index.php');
     5Version:1.5
     6Author: Genethick
     7Author URI: http://www.codetocode-developments.com
     8Plugin URI: http://www.codetocode-developments.com/wp-plugins/after-content-plugin-documentation/
     9License: GPLv2
     10License URI: http://www.gnu.org/licenses/gpl-2.0.html
     11*/
     12     
     13// Script version, used to add version for scripts and styles
     14define( 'AFC_VER', '1.5' );
     15// Define plugin URLs, for fast enqueuing scripts and styles
     16if ( ! defined( 'AFC_URL' ) )
     17    define( 'AFC_URL', plugin_dir_url( __FILE__ ) );
     18// Plugin paths, for including files
     19if ( ! defined( 'AFC_DIR' ) )
     20    define( 'AFC_DIR', plugin_dir_path( __FILE__ ) );
    2521   
    26 /*------------------------------------------------------------------------------------------------------------------------------
    27     ADD HOOKS
    28 ---------------------------------------------------------------------------------------------------------------------------------*/
    29 
    30 //display pagination if is active and is single page
    31 if ( $smof_data['afc_pagination_active'] == 1 ) {
    32    
    33     function add_afc_pagination ($content) {
    34        
    35         $content .= afc_post_pagination();
    36         return $content;
    37        
    38     }
    39    
    40     add_filter('the_content',  'add_afc_pagination' );
    41    
    42     function add_afc_pagination_css () {
    43        
    44         global $smof_data;
    45         echo '<style>' . $smof_data['afc_post_pagination_css'] . '</style>';
    46        
    47     }
    48    
    49     add_action('wp_head',  'add_afc_pagination_css' );
    50    
    51 }
     22// Initialize Redux Framework
     23if ( !class_exists( 'ReduxFramework' ) && file_exists( dirname( __FILE__ ) . '/ReduxFramework/ReduxCore/framework.php' ) ) {
     24    require_once( dirname( __FILE__ ) . '/ReduxFramework/ReduxCore/framework.php' );
     25}
     26if ( !isset( $afc_opt ) && file_exists( dirname( __FILE__ ) . '/inc/plugin-options.php' ) ) {
     27    require_once( dirname( __FILE__ ) . '/inc/plugin-options.php' );
     28}   
     29if ( file_exists( AFC_DIR . '/inc/post-pagination.php' ) ) {
     30    require_once AFC_DIR . 'inc/post-pagination.php';
     31}
     32if ( file_exists( AFC_DIR . '/inc/related.php' ) ) {
     33    include AFC_DIR . 'inc/related.php';
     34}
     35if ( file_exists( AFC_DIR . '/inc/author.php' ) ) {
     36    require_once AFC_DIR . 'inc/author.php';
     37}
     38if ( file_exists( AFC_DIR . '/inc/social-profiles.php' ) ) {
     39    require_once AFC_DIR . 'inc/social-profiles.php';
     40}
     41if ( file_exists( AFC_DIR . '/inc/social-sharing.php' ) ) {
     42    require_once AFC_DIR . 'inc/social-sharing.php';
     43}
     44if ( file_exists( AFC_DIR . '/inc/post-meta.php' ) ) {
     45    require_once AFC_DIR . 'inc/post-meta.php';
     46}
     47if ( file_exists( AFC_DIR . '/inc/text.php' ) ) {
     48    require_once AFC_DIR . 'inc/text.php';
     49}
     50if ( file_exists( AFC_DIR . '/inc/img.php' ) ) {
     51    require_once AFC_DIR . 'inc/img.php';
     52}
     53if ( file_exists( AFC_DIR . '/inc/banner.php' ) ) {
     54    require_once AFC_DIR . 'inc/banner.php';
     55}
    5256
    5357
    54 //display related content if is active and is single page
    55 if ( $smof_data['afc_related_active'] == 1 ) {
    56    
    57     function add_afc_related_content_cat ($content) {
    58        
    59         $content .= afc_related_content(); 
    60         return $content;
    61        
    62     }
    63    
    64     add_filter('the_content',  'add_afc_related_content_cat', 2 );
    65    
    66     function add_afc_related_css () {
    67        
    68         global $smof_data;
    69         echo '<style>' . $smof_data['afc_related_content_css'] . '</style>';
    70        
    71     }
    72    
    73     add_action('wp_head',  'add_afc_related_css' );
    74    
    75 }
     58//add activated features after post content
     59add_filter( 'the_content',  'afc_add_after_post', 2 ); 
     60function afc_add_after_post ($content) {
     61     
     62    global $afc_opt;
     63     
     64    if ( $afc_opt['activate_pagination'] == '1' ) {
     65        $content .= afc_post_pagination();
     66    }   
     67    if ( $afc_opt['activate_related'] == '1' ) {
     68        $content .= afc_related_content();   
     69    }
     70    if ( $afc_opt['activate_author'] == '1' ) {
     71        $content .= afc_author_info();
     72    }
     73    if ( $afc_opt['activate_social_buttons'] == '1' ) {
     74        $content .= afc_social_sharing();
     75    }
     76    if ( $afc_opt['activate_post_meta'] == '1' ) {
     77        $content .= afc_post_meta();
     78    }
     79    if ( $afc_opt['activate_text'] == '1') {
     80        $content .= afc_text();
     81    }
     82    if ( $afc_opt['activate_img'] == '1' ) {
     83        $content .= afc_img();
     84    }
     85    if ( $afc_opt['activate_banner'] == '1' ) {
     86        $content .= afc_banner();
     87    }
     88    return $content;
     89}
     90/* facebook */
     91function afc_facebook() {
     92    wp_register_script( 'facebook',  AFC_URL . 'js/facebook.js' );
     93    wp_enqueue_script( 'facebook' );
     94}
     95add_action( 'wp_enqueue_scripts', 'afc_facebook' );
     96 
     97/* twitter */
     98function afc_twitter() {
     99    wp_register_script( 'twitter',  AFC_URL . 'js/twitter.js' );
     100    wp_enqueue_script( 'twitter' );
     101}
     102add_action( 'wp_enqueue_scripts', 'afc_twitter' );
    76103
     104/* google plus */
     105function afc_google_plus() {
     106    wp_register_script( 'google_plus',  AFC_URL . 'js/google-plus.js' );
     107    wp_enqueue_script( 'google_plus' );
     108}
     109add_action( 'wp_enqueue_scripts', 'afc_google_plus' );
    77110
    78 //display author info if is active and is single page
    79 if ( $smof_data['afc_author_active'] == 1 ) {
    80    
    81     add_filter('user_contactmethods','afc_new_contact_methods');
    82    
    83     function add_afc_author ($content) {
    84        
    85         $content .= afc_author_info();
    86         return $content;
    87        
    88     }
    89    
    90     add_filter('the_content',  'add_afc_author', 12 );
    91    
    92     function add_afc_author_css () {
    93        
    94         global $smof_data;
    95         echo '<style>' . $smof_data['afc_author_info_css'] . '</style>';
    96        
    97     }
    98    
    99     add_action('wp_head',  'add_afc_author_css' );
    100    
    101 }
     111/* FONT AWESOME ICONS*/
     112function afc_font_awesome () {
     113    wp_register_style( 'afc_font_awesome', '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css');
     114    wp_enqueue_style( 'afc_font_awesome' );
     115}
     116add_action('wp_enqueue_scripts', 'afc_font_awesome');
    102117
     118/* THUMBNAILS SUPPORT AND SIZES */
     119if (!current_theme_supports('post-thumbnail')) {
     120    add_theme_support( 'post-thumbnails' );
     121}
     122add_image_size ('afc-200','200','150',true);
     123 
     124//add jquery
     125add_action( 'wp_enqueue_scripts', 'afc_add_jquery' );
     126function afc_add_jquery() {
     127    wp_enqueue_script( 'jquery' );
     128}
    103129
    104 //display social sharing buttons if is active and is single page
    105 if ( $smof_data['afc_social_sharing_active'] == 1 ) {
    106    
    107     function add_afc_social_sharing ($content) {
    108        
    109         $content .= afc_social_sharing();
    110         return $content;
    111        
    112     }
    113    
    114     add_filter('the_content',  'add_afc_social_sharing', 1 );
    115    
    116     function add_afc_social_sharing_css () {
    117        
    118         global $smof_data;
    119         echo '<style>' . $smof_data['afc_social_sharing_css'] . '</style>';
    120        
    121     }
    122    
    123     add_action('wp_head',  'add_afc_social_sharing_css' );
    124    
    125 }
     130//add styles
     131add_action( 'wp_enqueue_scripts', 'afc_add_style' );
     132function afc_add_style() {
     133    wp_register_style( 'after-content-css', AFC_URL . 'after-content.css' );
     134    wp_enqueue_style( 'after-content-css' );
     135}
    126136
    127 //display post custom meta list if is active and is single page
    128 if ( $smof_data['afc_post_meta'] == 1 ) {
    129    
    130     function add_afc_post_meta ($content) {
    131        
    132         $content .= afc_post_meta();
    133         return $content;
    134        
    135     }
    136    
    137     add_filter('the_content',  'add_afc_post_meta', 1 );
    138    
    139     function add_afc_post_meta_css () {
    140        
    141         global $smof_data;
    142         echo '<style>' . $smof_data['afc_post_meta_css'] . '</style>';
    143        
    144     }
    145    
    146     add_action('wp_head',  'add_afc_post_meta_css' );
    147    
    148 }
    149 
    150 //display custom if is active and is single page
    151 if ( $smof_data['afc_add_text'] == 1 ) {
    152    
    153     function add_afc_text ($content) {
    154        
    155         $content .= afc_text();
    156         return $content;
    157        
    158     }
    159    
    160     add_filter('the_content',  'add_afc_text', 1 );
    161    
    162     function add_afc_text_css () {
    163        
    164         global $smof_data;
    165         echo '<style>' . $smof_data['afc_text_css'] . '</style>';
    166        
    167     }
    168    
    169     add_action('wp_head',  'add_afc_text_css' );
    170    
    171 }
    172 
    173 //display custom image if is active and is single page
    174 if ( $smof_data['afc_add_image'] == 1 ) {
    175    
    176     function add_afc_img ($content) {
    177        
    178         $content .= afc_img();
    179         return $content;
    180        
    181     }
    182    
    183     add_filter('the_content',  'add_afc_img', 1 );
    184    
    185     function add_afc_image_css () {
    186        
    187         global $smof_data;
    188         echo '<style>' . $smof_data['afc_image_css'] . '</style>';
    189        
    190     }
    191    
    192     add_action('wp_head',  'add_afc_image_css' );
    193    
    194 }
    195 
    196 //display banner if is active and is single page
    197 if ( $smof_data['afc_add_banner'] == 1 ) {
    198    
    199     function add_afc_banner ($content) {
    200         $content .= afc_banner();   
    201         return $content;
    202        
    203     }
    204    
    205     add_filter('the_content',  'add_afc_banner', 1 );
    206    
    207     function add_afc_banner_css () {
    208        
    209         global $smof_data;
    210         echo '<style>' . $smof_data['afc_banner_css'] . '</style>';
    211        
    212     }
    213    
    214     add_action('wp_head',  'add_afc_banner_css' );
    215    
    216 }
    217 
    218 
    219 //add jquery
    220 function afc_add_jquery() {
    221 
    222     wp_enqueue_script("jquery");
    223    
    224 }
    225 
    226 add_action('wp_enqueue_scripts', 'afc_add_jquery');
     137//add custom css
     138add_action('wp_enqueue_scripts',  'add_afc_css' );
     139function add_afc_css () {
     140    global $afc_opt;
     141    if( !empty( $afc_opt['custom_css'] ) ) {
     142        echo '<style type="text/css">' . $afc_opt['custom_css'] . '</style>';
     143    }
     144}     
    227145?>
  • after-content/trunk/js/facebook.js

    r841374 r871162  
    11(function(d, s, id) {
     2
    23  var js, fjs = d.getElementsByTagName(s)[0];
     4
    35  if (d.getElementById(id)) return;
     6
    47  js = d.createElement(s); js.id = id;
     8
    59  js.src = "//connect.facebook.net/es_ES/all.js#xfbml=1&appId=501726816556905";
     10
    611  fjs.parentNode.insertBefore(js, fjs);
     12
    713}(document, 'script', 'facebook-jssdk'));
  • after-content/trunk/js/google-plus.js

    r841374 r871162  
    11  (function() {
     2
    23    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
     4
    35    po.src = 'https://apis.google.com/js/platform.js';
     6
    47    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
     8
    59  })();
  • after-content/trunk/readme.txt

    r841374 r871162  
    44Tags: post pagination, related content, author info, author biography, post meta, social sharing, social networks, like button
    55Requires at least: 3.0
    6 Tested up to: 3.8
    7 Stable tag: 1.0
     6Tested up to: 3.8.1
     7Stable tag: 1.5
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1717This plugin adds eight functionalities you can add after all post content:
    1818
    19 *   Post pagination
    20 *   Related content
    21 *   Author info
    22 *   Social sharing buttons
     19*   Post pagination
     20*   Related content
     21*   Author info
     22*   Social sharing buttons
    2323*   Custom post meta list
    2424*   Custom text
     
    2929
    3030== Installation ==
    31 1. Upload `WP-Basics` directory to the `/wp-content/plugins/` directory
     311. Upload `after-content` directory to the `/wp-content/plugins/` directory
    32322. Activate the plugin through the 'Plugins' menu in WordPress
    33 3. Go to WP-Basics menu to activate and configure the plugin
     333. Go to After Content menu to activate and configure the plugin
    3434
    3535== Frequently Asked Questions ==
     
    4646
    4747== Changelog ==
     48= 1.5 =
     49*Smof Options Framework replaced by Redux Framework
     50*Improve file and code organization
    4851= 1.0 =
    4952First release
Note: See TracChangeset for help on using the changeset viewer.