Plugin Directory

Changeset 8297

Timestamp:
03/16/2007 09:17:31 PM (19 years ago)
Author:
kccricket
Message:

cricket-moods:

  • Starting with 3.4, all new versions will be licensed under the GPL.
  • Available mood icons are now always shown in the manage and option pages.
Location:
cricket-moods/trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • cricket-moods/trunk/changelog.txt

    r8035 r8297  
    11=== Cricket Moods Changelog ===
    22
    3 20070221: Version 3.4
     320070: Version 3.4
    44* The plugin is now translatable.  The POT file can be found in the subversion repository.
     5
     6
     7
    58
    6920070105: Version 3.3
  • cricket-moods/trunk/cricket-moods.php

    r8035 r8297  
    1010
    1111/**
     12
    1213Copyright (c) 2007 Keith Constable
    1314
    14 Permission is hereby granted, free of charge, to any person obtaining a copy of
    15 this software and associated documentation files (the "Software"), to deal in
    16 the Software without restriction, including without limitation the rights to
    17 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
    18 the Software, and to permit persons to whom the Software is furnished to do so,
    19 subject to the following conditions:
    20 
    21 The above copyright notice and this permission notice shall be included in all
    22 copies or substantial portions of the Software.
    23 
    24 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    25 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
    26 FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
    27 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
    28 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
    29 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     15This program is free software; you can redistribute it and/or modify
     16it under the terms of the GNU General Public License as published by
     17the Free Software Foundation; either version 2 of the License, or
     18(at your option) any later version.
     19
     20This program is distributed in the hope that it will be useful,
     21but WITHOUT ANY WARRANTY; without even the implied warranty of
     22MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     23GNU General Public License for more details.
     24
     25You should have received a copy of the GNU General Public License along
     26with this program; if not, write to the Free Software Foundation, Inc.,
     2751 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
    3028*/
    3129
     
    5149load_plugin_textdomain('cricket-moods','wp-content/plugins/');
    5250
     51
     52
     53
     54
     55
    5356/**
    5457cm_the_moods
     
    383386look decent.
    384387*/
    385 function cm_admin_style() { ?>
    386 
    387 <!-- Cricket Moods styles -->
    388 <style type="text/css">
     388function cm_admin_style() {
     389
     390header('Content-Type: text/css');
     391>
    389392
    390393#cm_moodlist img {
     
    395398#cm_mood_table {
    396399    text-align: center;
    397     width: 100%;
     400    width: 80%;
     401    margin: 0 auto;
    398402}
    399403
     
    407411
    408412#mood_image_box {
    409     max-height: 15em;
     413    float: left;
     414    width: 18%;
     415    max-height: 40em;
    410416    overflow: scroll;
    411     margin: 1em 0;
     417}
     418
     419#mood_image_box h4 {
     420    margin: 0;
    412421}
    413422
     
    419428
    420429#mood_image_list li {
    421     margin: 0 .5ex;
     430    margin: ;
    422431    padding: 2px;
    423     white-space: nowrap;
    424     display: inline;
    425     border: 1px solid silver;
    426     line-height: 190%;
     432    background-color: silver;
    427433}
    428434
     
    440446    font-size: 1.2em;
    441447    font-weight: bold;
     448
     449
     450
     451
     452
    442453}
    443454
     
    460471}
    461472
    462 </style>
    463 <!-- end Cricket Moods -->
    464 
    465 <?php } // cm_admin_style
    466 
    467 add_action('admin_head', 'cm_admin_style');
     473<?php
     474} // cm_admin_style
     475
     476
     477function cm_admin_style_link() {
     478    echo '<link rel="stylesheet" href="'. $_SERVER[PHP_SELF] .'?style=true" type="text/css" />';
     479?>
     480<script type="text/javascript" language="javascript">
     481    // <![CDATA[
     482    function cmUE(id) {
     483        document.getElementById("cm_image_preview_" + id).src = "<?php echo get_option(CM_OPTION_DIR); ?>" + this.name;
     484    }
     485    // ]]>
     486</script>
     487
     488<?php
     489}
     490
     491add_action('admin_head', 'cm_admin_style_link');
    468492
    469493
     
    544568        }
    545569
    546                 foreach ($_POST as $name => $value) {
     570        foreach ($_POST as $name => $value) {
    547571
    548572            // Existing moods start with 'cm_id_'.
     
    610634<h3><?php _e('Default Moods', 'cricket-moods') ?></h3>
    611635    <p><?php _e('Use the table below to modify the <strong>default list of moods</strong> for new users.  You may leave <em>either</em> the name <em>or</em> the image blank, but not both.  Use the blank entries at the bottom to add new moods.', 'cricket-moods');
    612     if($_GET['showimages'] != 'true') { ?> <?php _e('You can also view a table of <a href="options-general.php?page=cm-options&amp;showimages=true">available mood images</a> in the mood image directory.', 'cricket-moods'); } ?></p>
    613 
    614 <?php
    615     if( $_GET['showimages'] == 'true' ) {
     636    ?></p>
     637
     638<?php
     639 if( $_GET['showimages'] == 'true' ) {
    616640        cm_list_mood_images();
    617     }
     641 }
    618642
    619643cm_edit_moods_table( cm_process_moods(-1) , $index, $err); ?>
     
    623647</p>
    624648</form>
    625 
     649<hr/>
    626650<form method="post">
    627651<fieldset class="cm_danger" id="cm_reset_moods"><legend><?php _e('Reset Moods', 'cricket-moods') ?></legend>
     
    660684
    661685<div id="mood_image_box">
     686
    662687<ul id="mood_image_list">
    663688<?php
     
    678703**/
    679704function cm_edit_moods_table($mood_list, $index, $err = array() ) {
     705
     706
     707
    680708?>
    681709    <table id="cm_mood_table">
    682         <thead><tr><th><?php _e('ID', 'cricket-moods') ?></th><th><?php _e('Mood Name', 'cricket-moods') ?></th><th><?php _e('Image File', 'cricket-moods') ?></th><th><?php _e('Delete', 'cricket-moods') ?></th></tr></thead>
    683         <tfoot><tr><th><?php _e('ID', 'cricket-moods') ?></th><th><?php _e('Mood Name', 'cricket-moods') ?></th><th><?php _e('Image File', 'cricket-moods') ?></th><th><?php _e('Delete', 'cricket-moods') ?></th></tr></tfoot>
     710        <thead><tr>
     711            <th><?php _e('ID', 'cricket-moods') ?></th>
     712            <th><?php _e('Mood Name', 'cricket-moods') ?></th>
     713            <th><?php _e('Image', 'cricket-moods') ?></th>
     714            <th><?php _e('Image File', 'cricket-moods') ?></th>
     715            <th><?php _e('Delete', 'cricket-moods') ?></th>
     716        </tr></thead>
     717        <tfoot><tr>
     718            <th><?php _e('ID', 'cricket-moods') ?></th>
     719            <th><?php _e('Mood Name', 'cricket-moods') ?></th>
     720            <th><?php _e('Image', 'cricket-moods') ?></th>
     721            <th><?php _e('Image File', 'cricket-moods') ?></th>
     722            <th><?php _e('Delete', 'cricket-moods') ?></th>
     723        </tr></tfoot>
    684724<?php
    685725    // List the existing moods.
     
    690730            <td><?php echo $id ?><input type="hidden" name="cm_id_<?php echo $id ?>" value="<?php echo $id ?>"/></td>
    691731            <td><input class="cm_text" type="text" name="cm_name_<?php echo $id ?>" value="<?php echo wp_specialchars($mood['mood_name'], true) ?>"/></td>
    692             <td><input class="cm_text" type="text" name="cm_image_<?php echo $id ?>" value="<?php echo wp_specialchars($mood['mood_image'], true) ?>"/></td>
     732            <td><?php if(!empty($mood['mood_image'])) { echo '<img src="'. $dir.$mood['mood_image'] .'" id="cm_image_preview_'. $id .'"/>'; } ?></td>
     733            <td><input class="cm_text" type="text" name="cm_image_<?php echo $id ?>" onchange="cmUE(<?php echo $id ?>);" value="<?php echo wp_specialchars($mood['mood_image'], true) ?>"/></td>
    693734            <td class="delete"><input type="checkbox" name="cm_delete_<?php echo $id ?>" onclick="return confirm('<?php _e('Are you sure you want to delete this mood?', 'cricket-moods') ?>');"/></td>
    694735        </tr>
     
    702743            <td><?php echo $i ?><input type="hidden" name="cm_new_id_<?php echo $i ?>" value="<?php echo $i ?>"/></td>
    703744            <td><input class="cm_text" type="text" name="cm_new_name_<?php echo $i ?>"/></td>
     745
    704746            <td><input class="cm_text" type="text" name="cm_new_image_<?php echo $i ?>"/></td>
    705             <td>-</td>
     747            <td></td>
    706748        </tr>
    707749<?php
     
    800842<form method="post">
    801843    <p><?php _e('Use the table below to modify your list of moods.  You may leave <em>either</em> the name <em>or</em> the image blank, but not both.  Use the blank entries at the bottom to add new moods.', 'cricket-moods');
    802     if($_GET['showimages'] != 'true') { ?> <?php _e('You can also view a table of <a href="edit.php?page=cm-manage-moods&amp;showimages=true">available mood images</a> in the mood image directory.', 'cricket-moods'); } ?></p>
     844    ?></p>
    803845    <p><strong><?php _e('Deleting a mood will also remove any references to that mood from your posts.', 'cricket-moods') ?></strong></p>
    804846
    805847<?php
    806     if( $_GET['showimages'] == 'true' ) {
     848 if( $_GET['showimages'] == 'true' ) {
    807849        cm_list_mood_images();
    808     }
     850 }
    809851
    810852    cm_edit_moods_table(cm_process_moods(), $index, $err);
  • cricket-moods/trunk/readme.txt

    r8035 r8297  
    11=== Cricket Moods ===
    2 Version: 3.4
    3 Tags: mood, meta
    4 Website: http://dev.wp-plugins.org/wiki/CricketMoods
     2Stable tag: 3.4
     3Tested up to: 2.1.2
     4Requires at least: 2.0.5
     5Contributors: kccricket
     6Donate link: http://kccricket.net/projects/
     7Tags: mood, meta, post
     8
     9Cricket Moods is a flexible "mood tag" WordPress plugin.  It allows an author to
     10add one or more "moods" to every post.
     11
     12== Description ==
    513
    614Cricket Moods is a flexible "mood tag" WordPress plugin.  It allows an author to
     
    6169ampersand, and any more moods followed by ampersands.  For example, on a post
    6270with the moods "Happy" and "Bored" it will print:
    63   <img src="/wp-images/smilies/icon_happy.gif" alt="Happy emoticon" /> Happy
     71  <img src="/wp-images/smilies/icon_happy.gif" alt="Happy emoticon" /> Happy
    6472    &amp; <img src="/wp-images/smilies/icon_neutral.gif" alt="Bored emoticon" />
    65     Bored
     73    Bored
    6674
    6775If there are no moods for the current post, it will print nothing.
    6876
    6977cm_the_moods() can take three parameters:
    70   <?php cm_the_moods('separator', 'before', 'after'); ?>
     78 
    7179  'separator'
    7280    (string) Text to place in between multiple moods. Default is ' &amp; '.
     
    7785
    7886A good way to implement this would be:
    79   <?php cm_the_moods(' and ', '<p>My mood is: ', '.</p>'); ?>
     87 
    8088
    8189You can also use cm_has_moods() to determine if the current post or a specific
     
    8391
    8492cm_has_moods() can take one parameter:
    85   <?php cm_has_moods(post_id); ?>
     93 
    8694  post_id
    8795    (integer) The ID of the post you are inquiring about.  Default is the ID of
     
    109117recommended that you disassociate all the moods from a post before changing the
    110118post's author.
    111 
    112119* Editing the post of another user will cause *that* user's moods to be
    113120displayed, not yours.  This is an unavoidable feature.
     
    122129
    123130
    124 == Change Log ==
    125 
    126 See changelog.txt
    127 
    128 
    129131== Copying ==
    130132
    131 Copyright (c) 2006 Keith Constable
     133Cricket Moods: A flexible mood tag plugin for the WordPress publishing platform.
     134Copyright (c) 2007 Keith Constable
    132135
    133 Permission is hereby granted, free of charge, to any person obtaining a copy of
    134 this software and associated documentation files (the "Software"), to deal in
    135 the Software without restriction, including without limitation the rights to
    136 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
    137 the Software, and to permit persons to whom the Software is furnished to do so,
    138 subject to the following conditions:
     136This program is free software; you can redistribute it and/or modify
     137it under the terms of the GNU General Public License as published by
     138the Free Software Foundation; either version 2 of the License, or
     139(at your option) any later version.
    139140
    140 The above copyright notice and this permission notice shall be included in all
    141 copies or substantial portions of the Software.
     141This program is distributed in the hope that it will be useful,
     142but WITHOUT ANY WARRANTY; without even the implied warranty of
     143MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     144GNU General Public License for more details.
    142145
    143 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    144 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
    145 FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
    146 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
    147 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
    148 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     146You should have received a copy of the GNU General Public License along
     147with this program; if not, write to the Free Software Foundation, Inc.,
     14851 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Note: See TracChangeset for help on using the changeset viewer.