Changeset 1337

Show
Ignore:
Timestamp:
09/07/08 08:52:49 (3 months ago)
Author:
Thion
Message:

0.0.3 is going online

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • bbsocialize/trunk/bb-socialize.php

    r1282 r1337  
    66Author: F.Thion 
    77Author URI: http://astateofmind.eu 
    8 Version: 0.0.2 
     8Version: 0.0.3 
    99 
    1010license: CC-GNU-GPL http://creativecommons.org/licenses/GPL/2.0/ 
    11  
    1211donate: http://astateofmind.eu/about/support/ 
     12 
     13TO DO: 
     14   - Add support for 
     15        - Technorati 
     16        - MyBlogLog 
     17        - MySpace 
     18 
     19History for 0.0.3: 
     20        - If profiles are empty and are not set by user, then they are not displayed; 
     21        - Added support for technorati; 
     22        - Changed images names, from x.gif to bb_x.gif; 
     23        - Minor modifications to look of management page; 
     24        - Added support to display profile links in single posts; 
     25        - Added "Reset Button" - you can now reset all settings to default (minor error, changes won't appear without page refresh) 
    1326*/ 
    1427 
     
    2841                        $bb_socialize['delicious'] = "true"; 
    2942                        $bb_socialize['flickr'] = "true"; 
     43                        $bb_socialize['technorati'] = "true"; 
     44                        /* $bb_socialize['mybloglog'] = "true"; */ 
     45                        /* $bb_socialize['facebook'] = "true"; */ 
    3046                } 
    3147        } 
     
    3349add_action( 'bb_init', 'bb_socialize_initialize'); 
    3450 
     51// Let's get some profiles to display 
    3552function get_twitter($user_id) { 
    3653        $user = bb_get_user( $user_id );   
     
    6380} 
    6481 
     82function get_technorati($user_id) { 
     83        $user = bb_get_user( $user_id );   
     84        $bb_technorati = $user->social_technorati; 
     85        if ( $bb_technorati ) { return $bb_technorati; }  else  { return ""; } 
     86} 
     87 
     88/* function get_mybloglog($user_id) { 
     89        $user = bb_get_user( $user_id );   
     90        $bb_mybloglog = $user->social_mybloglog; 
     91        if ( $bb_mybloglog ) { return $bb_mybloglog; }  else  { return ""; } 
     92} */ 
     93 
     94/* function get_facebook($user_id) { 
     95        $user = bb_get_user( $user_id );   
     96        $bb_facebook = $user->social_facebook; 
     97        if ( $bb_facebook ) { return $bb_facebook; }  else  { return ""; } 
     98} */ 
     99 
     100/* function get_myspace($user_id) { 
     101        $user = bb_get_user( $user_id );   
     102        $bb_myspace = $user->social_myspace; 
     103        if ( $bb_myspace ) { return $bb_myspace; }  else  { return ""; } 
     104} */ 
     105 
     106// Now, let's add input fields to our profile-edit page 
    65107function add_socialize_to_profile_edit() { 
    66108        global $user_id, $bb_current_user, $bb_socialize;        
     
    72114$bb_delicious = get_delicious($user_id); 
    73115$bb_pownce = get_pownce($user_id); 
     116$bb_technorati = get_technorati($user_id); 
     117/* $bb_mybloglog = get_mybloglog($user_id); */ 
     118/* $bb_facebook = get_facebook($user_id); */ 
    74119 
    75120echo '<div class="socialize_edit"> 
    76 '. __('Social Media Profiles') .' 
     121<fieldset> 
     122<legend>'. __('Social Media Profiles') .'</legend> 
     123 
     124<p>Set your Social Media Profiles below.</p> 
    77125 
    78126<table>'; 
     
    121169</tr>'; 
    122170} 
    123 echo '</table> 
     171 
     172if ( $bb_socialize['technorati'] == true ) { 
     173echo '<tr class="form-field"> 
     174        <th scope="row">Technorati</th> 
     175        <td> 
     176                <input type="text" name="bb_technorati" value="'. $bb_technorati .'" /> 
     177        </td> 
     178</tr>'; 
     179
     180 
     181/* if ( $bb_socialize['mybloglog'] == true ) { 
     182echo '<tr class="form-field"> 
     183        <th scope="row">MyBlogLog</th> 
     184        <td> 
     185                <input type="text" name="bb_mybloglog" value="'. $bb_mybloglog .'" /> 
     186        </td> 
     187</tr>'; 
     188} */ 
     189 
     190/* if ( $bb_socialize['facebook'] == true ) { 
     191echo '<tr class="form-field"> 
     192        <th scope="row">Facebook</th> 
     193        <td> 
     194                <input type="text" name="bb_facebook" value="'. $bb_facebook .'" /> 
     195        </td> 
     196</tr>'; 
     197} */ 
     198 
     199/* if ( $bb_socialize['myspace'] == true ) { 
     200echo '<tr class="form-field"> 
     201        <th scope="row">MySpace</th> 
     202        <td> 
     203                <input type="text" name="bb_myspace" value="'. $bb_myspace .'" /> 
     204        </td> 
     205</tr>'; 
     206} */ 
     207 
     208echo '</table></fieldset> 
    124209 
    125210</div>'; 
     
    128213add_action('extra_profile_info', 'add_socialize_to_profile_edit'); 
    129214 
     215// The following function can be used to display profiles on user-profile-page 
    130216function get_socialize() { 
    131217        global $user_id, $bb_current_user, $bb_socialize; 
     
    138224        $bb_delicious = $user_id->social_delicious; 
    139225        $bb_flickr = $user_id->social_flickr; 
     226        $bb_technorati = $user_id->social_technorati; 
     227        /* $bb_mybloglog = $user_id->social_mybloglog; */ 
     228        /* $bb_facebook = $user_id->social_facebook; */ 
     229        /* $bb_myspace = $user_id->social_myspace; */ 
    140230         
    141231        echo '<div class="socialize_wrap">'; 
    142         if ( $bb_socialize['twitter'] == true ) { echo '<dd><img src="'.$bb_socialize['images_url'].'/twitter.gif" width="16" height="16" border="0" /><a href="http://twitter.com/'.$bb_twitter.'" title="User Twitter account" rel="'.$bb_socialize['links_rel'].'"><span>'.$bb_twitter.'</span></a></dd>'; } 
    143         if ( $bb_socialize['digg'] == true ) { echo '<dd><img src="'.$bb_socialize['images_url'].'/digg.gif" width="16" height="16" border="0" /><a href="http://digg.com/users/'.$bb_digg.'" title="User Digg account" rel="'.$bb_socialize['links_rel'].'"><span>'.$bb_digg.'</span></a></dd>'; } 
    144         if ( $bb_socialize['pownce'] == true ) { echo '<dd><img src="'.$bb_socialize['images_url'].'/pownce.gif" width="16" height="16" border="0" /><a href="http://pownce.com/'.$bb_pownce.'" title="User Pownce account" rel="'.$bb_socialize['links_rel'].'"><span>'.$bb_pownce.'</span></a></dd>'; } 
    145         if ( $bb_socialize['delicious'] == true ) { echo '<dd><img src="'.$bb_socialize['images_url'].'/delicious.gif" width="16" height="16" border="0" /><a href="http://delicious.com/'.$bb_delicious.'" title="User Delicious account" rel="'.$bb_socialize['links_rel'].'"><span>'.$bb_delicious.'</span></a></dd>'; } 
    146         if ( $bb_socialize['flickr'] == true ) { echo '<dd><img src="'.$bb_socialize['images_url'].'/flickr.gif" width="16" height="16" border="0" /><a href="http://flickr.com/photos/'.$bb_flickr.'" title="User Flickr account" rel="'.$bb_socialize['links_rel'].'"><span>'.$bb_flickr.'</span></a></dd>'; } 
     232        if ( $bb_socialize['twitter'] == true ) { if ( !empty( $bb_twitter ) ) { echo '<dd><img src="'.$bb_socialize['images_url'].'/bb_twitter.png" width="16" height="16" border="0" /><a href="http://twitter.com/'.$bb_twitter.'" title="User Twitter account" rel="'.$bb_socialize['links_rel'].'"><span>'.$bb_twitter.'</span></a></dd>'; } } 
     233        if ( $bb_socialize['digg'] == true ) { if ( !empty( $bb_digg ) ) { echo '<dd><img src="'.$bb_socialize['images_url'].'/bb_digg.png" width="16" height="16" border="0" /><a href="http://digg.com/users/'.$bb_digg.'" title="User Digg account" rel="'.$bb_socialize['links_rel'].'"><span>'.$bb_digg.'</span></a></dd>'; } } 
     234        if ( $bb_socialize['pownce'] == true ) { if ( !empty( $bb_pownce ) ) { echo '<dd><img src="'.$bb_socialize['images_url'].'/bb_pownce.png" width="16" height="16" border="0" /><a href="http://pownce.com/'.$bb_pownce.'" title="User Pownce account" rel="'.$bb_socialize['links_rel'].'"><span>'.$bb_pownce.'</span></a></dd>'; } } 
     235        if ( $bb_socialize['delicious'] == true ) { if ( !empty( $bb_delicious ) ) { echo '<dd><img src="'.$bb_socialize['images_url'].'/bb_delicious.png" width="16" height="16" border="0" /><a href="http://delicious.com/'.$bb_delicious.'" title="User Delicious account" rel="'.$bb_socialize['links_rel'].'"><span>'.$bb_delicious.'</span></a></dd>'; } } 
     236        if ( $bb_socialize['flickr'] == true ) { if ( !empty( $bb_flickr ) ) { echo '<dd><img src="'.$bb_socialize['images_url'].'/bb_flickr.png" width="16" height="16" border="0" /><a href="http://flickr.com/photos/'.$bb_flickr.'" title="User Flickr account" rel="'.$bb_socialize['links_rel'].'"><span>'.$bb_flickr.'</span></a></dd>'; } } 
     237        if ( $bb_socialize['technorati'] == true ) { if ( !empty( $bb_technorati) ) { echo '<dd><img src="'.$bb_socialize['images_url'].'/bb_technorati.png" width="16" height="16" border="0" /><a href="http://technorati.com/people/technorati/'.$bb_technorati.'" title="User Technorati account" rel="'.$bb_socialize['links_rel'].'"><span>'.$bb_technorati.'</span></a></dd>'; } } 
     238        /* if ( $bb_socialize['mybloglog'] == true ) { if ( !empty( $bb_mybloglog ) ) { echo '<dd><img src="'.$bb_socialize['images_url'].'/bb_mybloglog.png" width="16" height="16" border="0" /><a href="http://technorati.com/people/technorati/'.$bb_mybloglog.'" title="User MyBlogLog account" rel="'.$bb_socialize['links_rel'].'"><span>'.$bb_mybloglog.'</span></a></dd>'; } } */ 
     239        /* if ( $bb_socialize['facebook'] == true ) { if ( !empty( $bb_facebook ) ) { echo '<dd><img src="'.$bb_socialize['images_url'].'/bb_facebook.png" width="16" height="16" border="0" /><a href="http://technorati.com/people/technorati/'.$bb_mybloglog.'" title="User Facebook account" rel="'.$bb_socialize['links_rel'].'"><span>'.$bb_facebook.'</span></a></dd>'; } } */ 
     240        /* if ( $bb_socialize['myspace'] == true ) { if ( !empty( $bb_myspace ) ) { echo '<dd><img src="'.$bb_socialize['images_url'].'/bb_myspace.png" width="16" height="16" border="0" /><a href="http://myspace.com/'.$bb_myspace.'" title="User MySpace page" rel="'.$bb_socialize['links_rel'].'"><span>'.$bb_myspace.'</span></a></dd>'; } } */ 
     241        echo '</div>'; 
     242
     243 
     244// The following function can be used in posts; just put get_socialize_post(get_post_author_id()); somewhere :) 
     245function get_socialize_post( $user_id ) { 
     246        global $bb, $bb_socialize; 
     247         
     248        $user_id = bb_get_user( $user_id ); 
     249         
     250        $bb_twitter = $user_id->social_twitter; 
     251        $bb_pownce = $user_id->social_pownce; 
     252        $bb_digg = $user_id->social_digg; 
     253        $bb_delicious = $user_id->social_delicious; 
     254        $bb_flickr = $user_id->social_flickr; 
     255        $bb_technorati = $user_id->social_technorati; 
     256        /* $bb_mybloglog = $user_id->social_mybloglog; */ 
     257        /* $bb_facebook = $user_id->social_facebook; */ 
     258        /* $bb_myspace = $user_id->social_myspace; */ 
     259         
     260        echo '<div class="post_socialize_wrap">'; 
     261        if ( $bb_socialize['twitter'] == true ) { if ( !empty( $bb_twitter ) ) { echo '<span><a href="http://twitter.com/'.$bb_twitter.'" title="User Twitter account" rel="'.$bb_socialize['links_rel'].'"><img src="'.$bb_socialize['images_url'].'/bb_twitter.png" width="16" height="16" border="0" /></a></span>'; } } 
     262        if ( $bb_socialize['digg'] == true ) { if ( !empty( $bb_digg ) ) { echo '<span><a href="http://digg.com/users/'.$bb_digg.'" title="User Digg account" rel="'.$bb_socialize['links_rel'].'"><img src="'.$bb_socialize['images_url'].'/bb_digg.png" width="16" height="16" border="0" /></a></span>'; } } 
     263        if ( $bb_socialize['pownce'] == true ) { if ( !empty( $bb_pownce ) ) { echo '<span><a href="http://pownce.com/'.$bb_pownce.'" title="User Pownce account" rel="'.$bb_socialize['links_rel'].'"><img src="'.$bb_socialize['images_url'].'/bb_pownce.png" width="16" height="16" border="0" /></a></span>'; } } 
     264        if ( $bb_socialize['delicious'] == true ) { if ( !empty( $bb_delicious ) ) { echo '<span><a href="http://delicious.com/'.$bb_delicious.'" title="User Delicious account" rel="'.$bb_socialize['links_rel'].'"><img src="'.$bb_socialize['images_url'].'/bb_delicious.png" width="16" height="16" border="0" /></a></span>'; } } 
     265        if ( $bb_socialize['flickr'] == true ) { if ( !empty( $bb_flickr ) ) { echo '<span><a href="http://flickr.com/photos/'.$bb_flickr.'" title="User Flickr account" rel="'.$bb_socialize['links_rel'].'"><img src="'.$bb_socialize['images_url'].'/bb_flickr.png" width="16" height="16" border="0" /></a></span>'; } } 
     266        if ( $bb_socialize['technorati'] == true ) { if ( !empty( $bb_technorati) ) { echo '<span><a href="http://technorati.com/people/technorati/'.$bb_technorati.'" title="User Technorati account" rel="'.$bb_socialize['links_rel'].'"><img src="'.$bb_socialize['images_url'].'/bb_technorati.png" width="16" height="16" border="0" /></a></span>'; } } 
     267        /* if ( $bb_socialize['mybloglog'] == true ) { if ( !empty( $bb_mybloglog ) ) { echo '<span><a href="http://technorati.com/people/technorati/'.$bb_mybloglog.'" title="User MyBlogLog account" rel="'.$bb_socialize['links_rel'].'"><img src="'.$bb_socialize['images_url'].'/bb_mybloglog.png" width="16" height="16" border="0" /></a></span>'; } } */ 
     268        /* if ( $bb_socialize['facebook'] == true ) { if ( !empty( $bb_facebook ) ) { echo '<span><a href="http://technorati.com/people/technorati/'.$bb_mybloglog.'" title="User Facebook account" rel="'.$bb_socialize['links_rel'].'"><img src="'.$bb_socialize['images_url'].'/bb_facebook.png" width="16" height="16" border="0" /></a></span>'; } } */ 
     269        /* if ( $bb_socialize['myspace'] == true ) { if ( !empty( $bb_myspace ) ) { echo '<span><a href="http://myspace.com/'.$bb_myspace.'" title="User MySpace page" rel="'.$bb_socialize['links_rel'].'"><img src="'.$bb_socialize['images_url'].'/bb_myspace.png" width="16" height="16" border="0" /></a></span>'; } } */ 
    147270        echo '</div>'; 
    148271} 
     
    156279        $bb_delicious = $_POST['bb_delicious']; 
    157280        $bb_pownce = $_POST['bb_pownce']; 
     281        $bb_technorati = $_POST['bb_technorati']; 
     282        /* $bb_mybloglog = $_POST['bb_mybloglog']; */ 
     283        /* $bb_facebook = $_POST['bb_facebook']; */  
     284        /* $bb_myspace = $_POST['bb_myspace']; */ 
    158285         
    159286        if ( $bb_twitter )  
     
    191318        } 
    192319        else {bb_delete_usermeta($user_id, "social_pownce");} 
     320         
     321        if ( $bb_technorati )  
     322        { 
     323                $bb_technorati = bb_filter_kses( stripslashes( balanceTags( bb_code_trick( bb_encode_bad($bb_technorati) ), true) ) ); 
     324                bb_update_usermeta($user_id, "social_technorati",$bb_technorati); 
     325        } 
     326        else {bb_delete_usermeta($user_id, "social_technorati");} 
     327         
     328        /* if ( $bb_mybloglog )  
     329        { 
     330                $bb_mybloglog = bb_filter_kses( stripslashes( balanceTags( bb_code_trick( bb_encode_bad($bb_mybloglog) ), true) ) ); 
     331                bb_update_usermeta($user_id, "social_mybloglog",$bb_mybloglog); 
     332        } 
     333        else {bb_delete_usermeta($user_id, "social_mybloglog");} */ 
     334 
     335        /* if ( $bb_facebook )  
     336        { 
     337                $bb_facebook = bb_filter_kses( stripslashes( balanceTags( bb_code_trick( bb_encode_bad($bb_facebook) ), true) ) ); 
     338                bb_update_usermeta($user_id, "social_facebook",$bb_facebook); 
     339        } 
     340        else {bb_delete_usermeta($user_id, "social_facebook");} */ 
     341         
     342        /* if ( $bb_myspace )  
     343        { 
     344                $bb_myspace = bb_filter_kses( stripslashes( balanceTags( bb_code_trick( bb_encode_bad($bb_myspace) ), true) ) ); 
     345                bb_update_usermeta($user_id, "social_myspace",$bb_myspace); 
     346        } 
     347        else {bb_delete_usermeta($user_id, "social_myspace");} */ 
    193348} 
    194349add_action('profile_edited', 'update_user_socialize'); 
     
    224379                                        </td> 
    225380                                </tr> 
    226                                  
    227                                 <tr> 
    228                                         <td><label for="twitter"><b>Get Twitter</b></label></td> 
    229                                          
    230                                         <td> 
    231                                                 <input name="twitter" value="1" type="radio" <?php if ( $bb_socialize['twitter'] == true ) { echo 'checked="checked"'; } ?>> Yes &nbsp; &nbsp; 
    232                                                 <input name="twitter" value="0" type="radio" <?php if ( $bb_socialize['twitter'] == false ) { echo 'checked="checked"'; } ?>>NO 
    233                                         </td> 
    234                                 </tr> 
    235                                  
    236                                 <tr> 
    237                                         <td><label for="pownce"><b>Get Pownce</b></label></td> 
    238                                          
    239                                         <td> 
    240                                                 <input name="pownce" value="1" type="radio" <?php if ( $bb_socialize['pownce'] == true ) { echo 'checked="checked"'; } ?>> Yes &nbsp; &nbsp; 
    241                                                 <input name="pownce" value="0" type="radio" <?php if ( $bb_socialize['pownce'] == false ) { echo 'checked="checked"'; } ?>>NO 
    242                                         </td> 
    243                                 </tr> 
    244                                  
    245                                 <tr> 
    246                                         <td><label for="digg"><b>Get Digg</b></label></td> 
    247                                          
    248                                         <td> 
    249                                                 <input name="digg" value="1" type="radio" <?php if ( $bb_socialize['digg'] == true ) { echo 'checked="checked"'; } ?>> Yes &nbsp; &nbsp; 
    250                                                 <input name="digg" value="0" type="radio" <?php if ( $bb_socialize['digg'] == false ) { echo 'checked="checked"'; } ?>>NO 
    251                                         </td> 
    252                                 </tr> 
    253                                  
    254                                 <tr> 
    255                                         <td><label for="delicious"><b>Get Delicious</b></label></td> 
    256                                          
    257                                         <td> 
    258                                                 <input name="delicious" value="1" type="radio" <?php if ( $bb_socialize['delicious'] == true ) { echo 'checked="checked"'; } ?>> Yes &nbsp; &nbsp; 
    259                                                 <input name="delicious" value="0" type="radio" <?php if ( $bb_socialize['delicious'] == false ) { echo 'checked="checked"'; } ?>>NO 
    260                                         </td> 
    261                                 </tr> 
    262                                  
    263                                 <tr> 
    264                                         <td><label for="flickr"><b>Get Flickr</b></label></td> 
    265                                          
    266                                         <td> 
    267                                                 <input name="flickr" value="1" type="radio" <?php if ( $bb_socialize['flickr'] == true ) { echo 'checked="checked"'; } ?>> Yes &nbsp; &nbsp; 
    268                                                 <input name="flickr" value="0" type="radio" <?php if ( $bb_socialize['flickr'] == false ) { echo 'checked="checked"'; } ?>>NO 
    269                                         </td> 
    270                                 </tr> 
    271                                  
    272381                        </tbody> 
    273382                </table> 
    274                 <p class="submit"><input type="submit" name="submit" value="Save bbSocialize settings"></p> 
     383                 
     384                <h3>Set social sites</h3> 
     385                 
     386                <p>Use the settings below to decide, which social media websites will be used on your forum. Set "yes" if you want to allow users to set their account for this specific website, or set "no" to hide the specific website. You can change these settings anytime you want.</p> 
     387                 
     388                <table class="widefat"> 
     389                        <thead> 
     390                                <tr><th width="170">Social Media Site</th><th>Display</th></tr> 
     391                        </thead> 
     392                        <tbody> 
     393                                <tr> 
     394                                        <td><img src="<?php echo $bb_socialize['images_url']; ?>/bb_twitter.png" width="16" height="16" border="0" /> <label for="twitter"><b>Twitter</b></label></td> 
     395                                         
     396                                        <td> 
     397                                                <input name="twitter" value="1" type="radio" <?php if ( $bb_socialize['twitter'] == true ) { echo 'checked="checked"'; } ?>> Yes &nbsp; &nbsp; 
     398                                                <input name="twitter" value="0" type="radio" <?php if ( $bb_socialize['twitter'] == false ) { echo 'checked="checked"'; } ?>>No 
     399                                        </td> 
     400                                </tr> 
     401                                 
     402                                <tr> 
     403                                        <td><img src="<?php echo $bb_socialize['images_url']; ?>/bb_pownce.png" width="16" height="16" border="0" /> <label for="pownce"><b>Pownce</b></label></td> 
     404                                         
     405                                        <td> 
     406                                                <input name="pownce" value="1" type="radio" <?php if ( $bb_socialize['pownce'] == true ) { echo 'checked="checked"'; } ?>> Yes &nbsp; &nbsp; 
     407                                                <input name="pownce" value="0" type="radio" <?php if ( $bb_socialize['pownce'] == false ) { echo 'checked="checked"'; } ?>>No 
     408                                        </td> 
     409                                </tr> 
     410                                 
     411                                <tr> 
     412                                        <td><img src="<?php echo $bb_socialize['images_url']; ?>/bb_digg.png" width="16" height="16" border="0" /> <label for="digg"><b>Digg</b></label></td> 
     413                                         
     414                                        <td> 
     415                                                <input name="digg" value="1" type="radio" <?php if ( $bb_socialize['digg'] == true ) { echo 'checked="checked"'; } ?>> Yes &nbsp; &nbsp; 
     416                                                <input name="digg" value="0" type="radio" <?php if ( $bb_socialize['digg'] == false ) { echo 'checked="checked"'; } ?>>No 
     417                                        </td> 
     418                                </tr> 
     419                                 
     420                                <tr> 
     421                                        <td><img src="<?php echo $bb_socialize['images_url']; ?>/bb_delicious.png" width="16" height="16" border="0" /> <label for="delicious"><b>Delicious</b></label></td> 
     422                                         
     423                                        <td> 
     424                                                <input name="delicious" value="1" type="radio" <?php if ( $bb_socialize['delicious'] == true ) { echo 'checked="checked"'; } ?>> Yes &nbsp; &nbsp; 
     425                                                <input name="delicious" value="0" type="radio" <?php if ( $bb_socialize['delicious'] == false ) { echo 'checked="checked"'; } ?>>No 
     426                                        </td> 
     427                                </tr> 
     428                                 
     429                                <tr> 
     430                                        <td><img src="<?php echo $bb_socialize['images_url']; ?>/bb_flickr.png" width="16" height="16" border="0" /> <label for="flickr"><b>Flickr</b></label></td> 
     431                                         
     432                                        <td> 
     433                                                <input name="flickr" value="1" type="radio" <?php if ( $bb_socialize['flickr'] == true ) { echo 'checked="checked"'; } ?>> Yes &nbsp; &nbsp; 
     434                                                <input name="flickr" value="0" type="radio" <?php if ( $bb_socialize['flickr'] == false ) { echo 'checked="checked"'; } ?>>No 
     435                                        </td> 
     436                                </tr> 
     437                                 
     438                                <tr> 
     439                                        <td><img src="<?php echo $bb_socialize['images_url']; ?>/bb_technorati.png" width="16" height="16" border="0" /> <label for="technorati"><b>Technorati</b></label></td> 
     440                                         
     441                                        <td> 
     442                                                <input name="technorati" value="1" type="radio" <?php if ( $bb_socialize['technorati'] == true ) { echo 'checked="checked"'; } ?>> Yes &nbsp; &nbsp; 
     443                                                <input name="technorati" value="0" type="radio" <?php if ( $bb_socialize['technorati'] == false ) { echo 'checked="checked"'; } ?>>No 
     444                                        </td> 
     445                                </tr> 
     446 
     447                        </tbody> 
     448                </table> 
     449                <p class="submit"><input type="submit" name="bb_socialize_submit" value="Save bbSocialize settings"> <input type="submit" name="bb_socialize_reset" value="Reset settings"></p> 
    275450        </fieldset> 
    276451        </form> 
    277452 
    278         <h3>Please support the developer</h3> 
    279          
    280         <img src="http://astateofmind.eu/uploads/donation.gif" style="margin-right:10px" border="0" align="left" /> 
    281          
    282         Do you like this plugin? Do you find it useful? If so, please donate few dollars so I could keep develop this plugin and others further and further. Even the smallest help is greatly appreciated for a student in Poland ;). <br /><br /> 
     453        <hr /> 
     454         
     455        <p>If you like this plugin, please donate few bucks so I could keep developing it. Or at least <a href="http://twitter.com/t_thion/">follow me on Twitter</a> :). 
    283456         
    284457        <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 
     
    301474        <img alt="" border="0" src="https://www.paypal.com/pl_PL/i/scr/pixel.gif" width="1" height="1"> 
    302475        </form> 
    303          
    304         <p>Want to know what I'm developing right now? <a href="http://twitter.com/t_thion/">Follow me on Twitter</a>, ignore 90% of stuff and learn a lot you will ;). And thank you for using my plugin!</p> 
    305          
    306  
     476        </p> 
     477         
    307478        <?php 
    308479} 
    309480 
    310481function bb_socialize_process_post() { 
    311         if ( isset( $_POST['submit'] ) && isset( $_POST['bb_socialize'] ) )  
     482        if ( isset( $_POST['bb_socialize_submit'] ) && isset( $_POST['bb_socialize'] ) )  
    312483        { 
    313484                global $bb_socialize; 
     
    318489                 
    319490                bb_update_option('bb_socialize',$bb_socialize); 
     491        } elseif ( isset( $_POST['bb_socialize_reset'] ) ) { 
     492                global $bb_socialize; 
     493                 
     494                foreach( array_keys($bb_socialize) as $key) { 
     495                        if ( isset( $_POST[$key] ) ) { $bb_socialize[$key] = $_POST[$key]; } 
     496                } 
     497                 
     498                bb_delete_option('bb_socialize'); 
    320499        } 
    321500} 
  • bbsocialize/trunk/readme.txt

    r1282 r1337  
    99== Description == 
    1010 
    11 Allows you to set and display your social media profiles in your public forum profile. Currently, following websites are supported: Twitter, StumbleUpon, Digg, Pownce, Flickr, Delicious. As administrator, you can select which sites will be supported using simple management panel. 
     11Allows you to set and display your social media profiles in your public forum profile. As administrator, you can select which sites will be supported using simple management panel. 
    1212 
    1313== Installation == 
    1414 
    15151. Unpackage all files. 
    16 2. Move `bb-socialize` directory o to your `/my-plugins/` directory. 
     162. Move `bbsocialize` directory o to your `/my-plugins/` directory. 
    17173. Go to your administration panel and activate plugin. 
    18186. Go to tab `Social Profiles` tab under `Plugins` tab and configure settings. 
    19197. Open your `profile.php` file in your theme directory and add `<?php get_socialize(); ?>` where you want your profiles to be displayed. 
     20 
     21== Use == 
     22 
     23- Open `profile.php` located in your theme directory and put somewhere `get_socialize();` within PHP tags - now profiles will be displayed; 
     24- You can display profiles within single post, just open `post.php` and put `get_socialize_post( get_post_author_id() );` within PHP tags; 
    2025 
    2126== To Do == 
     
    2631== Donate == 
    2732 
     33Give me coffee! Pease ;) 
     34 
    2835* http://astateofmind.eu/about/support/ 
    2936 
    3037== History == 
    3138 
     390.0.3 - (2008-08-12)  
     40- Added support for Technorati;  
     41- Minor fixes to input forms;  
     42- Minor fixes to management panel;  
     43- New images for social media websites, 
     44- New function to display links within posts; 
     45- New "reset" button to reset settings; 
     46- Now, empty profiles are not displayed; 
     47 
    32480.0.2 - (2008-08-11) First beta release, most popular websites supported;