Plugin Directory

Changeset 187559


Ignore:
Timestamp:
12/28/2009 11:55:02 AM (16 years ago)
Author:
geniosity
Message:

Added options to auto select the text and make it read only.

Location:
please-link-2-me/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • please-link-2-me/trunk/pleaselink2me.php

    r186795 r187559  
    55Description: This plugin adds a text box containing all the code necessary for visitors to easily create links back to your article from their website.
    66Author: James McMullan
    7 Version: 1.6
     7Version: 1.7
    88Author URI: http://www.geniosity.co.za/
    99*/
     
    8888                $theHTMLCode .= '</div>';
    8989            }
    90             $theHTMLCode .= '<textarea rows="'. $options['number-of-rows'] .'" cols="'. $options['number-of-columns'] .'" id="please_link_to_area" name="please_link_to_me_area">&lt;a href=&quot;' . get_permalink() . '&quot; &gt;';
     90            $theHTMLCode .= '<textarea ';
     91            if ($options['make-read-only'] != "" && $options['make-read-only'] == true) {
     92                $theHTMLCode .= 'readonly="readonly" ';
     93            }
     94            if ($options['make-select-all'] != "" && $options['make-select-all'] == true) {
     95                $theHTMLCode .= ' onclick="this.focus();this.select();" ';
     96            }
     97            $theHTMLCode .= ' rows="'. $options['number-of-rows'] .'" cols="'. $options['number-of-columns'] .'" id="please_link_to_area" name="please_link_to_me_area">&lt;a href=&quot;' . get_permalink() . '&quot; &gt;';
    9198            $theHTMLCode .= $theTitle;
    9299            $theHTMLCode .= '&lt;/a&gt;</textarea>';
     
    171178                        <th><label for="number-of-columns">Text Box number of columns:</label></th>
    172179                        <td><input size="5" id="number-of-columns" name="pleaselink2me[number-of-columns]" value="<?php echo stripslashes($options['number-of-columns']) ?>" />The width (in columns) of the text box containing your link. (Default: 50)</td>
     180                    </tr>
     181                    <tr>
     182                        <th><label for="make-read-only">Make the text Read Only?:</label></th>
     183                        <td><input type="checkbox" id="make-read-only" name="pleaselink2me[make-read-only]" <?php if ( $options['make-read-only'] == true ) echo ' checked="checked" '; ?>/> (Selecting this will prevent people from editing the text in the box before selecting it)</td>
     184                    </tr>
     185                    <tr>
     186                        <th><label for="make-select-all">Make the text "Auto Selected"?:</label></th>
     187                        <td><input type="checkbox" id="make-select-all" name="pleaselink2me[make-select-all]" <?php if ( $options['make-select-all'] == true ) echo ' checked="checked" '; ?>/> (Enabling this will set it so the text is automatically selected as soon as the reader clicks in the box)</td>
    173188                    </tr>
    174189                    <tr>
     
    251266                    - <b>A Description</b>: Just a little reason for about what the "link box" contains and why the reader should link to you. Leave it blank to skip the description.<br />
    252267                    - <b>Markup before/after</b>: Each of the above sections can be surrounded by html markup that will help you style the section to your liking. For example, giving the Title &lt;h3&gt; tags to make it a heading. If either the "before" box or the "after" box is empty, the markup will be skipped.<br />
     268                    - <b>Text Box number of rows</b>: Change the default number of rows for the text box (the height). Allows you to customise it a little to fit in with your theme.<br />
     269                    - <b>Text Box number of columns</b>: As above, but for the number of columns (width).<br />
     270                    - <b>Make the text Read Only?</b>: If this is selected, the user won't be able to edit the text in the text box before selecting it.<br />
     271                    - <b>Make the text "Auto Selected"?</b>: If this is selected, the text will be automatically selected as soon as a user clicks in the text box.<br />
    253272                    - <b>Show below Post?</b>: If you tick this box, then you won't need to edit your template file at all. The "Please Link 2 Me" box will be placed below your blog post automatically.<br />
    254273                    - <b>Show below Page?</b>: As above, but this will put the box on your site's Pages.<br />
  • please-link-2-me/trunk/readme.txt

    r186583 r187559  
    23237. Add formatting tags for before and after the Description text. For example, to make the text bold, add <b> in the "Pre" box, and </b> in the "Post" box. Or leave them blank for no extra formatting.
    24248. Determine the size of your text box that contains the link.
    25 9. Choose whether to automatically add the box to your blog post. Leaving this blank will mean you need to edit your template to add the code. (See the step below).
    26 10. If you choose NOT to add the link box automatically to your blog post (in option 8), you will need to add the following to the appropriate location in your theme's template page (for a better example, see the plugin's admin page on your blog): **`<?php if(function_exists('pl2mAddLinkBox')) {pl2mAddLinkBox();} ?>`**
     259. Choose whether you want to make the text "read only" in the text box. This will prevent readers from editing the text before selecting it.
     2610. Choose whether you want the text to automatically be selected once the user/reader clicks in the text box.
     2711. Choose whether to automatically add the box to your blog post. Leaving this blank will mean you need to edit your template to add the code. (See the step below).
     2812. If you choose NOT to add the link box automatically to your blog post (in option 8), you will need to add the following to the appropriate location in your theme's template page (for a better example, see the plugin's admin page on your blog): **`<?php if(function_exists('pl2mAddLinkBox')) {pl2mAddLinkBox();} ?>`**
    2729
    2830== Screenshots ==
     
    3840
    3941== ChangeLog ==
     42
     43= 1.7 =
     44* 2009/12/28
     45* Added an option to make the text area Read Only
     46* Added an option so the text is auto selected when a reader clicks in the box
    4047
    4148= 1.6 =
Note: See TracChangeset for help on using the changeset viewer.