Plugin Directory

Changeset 1224049


Ignore:
Timestamp:
08/18/2015 07:46:53 PM (11 years ago)
Author:
OptimalDevs
Message:
  • Updated to Creative Commons License 4.0.
  • Now it's compatible with custom post types.
  • Tested with Wordpress 4.2.4.
Location:
creative-commons-generator/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • creative-commons-generator/trunk/ccg-admin.php

    r633999 r1224049  
    1414
    1515function ccg_set_default() {
     16   
    1617    if ( !get_option( 'ccg_options' ) ) {
     18       
    1719        $ccg_options = array(
    1820            'active' => TRUE,
     
    3234        update_option( 'ccg_options', $ccg_options );
    3335    }
     36   
    3437}
    3538
     
    6063    }
    6164
    62     $banner = "<a target='_blank' rel='license nofollow' href='http://creativecommons.org/licenses/" . $attributes . "/3.0/'><img alt='Creative Commons License' style='border-width:0' src='http://i.creativecommons.org/l/" . $attributes . "/3.0/88x31.png' /></a><br />";
    63     $islicensed =  ' is licensed under a <a target="_blank" rel="license nofollow" href="http://creativecommons.org/licenses/' . $attributes . '/3.0/">' . $attributes_text . ' 3.0 Unported</a><br />';
     65    $banner = "<a target='_blank' rel='license nofollow' href='http://creativecommons.org/licenses/" . $attributes . "/4.0/'><img alt='Creative Commons License' style='border-width:0' src='http://i.creativecommons.org/l/" . $attributes . "/4.0/88x31.png' /></a><br />";
     66    $islicensed =  ' is licensed under a <a target="_blank" rel="license nofollow" href="http://creativecommons.org/licenses/' . $attributes . '/4.0/">' . $attributes_text . ' 4.0 ' . __( 'International', 'ccg-domain' ) . '</a><br />';
    6467   
    6568    switch ( $who_call ) {
     
    127130    $ccg_options['more_url'] = esc_attr( esc_url( $form['ccg_more'] ) );
    128131    $ccg_options['format'] = $form['ccg_format'];
    129    
     132
    130133    return $ccg_options;
    131134}
  • creative-commons-generator/trunk/ccg-init.php

    r633999 r1224049  
    44Plugin URI: http://wordpress.org/extend/plugins/creative-commons-generator/
    55Description: A Creative Commons banner for Wordpress!.
    6 Version: 1.3
     6Version: 1.4
    77Author: OptimalDevs
    8 Author URI: http://optimaldevs.com/
     8Author URI: https://profiles.wordpress.org/optimaldevs/
    99*/
    1010load_plugin_textdomain( 'ccg-domain', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
  • creative-commons-generator/trunk/ccg-post-options.php

    r632209 r1224049  
    44
    55function ccg_add_meta_box() {
    6      add_meta_box(
    7         'ccg_metabox',
    8         __( 'Creative Commons Generator', 'ccg-domain' ),
    9         'ccg_meta_box',
    10         'post'
    11     );
     6   
     7    $args   = array(
     8        'public'    => true,
     9        '_builtin'  => false
     10    );
     11
     12    $output     = 'names'; // names or objects, note names is the default
     13    $operator   = 'and'; // 'and' or 'or'
     14    $post_types = get_post_types($args,$output,$operator);
     15    $posttypes_array = array();
     16
     17    foreach ($post_types  as $post_type ) {
     18        $posttypes_array[] = $post_type;
     19    }
     20   
     21    $posttypes_array[] = 'post';
     22
     23    foreach ( $posttypes_array as $post_type ) {
     24       
     25        add_meta_box(
     26            'ccg_metabox',
     27            __( 'Creative Commons Generator', 'ccg-domain' ),
     28            'ccg_meta_box',
     29            $post_type
     30        );
     31       
     32    }
     33   
    1234}
    1335
    1436function ccg_save_post_data( $post_id ) {
     37   
    1538    if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;
    1639    if ( !isset( $_POST['ccg_nonce'] ) ) return;
     
    2043    $ccg_options = ccg_set_options( $_POST );   
    2144    update_post_meta( $post_id, '_ccg_options', $ccg_options );
     45   
    2246}
    2347
    2448function ccg_meta_box( $post ) {
     49   
    2550    wp_nonce_field( plugin_basename( __FILE__ ), 'ccg_nonce' );
    2651   
    2752    // Get the current options
    2853    if ( get_post_meta( $post->ID, '_ccg_options' ) ) {
     54       
    2955        $ccg_old_options = get_post_meta( $post->ID, '_ccg_options', true );
    3056        $ccg_author_name = $ccg_old_options['author_name'];
    3157        $ccg_author_url = $ccg_old_options['author_url'];
    32         echo ccg_get_banner( $ccg_old_options, "meta_exist" );
     58        echo ccg_get_banner( $ccg_old_options, 'meta_exist' );
     59       
    3360    } else {
     61       
    3462        $ccg_old_options = get_option('ccg_options');
    3563        global $current_user;
    3664        $ccg_author_name = esc_attr( $current_user->display_name );
    3765        $ccg_author_url = esc_url( get_author_posts_url( $current_user->ID ) );
    38         echo ccg_get_banner( $ccg_old_options, "publish" );
     66        echo ccg_get_banner( $ccg_old_options, 'publish' );
     67       
    3968    }
    4069   
     
    89118    ccg_get_table( $ccg_old_options );
    90119}
     120
     121
     122
    91123?>
  • creative-commons-generator/trunk/lang/ccg-domain-es_ES.po

    r631821 r1224049  
    11msgid ""
    22msgstr ""
    3 "Project-Id-Version: Creative Commons Generator 1.0\n"
    4 "POT-Creation-Date: 2012-11-27 09:57+0100\n"
    5 "PO-Revision-Date: 2012-11-27 11:03+0100\n"
     3"Project-Id-Version: Creative Commons Generator 1.4\n"
     4"POT-Creation-Date: 2015-08-18 21:42+0200\n"
     5"PO-Revision-Date: 2015-08-18 21:42+0200\n"
    66"Last-Translator: Alejandro Gálvez Sánchez y Andy Hernández Salazar\n"
    7 "Language-Team: OptimalDevs <info@optimaldevs.com>\n"
    8 "Language: Spanish\n"
     7"Language-Team: OptimalDevs <optimaldevs@gmail.com>\n"
     8"Language: es\n"
    99"MIME-Version: 1.0\n"
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "X-Generator: Poedit 1.5.4\n"
     12"X-Generator: Poedit 1.8.4\n"
    1313"X-Poedit-KeywordsList: __;_e\n"
    1414"X-Poedit-Basepath: ..\n"
     
    2121msgstr "Opciones de Creative Commons Generator"
    2222
    23 #: ccg-admin.php:45
     23#: ccg-admin.php:50
    2424msgid "Creative Commons Attribution"
    2525msgstr "Creative Commons Attribution"
    2626
    27 #: ccg-admin.php:49
     27#: ccg-admin.php:54
    2828msgid "-NonCommercial"
    2929msgstr "-NonCommercial"
    3030
    31 #: ccg-admin.php:53
     31#: ccg-admin.php:58
    3232msgid "-ShareAlike"
    3333msgstr "-ShareAlike"
    3434
    35 #: ccg-admin.php:57
     35#: ccg-admin.php:62
    3636msgid "-NoDerivs"
    3737msgstr "-NoDerivs"
    3838
    39 #: ccg-admin.php:65
     39#: ccg-admin.php:66
     40msgid "International"
     41msgstr "Internacional"
     42
     43#: ccg-admin.php:70
    4044msgid "Title"
    4145msgstr "Título"
    4246
    43 #: ccg-admin.php:66
     47#: ccg-admin.php:71
    4448msgid "Author-Name"
    4549msgstr "Nombre-Autor"
    4650
    47 #: ccg-admin.php:87
     51#: ccg-admin.php:92
    4852msgid "This work"
    4953msgstr "This work"
    5054
    51 #: ccg-admin.php:152
     55#: ccg-admin.php:141
    5256msgid "Options"
    5357msgstr "Opciones"
    5458
    55 #: ccg-admin.php:153
     59#: ccg-admin.php:142
    5660msgid "Description"
    5761msgstr "Descripción"
    5862
    59 #: ccg-admin.php:160
     63#: ccg-admin.php:149
    6064msgid "Enable Creative Commons Generator"
    6165msgstr "Activar Creative Commons Generator"
    6266
    63 #: ccg-admin.php:164
     67#: ccg-admin.php:153
    6468msgid ""
    6569"Creative Commons Generator display the banner below the post if you check "
     
    6973"marca esta opción."
    7074
    71 #: ccg-admin.php:170
     75#: ccg-admin.php:159
    7276msgid "Allow modifications of your work"
    7377msgstr "Permitir modificaciones de la obra"
    7478
    75 #: ccg-admin.php:174
     79#: ccg-admin.php:163
    7680msgid ""
    7781"The licensor permits others to copy, distribute, display and perform the "
     
    8185"de la obra así como la generación de obras derivadas."
    8286
    83 #: ccg-admin.php:180
     87#: ccg-admin.php:169
    8488msgid "Allow modifications as long as others share alike"
    8589msgstr ""
    8690"Permitir modificaciones de la obra solo si se comparte de la misma manera"
    8791
    88 #: ccg-admin.php:184
     92#: ccg-admin.php:173
    8993msgid ""
    9094"The licensor permits others to create and distribute derivative works but "
     
    9498"solamente bajo la misma licencia o bajo una licencia compatible."
    9599
    96 #: ccg-admin.php:190
     100#: ccg-admin.php:179
    97101msgid "Disallow modifications of the work."
    98102msgstr "No permitir modificaciones de la obra"
    99103
    100 #: ccg-admin.php:194
     104#: ccg-admin.php:183
    101105msgid ""
    102106"The licensor permits others to copy, distribute, display and perform only "
     
    108112"distribuir obras derivadas basadas en ella."
    109113
    110 #: ccg-admin.php:200
     114#: ccg-admin.php:189
    111115msgid "Disallow commercial uses of your work"
    112116msgstr "No permitir uso comercial de la obra"
    113117
    114 #: ccg-admin.php:204
     118#: ccg-admin.php:193
    115119msgid ""
    116120"The licensor permits others to copy, distribute, display, and perform the "
     
    120124"obtenga el permiso del licenciador."
    121125
    122 #: ccg-admin.php:210
     126#: ccg-admin.php:199
    123127msgid "Show title of work"
    124128msgstr "Mostrar título de la obra"
    125129
    126 #: ccg-admin.php:214 ccg-post-options.php:54
     130#: ccg-admin.php:203 ccg-post-options.php:80
    127131msgid "The title of the work you are licensing."
    128132msgstr "El título de la obra que está licenciando."
    129133
    130 #: ccg-admin.php:220
     134#: ccg-admin.php:209
    131135msgid "Show author of work"
    132136msgstr "Mostrar autor de la obra"
    133137
    134 #: ccg-admin.php:224 ccg-post-options.php:76
     138#: ccg-admin.php:213 ccg-post-options.php:102
    135139msgid ""
    136140"The name of the person who should receive attribution for the work. Most "
     
    140144"Generalmente, el autor."
    141145
    142 #: ccg-admin.php:230 ccg-admin.php:297 ccg-post-options.php:81
     146#: ccg-admin.php:219 ccg-admin.php:286 ccg-post-options.php:107
    143147msgid "Link to the author of the work"
    144148msgstr "Enlazar al autor de la obra"
    145149
    146 #: ccg-admin.php:234 ccg-post-options.php:87
     150#: ccg-admin.php:223 ccg-post-options.php:113
    147151msgid ""
    148152"The URL to which the work should be attributed. For example, the work's page "
     
    152156"ejemplo, la página de la obra o el sitio del autor."
    153157
    154 #: ccg-admin.php:240
     158#: ccg-admin.php:229
    155159msgid "More permissions URL:"
    156160msgstr "Más permisos URL:"
    157161
    158 #: ccg-admin.php:245
     162#: ccg-admin.php:234
    159163msgid ""
    160164"A URL where a user can find information about obtaining rights that are not "
     
    164168"no otorgados por la licencia CC."
    165169
    166 #: ccg-admin.php:251
     170#: ccg-admin.php:240
    167171msgid "Format of work"
    168172msgstr "Formato de la obra"
    169173
    170 #: ccg-admin.php:253
     174#: ccg-admin.php:242
    171175msgid "Other / Multiple formats"
    172176msgstr "Otros / Múltiples formatos"
    173177
    174 #: ccg-admin.php:254
     178#: ccg-admin.php:243
    175179msgid "Audio"
    176180msgstr "Audio"
    177181
    178 #: ccg-admin.php:255
     182#: ccg-admin.php:244
    179183msgid "Video"
    180184msgstr "Vídeo"
    181185
    182 #: ccg-admin.php:256
     186#: ccg-admin.php:245
    183187msgid "Image"
    184188msgstr "Imagen"
    185189
    186 #: ccg-admin.php:257
     190#: ccg-admin.php:246
    187191msgid "Text"
    188192msgstr "Texto"
    189193
    190 #: ccg-admin.php:258
     194#: ccg-admin.php:247
    191195msgid "Dataset"
    192196msgstr "Conjunto de datos"
    193197
    194 #: ccg-admin.php:259
     198#: ccg-admin.php:248
    195199msgid "Interactive"
    196200msgstr "Interactivo"
    197201
    198 #: ccg-admin.php:264
     202#: ccg-admin.php:253
    199203msgid ""
    200204"This describes what kind of work is being licensed. For example, a "
     
    206210"múltiples\"."
    207211
    208 #: ccg-admin.php:276
     212#: ccg-admin.php:265
    209213msgid "Creative Commons Generator - Options Page"
    210214msgstr "Creative Commons Generator - Página de Opciones"
    211215
    212 #: ccg-admin.php:283
     216#: ccg-admin.php:272
    213217msgid "Successfully saved configuration."
    214218msgstr "Configuración guardada con éxito."
    215219
    216 #: ccg-admin.php:286
     220#: ccg-admin.php:275
    217221msgid "Preview"
    218222msgstr "Vista Previa"
    219223
    220 #: ccg-admin.php:289
     224#: ccg-admin.php:278
    221225msgid "General Settings"
    222226msgstr "Configuración General"
    223227
    224 #: ccg-admin.php:290
     228#: ccg-admin.php:279
    225229msgid ""
    226230"This setting is general and is used by default for all entries (old and "
     
    233237"edicíon."
    234238
    235 #: ccg-admin.php:293
     239#: ccg-admin.php:282
    236240msgid "Save Changes"
    237241msgstr "Guardar Cambios"
    238242
    239 #: ccg-admin.php:296 ccg-post-options.php:70
     243#: ccg-admin.php:285 ccg-post-options.php:96
    240244msgid "Author's Name:"
    241245msgstr "Nombre del Autor:"
    242246
    243 #: ccg-admin.php:296
     247#: ccg-admin.php:285
    244248msgid "The author's Display Name will be used by default."
    245249msgstr ""
    246250"Se usará por defecto el Display Name del usuario que publicó la noticia."
    247251
    248 #: ccg-admin.php:297
     252#: ccg-admin.php:286
    249253msgid "The author's link in WordPress will be used by default."
    250254msgstr "Se usará por defecto el enlace al autor en WordPress."
    251255
    252 #: ccg-admin.php:298 ccg-post-options.php:48
     256#: ccg-admin.php:287 ccg-post-options.php:74
    253257msgid "Title of work:"
    254258msgstr "Título de la obra:"
    255259
    256 #: ccg-admin.php:298
     260#: ccg-admin.php:287
    257261msgid ""
    258262"For entries created with disabled CCG will use the title of the post by "
     
    264268"deberá ser introducido manualmente."
    265269
    266 #: ccg-post-options.php:8
     270#: ccg-post-options.php:27
    267271msgid "Creative Commons Generator"
    268272msgstr "Creative Commons Generator"
    269273
    270 #: ccg-post-options.php:59
     274#: ccg-post-options.php:85
    271275msgid "Source work URL:"
    272276msgstr "Fuenta de la obra URL:"
    273277
    274 #: ccg-post-options.php:65
     278#: ccg-post-options.php:91
    275279msgid "The URL of the work upon which this work is based or derived."
    276280msgstr ""
  • creative-commons-generator/trunk/readme.txt

    r633999 r1224049  
    11=== Plugin Name ===
    2 Contributors: OptimalDevs
     2Contributors: OptimalDevs, Alejandro Galvez, Andy Hernandez
    33Donate link: http://optimaldevs.com/
    44Tags: creative, commons, generator, post, attribution, cc, cc license, creative commons, legal, license, metadata, rights
    55Requires at least: 2.8
    6 Tested up to: 3.4.5
    7 Stable tag: 1.3
     6Tested up to: 4.2.4
     7Stable tag: 1.4
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    1818
    1919* Official banner images provided by creativecommons.org.
    20 * Version 3.0 and International jurisdiction license.
    21 * General settings for all post published.
     20* Version 4.0 and International jurisdiction license.
     21* General settings for all post published (custom post types included).
    2222* Specific settings for each post.
    2323* Including metadata, according creativecommons.org.
     
    4747== Changelog ==
    4848
     49= 1.4 =
     50* Updated to Creative Commons License 4.0.
     51* Now it's compatible with custom post types.
     52* Tested with Wordpress 4.2.4.
     53
    4954= 1.3 =
    5055* Added target=_blank for all links.
Note: See TracChangeset for help on using the changeset viewer.