Changeset 380802
- Timestamp:
- 05/04/2011 03:26:20 PM (15 years ago)
- Location:
- billyben-rings/trunk
- Files:
-
- 8 added
- 1 deleted
- 7 edited
-
BillyBenRing/BillyBenRing.php (modified) (1 diff)
-
BillyBenRing/BillyBenRing.swf (modified) (previous)
-
BillyBenRing/elm/WPMenuBBR.php (deleted)
-
BillyBenRing/elm/bbr_bd_manager.php (added)
-
BillyBenRing/elm/bbr_options_class.php (added)
-
BillyBenRing/elm/bbr_style.css (added)
-
BillyBenRing/elm/bbr_widget_class.php (added)
-
BillyBenRing/elm/js/bbr_js.js (added)
-
BillyBenRing/elm/utilsClasse.php (modified) (6 diffs)
-
readme.txt (modified) (2 diffs)
-
screenshot-1.jpg (modified) (previous)
-
screenshot-2.jpg (modified) (previous)
-
screenshot-3.jpg (modified) (previous)
-
screenshot-4.jpg (added)
-
screenshot-5.jpg (added)
-
screenshot-6.jpg (added)
Legend:
- Unmodified
- Added
- Removed
-
billyben-rings/trunk/BillyBenRing/BillyBenRing.php
r377905 r380802 3 3 Plugin Name: BillyBenRing 4 4 Plugin URI: http://www.etherocliquecite.eu 5 Description: BillyBenRing for my own personnal link/cat/bm5 Description: BillyBenRing display your links, tag and/or categories by a circlar sideBar widget, with full or arrowed circles. Fully customizable. 6 6 Author: Billyben 7 Version: 17 Version: 2.1.1 8 8 Author URI: http://asblog.etherocliquecite.eu 9 9 */ 10 10 11 11 /* inclu les utilitaires */ 12 include("elm/utilsClasse.php");//fct util 13 include("elm/WPMenuBBR.php");//description du menu 12 include_once("elm/utilsClasse.php");//fct util 13 include_once("elm/bbr_widget_class.php");//la classe du widget 14 include_once("elm/bbr_bd_manager.php");// les fonction de gestion de la bd 15 include_once("elm/bbr_options_class.php");// les fonction de gestion de la bd 16 17 // les variables globales 18 $bbr_new_version = '2.1.1'; 19 if (!defined('BBR_VERSION_KEY'))define('BBR_VERSION_KEY', 'bbr_version'); 20 if (!defined('BBR_VERSION_NUM'))define('BBR_VERSION_NUM', $bbr_new_version); 21 if (!defined('BBR_TEXT_DOMAIN'))define('BBR_TEXT_DOMAIN', 'bbr_widget_text'); 22 // on met à jour la table selon la version 23 function bbr_check_version(){ 24 global $bbr_new_version; 25 if (!get_option('bbr_version') ||(get_option('bbr_version') != $bbr_new_version&&get_option('bbr_version') !="2.1.0")) { 26 //bbr_create_database_table(); 27 bbr_fill_table_with_older_version(); 28 add_option('bbr_version', $bbr_new_version); 29 } 30 } 31 function bbr_create_option_page(){ 32 $page=new bbr_Theme_Options(); 33 34 } 35 // 14 36 function bbr_install () { 37 bbr_check_version(); 15 38 $options=get_option('bbr_options'); 16 39 $options= bbr_init_options($options); 17 add_option('bbr_options', $options);40 update_option('bbr_options', $options); 18 41 } 19 42 function bbr_uninstall(){ 20 delete_option('bbr_options'); 21 } 22 23 function bbr_get_FlashCode() 24 { 25 // pour le swfObjet 26 $options=get_option('bbr_options'); 27 $wSize=$options['width']; 28 $hSize=$options['height']; 29 $path=get_bloginfo('wpurl')."/wp-content/plugins/BillyBenRing/" ; 30 // creation des flash var 31 $flashVar['ringSize']=$options['ringSize']; 32 $flashVar['firstRingSize']=$options['firstRingSize']; 33 $flashVar['transparent']=$options['transparent']; 34 if(!$options['transparent'])$flashVar['bgColor']=$options['bgColor']; 35 $flashVar['txtOffColor']= $options['txtOffColor']; 36 $flashVar['txtOnColor']= $options['txtOnColor']; 37 $flashVar['overGlowColor']= $options['overGlowColor']; 38 $flashVar['deltaRing']= $options['deltaRing']; 39 $flashVar['RingCrop']= $options['RingCrop']; 40 $flashVar['startAlign']=$options['startAlign']; 41 $flashVar['xmlString']=bbr_getXML_String(); 42 $flashVar['startAngle']=$options['startAngle']; 43 $flashVar['decalAngle']=$options['decalAngle']; 44 $flashVar['textAlign']= $options['textAlign']; 45 // le code html 46 $flashHTML=""; 47 $flashHTML.='<script type="text/javascript" src="'.$path.'elm/js/swfobject.js"></script> 48 <script type="text/javascript"> 49 var flashvars ={};'; 50 foreach ($flashVar as $key=>$value){ 51 $flashHTML.='flashvars.'.$key.'="'.$value.'";'; 52 } 53 $flashHTML.='var params = {allowScriptAccess:"always"}; 54 params.scale="exactfit";'; 55 if($options['transparent']){ 56 $flashHTML.='params.wmode="transparent";'; 57 }else{ 58 $flashHTML.='params.bgcolor="#'.$options['bgColor'].'";'; 59 } 60 $flashHTML.='var attributes = {}; 61 attributes.align = "middle"; 62 attributes.id = "flashContentId"; 63 swfobject.embedSWF("'.$path.'BillyBenRing.swf", "flashContentId", "'.$wSize.'", "'.$hSize.'", "10.0.0", false, flashvars, params, attributes);'; 64 65 $flashHTML.='</script>'; 66 $flashHTML.=' <div id="flashContentId">'; 67 $flashHTML.='<div id="myAlternativeContent"> 68 <a href="http://www.adobe.com/go/getflashplayer"> 69 <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /> 70 </a> 71 </div></div>'; 72 return $flashHTML; 43 //delete_option('bbr_options'); 73 44 } 74 45 75 // construction du xml de retour 76 function bbr_getXML_String(){ 77 $options=get_option('bbr_options'); 78 $xmlStr="<DATA>"; 79 // si des liens 80 if($options['displayLink']){ 81 $cats = bbr_get_bookmark_arr(); 82 $catsId=bbr_get_bookmark_tag_arr(); 83 foreach ( $cats as $catName=>$bookmarks ) { 84 $catStr=($options['displayLinkTag'])?'cat="'.$catName.'" catColor="'.$options["link_cat_id_".$catsId[$catName]].'" ':' '; 85 foreach($bookmarks as $bm){ 86 $xmlStr.='<ring type="link" '.$catStr.' url="'.$bm->link_url.'" color="'.$options["link_id_".$bm->link_id].'">'.$bm->link_name.'</ring>'; 87 } 88 } 89 } 90 // si catégory 91 if($options['displayCat']){ 92 $cats =bbr_get_category_arr(); 93 foreach($cats as $cat) { 94 $idCurr=bbr_get_default_id($cat->term_id, 'category'); 95 $xmlStr.='<ring type="cat" color="'.$options["cat_id_".$idCurr].'" url="'.get_category_link($idCurr).'" count="'.$cat->count.'">'.$cat->name.'</ring>'; 96 } 97 } 98 if($options['displayKeyWord']){ 99 $tags = bbr_get_keywords_arr(); 100 foreach ( $tags as $key => $tag ) { 101 $idCurr=bbr_get_default_id($tag["id"], 'post_tag'); 102 $xmlStr.='<ring type="keyword" color="'.$options["tag_id_".$idCurr].'" url="'.$tag["link"].'">'.$key.'</ring>'; 103 } 104 } 105 // on fini 106 $xmlStr.="</DATA>"; 107 return urlencode($xmlStr); 46 47 function BillyBenRing_widget() 48 { 49 bbr_check_version(); 50 register_widget("BillyBenRing"); 108 51 } 109 110 function widget_BillyBenRing($args) {111 extract($args);112 $options = get_option('bbr_options');113 echo $before_widget;114 ?>115 <?php if( !empty($options['title']) ): ?>116 <?php echo $before_title . $options['title'] . $after_title; ?>117 <?php endif; ?>118 <?php119 if( !stristr( $_SERVER['PHP_SELF'], 'widgets.php' ) ){120 echo bbr_get_FlashCode();121 }122 ?>123 <?php124 echo $after_widget;125 }126 127 function BillyBenRing_widget()128 {129 register_sidebar_widget(__('BillyBenRing'), 'widget_BillyBenRing');130 }131 add_action('admin_menu', 'bbr_init_menu');132 52 133 add_action("plugins_loaded", "BillyBenRing_widget"); 53 54 add_action("widgets_init", "BillyBenRing_widget"); 55 add_action('wp_loaded' , 'bbr_create_option_page'); 134 56 register_activation_hook( __FILE__, 'bbr_install' ); 135 57 register_deactivation_hook( __FILE__, 'bbr_uninstall' ); 136 58 add_shortcode( 'BBR', 'bbr_shortcodehandler' ); 137 59 138 60 ?> -
billyben-rings/trunk/BillyBenRing/elm/utilsClasse.php
r377867 r380802 23 23 return get_categories(); 24 24 } 25 25 function bbr_get_page_arr(){ 26 $catArr=array(); 27 $cats = get_pages(); 28 foreach ( (array) $cats as $cat ) { 29 $catName=$cat->post_title; 30 $link = get_page_link( intval($cat->ID)); 31 $catArr[]=Array("id"=>$cat->ID, "link"=>$link, "name"=>$catName); 32 } 33 return $catArr; 34 } 26 35 function bbr_get_keywords_arr(){ 27 36 $tags = get_terms('post_tag'); … … 34 43 } 35 44 36 37 38 function bbr_init_options($options){ 45 function bbr_init_single_widget_options($options){ 39 46 $options['width'] = (isset($options['width']))?$options['width']:'300'; 40 47 $options['height'] = (isset($options['height']))?$options['height']:'300'; 41 $options['ringSize'] = (isset($options['ringSize']))?$options['ringSize']: 20;48 $options['ringSize'] = (isset($options['ringSize']))?$options['ringSize']:15; 42 49 $options['firstRingSize']= (isset($options['firstRingSize']))?$options['firstRingSize']:20; 43 50 $options['displayLink']=(isset($options['displayLink']))?$options['displayLink']:true; … … 45 52 $options['displayCat']=(isset($options['displayCat']))?$options['displayCat']:false; 46 53 $options['displayKeyWord']=(isset($options['displayKeyWord']))?$options['displayKeyWord']:false; 54 $options['displayPage']=(isset($options['displayPage']))?$options['displayPage']:false; 47 55 $options['transparent']=(isset($options['transparent']))?$options['transparent']:true; 48 56 $options['bgColor']=(isset($options['bgColor']))?$options['bgColor']:"CCCCCC"; … … 56 64 $options['decalAngle']=(isset($options['decalAngle']))?$options['decalAngle']:0; 57 65 $options['textAlign']=(isset($options['textAlign']))?$options['textAlign']:0; 66 return $options; 67 68 } 69 70 function bbr_init_options($options){ 71 58 72 $options['bbr_currLang']=(isset($options['bbr_currLang']))?$options['bbr_currLang']:"En"; 73 $options['link_dest']=(isset($options['link_dest']))?$options['link_dest']:"_blank"; 74 $options['cat_dest']=(isset($options['cat_dest']))?$options['cat_dest']:"_self"; 75 $options['tag_dest']=(isset($options['tag_dest']))?$options['tag_dest']:"_self"; 76 $options['page_dest']=(isset($options['page_dest']))?$options['page_dest']:"_self"; 77 $options['display']=(isset($options['display']))?$options['display']:"bbr_link_table"; 78 79 $options['short_id']=(isset($options['short_id']))?$options['short_id']:0; 80 59 81 // init des couleur 60 82 //les liens 61 $defaultColor=" 00CCFF";83 $defaultColor="CCCCCC"; 62 84 $cats = bbr_get_bookmark_arr(); 63 85 foreach ( $cats as $catName=>$bookmarks ) { … … 82 104 $options[$catId]=(isset($options[$catId]))?$options[$catId]:$defaultColor; 83 105 } 84 85 86 87 88 106 $cats=bbr_get_page_arr(); 107 foreach ( $cats as $tag ) { 108 $catId="page_id_".$tag["id"]; 109 $options[$catId]=(isset($options[$catId]))?$options[$catId]:$defaultColor; 110 } 89 111 return $options; 90 112 … … 95 117 if(function_exists('icl_object_id')){ 96 118 $options=get_option('bbr_options'); 97 $curValue=icl_object_id($curValue, $type, true, $options['bbr_currLang']); 119 $curValue=icl_object_id($curValue, $type, true, $options['bbr_currLang']); 98 120 } 99 121 return $curValue; 100 122 } 101 123 124 // construction du xml de retour 125 function bbr_getXML_String($displays){ 126 $options=get_option('bbr_options'); 127 $options= bbr_init_options($options); 128 $xmlStr="<DATA>"; 129 // si des liens 130 if(isset($displays['displayLink'])&&$displays['displayLink']){ 131 $cats = bbr_get_bookmark_arr(); 132 $catsId=bbr_get_bookmark_tag_arr(); 133 foreach ( $cats as $catName=>$bookmarks ) { 134 $catStr=(isset($displays['displayLinkTag'])&&$displays['displayLinkTag'])?'cat="'.$catName.'" catColor="'.$options["link_cat_id_".$catsId[$catName]].'" ':' '; 135 foreach($bookmarks as $bm){ 136 $xmlStr.='<ring type="link" '.$catStr.' url="'.$bm->link_url.'" color="'.$options["link_id_".$bm->link_id].'">'.$bm->link_name.'</ring>'; 137 } 138 } 139 } 140 // si catégory 141 if(isset($displays['displayCat'])&&$displays['displayCat']){ 142 $cats =bbr_get_category_arr(); 143 foreach($cats as $cat) { 144 $idCurr=bbr_get_default_id($cat->term_id, 'category'); 145 $xmlStr.='<ring type="cat" color="'.$options["cat_id_".$idCurr].'" url="'.get_category_link($idCurr).'" count="'.$cat->count.'">'.$cat->name.'</ring>'; 146 } 147 } 148 // si tag 149 if(isset($displays['displayKeyWord'])&&$displays['displayKeyWord']){ 150 $tags = bbr_get_keywords_arr(); 151 foreach ( $tags as $key => $tag ) { 152 $idCurr=bbr_get_default_id($tag["id"], 'post_tag'); 153 $xmlStr.='<ring type="keyword" color="'.$options["tag_id_".$idCurr].'" url="'.$tag["link"].'">'.$key.'</ring>'; 154 } 155 } 156 // si page 157 if(isset($displays['displayPage'])&&$displays['displayPage']){ 158 $tags = bbr_get_page_arr(); 159 foreach ( $tags as $tag ) { 160 $idCurr=bbr_get_default_id($tag["id"], 'page'); 161 $xmlStr.='<ring type="page" color="'.$options["page_id_".$idCurr].'" url="'.$tag["link"].'">'.$tag["name"].'</ring>'; 162 } 163 } 164 // on fini 165 $xmlStr.="</DATA>"; 166 return urlencode($xmlStr); 167 } 168 169 function bbr_transform_attribute_to_option($atts){ 170 if(count($atts)<1)return $atts; 171 $options=bbr_init_single_widget_options(array()); 172 foreach($options as $key=>$value){ 173 $lowerKey=strtolower($key); 174 if(isset($atts[$lowerKey])){ 175 $atts[$key]=$atts[$lowerKey]; 176 if($key!=$lowerKey)unset($atts[$lowerKey]); 177 } 178 179 } 180 return $atts; 181 182 } 183 102 184 103 185 ?> -
billyben-rings/trunk/readme.txt
r380749 r380802 6 6 Stable tag: 2.1.1 7 7 8 Display your links, tags, pages, and/or categories by a circular sideBar widget, with full or arrowed circles. Fully customizable. Add Shortcode to your page/post. Mutli Instance8 Display links, tag, pages, and categories by a circular sideBar widget, with full or arrowed circles. Fully customizable, ShortCoded, Mutli Instance. 9 9 10 10 == Description == … … 47 47 4. The BBR's Color Option page 48 48 5. The BBR Help Page head 49 6. The S IdeBar configuration of BBR Widget49 6. The SideBar configuration of BBR Widget 50 50 51 51 == Changelog == 52 = 2.1.1 = 53 * minor bug corrected 52 54 = 2.1.0 = 53 55 * Add ShortCode 54 56 * Change Menu - add specific BBR Menu 57 55 58 Updating from version 2.0 should not erase your configuration 56 59 = 2.0.0 =
Note: See TracChangeset
for help on using the changeset viewer.