PluginProbe
Easy Bootstrap Shortcode / 2.5
Easy Bootstrap Shortcode v2.5
trunk 2.4.0 2.5 3.4 3.5 3.6 3.7 4.0.0 4.4 4.5 4.5.4 5.0.0 5.0.1 5.0.2
easy-bootstrap-shortcodes / shortcode / servicebox / plugin_shortcode.php

plugin_shortcode.php in Easy Bootstrap Shortcode 2.5, at shortcode/servicebox/plugin_shortcode.php

95 lines 2.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /* * *********************************************************
4 * Servicebox
5 * ********************************************************* */
6 $_ebsp_servicebox=array();
7
8 $_SESSION['ebs_servicebox_css']=array();
9 function osc_theme_servicebox($params, $content = null) {
10 global $_ebsp_servicebox;
11 extract(shortcode_atts(array(
12 'id' => count($_ebsp_servicebox),
13 'icon' => '',
14 'type'=>'icon',
15 'icontype'=>'glyphicon',
16 'icon_size'=>40,
17 'iconbg_size'=>100,
18 'iconbg_radius'=>50,
19 'margin_bottom'=>30,
20 'margin_top'=>30,
21 'iconbgcolor'=>'#FFFFFF',
22 'iconcolor'=>'#777777',
23 'headingtype' => 'h3',
24 'heading' => '',
25 'class' => '',
26 'readmore'=>'',
27 'readmore_link'=>'',
28 'readmore_text'=>'',
29 'readmore_type'=>'',
30 'readmorestyle'=>'default',
31 'readmore_bgcolor'=>'',
32 'readmore_fgcolor'=>''
33 ), $params));
34 $out = '';$style='';
35 $_ebsp_servicebox[$id]=array();
36
37 $out.='<div id="osc_servicebox_'.$id.'" class="osc_servicebox '.$class.'">';
38
39 if($icon!=''){
40 $out.= '<span class="'.$icontype.' ' . $icon . ' icon_bg iconcircle"></span>';
41 }
42
43 if($heading!=''){
44 $out.='<'.$headingtype.'>'.$heading.'</'.$headingtype.'>';
45 }
46 $out.='<div class="osc_servicebox_content">';
47 $out.=do_shortcode($content);
48 $out.='</div>';
49 if($readmore=='true'){
50 if($readmore_type!=''){
51 $btnclass=' btn '.$readmore_type;
52 } else{
53 $btnclass=' osc_servicebox_readmore';
54 }
55 $out.='<a href="'.$readmore_link.'" class="osc_servicebox_readmore_css'.$btnclass.'">'.$readmore_text.'</a>';
56 }
57 $out.='</div>';
58
59 if($readmore=='true' && $readmorestyle=='custom' ){
60 $style.='
61 #osc_servicebox_'.$id.' .osc_servicebox_readmore_css{
62 color:'.$readmore_fgcolor.';
63 background-color:'.$readmore_bgcolor.';
64 }';
65 }
66 $lineheight=intval($iconbg_size)-10;
67 $style.='
68 #osc_servicebox_'.$id.' .iconcircle{
69
70 }
71 #osc_servicebox_'.$id.' span.iconcircle {
72 color:'.$iconcolor.';
73 font-size:'.$icon_size.'px;
74 line-height:'.$lineheight.'px;
75 background-color:'.$iconbgcolor.';
76 height:'.$iconbg_size.'px;
77 width:'.$iconbg_size.'px;
78 margin-top:'.$margin_top.'px;
79 margin-bottom:'.$margin_bottom.'px;
80 border-radius:'.$iconbg_radius.'%;
81 -moz-border-radius: '.$iconbg_radius.'%;
82 -webkit-border-radius: '.$iconbg_radius.'%;
83 -ms-border-radius: '.$iconbg_radius.'%;
84 -o-border-radius: '.$iconbg_radius.'%;
85 ;
86 }';
87 $_SESSION['ebs_servicebox_css'][]= 'ebs_servicebox_css_id_'.$id;
88 $_SESSION['ebs_servicebox_css_id_'.$id]=$style;
89 wp_enqueue_style('ebs-dstyle',EBS_PLUGIN_URL.'styles/ebs-dstyle.php');
90 return $out;
91 }
92
93 add_shortcode('servicebox', 'osc_theme_servicebox');
94
95