Advertisement
Guest User

Untitled

a guest
Oct 12th, 2012
611
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 32.52 KB | None | 0 0
  1. <?php
  2.  
  3. function filter_shortcode($content) {
  4.  
  5.     return do_shortcode(strip_tags($content, "<h1><h2><h3><h4><h5><h6><a><img><div><ul><li><ol><table><td><th><span><p><br>"));
  6.  
  7. }
  8.  
  9. add_shortcode('feedburner','vp_feedburner');
  10.  
  11. function vp_feedburner($atts, $content = null){
  12.  
  13.     extract(shortcode_atts(array(
  14.  
  15.         "name" => ''
  16.  
  17.     ), $atts));
  18.  
  19.     if($name !== '')
  20.  
  21.     {
  22.  
  23.         $output = '<div style="margin: 5px; display: inline">';
  24.  
  25.         $output .= "<a href='" . esc_url( "http://feeds.feedburner.com/{$name}" ) . "'>
  26.  
  27.             <img src='" . esc_url( "http://feeds.feedburner.com/~fc/{$name}?bg=99CCFF&amp;fg=444444&amp;anim=0" ) . "' height='26' width='88' style='border:0' alt='' />
  28.  
  29.         </a>";
  30.  
  31.         $output .= '</div>';
  32.  
  33.     }
  34.  
  35.     else $output = '';
  36.  
  37.     return $output;
  38.  
  39. }
  40.  
  41. add_shortcode('twitter','vp_twitter');
  42.  
  43. function vp_twitter($atts, $content = null){
  44.  
  45.     extract(shortcode_atts(array(
  46.  
  47.         "variation" => 1,
  48.  
  49.         "username" => ''
  50.  
  51.     ), $atts));
  52.  
  53.     if($username !== '')
  54.  
  55.     {
  56.  
  57.         $output = '<div style="margin: 5px; display: inline">';
  58.  
  59.         switch($variation) {
  60.  
  61.             case 1:
  62.  
  63.                 $output .= '<a href="http://twitter.com/' . esc_html($username) . '"><img alt="twitter" src="http://button.twittercounter.com/animated/' . esc_html($username) . '/ffffff/00ACED" /></a>';
  64.  
  65.                 break;
  66.  
  67.             case 2:
  68.  
  69.                 $output .= '<a href="http://twitter.com/' . esc_html($username) . '"><img alt="twitter" src="http://button.twittercounter.com/avatar/?u=' . esc_html($username) . '" /></a>';
  70.  
  71.                 break;
  72.  
  73.             case 3:    
  74.  
  75.                 $output .= '<a href="http://twitter.com/' . esc_html($username) . '"><img alt="twitter" src="http://button.twittercounter.com/bird/?u=' . esc_html($username) . '" /></a>';
  76.  
  77.                 break;
  78.  
  79.         }
  80.  
  81.         $output .= '</div>';       
  82.  
  83.     }
  84.  
  85.     else $output = '';
  86.  
  87.     return $output;
  88.  
  89. }
  90.  
  91. add_shortcode('digg','vp_digg');
  92.  
  93. function vp_digg($atts, $content = null){
  94.  
  95.     extract(shortcode_atts(array(
  96.  
  97.         "variation" => 1
  98.  
  99.     ), $atts));
  100.  
  101.     $output = '<script type="text/javascript">
  102.  
  103.     (function() {
  104.  
  105.     var s = document.createElement("SCRIPT"), s1 = document.getElementsByTagName("SCRIPT")[0];
  106.  
  107.     s.type = "text/javascript";
  108.  
  109.     s.async = true;
  110.  
  111.     s.src = "http://widgets.digg.com/buttons.js";
  112.  
  113.     s1.parentNode.insertBefore(s, s1);
  114.  
  115.     })();
  116.  
  117.     </script>';
  118.  
  119.     $output .= '<div style="margin: 5px; display: inline">';
  120.  
  121.     switch($variation) {
  122.  
  123.         case 1:
  124.  
  125.             $output .= '<a class="DiggThisButton DiggWide"></a>';
  126.  
  127.             break;
  128.  
  129.         case 2:
  130.  
  131.             $output .= '<a class="DiggThisButton DiggMedium"></a>';
  132.  
  133.             break;
  134.  
  135.         case 3:    
  136.  
  137.             $output .= '<a class="DiggThisButton DiggCompact"></a>';
  138.  
  139.             break;
  140.  
  141.         case 4:
  142.  
  143.             $output .= '<a class="DiggThisButton DiggIcon"></a>';
  144.  
  145.             break;
  146.  
  147.     }      
  148.  
  149.     $output .= '</div>';
  150.  
  151.     return $output;
  152.  
  153. }
  154.  
  155.  
  156.  
  157. add_shortcode('facebook','vp_facebook');
  158.  
  159. function vp_facebook($atts, $content = null) {
  160.  
  161.     $output = '<div style="margin: 5px; display: inline">';
  162.  
  163.     $output .= '<a name="fb_share"></a>
  164.  
  165.     <script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share"
  166.  
  167.             type="text/javascript">
  168.  
  169.     </script>';
  170.  
  171.     $output .= '</div>';
  172.  
  173.     return $output;
  174.  
  175. }
  176.  
  177.  
  178.  
  179. add_shortcode('stumble','vp_stumble');
  180.  
  181. function vp_stumble($atts, $content = null) {
  182.  
  183.     extract(shortcode_atts(array(
  184.  
  185.         "variation" => 5
  186.  
  187.     ), $atts));
  188.  
  189.     $output = '<div style="margin: 5px; display: inline">';
  190.  
  191.     $output .= '<su:badge layout="' . (int)$variation . '"></su:badge>
  192.  
  193.  
  194.  
  195. <script type="text/javascript">
  196.  
  197.  (function() {
  198.  
  199.    var li = document.createElement("script"); li.type = "text/javascript"; li.async = true;
  200.  
  201.    li.src = "https://platform.stumbleupon.com/1/widgets.js";
  202.  
  203.    var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(li, s);
  204.  
  205.  })();
  206.  
  207. </script>';
  208.  
  209.     $output .= '</div>';
  210.  
  211.     return $output;
  212.  
  213. }
  214.  
  215.  
  216.  
  217. add_shortcode('retweet','vp_retweet');
  218.  
  219. function vp_retweet($atts, $content = null) {
  220.  
  221.     $output = '<div style="margin: 5px; display: inline">';
  222.  
  223.     $output .= "<a href='http://twitter.com/share' class='twitter-share-button' data-count='vertical'>Tweet</a><script type='text/javascript' src='http://platform.twitter.com/widgets.js'></script>";
  224.  
  225.     $output .= '</div>';
  226.  
  227.     return $output;
  228.  
  229. }
  230.  
  231.  
  232.  
  233. add_shortcode('pinterest','vp_pinterest');
  234.  
  235. function vp_pinterest($atts, $content = null){
  236.  
  237.     extract(shortcode_atts(array(
  238.  
  239.         "variation" => 1,
  240.  
  241.         "username" => ''
  242.  
  243.     ), $atts));
  244.  
  245.     if($username !== '')
  246.  
  247.     {
  248.  
  249.         $output = '<div style="margin: 5px; display: inline">';
  250.  
  251.         switch($variation) {
  252.  
  253.             case 1:
  254.  
  255.                 $output .= '<a href="http://pinterest.com/' . esc_html($username) . '/"><img src="http://passets-ec.pinterest.com/images/about/buttons/follow-me-on-pinterest-button.png" width="169" height="28" alt="Follow Me on Pinterest" /></a>';
  256.  
  257.                 break;
  258.  
  259.             case 2:
  260.  
  261.                 $output .= '<a href="http://pinterest.com/' . esc_html($username) . '/"><img src="http://passets-ec.pinterest.com/images/about/buttons/pinterest-button.png" width="80" height="28" alt="Follow Me on Pinterest" /></a>';
  262.  
  263.                 break;
  264.  
  265.             case 3:    
  266.  
  267.                 $output .= '<a href="http://pinterest.com/' . esc_html($username) . '/"><img src="http://passets-ec.pinterest.com/images/about/buttons/big-p-button.png" width="60" height="60" alt="Follow Me on Pinterest" /></a>';
  268.  
  269.                 break;
  270.  
  271.             case 4:
  272.  
  273.                 $output .= '<a href="http://pinterest.com/' . esc_html($username) . '/"><img src="http://passets-ec.pinterest.com/images/about/buttons/small-p-button.png" width="16" height="16" alt="Follow Me on Pinterest" /></a>';
  274.  
  275.                 break;
  276.  
  277.         }
  278.  
  279.         $output .= '</div>';       
  280.  
  281.     }
  282.  
  283.     else $output = '';
  284.  
  285.     return $output;
  286.  
  287. }
  288.  
  289.  
  290.  
  291. add_shortcode('addthis','vp_addthis');
  292.  
  293. function vp_addthis($atts, $content = null){
  294.  
  295.     extract(shortcode_atts(array(
  296.  
  297.         "variation" => 1,
  298.  
  299.     ), $atts));
  300.  
  301.    
  302.  
  303.     $output = '<div style="margin: 5px; display: inline">';
  304.  
  305.     switch($variation) {
  306.  
  307.         case 1:
  308.  
  309.             $output .= '<div class="addthis_toolbox addthis_default_style ">
  310.  
  311.                 <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
  312.  
  313.                 <a class="addthis_button_tweet"></a>
  314.  
  315.                 <a class="addthis_button_pinterest_pinit"></a>
  316.  
  317.                 <a class="addthis_counter addthis_pill_style"></a>
  318.  
  319.                 </div>';
  320.  
  321.             break;
  322.  
  323.         case 2:
  324.  
  325.             $output .= '<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
  326.  
  327.                 <a class="addthis_button_preferred_1"></a>
  328.  
  329.                 <a class="addthis_button_preferred_2"></a>
  330.  
  331.                 <a class="addthis_button_preferred_3"></a>
  332.  
  333.                 <a class="addthis_button_preferred_4"></a>
  334.  
  335.                 <a class="addthis_button_compact"></a>
  336.  
  337.                 <a class="addthis_counter addthis_bubble_style"></a>
  338.  
  339.                 </div>';
  340.  
  341.             break;
  342.  
  343.         case 3:    
  344.  
  345.             $output .= '<div class="addthis_toolbox addthis_default_style ">
  346.  
  347.                 <a class="addthis_button_preferred_1"></a>
  348.  
  349.                 <a class="addthis_button_preferred_2"></a>
  350.  
  351.                 <a class="addthis_button_preferred_3"></a>
  352.  
  353.                 <a class="addthis_button_preferred_4"></a>
  354.  
  355.                 <a class="addthis_button_compact"></a>
  356.  
  357.                 <a class="addthis_counter addthis_bubble_style"></a>
  358.  
  359.                 </div>';
  360.  
  361.             break;
  362.  
  363.         case 4:
  364.  
  365.             $output .= '<div class="addthis_toolbox addthis_floating_style addthis_counter_style" style="left:50px;top:50px;">
  366.  
  367.                 <a class="addthis_button_facebook_like" fb:like:layout="box_count"></a>
  368.  
  369.                 <a class="addthis_button_tweet" tw:count="vertical"></a>
  370.  
  371.                 <a class="addthis_button_google_plusone" g:plusone:size="tall"></a>
  372.  
  373.                 <a class="addthis_counter"></a>
  374.  
  375.                 </div>';
  376.  
  377.             break;
  378.  
  379.     }
  380.  
  381.     $output .= '<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4ff05056494689b5"></script>';
  382.  
  383.     $output .= '</div>';       
  384.  
  385.     return $output;
  386.  
  387. }
  388.  
  389. add_shortcode('one_third','vp_one_third');
  390.  
  391. function vp_one_third($atts, $content = null){
  392.  
  393.     extract(shortcode_atts(array(
  394.  
  395.         'noleft' => '',
  396.  
  397.         'noright' => ''
  398.  
  399.     ), $atts));
  400.  
  401.     $content = filter_shortcode($content);
  402.  
  403.     $class = '';
  404.  
  405.     if($noleft !== '')
  406.  
  407.         $class .= 'alpha ';
  408.  
  409.     if($noright !== '')
  410.  
  411.         $class .= 'omega';
  412.  
  413.     $output = '<div class="one-third column ' . $class . '">' . $content . '</div>';
  414.  
  415.     return $output;
  416.  
  417. }
  418.  
  419. add_shortcode('one_half','vp_one_half');
  420.  
  421. function vp_one_half($atts, $content = null){
  422.  
  423.     extract(shortcode_atts(array(
  424.  
  425.         'noleft' => '',
  426.  
  427.         'noright' => ''
  428.  
  429.     ), $atts));
  430.  
  431.     $content = filter_shortcode($content);
  432.  
  433.     $class = '';
  434.  
  435.     if($noleft !== '')
  436.  
  437.         $class .= 'alpha ';
  438.  
  439.     if($noright !== '')
  440.  
  441.         $class .= 'omega';
  442.  
  443.     $output = '<div class="eight columns ' . $class . '">' . $content . '</div>';
  444.  
  445.     return $output;
  446.  
  447. }
  448.  
  449.  
  450.  
  451. add_shortcode('two_thirds','vp_two_thirds');
  452.  
  453. function vp_two_thirds($atts, $content = null){
  454.  
  455.     extract(shortcode_atts(array(
  456.  
  457.         'noleft' => '',
  458.  
  459.         'noright' => ''
  460.  
  461.     ), $atts));
  462.  
  463.     $content = filter_shortcode($content);
  464.  
  465.     $class = '';
  466.  
  467.     if($noleft !== '')
  468.  
  469.         $class .= 'alpha ';
  470.  
  471.     if($noright !== '')
  472.  
  473.         $class .= 'omega';
  474.  
  475.     $output = '<div class="two-thirds column ' . $class . '">' . $content . '</div>';
  476.  
  477.     return $output;
  478.  
  479. }
  480.  
  481.  
  482.  
  483. add_shortcode('one_fourth','vp_one_fourth');
  484.  
  485. function vp_one_fourth($atts, $content = null){
  486.  
  487.     extract(shortcode_atts(array(
  488.  
  489.         'icon' => '',
  490.  
  491.         'noleft' => '',
  492.  
  493.         'noright' => ''
  494.  
  495.     ), $atts));
  496.  
  497.     $content = filter_shortcode($content);
  498.  
  499.     $class = '';
  500.  
  501.     if($noleft !== '')
  502.  
  503.         $class .= 'alpha ';
  504.  
  505.     if($noright !== '')
  506.  
  507.         $class .= 'omega';
  508.  
  509.     $output = '<div class="four columns ' . $class . '">';
  510.  
  511.     if($icon !== '')
  512.  
  513.         $output .= '<img alt="" src="' . esc_attr($icon) . '">';
  514.  
  515.     $output .= $content;
  516.  
  517.     $output .= '</div>';
  518.  
  519.     return $output;
  520.  
  521. }
  522.  
  523. add_shortcode('one_column','vp_one_column');
  524.  
  525. function vp_one_column($atts, $content = null){
  526.  
  527.     extract(shortcode_atts(array(
  528.  
  529.         'noleft' => '',
  530.  
  531.         'noright' => ''
  532.  
  533.     ), $atts));
  534.  
  535.     $content = filter_shortcode($content);
  536.  
  537.     $class = '';
  538.  
  539.     if($noleft !== '')
  540.  
  541.         $class .= 'alpha ';
  542.  
  543.     if($noright !== '')
  544.  
  545.         $class .= 'omega';
  546.  
  547.     $output = '<div class="one column ' . $class . '">' . $content . '</div>';
  548.  
  549.     return $output;
  550.  
  551. }
  552.  
  553. add_shortcode('two_columns','vp_two_columns');
  554.  
  555. function vp_two_columns($atts, $content = null){
  556.  
  557.     extract(shortcode_atts(array(
  558.  
  559.         'noleft' => '',
  560.  
  561.         'noright' => ''
  562.  
  563.     ), $atts));
  564.  
  565.     $content = filter_shortcode($content);
  566.  
  567.     $class = '';
  568.  
  569.     if($noleft !== '')
  570.  
  571.         $class .= 'alpha ';
  572.  
  573.     if($noright !== '')
  574.  
  575.         $class .= 'omega';
  576.  
  577.     $output = '<div class="two columns ' . $class . '">' . $content . '</div>';
  578.  
  579.     return $output;
  580.  
  581. }
  582.  
  583. add_shortcode('three_columns','vp_three_columns');
  584.  
  585. function vp_three_columns($atts, $content = null){
  586.  
  587.     extract(shortcode_atts(array(
  588.  
  589.         'noleft' => '',
  590.  
  591.         'noright' => ''
  592.  
  593.     ), $atts));
  594.  
  595.     $content = filter_shortcode($content);
  596.  
  597.     $class = '';
  598.  
  599.     if($noleft !== '')
  600.  
  601.         $class .= 'alpha ';
  602.  
  603.     if($noright !== '')
  604.  
  605.         $class .= 'omega';
  606.  
  607.     $output = '<div class="three columns ' . $class . '">' . $content . '</div>';
  608.  
  609.     return $output;
  610.  
  611. }
  612.  
  613. add_shortcode('five_columns','vp_five_columns');
  614.  
  615. function vp_five_columns($atts, $content = null){
  616.  
  617.     extract(shortcode_atts(array(
  618.  
  619.         'noleft' => '',
  620.  
  621.         'noright' => ''
  622.  
  623.     ), $atts));
  624.  
  625.     $content = filter_shortcode($content);
  626.  
  627.     $class = '';
  628.  
  629.     if($noleft !== '')
  630.  
  631.         $class .= 'alpha ';
  632.  
  633.     if($noright !== '')
  634.  
  635.         $class .= 'omega';
  636.  
  637.     $output = '<div class="five columns ' . $class . '">' . $content . '</div>';
  638.  
  639.     return $output;
  640.  
  641. }
  642.  
  643. add_shortcode('six_columns','vp_six_columns');
  644.  
  645. function vp_six_columns($atts, $content = null){
  646.  
  647.     extract(shortcode_atts(array(
  648.  
  649.         'noleft' => '',
  650.  
  651.         'noright' => ''
  652.  
  653.     ), $atts));
  654.  
  655.     $content = filter_shortcode($content);
  656.  
  657.     $class = '';
  658.  
  659.     if($noleft !== '')
  660.  
  661.         $class .= 'alpha ';
  662.  
  663.     if($noright !== '')
  664.  
  665.         $class .= 'omega';
  666.  
  667.     $output = '<div class="six columns ' . $class . '">' . $content . '</div>';
  668.  
  669.     return $output;
  670.  
  671. }
  672.  
  673. add_shortcode('seven_columns','vp_seven_columns');
  674.  
  675. function vp_seven_columns($atts, $content = null){
  676.  
  677.     extract(shortcode_atts(array(
  678.  
  679.         'noleft' => '',
  680.  
  681.         'noright' => ''
  682.  
  683.     ), $atts));
  684.  
  685.     $content = filter_shortcode($content);
  686.  
  687.     $class = '';
  688.  
  689.     if($noleft !== '')
  690.  
  691.         $class .= 'alpha ';
  692.  
  693.     if($noright !== '')
  694.  
  695.         $class .= 'omega';
  696.  
  697.     $output = '<div class="seven columns ' . $class . '">' . $content . '</div>';
  698.  
  699.     return $output;
  700.  
  701. }
  702.  
  703. add_shortcode('nine_columns','vp_nine_columns');
  704.  
  705. function vp_nine_columns($atts, $content = null){
  706.  
  707.     extract(shortcode_atts(array(
  708.  
  709.         'noleft' => '',
  710.  
  711.         'noright' => ''
  712.  
  713.     ), $atts));
  714.  
  715.     $content = filter_shortcode($content);
  716.  
  717.     $class = '';
  718.  
  719.     if($noleft !== '')
  720.  
  721.         $class .= 'alpha ';
  722.  
  723.     if($noright !== '')
  724.  
  725.         $class .= 'omega';
  726.  
  727.     $output = '<div class="nine columns ' . $class . '">' . $content . '</div>';
  728.  
  729.     return $output;
  730.  
  731. }
  732.  
  733. add_shortcode('ten_columns','vp_ten_columns');
  734.  
  735. function vp_ten_columns($atts, $content = null){
  736.  
  737.     extract(shortcode_atts(array(
  738.  
  739.         'noleft' => '',
  740.  
  741.         'noright' => ''
  742.  
  743.     ), $atts));
  744.  
  745.     $content = filter_shortcode($content);
  746.  
  747.     $output = '<div class="ten columns ' . $class . '">' . $content . '</div>';
  748.  
  749.     return $output;
  750.  
  751. }
  752.  
  753. add_shortcode('eleven_columns','vp_eleven_columns');
  754.  
  755. function vp_eleven_columns($atts, $content = null){
  756.  
  757.     extract(shortcode_atts(array(
  758.  
  759.         'noleft' => '',
  760.  
  761.         'noright' => ''
  762.  
  763.     ), $atts));
  764.  
  765.     $content = filter_shortcode($content);
  766.  
  767.     $class = '';
  768.  
  769.     if($noleft !== '')
  770.  
  771.         $class .= 'alpha ';
  772.  
  773.     if($noright !== '')
  774.  
  775.         $class .= 'omega';
  776.  
  777.     $output = '<div class="eleven columns ' . $class . '">' . $content . '</div>';
  778.  
  779.     return $output;
  780.  
  781. }
  782.  
  783. add_shortcode('twelve_columns','vp_twelve_columns');
  784.  
  785. function vp_twelve_columns($atts, $content = null){
  786.  
  787.     extract(shortcode_atts(array(
  788.  
  789.         'noleft' => '',
  790.  
  791.         'noright' => ''
  792.  
  793.     ), $atts));
  794.  
  795.     $content = filter_shortcode($content);
  796.  
  797.     $class = '';
  798.  
  799.     if($noleft !== '')
  800.  
  801.         $class .= 'alpha ';
  802.  
  803.     if($noright !== '')
  804.  
  805.         $class .= 'omega';
  806.  
  807.     $output = '<div class="twelve columns ' . $class . '">' . $content . '</div>';
  808.  
  809.     return $output;
  810.  
  811. }
  812.  
  813. add_shortcode('thirteen_columns','vp_thirteen_columns');
  814.  
  815. function vp_thirteen_columns($atts, $content = null){
  816.  
  817.     extract(shortcode_atts(array(
  818.  
  819.         'noleft' => '',
  820.  
  821.         'noright' => ''
  822.  
  823.     ), $atts));
  824.  
  825.     $content = filter_shortcode($content);
  826.  
  827.     $class = '';
  828.  
  829.     if($noleft !== '')
  830.  
  831.         $class .= 'alpha ';
  832.  
  833.     if($noright !== '')
  834.  
  835.         $class .= 'omega';
  836.  
  837.     $output = '<div class="thirteen columns ' . $class . '">' . $content . '</div>';
  838.  
  839.     return $output;
  840.  
  841. }
  842.  
  843. add_shortcode('fourteen_columns','vp_fourteen_columns');
  844.  
  845. function vp_fourteen_columns($atts, $content = null){
  846.  
  847.     extract(shortcode_atts(array(
  848.  
  849.         'noleft' => '',
  850.  
  851.         'noright' => ''
  852.  
  853.     ), $atts));
  854.  
  855.     $content = filter_shortcode($content);
  856.  
  857.     $class = '';
  858.  
  859.     if($noleft !== '')
  860.  
  861.         $class .= 'alpha ';
  862.  
  863.     if($noright !== '')
  864.  
  865.         $class .= 'omega';
  866.  
  867.     $output = '<div class="fourteen columns ' . $class . '">' . $content . '</div>';
  868.  
  869.     return $output;
  870.  
  871. }
  872.  
  873. add_shortcode('fifteen_columns','vp_fifteen_columns');
  874.  
  875. function vp_fifteen_columns($atts, $content = null){
  876.  
  877.     extract(shortcode_atts(array(
  878.  
  879.         'noleft' => '',
  880.  
  881.         'noright' => ''
  882.  
  883.     ), $atts));
  884.  
  885.     $content = filter_shortcode($content);
  886.  
  887.     $class = '';
  888.  
  889.     if($noleft !== '')
  890.  
  891.         $class .= 'alpha ';
  892.  
  893.     if($noright !== '')
  894.  
  895.         $class .= 'omega';
  896.  
  897.     $output = '<div class="fifteen columns ' . $class . '">' . $content . '</div>';
  898.  
  899.     return $output;
  900.  
  901. }
  902.  
  903. add_shortcode('full','vp_full');
  904.  
  905. function vp_full($atts, $content = null){
  906.  
  907.     $content = filter_shortcode($content);
  908.  
  909.     $output = '<div class="sixteen columns">' . $content . '</div>';
  910.  
  911.     return $output;
  912.  
  913. }
  914.  
  915. add_shortcode('subtext','vp_subtext');
  916.  
  917. function vp_subtext($atts, $content = null){
  918.  
  919.     $content = filter_shortcode($content);
  920.  
  921.     $output = '<p class="line2nd">' . $content . '</p>';
  922.  
  923.     return $output;
  924.  
  925. }
  926.  
  927. add_shortcode('skills','vp_skills');
  928.  
  929. function vp_skills($atts, $content = null){
  930.  
  931.     $content = filter_shortcode($content);
  932.  
  933.     return '<div class="skills"><div class="sixteen columns">' . $content . '</div></div>';
  934.  
  935. }
  936.  
  937. add_shortcode('skill','vp_skill');
  938.  
  939. function vp_skill($atts, $content = null){
  940.  
  941.     extract(shortcode_atts(array(
  942.  
  943.         'value' => '50',
  944.  
  945.         'bg' => ''
  946.  
  947.     ), $atts));
  948.  
  949.     $content = filter_shortcode($content);
  950.  
  951.     $value = (int)$value;
  952.  
  953.     $rand = rand(1,5); //uses some random backgrounds, just to make them different in case the use doesn't set any
  954.  
  955.     $output = '<p> ' . $content . '</p>';
  956.  
  957.     $output .= '<div class="skill-bg"><div style="width: ' . $value . '%;';
  958.  
  959.     if($bg !== '') $output .= 'background-color: #' . esc_attr($bg);
  960.  
  961.     $output .= '" class="skill' . $rand . '"></div></div>';
  962.  
  963.     return $output;
  964.  
  965. }
  966.  
  967. add_shortcode('lightbox', 'vp_lightbox');
  968.  
  969. function vp_lightbox($atts, $content = null) {
  970.  
  971.     extract(shortcode_atts(array(
  972.  
  973.         'alt' => 0,
  974.  
  975.         'title' => 0,
  976.  
  977.         'thumbnail' => 0,
  978.  
  979.         'width' => 250,
  980.  
  981.         'height' => 125,
  982.  
  983.         'float' => 'none'
  984.  
  985.     ), $atts));
  986.  
  987.  
  988.  
  989.     $content = filter_shortcode($content);
  990.  
  991.  
  992.  
  993.     $output = '<div class="pic" style="width: ' . $width . 'px; float: ' . $float;
  994.  
  995.     if($float == 'left')
  996.  
  997.         $output .= '; margin-right: 10px';
  998.  
  999.     elseif($float == 'right')
  1000.  
  1001.         $output .= '; margin-left: 10px';
  1002.  
  1003.     $output .= '">';
  1004.  
  1005.     $output .= '<div class="proj-img">' . PHP_EOL;
  1006.  
  1007.     if($content != '')
  1008.  
  1009.     {
  1010.  
  1011.         if($title !== 0)
  1012.  
  1013.             $title = ' title="' . $title . '"';
  1014.  
  1015.         else
  1016.  
  1017.             $title = '';
  1018.  
  1019.         if($alt !== 0)
  1020.  
  1021.             $alt = ' alt="' . $alt . '"';
  1022.  
  1023.         else
  1024.  
  1025.             $alt = '';
  1026.  
  1027.         //the shortcode should return something only if the user sends an image
  1028.  
  1029.         $output .= '<a href="' . $content . '" class="prettyPhoto"' . $title . $alt . '></a>' . PHP_EOL;
  1030.  
  1031.         if($thumbnail === 0)
  1032.  
  1033.         {
  1034.  
  1035.             $thumbnail = $content;
  1036.  
  1037.         }
  1038.  
  1039.         //if the user sends out a thumbnail img, we use that one. If not, we use the full width img to create a thumb.
  1040.  
  1041.         $output .= '<img ' . $alt . ' src="' . $thumbnail . '" style="width: ' . $width . 'px; height: ' . $height . 'px" />' . PHP_EOL;
  1042.  
  1043.         $output .= '<i>hover background</i>' . PHP_EOL;
  1044.  
  1045.         $output .= '</div>
  1046.  
  1047.         </div>' . PHP_EOL;
  1048.  
  1049.     }
  1050.  
  1051.     else
  1052.  
  1053.         $output = '';
  1054.  
  1055.         return $output;
  1056.  
  1057. }
  1058.  
  1059.  
  1060.  
  1061. add_shortcode('quote_slider', 'vp_quote_slider');
  1062.  
  1063. function vp_quote_slider($atts, $content=null) {
  1064.  
  1065.     $content = filter_shortcode($content);
  1066.  
  1067.     $id = rand(1, 25000);
  1068.  
  1069.     $output = '<div class="quote-container">
  1070.  
  1071.     <div class="quote-nav-left" id="quote-nav-left-' . $id . '">
  1072.  
  1073.         <a href="#" onclick="return false">&laquo; left</a>
  1074.  
  1075.     </div>
  1076.  
  1077.     <div class="quote-nav-right" id="quote-nav-right-' . $id . '">
  1078.  
  1079.         <a href="#" onclick="return false">right &raquo;</a>
  1080.  
  1081.     </div>
  1082.  
  1083.          <div class="quote-slider" id="quote-slider-' . $id . '">' . PHP_EOL;
  1084.  
  1085.     $output .= $content;
  1086.  
  1087.     $output .= '</div>
  1088.  
  1089.    </div>' . PHP_EOL;
  1090.  
  1091.     $output .= "<script type='text/javascript'>
  1092.  
  1093.    jQuery().ready(function() {
  1094.  
  1095.    jQuery('#quote-slider-$id').cycle({
  1096.  
  1097.             fx: 'scrollHorz',
  1098.  
  1099.             easing: 'easeInOutExpo',
  1100.  
  1101.             prev: '#quote-nav-left-$id a',
  1102.  
  1103.             next: '#quote-nav-right-$id a',
  1104.  
  1105.             timeout: 1,
  1106.  
  1107.             timeout: 4000
  1108.  
  1109.         });
  1110.  
  1111.     });
  1112.  
  1113.    </script>" . PHP_EOL;
  1114.  
  1115.     return $output;
  1116.  
  1117. }
  1118.  
  1119. add_shortcode('quote', 'vp_quote');
  1120.  
  1121. function vp_quote($atts, $content=null) {
  1122.  
  1123.     extract(shortcode_atts(array(
  1124.  
  1125.         'author' => ''
  1126.  
  1127.     ), $atts));
  1128.  
  1129.  
  1130.  
  1131.     $content = filter_shortcode($content);
  1132.  
  1133.     $output = '<div class="panel">
  1134.  
  1135.            <p>&ldquo;' . $content . '&rdquo;</p>
  1136.  
  1137.            <p class="quoter">' . $author . '</p>
  1138.  
  1139.    </div>' . PHP_EOL;
  1140.  
  1141.     return $output;
  1142.  
  1143. }
  1144.  
  1145.  
  1146.  
  1147. add_shortcode('slider', 'vp_slider');
  1148.  
  1149. function vp_slider($atts, $content=null) {
  1150.  
  1151.     $id = rand(0, 25000);
  1152.  
  1153.     $content = filter_shortcode($content);
  1154.  
  1155.     $output = '<div class="flexslider flex-' . $id . '">';
  1156.  
  1157.     $output .= '<ul class="slides">';
  1158.  
  1159.     $output .= $content;
  1160.  
  1161.     $output .= '</ul></div>';
  1162.  
  1163.     $output .= '
  1164.  
  1165.     <script type="text/javascript">
  1166.  
  1167.         jQuery(".flex-' . $id . '").flexslider({
  1168.  
  1169.                 animation: "slide",
  1170.  
  1171.                 slideshow: true,
  1172.  
  1173.                 slideshowSpeed: 3500,
  1174.  
  1175.                 animationSpeed: 1000
  1176.  
  1177.             });
  1178.  
  1179.     </script>';
  1180.  
  1181.     return $output;
  1182.  
  1183. }
  1184.  
  1185.  
  1186.  
  1187. add_shortcode('slider_img', 'vp_slider_img');
  1188.  
  1189. function vp_slider_img($atts, $content=null) {
  1190.  
  1191.     extract(shortcode_atts(array(
  1192.  
  1193.         'alt' => ''
  1194.  
  1195.     ), $atts));
  1196.  
  1197.     $content = filter_shortcode($content);
  1198.  
  1199.     if($content != '')
  1200.  
  1201.     {
  1202.  
  1203.         $output = ' <li><img alt="' . $alt . '" src="' . $content . '"></li>' . PHP_EOL;
  1204.  
  1205.         return $output;
  1206.  
  1207.     }
  1208.  
  1209.     else return '';
  1210.  
  1211. }
  1212.  
  1213.  
  1214.  
  1215. add_shortcode('portfolio', 'vp_portfolio');
  1216.  
  1217. function vp_portfolio($atts, $content=null) {
  1218.  
  1219.     $content = filter_shortcode($content);
  1220.  
  1221.     $output = '<div class="portfolio">' . PHP_EOL;
  1222.  
  1223.     $output .= $content;
  1224.  
  1225.     $output .= '</div>';
  1226.  
  1227.     return $output;
  1228.  
  1229. }
  1230.  
  1231.  
  1232.  
  1233. add_shortcode('portfolio_item', 'vp_portfolio_item');
  1234.  
  1235. function vp_portfolio_item($atts, $content=null) {
  1236.  
  1237.     extract(shortcode_atts(array(
  1238.  
  1239.         'thumbnail' => '',
  1240.  
  1241.         'image' => '',
  1242.  
  1243.         'title' => '',
  1244.  
  1245.         'text' => '',
  1246.  
  1247.         'columns' => 3,
  1248.  
  1249.         'centered' => 'no',
  1250.  
  1251.         'alt' => '',
  1252.         'link' => ''
  1253.  
  1254.     ), $atts));
  1255.  
  1256.     switch($columns)
  1257.  
  1258.     {
  1259.  
  1260.         case 1:
  1261.  
  1262.             $class = 'class="sixteen columns"';
  1263.  
  1264.             break;
  1265.  
  1266.         case 2:
  1267.  
  1268.             $class = 'class="eight columns"';
  1269.  
  1270.             break;
  1271.  
  1272.         case 3:
  1273.  
  1274.             $class = 'class="one-third column"';
  1275.  
  1276.             break;
  1277.  
  1278.         case 4:
  1279.  
  1280.             $class = 'class="four columns"';
  1281.  
  1282.             break;
  1283.  
  1284.     }
  1285.  
  1286.     if($thumbnail === '')
  1287.  
  1288.         $thumbnail = $image;
  1289.  
  1290.     if($image !== '')
  1291.  
  1292.     {
  1293.  
  1294.         if($centered == 'yes')
  1295.  
  1296.             $var = ' style="text-align: center" ';
  1297.  
  1298.         else
  1299.  
  1300.             $var = '';
  1301.  
  1302.         $output = '<div ' . $var . $class . '>';
  1303.  
  1304.         $output .= '<a ';
  1305.         if($link === '')
  1306.             $output .= 'class="prettyPhoto" href="' . esc_attr($image) . '">';
  1307.         else
  1308.             $output .= 'target="_blank" href="' . esc_attr($link) . '">';
  1309.         $output .= '<img alt="' . esc_attr($alt) . '" class="scale-with-grid" src="' . esc_attr($thumbnail) . '" /></a>';
  1310.  
  1311.         $output .= '<p class="proj-title">' . esc_attr($title) . '</p>';
  1312.  
  1313.         $output .= '<p class="proj-desc">' . $text . '</p>';
  1314.  
  1315.         $output .= '</div>';
  1316.  
  1317.         return $output;
  1318.  
  1319.     }
  1320.  
  1321.     else return '';
  1322.  
  1323. }
  1324.  
  1325.  
  1326.  
  1327. add_shortcode('button', 'vp_button');
  1328.  
  1329. function vp_button($atts, $content=null) {
  1330.  
  1331.     extract(shortcode_atts(array(
  1332.  
  1333.         'url' => '',
  1334.  
  1335.         'newwindow' => 'no',
  1336.  
  1337.         'color' => 'FADBA1'
  1338.  
  1339.     ), $atts));
  1340.  
  1341.     $content = filter_shortcode($content);
  1342.  
  1343.     $color = esc_attr($color);
  1344.  
  1345.     if($newwindow == 'yes')
  1346.  
  1347.         $target = ' target="_blank" ';
  1348.  
  1349.     else
  1350.  
  1351.         $target = '';
  1352.  
  1353.     if($content !== '')
  1354.  
  1355.     {
  1356.  
  1357.         if($color === 'FADBA1')
  1358.  
  1359.         {
  1360.  
  1361.             if($url === '')
  1362.  
  1363.                 $output = '<div class="button1">' . $content . '</div>';
  1364.  
  1365.             else
  1366.  
  1367.                 $output = '<a ' . $target . ' href="' . esc_url($url) . '"><div class="button1">' . $content . '</div></a>';
  1368.  
  1369.         }
  1370.  
  1371.         else
  1372.  
  1373.         {
  1374.  
  1375.             if($url === '')
  1376.  
  1377.                 $output = '<div class="button2" style="background-color: #' . $color . '">' . $content . '</div>';
  1378.  
  1379.             else
  1380.  
  1381.                 $output = '<a ' . $target . ' href="' . esc_url($url) . '"><div class="button2" style="background-color: #' . $color . '">' . $content . '</div></a>';
  1382.  
  1383.         }
  1384.  
  1385.         return $output;
  1386.  
  1387.     }
  1388.  
  1389.     else return '';
  1390.  
  1391. }
  1392.  
  1393.  
  1394.  
  1395. add_shortcode('testimonial', 'vp_testimonial');
  1396.  
  1397. function vp_testimonial($atts, $content=null) {
  1398.  
  1399.     $content = filter_shortcode($content);
  1400.  
  1401.     return '<div class="testimonials">
  1402.  
  1403.     <p>&ldquo;' . $content . '&rdquo;</p>
  1404.  
  1405.     </div>';
  1406.  
  1407. }
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413. add_shortcode('clear', 'vp_clear');
  1414.  
  1415. function vp_clear($atts, $content=null) {
  1416.  
  1417.     return '<div class="clear"></div>';
  1418.  
  1419. }
  1420.  
  1421. add_shortcode('center', 'vp_centered');
  1422.  
  1423. function vp_centered($atts, $content=null) {
  1424.  
  1425.     $content = filter_shortcode($content);
  1426.  
  1427.     return '<div style="text-align: center">' . $content . '</div>';
  1428.  
  1429. }
  1430.  
  1431. add_shortcode('list', 'vp_list');
  1432.  
  1433. function vp_list($atts, $content=null) {
  1434.  
  1435.     extract(shortcode_atts(array(
  1436.  
  1437.         'type' => 'bullet'
  1438.  
  1439.     ), $atts));
  1440.  
  1441.     $content = filter_shortcode($content);
  1442.  
  1443.     if($type == 'bullet')
  1444.  
  1445.         $output = '<ul class="list bullet">';
  1446.  
  1447.     elseif($type == 'check')
  1448.  
  1449.         $output = '<ul class="list check">';
  1450.  
  1451.     elseif($type == 'float')
  1452.  
  1453.         $output = '<ul class="list float">';
  1454.  
  1455.     else return '';
  1456.  
  1457.     $output .= $content;
  1458.  
  1459.     $output .= '</ul>';
  1460.  
  1461.     return $output;
  1462.  
  1463. }
  1464.  
  1465. add_shortcode('twitter_updates', 'vp_twitter_updates');
  1466.  
  1467. function vp_twitter_updates($atts, $content=null) {
  1468.  
  1469.     $output = '<div class="last_tweets">
  1470.  
  1471.                     <div id="twitter_update_list"></div>
  1472.  
  1473.                 </div> <!-- end last_tweets -->';
  1474.  
  1475.     return $output;
  1476.  
  1477. }
  1478.  
  1479.  
  1480.  
  1481. add_shortcode('pricing_table','til_pricing_table');
  1482.  
  1483. function til_pricing_table($atts, $content = null){
  1484.  
  1485.     extract(shortcode_atts(array(
  1486.  
  1487.         'name' => '',
  1488.  
  1489.         'price' => '',
  1490.  
  1491.         'price_text' => '',
  1492.  
  1493.         'moretext' => 'Sign up',
  1494.  
  1495.         'morelink' => '',
  1496.  
  1497.         'columns' => '4'
  1498.  
  1499.     ), $atts));
  1500.  
  1501.     switch($columns)
  1502.  
  1503.     {
  1504.  
  1505.         case 1:
  1506.  
  1507.             $class = 'class="sixteen columns pricing"';
  1508.  
  1509.             break;
  1510.  
  1511.         case 2:
  1512.  
  1513.             $class = 'class="eight columns pricing"';
  1514.  
  1515.             break;
  1516.  
  1517.         case 3:
  1518.  
  1519.             $class = 'class="one-third column pricing"';
  1520.  
  1521.             break;
  1522.  
  1523.         case 4:
  1524.  
  1525.             $class = 'class="four columns pricing"';
  1526.  
  1527.             break;
  1528.  
  1529.         default:
  1530.  
  1531.             $class = 'class="one-third column pricing"';
  1532.  
  1533.             break;
  1534.  
  1535.     }
  1536.  
  1537.     $content = filter_shortcode($content);
  1538.  
  1539.     $name = esc_attr($name);
  1540.  
  1541.     $price = esc_attr($price);
  1542.  
  1543.     $price_text = esc_attr($price_text);
  1544.  
  1545.     $moretext = esc_attr($moretext);
  1546.  
  1547.     $morelink = esc_url($morelink);
  1548.  
  1549.     $output = '';
  1550.  
  1551.     $output .= '<div ' . $class .'>';
  1552.  
  1553.     if($name !== '')
  1554.  
  1555.         $output .= '<p class="p-name">' . $name . '</p>';
  1556.  
  1557.     if($price !== '')
  1558.  
  1559.     {
  1560.  
  1561.         $output .= '<p class="p-price">' . $price;
  1562.  
  1563.         if ($price_text !== '') {
  1564.  
  1565.             $output .= '<span class="p-small">' . $price_text . '</span>';
  1566.  
  1567.         }
  1568.  
  1569.         $output .= '</p>';
  1570.  
  1571.     }
  1572.  
  1573.     $output .= '<ul>' . $content . '</ul>';
  1574.  
  1575.     $output .= '<div class="signup"><div class="button2">';
  1576.  
  1577.     if($morelink !== '')
  1578.  
  1579.         $output .= '<a href="' . $morelink . '">' . $moretext . '</a>';
  1580.  
  1581.     else
  1582.  
  1583.         $output .= $moretext;
  1584.  
  1585.     $output .= '</div></div>
  1586.  
  1587.     </div>';
  1588.  
  1589.     return $output;
  1590.  
  1591. }
  1592.  
  1593. add_shortcode('feature','vp_feature');
  1594.  
  1595. function vp_feature($atts, $content = null){
  1596.  
  1597.     $content = filter_shortcode($content);
  1598.  
  1599.     if($content != '')
  1600.  
  1601.         return '<li>' . $content . '</li>';
  1602.  
  1603. }
  1604.  
  1605.  
  1606.  
  1607. add_shortcode('facebook_small','vp_facebook_small');
  1608.  
  1609. function vp_facebook_small($atts, $content = null) {
  1610.  
  1611.     extract(shortcode_atts(array(
  1612.  
  1613.         "username" => '',
  1614.  
  1615.     ), $atts));
  1616.  
  1617.     if($username !== '')
  1618.  
  1619.         $output = '<div class="facebook_small">
  1620.  
  1621.             <a href="http://facebook.com/' . esc_html($username) . '/" title="facebook">Visit our facebook Account</a>
  1622.  
  1623.         </div>';
  1624.  
  1625.     else
  1626.  
  1627.         $output = '';
  1628.  
  1629.     return $output;
  1630.  
  1631. }
  1632.  
  1633.  
  1634.  
  1635. add_shortcode('twitter_small','vp_twitter_small');
  1636.  
  1637. function vp_twitter_small($atts, $content = null) {
  1638.  
  1639.     extract(shortcode_atts(array(
  1640.  
  1641.         "username" => '',
  1642.  
  1643.     ), $atts));
  1644.  
  1645.     if($username !== '')
  1646.  
  1647.         $output = '<div class="twitter2_small">
  1648.  
  1649.             <a href="http://twitter.com/#!/' . esc_html($username) . '/" title="twitter">Visit our twitter Account</a>
  1650.  
  1651.         </div>';
  1652.  
  1653.     else
  1654.  
  1655.         $output = '';
  1656.  
  1657.     return $output;
  1658.  
  1659. }
  1660.  
  1661.  
  1662.  
  1663. add_shortcode('twitter_big','vp_twitter_big');
  1664.  
  1665. function vp_twitter_big($atts, $content = null) {
  1666.  
  1667.     extract(shortcode_atts(array(
  1668.  
  1669.         "username" => '',
  1670.  
  1671.     ), $atts));
  1672.  
  1673.     if($username !== '')
  1674.  
  1675.         $output = '<div class="twitter_small">
  1676.  
  1677.             <a href="http://twitter.com/#!/' . esc_html($username) . '/" title="twitter">Visit our twitter Account</a>
  1678.  
  1679.         </div>';
  1680.  
  1681.     else
  1682.  
  1683.         $output = '';
  1684.  
  1685.     return $output;
  1686.  
  1687. }
  1688.  
  1689.  
  1690.  
  1691. add_shortcode('dribble_small','vp_dribble_small');
  1692.  
  1693. function vp_dribble_small($atts, $content = null) {
  1694.  
  1695.     extract(shortcode_atts(array(
  1696.  
  1697.         "username" => '',
  1698.  
  1699.     ), $atts));
  1700.  
  1701.     if($username !== '')
  1702.  
  1703.         $output = '<div class="dribble_small">
  1704.  
  1705.             <a href="http://dribbble.com/' . esc_html($username) . '/" title="dribble">Visit our dribble Account</a>
  1706.  
  1707.         </div>';
  1708.  
  1709.     else
  1710.  
  1711.         $output = '';
  1712.  
  1713.     return $output;
  1714.  
  1715. }
  1716.  
  1717.  
  1718.  
  1719. add_shortcode('vimeo_small','vp_vimeo_small');
  1720.  
  1721. function vp_vimeo_small($atts, $content = null) {
  1722.  
  1723.     extract(shortcode_atts(array(
  1724.  
  1725.         "username" => '',
  1726.  
  1727.     ), $atts));
  1728.  
  1729.     if($username !== '')
  1730.  
  1731.         $output = '<div class="vimeo_small">
  1732.  
  1733.             <a href="http://vimeo.com/' . esc_html($username) . '/" title="vimeo">Visit our vimeo Account</a>
  1734.  
  1735.         </div>';
  1736.  
  1737.     else
  1738.  
  1739.         $output = '';
  1740.  
  1741.     return $output;
  1742.  
  1743. }
  1744.  
  1745.  
  1746.  
  1747. add_shortcode('flickr_small','vp_flickr_small');
  1748.  
  1749. function vp_flickr_small($atts, $content = null) {
  1750.  
  1751.     extract(shortcode_atts(array(
  1752.  
  1753.         "username" => '',
  1754.  
  1755.     ), $atts));
  1756.  
  1757.     if($username !== '')
  1758.  
  1759.         $output = '<div class="flickr_small">
  1760.  
  1761.             <a href="http://www.flickr.com/people/' . esc_html($username) . '/" title="flickr">Visit our flickr Account</a>
  1762.  
  1763.         </div>';
  1764.  
  1765.     else
  1766.  
  1767.         $output = '';
  1768.  
  1769.     return $output;
  1770.  
  1771. }
  1772.  
  1773. add_shortcode('header','vp_header');
  1774.  
  1775. function vp_header($atts, $content = null) {
  1776.  
  1777.     $content = filter_shortcode($content);
  1778.  
  1779.     $output = '<h3 style="text-align: centered; margin-top: 25px"><span class="lines">' . $content . '</span></h3>';
  1780.  
  1781.     return $output;
  1782.  
  1783. }
  1784.  
  1785. add_shortcode('subheader','vp_subheader');
  1786.  
  1787. function vp_subheader($atts, $content = null) {
  1788.  
  1789.     $content = filter_shortcode($content);
  1790.  
  1791.     $output = '<div class="action"><p>' . $content . '</p></div>';
  1792.  
  1793.     return $output;
  1794.  
  1795. }
  1796.  
  1797. add_shortcode('team','vp_team');
  1798.  
  1799. function vp_team($atts, $content = null) {
  1800.  
  1801.     extract(shortcode_atts(array(
  1802.  
  1803.         "image" => '',
  1804.  
  1805.         "name" => '',
  1806.  
  1807.         "position" => '',
  1808.  
  1809.         "description" => '',
  1810.  
  1811.         "twitter" => '',
  1812.  
  1813.         "facebook" => '',
  1814.  
  1815.         "dribble" => '',
  1816.  
  1817.         "skype" => '',
  1818.  
  1819.         "gplus" => '',
  1820.  
  1821.         "linkedin" => '',
  1822.  
  1823.         "pinterest" => '',
  1824.  
  1825.         "columns" => 3
  1826.  
  1827.     ), $atts));
  1828.  
  1829.     switch($columns)
  1830.  
  1831.     {
  1832.  
  1833.         case 1:
  1834.  
  1835.             $class = 'class="sixteen columns team"';
  1836.  
  1837.             break;
  1838.  
  1839.         case 2:
  1840.  
  1841.             $class = 'class="eight columns team"';
  1842.  
  1843.             break;
  1844.  
  1845.         case 3:
  1846.  
  1847.             $class = 'class="one-third column team"';
  1848.  
  1849.             break;
  1850.  
  1851.         case 4:
  1852.  
  1853.             $class = 'class="four columns team"';
  1854.  
  1855.             break;
  1856.  
  1857.         default:
  1858.  
  1859.             $class = 'class="one-third column team';
  1860.  
  1861.             break;
  1862.  
  1863.     }
  1864.  
  1865.     $output = '<div ' . $class . '>';
  1866.  
  1867.     if($image !== '')
  1868.  
  1869.         $output .= '<img alt="' . esc_attr($name) . '"class="scale-with-grid" src="' . esc_attr($image) . '" />';
  1870.  
  1871.     if($name !== '')
  1872.  
  1873.         $output .= '<p class="t-name">' . esc_attr($name) . '</p>';
  1874.  
  1875.     if($position !== '')
  1876.  
  1877.         $output .= '<p class="t-type">' . esc_attr($position) . '</p>';
  1878.  
  1879.     if($description !== '')
  1880.  
  1881.         $output .= '<p>' . esc_attr($description) . '</p>';
  1882.  
  1883.     $output .= '<ul>';
  1884.  
  1885.     if($twitter !== '')
  1886.  
  1887.         $output .= '<li><a target="_blank" href="' . esc_url($twitter) . '"><img src="' . get_stylesheet_directory_uri() . '/images/icn-twitter.png" /></a></li>';
  1888.  
  1889.     if($facebook !== '')
  1890.  
  1891.         $output .= '<li><a target="_blank" href="' . esc_url($facebook) . '"><img src="' . get_stylesheet_directory_uri() . '/images/icn-facebook.png" /></a></li>';
  1892.  
  1893.     if($dribble !== '')
  1894.  
  1895.         $output .= '<li><a target="_blank" href="' . esc_url($dribble) . '"><img src="' . get_stylesheet_directory_uri() . '/images/icn-dribbble.png" /></a></li>';
  1896.  
  1897.     if($skype !== '')
  1898.  
  1899.         $output .= '<li><a target="_blank" href="' . esc_attr($skype) . '"><img src="' . get_stylesheet_directory_uri() . '/images/icn-skype.png" /></a></li>';
  1900.  
  1901.     if($gplus !== '')
  1902.  
  1903.         $output .= '<li><a target="_blank" href="' . esc_url($gplus) . '"><img src="' . get_stylesheet_directory_uri() . '/images/icn-gplus.png" /></a></li>';
  1904.  
  1905.     if($linkedin !== '')
  1906.  
  1907.         $output .= '<li><a target="_blank" href="' . esc_url($linkedin) . '"><img src="' . get_stylesheet_directory_uri() . '/images/icn-linkedin.png" /></a></li>';
  1908.  
  1909.     if($pinterest !== '')
  1910.  
  1911.         $output .= '<li><a target="_blank" href="' . esc_url($pinterest) . '"><img src="' . get_stylesheet_directory_uri() . '/images/icn-pinterest.png" /></a></li>';
  1912.  
  1913.     $output .= '</ul>
  1914.  
  1915.     </div>';
  1916.  
  1917.     return $output;
  1918.  
  1919. }
  1920.  
  1921. add_shortcode('service','vp_service');
  1922.  
  1923. function vp_service($atts, $content = null) {
  1924.  
  1925.     extract(shortcode_atts(array(
  1926.  
  1927.         "title" => '',
  1928.  
  1929.         "image" => '',
  1930.  
  1931.         "text" => '',
  1932.  
  1933.         "columns" => '3'
  1934.  
  1935.     ), $atts));
  1936.  
  1937.     switch($columns)
  1938.  
  1939.     {
  1940.  
  1941.         case 1:
  1942.  
  1943.             $class = 'class="sixteen columns serv-list"';
  1944.  
  1945.             break;
  1946.  
  1947.         case 2:
  1948.  
  1949.             $class = 'class="eight columns serv-list"';
  1950.  
  1951.             break;
  1952.  
  1953.         case 3:
  1954.  
  1955.             $class = 'class="one-third column serv-list"';
  1956.  
  1957.             break;
  1958.  
  1959.         case 4:
  1960.  
  1961.             $class = 'class="four columns serv-list"';
  1962.  
  1963.             break;
  1964.  
  1965.         default:
  1966.  
  1967.             $class = 'class="one-third column serv-list"';
  1968.  
  1969.             break;
  1970.  
  1971.     }
  1972.  
  1973.     $text = esc_attr($text);
  1974.  
  1975.     $image = esc_attr($image);
  1976.  
  1977.     $title = esc_attr($title);
  1978.  
  1979.     $output = '<div ' . $class . '>';
  1980.  
  1981.     if($title != '')
  1982.  
  1983.         $output .= '<h4>' . $title . '</h4>';
  1984.  
  1985.     if($image != '')
  1986.  
  1987.         $output .= '<img src="' . $image . '" />';
  1988.  
  1989.     if($text != '')
  1990.  
  1991.         $output .= '<p>' . $text . '</p>';
  1992.  
  1993.     $output .= '</div>';
  1994.  
  1995.     return $output;
  1996.  
  1997. }
  1998.  
  1999. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement