Changeset 8297
- Timestamp:
- 03/16/2007 09:17:31 PM (19 years ago)
- Location:
- cricket-moods/trunk
- Files:
-
- 1 added
- 3 edited
-
changelog.txt (modified) (1 diff)
-
cricket-moods.php (modified) (16 diffs)
-
license.txt (added)
-
readme.txt (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cricket-moods/trunk/changelog.txt
r8035 r8297 1 1 === Cricket Moods Changelog === 2 2 3 20070 221: Version 3.43 20070: Version 3.4 4 4 * The plugin is now translatable. The POT file can be found in the subversion repository. 5 6 7 5 8 6 9 20070105: Version 3.3 -
cricket-moods/trunk/cricket-moods.php
r8035 r8297 10 10 11 11 /** 12 12 13 Copyright (c) 2007 Keith Constable 13 14 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. 15 This program is free software; you can redistribute it and/or modify 16 it under the terms of the GNU General Public License as published by 17 the Free Software Foundation; either version 2 of the License, or 18 (at your option) any later version. 19 20 This program is distributed in the hope that it will be useful, 21 but WITHOUT ANY WARRANTY; without even the implied warranty of 22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 GNU General Public License for more details. 24 25 You should have received a copy of the GNU General Public License along 26 with this program; if not, write to the Free Software Foundation, Inc., 27 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 30 28 */ 31 29 … … 51 49 load_plugin_textdomain('cricket-moods','wp-content/plugins/'); 52 50 51 52 53 54 55 53 56 /** 54 57 cm_the_moods … … 383 386 look decent. 384 387 */ 385 function cm_admin_style() { ?>386 387 <!-- Cricket Moods styles --> 388 <style type="text/css">388 function cm_admin_style() { 389 390 header('Content-Type: text/css'); 391 > 389 392 390 393 #cm_moodlist img { … … 395 398 #cm_mood_table { 396 399 text-align: center; 397 width: 100%; 400 width: 80%; 401 margin: 0 auto; 398 402 } 399 403 … … 407 411 408 412 #mood_image_box { 409 max-height: 15em; 413 float: left; 414 width: 18%; 415 max-height: 40em; 410 416 overflow: scroll; 411 margin: 1em 0; 417 } 418 419 #mood_image_box h4 { 420 margin: 0; 412 421 } 413 422 … … 419 428 420 429 #mood_image_list li { 421 margin: 0 .5ex;430 margin: ; 422 431 padding: 2px; 423 white-space: nowrap; 424 display: inline; 425 border: 1px solid silver; 426 line-height: 190%; 432 background-color: silver; 427 433 } 428 434 … … 440 446 font-size: 1.2em; 441 447 font-weight: bold; 448 449 450 451 452 442 453 } 443 454 … … 460 471 } 461 472 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 477 function 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 491 add_action('admin_head', 'cm_admin_style_link'); 468 492 469 493 … … 544 568 } 545 569 546 foreach ($_POST as $name => $value) {570 foreach ($_POST as $name => $value) { 547 571 548 572 // Existing moods start with 'cm_id_'. … … 610 634 <h3><?php _e('Default Moods', 'cricket-moods') ?></h3> 611 635 <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&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' ) { 616 640 cm_list_mood_images(); 617 }641 } 618 642 619 643 cm_edit_moods_table( cm_process_moods(-1) , $index, $err); ?> … … 623 647 </p> 624 648 </form> 625 649 <hr/> 626 650 <form method="post"> 627 651 <fieldset class="cm_danger" id="cm_reset_moods"><legend><?php _e('Reset Moods', 'cricket-moods') ?></legend> … … 660 684 661 685 <div id="mood_image_box"> 686 662 687 <ul id="mood_image_list"> 663 688 <?php … … 678 703 **/ 679 704 function cm_edit_moods_table($mood_list, $index, $err = array() ) { 705 706 707 680 708 ?> 681 709 <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> 684 724 <?php 685 725 // List the existing moods. … … 690 730 <td><?php echo $id ?><input type="hidden" name="cm_id_<?php echo $id ?>" value="<?php echo $id ?>"/></td> 691 731 <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> 693 734 <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> 694 735 </tr> … … 702 743 <td><?php echo $i ?><input type="hidden" name="cm_new_id_<?php echo $i ?>" value="<?php echo $i ?>"/></td> 703 744 <td><input class="cm_text" type="text" name="cm_new_name_<?php echo $i ?>"/></td> 745 704 746 <td><input class="cm_text" type="text" name="cm_new_image_<?php echo $i ?>"/></td> 705 <td> -</td>747 <td></td> 706 748 </tr> 707 749 <?php … … 800 842 <form method="post"> 801 843 <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&showimages=true">available mood images</a> in the mood image directory.', 'cricket-moods'); }?></p>844 ?></p> 803 845 <p><strong><?php _e('Deleting a mood will also remove any references to that mood from your posts.', 'cricket-moods') ?></strong></p> 804 846 805 847 <?php 806 if( $_GET['showimages'] == 'true' ) {848 if( $_GET['showimages'] == 'true' ) { 807 849 cm_list_mood_images(); 808 }850 } 809 851 810 852 cm_edit_moods_table(cm_process_moods(), $index, $err); -
cricket-moods/trunk/readme.txt
r8035 r8297 1 1 === Cricket Moods === 2 Version: 3.4 3 Tags: mood, meta 4 Website: http://dev.wp-plugins.org/wiki/CricketMoods 2 Stable tag: 3.4 3 Tested up to: 2.1.2 4 Requires at least: 2.0.5 5 Contributors: kccricket 6 Donate link: http://kccricket.net/projects/ 7 Tags: mood, meta, post 8 9 Cricket Moods is a flexible "mood tag" WordPress plugin. It allows an author to 10 add one or more "moods" to every post. 11 12 == Description == 5 13 6 14 Cricket Moods is a flexible "mood tag" WordPress plugin. It allows an author to … … 61 69 ampersand, and any more moods followed by ampersands. For example, on a post 62 70 with the moods "Happy" and "Bored" it will print: 63 <img src="/wp-images/smilies/icon_happy.gif" alt="Happy emoticon" /> Happy71 <img src="/wp-images/smilies/icon_happy.gif" alt="Happy emoticon" /> Happy 64 72 & <img src="/wp-images/smilies/icon_neutral.gif" alt="Bored emoticon" /> 65 Bored 73 Bored 66 74 67 75 If there are no moods for the current post, it will print nothing. 68 76 69 77 cm_the_moods() can take three parameters: 70 <?php cm_the_moods('separator', 'before', 'after'); ?>78 71 79 'separator' 72 80 (string) Text to place in between multiple moods. Default is ' & '. … … 77 85 78 86 A good way to implement this would be: 79 <?php cm_the_moods(' and ', '<p>My mood is: ', '.</p>'); ?>87 80 88 81 89 You can also use cm_has_moods() to determine if the current post or a specific … … 83 91 84 92 cm_has_moods() can take one parameter: 85 <?php cm_has_moods(post_id); ?>93 86 94 post_id 87 95 (integer) The ID of the post you are inquiring about. Default is the ID of … … 109 117 recommended that you disassociate all the moods from a post before changing the 110 118 post's author. 111 112 119 * Editing the post of another user will cause *that* user's moods to be 113 120 displayed, not yours. This is an unavoidable feature. … … 122 129 123 130 124 == Change Log ==125 126 See changelog.txt127 128 129 131 == Copying == 130 132 131 Copyright (c) 2006 Keith Constable 133 Cricket Moods: A flexible mood tag plugin for the WordPress publishing platform. 134 Copyright (c) 2007 Keith Constable 132 135 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: 136 This program is free software; you can redistribute it and/or modify 137 it under the terms of the GNU General Public License as published by 138 the Free Software Foundation; either version 2 of the License, or 139 (at your option) any later version. 139 140 140 The above copyright notice and this permission notice shall be included in all 141 copies or substantial portions of the Software. 141 This program is distributed in the hope that it will be useful, 142 but WITHOUT ANY WARRANTY; without even the implied warranty of 143 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 144 GNU General Public License for more details. 142 145 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. 146 You should have received a copy of the GNU General Public License along 147 with this program; if not, write to the Free Software Foundation, Inc., 148 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Note: See TracChangeset
for help on using the changeset viewer.