Plugin Directory

Changeset 974792


Ignore:
Timestamp:
08/28/2014 05:52:14 PM (12 years ago)
Author:
Danny159
Message:

New feature to hide message for logged in users

Location:
sitewide-message/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sitewide-message/trunk/readme.txt

    r970978 r974792  
    3737== Changelog ==
    3838
     39= 0.6 = 
     40* New Feature - Hide Message for Logged in Users
     41
    3942= 0.5 = 
    4043* Bug Fixes
  • sitewide-message/trunk/sitewide-message.php

    r970976 r974792  
    66Author: ThatBlogger
    77Author URI: http://thatblogger.co/
    8 Version: 0.5
     8Version: 0.6
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    118118        <?php $ischecked = ($options['status'] == "1" ? "checked" : ""); ?>
    119119        <?php $schedule_statusischecked = ($options['schedule_status'] == "1" ? "checked" : ""); ?>
     120        <?php $hide_adminischecked = ($options['hide_admin'] == "1" ? "checked" : ""); ?>
    120121       
    121122        <?php $checkbgcol = ($options['bgcol'] == NULL ? "#ff3233" : $options['bgcol']); ?>
     
    161162                <th scope="row">Message Text Colour</th>
    162163                <td><input type="text" name="tb_msg_settings[txtcol]" value="<?php esc_attr_e($checktxtcol); ?>" class="regular-text colorfield" data-default-color="#ffffff" /></td>
     164            </tr>
     165           
     166            <tr valign="top">
     167                <th scope="row">Hide When Logged In?</th>
     168                <td><input name="tb_msg_settings[hide_admin]" type="checkbox" id="tb_msg_settings[hide_admin]" value="1" <?php esc_attr_e($hide_adminischecked); ?> /></td>
    163169            </tr>
    164170        </table>
     
    256262
    257263function showMessage($nurl, $linkloc, $text){
     264    $options = get_option('tb_msg_settings');
     265    if($options['hide_admin'] == 1){
     266        if(is_user_logged_in()){
     267            return;
     268        }
     269    }
     270   
    258271    return "<div class=\"tb_notification_bar tb_fadeInDown\"><div class=\"tb_inner_bar\"><span class=\"tb_specific_text\"><a href=\"".$nurl."\" target=\"".$linkloc."\">".$text."</a></span></div></div>";
    259272}
     
    266279    $options = get_option('tb_msg_settings');
    267280    if($options['status']){
     281       
     282        if($options['hide_admin'] == 1){
     283            if(is_user_logged_in()){
     284                return $classes;
     285            }
     286        }
     287   
    268288        // Check against date stuff
    269289        if($options['schedule_status']){
Note: See TracChangeset for help on using the changeset viewer.