Plugin Directory

Changeset 2100721


Ignore:
Timestamp:
06/04/2019 11:09:08 PM (7 years ago)
Author:
inderjeetsingh
Message:

code changes in new version

Location:
post-thanks
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • post-thanks/tags/1.2/postthankyou.php

    r2100706 r2100721  
    66Plugin Name: Post Thanks
    77Description: This plugin adds custom text in end of each post published.
    8 Version: 1.2
     8Version: 1.1
    99Author: Inderjeet Singh
    1010License: GPLv2 or later
     
    3232    font-size: -webkit-xxx-large;">Post Thank You ---- Menu</h2>
    3333    <form action="' . $_SERVER['REQUEST_URI'] . '" method="post">
     34    <div style="float:left;width:50%;">
    3435    <p style ="font-weight: 900;
    3536    font-style: italic;
     
    6162    <br>
    6263    </div>
     64    </div>
     65    <div style="float:left;width:50%;height: 389px;">
     66    <p style="font-weight: 900;
     67    font-style: italic;
     68    font-size: large;">Show text on top or bottom of posts.</p>
     69    <div class="radio">
     70      <label style="font-weight: 900;
     71    font-style: italic;
     72    font-size: inherit;"><input type="radio" name="topbottom" value="top">Top</label>
     73    </div>
     74    <div class="radio">
     75      <label style="font-weight: 900;
     76    font-style: italic;
     77    font-size: inherit;"><input type="radio" name="topbottom" value="bottom" checked>Bottom</label>
     78    </div>
     79        <br>
     80    </div>
    6381    <br>
    6482    <br>
     
    89107    add_option( 'post_thanks_text_displayhide', $showhide );
    90108    update_option( 'post_thanks_text_displayhide', $showhide );
     109   
     110    $topbottom = $_POST["topbottom"];
     111    add_option( 'post_thanks_text_topbottom', $topbottom );
     112    update_option( 'post_thanks_text_topbottom', $topbottom );
     113   
    91114    echo '<div style="border:solid; padding:15px;"><br><div style="font-weight: 900;
    92115    font-style: italic;
    93     font-size: large;">Following text added in end of all posts: </div> <br><div style="color:'.get_option( 'post_thanks_text_color' ).'">'.
     116    font-size: large;">Following text added in all posts: </div> <br><div style="color:'.get_option( 'post_thanks_text_color' ).'">'.
    94117        get_option( 'post_thanks_text' ).'</div></div>';
    95118}
     
    101124    $post_thanks_text_color = get_option( 'post_thanks_text_color' );
    102125    $post_thanks_text_showhide = get_option( 'post_thanks_text_displayhide' );
     126    $post_thanks_text_topbottom = get_option( 'post_thanks_text_topbottom' );
    103127       
    104128    if($post_thanks_text == ''){
    105129        return $content;
    106130    }
    107     else {
    108         return $content .= '<div style = "color: '.$post_thanks_text_color.'; display: '.$post_thanks_text_showhide.';" class="post_thanks">'.$post_thanks_text.'</div>';
     131    if($post_thanks_text != ''){
     132        if($post_thanks_text_topbottom == 'bottom'){
     133            return $content .= '<div style = "color: '.$post_thanks_text_color.'; display: '.$post_thanks_text_showhide.';" class="post_thanks">'.$post_thanks_text.'</div>';
     134        }
     135        if($post_thanks_text_topbottom == 'top'){
     136            $content2 = '<div style = "color: '.$post_thanks_text_color.'; display: '.$post_thanks_text_showhide.';" class="post_thanks">'.$post_thanks_text.'</div>' . $content;
     137            return $content2 ;
     138        }
    109139    }
    110140}
  • post-thanks/trunk/postthankyou.php

    r2100706 r2100721  
    66Plugin Name: Post Thanks
    77Description: This plugin adds custom text in end of each post published.
    8 Version: 1.2
     8Version: 1.1
    99Author: Inderjeet Singh
    1010License: GPLv2 or later
     
    3232    font-size: -webkit-xxx-large;">Post Thank You ---- Menu</h2>
    3333    <form action="' . $_SERVER['REQUEST_URI'] . '" method="post">
     34    <div style="float:left;width:50%;">
    3435    <p style ="font-weight: 900;
    3536    font-style: italic;
     
    6162    <br>
    6263    </div>
     64    </div>
     65    <div style="float:left;width:50%;height: 389px;">
     66    <p style="font-weight: 900;
     67    font-style: italic;
     68    font-size: large;">Show text on top or bottom of posts.</p>
     69    <div class="radio">
     70      <label style="font-weight: 900;
     71    font-style: italic;
     72    font-size: inherit;"><input type="radio" name="topbottom" value="top">Top</label>
     73    </div>
     74    <div class="radio">
     75      <label style="font-weight: 900;
     76    font-style: italic;
     77    font-size: inherit;"><input type="radio" name="topbottom" value="bottom" checked>Bottom</label>
     78    </div>
     79        <br>
     80    </div>
    6381    <br>
    6482    <br>
     
    89107    add_option( 'post_thanks_text_displayhide', $showhide );
    90108    update_option( 'post_thanks_text_displayhide', $showhide );
     109   
     110    $topbottom = $_POST["topbottom"];
     111    add_option( 'post_thanks_text_topbottom', $topbottom );
     112    update_option( 'post_thanks_text_topbottom', $topbottom );
     113   
    91114    echo '<div style="border:solid; padding:15px;"><br><div style="font-weight: 900;
    92115    font-style: italic;
    93     font-size: large;">Following text added in end of all posts: </div> <br><div style="color:'.get_option( 'post_thanks_text_color' ).'">'.
     116    font-size: large;">Following text added in all posts: </div> <br><div style="color:'.get_option( 'post_thanks_text_color' ).'">'.
    94117        get_option( 'post_thanks_text' ).'</div></div>';
    95118}
     
    101124    $post_thanks_text_color = get_option( 'post_thanks_text_color' );
    102125    $post_thanks_text_showhide = get_option( 'post_thanks_text_displayhide' );
     126    $post_thanks_text_topbottom = get_option( 'post_thanks_text_topbottom' );
    103127       
    104128    if($post_thanks_text == ''){
    105129        return $content;
    106130    }
    107     else {
    108         return $content .= '<div style = "color: '.$post_thanks_text_color.'; display: '.$post_thanks_text_showhide.';" class="post_thanks">'.$post_thanks_text.'</div>';
     131    if($post_thanks_text != ''){
     132        if($post_thanks_text_topbottom == 'bottom'){
     133            return $content .= '<div style = "color: '.$post_thanks_text_color.'; display: '.$post_thanks_text_showhide.';" class="post_thanks">'.$post_thanks_text.'</div>';
     134        }
     135        if($post_thanks_text_topbottom == 'top'){
     136            $content2 = '<div style = "color: '.$post_thanks_text_color.'; display: '.$post_thanks_text_showhide.';" class="post_thanks">'.$post_thanks_text.'</div>' . $content;
     137            return $content2 ;
     138        }
    109139    }
    110140}
Note: See TracChangeset for help on using the changeset viewer.