Advertisement
pixedelic

pix_shortcodes_flowplayer_analytics.php

Aug 15th, 2011
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 28.45 KB | None | 0 0
  1. <?php
  2. function pixSlideshow( $atts, $content = null ) {
  3.     extract(shortcode_atts(array(
  4.         'time'      => '7000',
  5.         'size'      => '427x280'
  6.     ), $atts));
  7.    
  8.     $size = explode('x',$size);
  9.    
  10.     $out = '<div class="pix_cycle" data-time="'.$time.'" style="width:'.$size[0].'px; height:'.$size[1].'px">';
  11.     $out .= do_shortcode($content);
  12.     $out .= '</div><!-- .pix_cycle -->
  13.        <div class="pix_slider_nav"></div><!-- .pix_slider_nav -->';
  14.    
  15.    return $out;
  16. }
  17. add_shortcode("slideshow", "pixSlideshow");
  18.  
  19. function pixSlider( $atts, $content = null ) {
  20.     extract(shortcode_atts(array(
  21.         'img'      => '',
  22.         'href'      => '',
  23.         'caption'   => '',
  24.         'button'    => ''
  25.     ), $atts));
  26.    
  27.     $out = '<div class="pix_slider">';
  28.         if($href!=''){
  29.     $out .= '<a href="'.$href.'" class="sliding_image" style="background:url('.$img.') center no-repeat #fff;"></a>';
  30.         } else {
  31.     $out .= '<span class="sliding_image" style="background:url('.$img.') center no-repeat #fff;"></span>';
  32.         }
  33.         if($caption!=''||$button!=''){
  34.     $out .= '<span class="pix_slide_caption">';
  35.             if($caption!=''){
  36.         $out .= $caption;
  37.             }
  38.             if($button!=''){
  39.         $out .= '<br><a href="'.$href.'" class="button small alignleft">'.$button.'</a>';
  40.             }
  41.     $out .='</span><!-- .pix_slide_caption -->';
  42.         }
  43.     $out .= ' </div><!-- .pix_slider -->';
  44.    
  45.    return $out;
  46. }
  47. add_shortcode("slider", "pixSlider");
  48.  
  49. /*=========================================================================================*/
  50.  
  51. function pixGoogleMap( $atts, $content = null ) {
  52.     extract(shortcode_atts(array(
  53.         'link'      => '',
  54.         'width'      => '427',
  55.         'height'      => '300',
  56.     ), $atts));
  57.    
  58.     $out = '<iframe width="'. $width .'" height="'. $height .'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'. $link .'&amp;output=embed"></iframe>';
  59.    
  60.    return $out;
  61. }
  62. add_shortcode("googlemap", "pixGoogleMap");
  63.  
  64. /*=========================================================================================*/
  65.  
  66. function pixContactEmail( $content = null ) {
  67.    
  68.     $out = '<input type="email" name="emailaddress" data-name="email" class="required email">';
  69.    
  70.    return $out;
  71. }
  72. add_shortcode("pix_email", "pixContactEmail");
  73.  
  74. /*=========================================================================================*/
  75.  
  76. function pixContactText( $atts, $content = null ) {
  77.     extract(shortcode_atts(array(
  78.         'name'      => '',
  79.         'required'      => ''
  80.     ), $atts));
  81.    
  82.     $out = '<input type="text" name="'.sanitize_title($name).'" data-name="'.$name.'" class="'.$required.'">';
  83.    
  84.    return $out;
  85. }
  86. add_shortcode("pix_text", "pixContactText");
  87.  
  88. /*=========================================================================================*/
  89.  
  90. function pixContactAltEmail( $atts, $content = null ) {
  91.     extract(shortcode_atts(array(
  92.         'name'      => '',
  93.         'required'      => ''
  94.     ), $atts));
  95.    
  96.     $out = '<input type="email" name="'.sanitize_title($name).'" data-name="'.$name.'" class="'.$required.' email">';
  97.    
  98.    return $out;
  99. }
  100. add_shortcode("pix_alt_email", "pixContactAltEmail");
  101.  
  102. /*=========================================================================================*/
  103.  
  104. function pixContactTextarea( $atts, $content = null ) {
  105.     extract(shortcode_atts(array(
  106.         'name'      => '',
  107.         'required'      => ''
  108.     ), $atts));
  109.    
  110.     $out = '<textarea name="'.sanitize_title($name).'" data-name="'.$name.'" class="'.$required.'"></textarea>';
  111.    
  112.    return $out;
  113. }
  114. add_shortcode("pix_textarea", "pixContactTextarea");
  115.  
  116. /*=========================================================================================*/
  117.  
  118. function pixCaptchaImg() {
  119.     return dsp_crypt();
  120.     }
  121. add_shortcode("pix_captcha_img", "pixCaptchaImg");
  122.  
  123. /*=========================================================================================*/
  124.  
  125. function pixCaptchaInput() {
  126.     return '<input type="text" name="captcha" data-name="captcha" class="required alignright" style="text-align:center; text-transform:uppercase; letter-spacing:2px; text-indent:0">';
  127.     }
  128. add_shortcode("pix_captcha_input", "pixCaptchaInput");
  129.  
  130. /*=========================================================================================*/
  131.  
  132. function pixSelect( $atts, $content = null ) {
  133.     extract(shortcode_atts(array(
  134.         'name'      => '',
  135.         'required'      => '',
  136.         'multiple'  => '',
  137.         'height'    => ''
  138.     ), $atts));
  139.    
  140.     $out = '<select name="'.sanitize_title($name).'" data-name="'.$name.'" class="'.$required.'"';
  141.         if($multiple=='multiple') {
  142.     $out .= ' multiple ';
  143.         }
  144.         if($height!='') {
  145.     $out .= ' style="height:'.$height.'px" ';
  146.         }
  147.     $out .= '>';
  148.     $out .= do_shortcode(add_space_brackets($content));
  149.     $out .= '</select>';
  150.    
  151.    return $out;
  152. }
  153. add_shortcode("pix_select", "pixSelect");
  154.  
  155. /*=========================================================================================*/
  156.  
  157. function pixOption( $atts, $content = null ) {
  158.     extract(shortcode_atts(array(
  159.         'value'      => ''
  160.     ), $atts));
  161.    
  162.     $out = '<option value="'.$value.'">'.$content.'</option>';
  163.    
  164.    return $out;
  165. }
  166. add_shortcode("pix_option", "pixOption");
  167.  
  168. /*=========================================================================================*/
  169.  
  170. function pixCheckBox( $atts, $content = null ) {
  171.     extract(shortcode_atts(array(
  172.         'name'      => '',
  173.         'required'      => ''
  174.     ), $atts));
  175.    
  176.     $out = '<input type="checkbox" name="'.sanitize_title($name).'" data-name="'.$name.'" class="'.$required.'">';
  177.    
  178.    return $out;
  179. }
  180. add_shortcode("pix_checkbox", "pixCheckBox");
  181.  
  182. /*=========================================================================================*/
  183.  
  184. function pixRadioButton( $atts, $content = null ) {
  185.     extract(shortcode_atts(array(
  186.         'name'      => '',
  187.         'value'      => '',
  188.         'required'      => ''
  189.     ), $atts));
  190.    
  191.     $out = '<input type="radio" name="'.sanitize_title($name).'" data-name="'.$name.'" class="'.$required.'" data-value="'.$value.'">';
  192.    
  193.    return $out;
  194. }
  195. add_shortcode("pix_radio", "pixRadioButton");
  196.  
  197. /*=========================================================================================*/
  198.  
  199. function pixPeriodFrom( $atts, $content = null ) {
  200.     extract(shortcode_atts(array(
  201.         'name'      => '',
  202.         'required'      => ''
  203.     ), $atts));
  204.    
  205.     $out = '<input type="text" name="'.sanitize_title($name).'" data-name="'.$name.'" class="'.$required.'" id="from">';
  206.    
  207.    return $out;
  208. }
  209. add_shortcode("pix_period_from", "pixPeriodFrom");
  210.  
  211. /*=========================================================================================*/
  212.  
  213. function pixPeriodTo( $atts, $content = null ) {
  214.     extract(shortcode_atts(array(
  215.         'name'      => '',
  216.         'required'      => ''
  217.     ), $atts));
  218.    
  219.     $out = '<input type="text" name="'.sanitize_title($name).'" data-name="'.$name.'" class="'.$required.'" id="to">';
  220.    
  221.    return $out;
  222. }
  223. add_shortcode("pix_period_to", "pixPeriodTo");
  224.  
  225. /*=========================================================================================*/
  226.  
  227. function pixContactForm( $atts, $content = null ) {
  228.     extract(shortcode_atts(array(
  229.         'form'      => ''
  230.     ), $atts));
  231.    
  232.     $pix_array_your_forms = get_pix_option('pix_array_your_forms_');
  233.    
  234.     $out = '<div class="contactForm" id="'.$form.'">
  235.                    <div class="success" style="display:none">
  236.                    '.get_pix_option('pix_array_'.$form.'_issuccess').'
  237.                    </div>
  238.                    <div class="unsuccess" style="display:none">
  239.                    '.get_pix_option('pix_array_'.$form.'_unsuccess').'
  240.                    </div>
  241.                    <form>
  242.                        <fieldset>';
  243.         $i2 = 0;
  244.         $pix_array_your_field = get_pix_option('pix_array_'.$form.'_fields_');
  245.         while ($i2<count($pix_array_your_field)){
  246.         $field = $pix_array_your_field[$i2][0];
  247.     $out .= do_shortcode(add_space_brackets(stripslashes($pix_array_your_field[$i2][$field])));
  248.         $i2++;
  249.         }
  250.     $out .='<div class="clear"></div>
  251.             <input type="submit" class="button medium" value="'.get_pix_option('pix_array_'.$form.'_button').'">
  252.                        </fieldset>
  253.                    </form>
  254.                </div><!-- .contactForm -->';
  255.    
  256.    return $out;
  257. }
  258. add_shortcode("pix_contact_form", "pixContactForm");
  259.  
  260. /*=========================================================================================*/
  261.  
  262. function pixToolTip( $atts, $content = null ) {
  263.     extract(shortcode_atts(array(
  264.         'width'     => '',
  265.         'height'    => '',
  266.         'text'      => '',
  267.         'rel'       => '',
  268.         'link'      => '#'
  269.     ), $atts));
  270.    
  271.    
  272.     $out = '<a href="'.$link.'"';
  273.         if($link!=''||$link!='#') {
  274.     $out .= ' data-rel="'.$rel.'"';
  275.         }
  276.         if($text!=''){
  277.     $out .= ' class="pix_tips" title="'.$text.'"';
  278.         } else {
  279.     $out .= ' class="pix_tips_ajax"';
  280.         }
  281.     $out .= ' data-width="'.$width.'" data-height="'.$height.'">';
  282.     $out .= do_shortcode($content);
  283.     $out .= '</a>';
  284.    
  285.    return $out;
  286. }
  287. add_shortcode("pix_tooltip", "pixToolTip");
  288.  
  289. /*=========================================================================================*/
  290.  
  291. function pixMovieFrame( $atts, $content = null ) {
  292.     extract(shortcode_atts(array(
  293.         'src'     => '',
  294.         'height'    => '241',
  295.         'width'     => '429',
  296.         'poster'        => '',
  297.         'id'        => ''
  298.     ), $atts));
  299.    
  300.     if($poster!='') {
  301.         $autoPlay = 'true';
  302.     } else {
  303.         $autoPlay = 'false';
  304.     }
  305.    
  306.     if(!detectMobile()){
  307.     $out = '
  308.         <a
  309.             href="'.$src.'"
  310.             style="display:block;width:'.$width.'px;height:'.$height.'px;"
  311.             id="'.$id.'">';
  312.     if($poster!=''){
  313.         $out .= '<span style="display:block; width:'.$width.'px;height:'.$height.'px; background: url('.$poster.') no-repeat center;"></span>';
  314.     }
  315.         $out .= '</a>
  316.         <script type="text/javascript">
  317.             flowplayer("'.$id.'", {src:"'.get_bloginfo( 'stylesheet_directory' ).'/scripts/flowplayer-3.2.7.swf", wmode:"opaque"},  {
  318.            clip: {
  319.                autoPlay: '.$autoPlay.',
  320.                scaling: "orig",
  321.                autoBuffering: true
  322.            },
  323.            plugins: {
  324.                viral: {
  325.                    url: "'.get_bloginfo( 'stylesheet_directory' ).'/scripts/flowplayer.viralvideos-3.2.5.swf"
  326.                }, gatracker: {
  327.                     url: "'. get_bloginfo( 'stylesheet_directory' ).'/scripts/flowplayer.analytics-3.2.2-dev.swf",
  328.                    
  329.                     // track all possible events. By default only Start and Stop
  330.                     // are tracked with their corresponding playhead time.
  331.                     events: {
  332.                         all: true
  333.                     },
  334.                     debug: true,
  335.                     accountId: "UA-5877901-1" // your Google Analytics id here
  336.                 }
  337.            }
  338.        });
  339.         </script>';
  340.    
  341.     } else {
  342.    
  343.        
  344.         $out = '<video id="'.$id.'" class="projekktor" poster="'.$poster.'" width="'.$width.'" height="'.$height.'" controls>
  345.             <source src="'.remove_something('.flv',$src).'.ogg" type="video/ogg">
  346.             <source src="'.remove_something('.flv',$src).'.mp4" type="video/mp4">
  347.             <source src="'.remove_something('.flv',$src).'.webm" type="video/mp4">
  348.         </video>';
  349.        
  350.        
  351.         $out .= '<script type="text/javascript">
  352.         jQuery(window).one("load",function() {
  353.             projekktor("#'.$id.'");
  354.         });
  355.         </script>';
  356.     }
  357.    
  358.   return $out;
  359. }
  360. add_shortcode("pix_video", "pixMovieFrame");
  361.  
  362. /*=========================================================================================*/
  363.  
  364. function pixAudioPlay( $atts, $content = null ) {
  365.     extract(shortcode_atts(array(
  366.         'src'     => '',
  367.         'height'    => '30',
  368.         'width'     => '429',
  369.         'poster'    => '',
  370.         'play'      => 'false',
  371.         'id'        => ''
  372.     ), $atts));
  373.    
  374.     if($poster!='') {
  375.         $coverImage = ', coverImage: { url: "'.$poster.'", scaling: "orig" }';
  376.         $plugin = 'clip: { url: "'.$src.'" '.$coverImage.', autoPlay: '.$play.'}';
  377.     } else {
  378.         $coverImage = '';
  379.         $height = '30';
  380.         $plugin = 'plugins: { controls: { fullscreen: false, height: '.$height.', autoHide: false } }, clip: { autoPlay: '.$play.'}';
  381.     }
  382.    
  383.    
  384.     $out = '
  385.         <a
  386.             href="'.$src.'"
  387.             style="display:block;width:'.$width.'px;height:'.$height.'px;"
  388.             id="'.$id.'"></a>
  389.        
  390.         <script type="text/javascript">
  391.             flowplayer("'.$id.'", {src:"'.get_bloginfo( 'stylesheet_directory' ).'/scripts/flowplayer-3.2.7.swf", wmode:"opaque"},
  392.                 {
  393.                     '.$plugin.'
  394.                 });
  395.         </script>';
  396.    
  397.   return $out;
  398. }
  399. add_shortcode("pix_audio", "pixAudioPlay");
  400.  
  401. /*=========================================================================================*/
  402.  
  403. function pixUIaccordion( $atts, $content = null ) {
  404.     extract(shortcode_atts(array(
  405.         'active'     => ''
  406.     ), $atts));
  407.    
  408.     $out = '<div class="pix_accordion" data-active="'.$active.'">'.do_shortcode($content).'</div><!-- .pix_accordion -->';
  409.    
  410.   return $out;
  411. }
  412. add_shortcode("pix_accordion", "pixUIaccordion");
  413.  
  414. /*=========================================================================================*/
  415.  
  416. function pixUIacc( $atts, $content = null ) {
  417.     extract(shortcode_atts(array(
  418.         'title'     => ''
  419.     ), $atts));
  420.  
  421.     $out = '<a class="header_accordion" href="#'.sanitize_title($title).'"><span class="icons">&gt;</span>'.$title.'</a>';
  422.     $out .= '<div>'.do_shortcode($content).'</div>';
  423.    
  424.   return $out;
  425. }
  426. add_shortcode("pix_acc", "pixUIacc");
  427.  
  428. /*=========================================================================================*/
  429.  
  430. function pixUItabs( $atts, $content = null ) {
  431.     extract(shortcode_atts(array(
  432.         'active'     => ''
  433.     ), $atts));
  434.    
  435.     $out = '<div class="pix_tabs" data-active="'.$active.'">'.do_shortcode($content).'</div><!-- .pix_tabs -->';
  436.    
  437.   return $out;
  438. }
  439. add_shortcode("pix_tabs", "pixUItabs");
  440.  
  441. /*=========================================================================================*/
  442.  
  443. function pixUItab( $atts, $content = null ) {
  444.     extract(shortcode_atts(array(
  445.         'title'     => ''      
  446.     ), $atts));
  447.  
  448.     $out = '<li><a href="#'.sanitize_title($title).'">'.$title.'</a></li>';
  449.    
  450.   return $out;
  451. }
  452. add_shortcode("pix_tab", "pixUItab");
  453.  
  454. /*=========================================================================================*/
  455.  
  456. function pixUItabContent( $atts, $content = null ) {
  457.     extract(shortcode_atts(array(
  458.         'title'     => ''
  459.     ), $atts));
  460.  
  461.     $out .= '<div id="'.sanitize_title($title).'">'.do_shortcode($content).'</div>';
  462.    
  463.   return $out;
  464. }
  465. add_shortcode("pix_tab_content", "pixUItabContent");
  466.  
  467. /*=========================================================================================*/
  468.  
  469. function pixUl( $atts, $content = null ) {
  470.  
  471.     $out = '<ul>'.do_shortcode($content).'</ul>';
  472.    
  473.   return $out;
  474. }
  475. add_shortcode("ul", "pixUl");
  476.  
  477. /*=========================================================================================*/
  478.  
  479. function pixColumns( $atts, $content = null ) {
  480.    
  481.  
  482.     $out = '<div class="pix_columns">'.general_cleaner(clean_shortcode($content)).'</div>';
  483.    
  484.   return $out;
  485. }
  486. add_shortcode("pix_columns", "pixColumns");
  487.  
  488. /*=========================================================================================*/
  489.  
  490. function colTwo( $atts, $content = null ) {
  491.     extract(shortcode_atts(array(
  492.         'last'     => '',  
  493.     ), $atts));
  494.    
  495.     if($last=='true'){
  496.         $margin = ' last_column';
  497.     }
  498.  
  499.  
  500.     $out = '<div class="col_two pix_column'.$margin.'">'.clean_shortcode($content).'</div>';
  501.    
  502.   return $out;
  503. }
  504. add_shortcode("col_two", "colTwo");
  505.  
  506. /*=========================================================================================*/
  507.  
  508. function colThree( $atts, $content = null ) {
  509.     extract(shortcode_atts(array(
  510.         'last'     => '',  
  511.     ), $atts));
  512.    
  513.     if($last=='true'){
  514.         $margin = ' last_column';
  515.     }
  516.  
  517.  
  518.     $out = '<div class="col_three pix_column'.$margin.'">'.clean_shortcode($content).'</div>';
  519.    
  520.   return $out;
  521. }
  522. add_shortcode("col_three", "colThree");
  523.  
  524. /*=========================================================================================*/
  525.  
  526. function colTwoThree( $atts, $content = null ) {
  527.     extract(shortcode_atts(array(
  528.         'last'     => '',  
  529.     ), $atts));
  530.    
  531.     if($last=='true'){
  532.         $margin = ' last_column';
  533.     }
  534.  
  535.  
  536.     $out = '<div class="col_two_three pix_column'.$margin.'">'.clean_shortcode($content).'</div>';
  537.    
  538.   return $out;
  539. }
  540. add_shortcode("col_two_three", "colTwoThree");
  541.  
  542. /*=========================================================================================*/
  543.  
  544. function colFour( $atts, $content = null ) {
  545.     extract(shortcode_atts(array(
  546.         'last'     => '',  
  547.     ), $atts));
  548.    
  549.     if($last=='true'){
  550.         $margin = ' last_column';
  551.     }
  552.  
  553.  
  554.     $out = '<div class="col_four pix_column'.$margin.'">'.clean_shortcode($content).'</div>';
  555.    
  556.   return $out;
  557. }
  558. add_shortcode("col_four", "colFour");
  559.  
  560. /*=========================================================================================*/
  561.  
  562. function colTwoFour( $atts, $content = null ) {
  563.     extract(shortcode_atts(array(
  564.         'last'     => '',  
  565.     ), $atts));
  566.    
  567.     if($last=='true'){
  568.         $margin = ' last_column';
  569.     }
  570.  
  571.  
  572.     $out = '<div class="col_two_four pix_column'.$margin.'">'.clean_shortcode($content).'</div>';
  573.    
  574.   return $out;
  575. }
  576. add_shortcode("col_two_four", "colTwoFour");
  577.  
  578. /*=========================================================================================*/
  579.  
  580. function colThreeFour( $atts, $content = null ) {
  581.     extract(shortcode_atts(array(
  582.         'last'     => '',  
  583.     ), $atts));
  584.    
  585.     if($last=='true'){
  586.         $margin = ' last_column';
  587.     }
  588.  
  589.  
  590.     $out = '<div class="col_three_four pix_column'.$margin.'">'.clean_shortcode($content).'</div>';
  591.    
  592.   return $out;
  593. }
  594. add_shortcode("col_three_four", "colThreeFour");
  595.  
  596. /*=========================================================================================*/
  597.  
  598. function colFive( $atts, $content = null ) {
  599.     extract(shortcode_atts(array(
  600.         'last'     => '',  
  601.     ), $atts));
  602.    
  603.     if($last=='true'){
  604.         $margin = ' last_column';
  605.     }
  606.  
  607.  
  608.     $out = '<div class="col_five pix_column'.$margin.'">'.clean_shortcode($content).'</div>';
  609.    
  610.   return $out;
  611. }
  612. add_shortcode("col_five", "colFive");
  613.  
  614. /*=========================================================================================*/
  615.  
  616. function colTwoFive( $atts, $content = null ) {
  617.     extract(shortcode_atts(array(
  618.         'last'     => '',  
  619.     ), $atts));
  620.    
  621.     if($last=='true'){
  622.         $margin = ' last_column';
  623.     }
  624.  
  625.  
  626.     $out = '<div class="col_two_five pix_column'.$margin.'">'.clean_shortcode($content).'</div>';
  627.    
  628.   return $out;
  629. }
  630. add_shortcode("col_two_five", "colTwoFive");
  631.  
  632. /*=========================================================================================*/
  633.  
  634. function colThreeFive( $atts, $content = null ) {
  635.     extract(shortcode_atts(array(
  636.         'last'     => '',  
  637.     ), $atts));
  638.    
  639.     if($last=='true'){
  640.         $margin = ' last_column';
  641.     }
  642.  
  643.  
  644.     $out = '<div class="col_three_five pix_column'.$margin.'">'.clean_shortcode($content).'</div>';
  645.    
  646.   return $out;
  647. }
  648. add_shortcode("col_three_five", "colThreeFive");
  649.  
  650. /*=========================================================================================*/
  651.  
  652. function pixSiteMap( $atts, $content = null ) {
  653.    
  654.     $out = '<div class="sitemap">
  655.                
  656.             <h5>'. __ ('Pages','delight') .'</h5>
  657.            
  658.             <div class="pix_accordion" data-active="0">
  659.                 <a class="header_accordion" href="#"><span class="icons">&gt;</span>'. __ ('Show / hide pages','delight') .'</a>
  660.                 <div><ul>';
  661.             $pages = get_pages();
  662.             foreach ($pages as $page) {
  663.                 $out .= '<li><a href="'.get_page_link($page->ID).'">'.$page->post_title.'</a></li>';
  664.             }
  665.     $out .= '</ul></div>                
  666.             </div><!-- .pix_accordion -->                  
  667.        
  668.             <span class="clear"></span>
  669.        
  670.             <h5>'. __ ('Categories','delight') .'</h5>
  671.        
  672.             <div class="pix_accordion" data-active="0">
  673.                 <a class="header_accordion" href="#"><span class="icons">&gt;</span>'. __ ('Show / hide categories','delight') .'</a>
  674.                 <div><ul>';
  675.             $categories=  get_categories();
  676.             foreach ($categories as $category) {
  677.                 $out .= '<li><a href="'.get_category_link( $category->term_id ).'">'.$category->cat_name.'</a></li>';
  678.             }
  679.  
  680.     $out .='</ul></div>                
  681.             </div><!-- .pix_accordion -->                  
  682.        
  683.             <span class="clear"></span>
  684.        
  685.             <h5>'. __ ('Posts','delight') .'</h5>
  686.            
  687.             <div class="pix_accordion" data-active="0">
  688.                 <a class="header_accordion" href="#"><span class="icons">&gt;</span>'. __ ('Show / hide posts','delight') .'</a>
  689.                 <div>
  690.                     <ul>';
  691.                     $archive_query = new WP_Query('posts_per_page=-1');
  692.                     while ($archive_query->have_posts()) : $archive_query->the_post();
  693.     $out .= '<li>
  694.                 <a href="'. get_permalink() .'" rel="bookmark" title="'.stripslashes(get_pix_option('cc_transl_permanent_link_to')). get_the_title() .'">'. get_the_title() .'</a>
  695.             </li>';
  696.                 endwhile; wp_reset_query();
  697.     $out .= '</ul>
  698.                 </div>
  699.             </div><!-- .pix_accordion -->                  
  700.        
  701.             <span class="clear"></span>
  702.        
  703.             <h5>'. __ ('Monthly archives','delight') .'</h5>
  704.            
  705.             <div class="pix_accordion" data-active="0">
  706.                 <a class="header_accordion" href="#"><span class="icons">&gt;</span>'. __ ('Show / hide archives','delight') .'</a>
  707.                 <div><ul class="arrow_list">
  708.                     '. wp_get_archives('echo=0&format=custom&before=<li>&after=</li>') .'  
  709.                 </ul></div>                  
  710.             </div><!-- .pix_accordion -->                  
  711.        
  712.             <span class="clear"></span>
  713.        
  714.             <h5>'. __ ('Galleries','delight') .'</h5>
  715.            
  716.             <div class="pix_accordion" data-active="0">
  717.                 <a class="header_accordion" href="#"><span class="icons">&gt;</span>'. __ ('Show / hide galleries','delight') .'</a>
  718.                 <div>';
  719.             $terms = get_terms("gallery");
  720.             $count = count($terms);
  721.             if($count > 0){
  722.                 $out .= "<ul>";
  723.                 foreach ($terms as $term) {
  724.                     $out .= '<li><a href="'.get_term_link($term->slug, 'gallery').'">'.$term->name.'</a></li>';
  725.            
  726.                 }
  727.                 $out .= "</ul>";
  728.             }
  729.     $out .='</div>                  
  730.             </div><!-- .pix_accordion -->                  
  731.        
  732.             <span class="clear"></span>
  733.        
  734.             <h5>'. __ ('Portfolio items','delight') .'</h5>
  735.            
  736.             <div class="pix_accordion" data-active="0">
  737.                 <a class="header_accordion" href="#"><span class="icons">&gt;</span>'. __ ('Show / hide posts','delight') .'</a>
  738.                 <div>
  739.                     <ul>';
  740.                     $archive_query = new WP_Query('post_type=portfolio&posts_per_page=-1');
  741.                     while ($archive_query->have_posts()) : $archive_query->the_post();
  742.     $out .= '<li>
  743.                 <a href="'. get_permalink() .'" rel="bookmark" title="'.stripslashes(get_pix_option('cc_transl_permanent_link_to')). get_the_title() .'">'. get_the_title() .'</a>
  744.             </li>';
  745.                 endwhile; wp_reset_query();
  746.     $out .= '</ul>
  747.                 </div>
  748.             </div><!-- .pix_accordion -->                  
  749.        
  750.             <span class="clear"></span>
  751.        
  752.         </div>';
  753.    
  754.    return $out;
  755. }
  756. add_shortcode("pix_sitemap", "pixSiteMap");
  757.  
  758. /*=========================================================================================*/
  759.  
  760. function pixBox( $atts, $content = null ) {
  761.     extract(shortcode_atts(array(
  762.         'icon'  => '',
  763.         'bg'    => '',
  764.         'border_color'  => '',
  765.         'border_size'   => '',
  766.         'border_style'  => '',
  767.         'color' => ''  
  768.     ), $atts));
  769.  
  770.     global $content_width;
  771.    
  772.     $width = $content_width - ($border_size + 40);
  773.    
  774.     $out = '<div class="pix_box '.$icon.'" style="background-color:'.$bg.'; color:'.$color.'; border:'.$border_size.'px '.$border_color.' '.$border_style.'">'.clean_shortcode($content).'</div>';
  775.    
  776.   return $out;
  777. }
  778. add_shortcode("pix_box", "pixBox");
  779.  
  780. /*=========================================================================================*/
  781.  
  782. function pixDropCap( $atts, $content = null  ) {
  783.     extract(shortcode_atts(array(
  784.         'color'     => '',
  785.         'bg'        => '',
  786.         'height'        => '',
  787.         'line_height'       => '',
  788.         'width'     => '',
  789.         'size'  => '',
  790.         'top'   => '',
  791.         'right' => '',
  792.         'shape'     => ''
  793.     ), $atts));
  794.    return '<span class="firstletter '.$shape.'" style="color:'.$color.'; background-color:'.$bg.'; line-height:'.$line_height.'px; height:'.$height.'px; width:'.$width.'px; font-size:'.$size.'px; margin-top:'.$top.'px; margin-right:'.$right.'px">'.$content.'</span>';
  795. }
  796. add_shortcode("pix_dropcap", "pixDropCap");
  797.  
  798. /*=========================================================================================*/
  799.  
  800. function pixButton( $atts, $content = null  ) {
  801.     extract(shortcode_atts(array(
  802.         'bg_color'      => '',
  803.         'bg_hover'      => '',
  804.         'text_color'        => '',
  805.         'border_color'      => '',
  806.         'border_size'       => '',
  807.         'size'  => ''
  808.     ), $atts));
  809.    return '<span class="cusButton '.$size.'" style="background-color:'.$bg_color.'; color:'.$text_color.'; border:'.$border_size.'px solid '.$border_color.'" onmouseover  = "this.style.backgroundColor =  \''.$bg_hover.'\'" onmouseout  = "this.style.backgroundColor =  \''.$bg_color.'\'">'.$content.'</span>';
  810. }
  811. add_shortcode("pix_button", "pixButton");
  812.  
  813. /*=========================================================================================*/
  814.  
  815. function pixPriceTable( $atts, $content = null  ) {
  816.     extract(shortcode_atts(array(
  817.         'columns'       => '',
  818.         'id'        => ''
  819.     ), $atts));
  820.    return '<div class="price_table td_'.$columns.'" id="'.$id.'">'.general_cleaner($content).'</div>';
  821. }
  822. add_shortcode("pix_price_table", "pixPriceTable");
  823.  
  824. /*=========================================================================================*/
  825.  
  826. function pixPriceColumn( $atts, $content = null  ) {
  827.     extract(shortcode_atts(array(
  828.         'id'        => '',
  829.         'highlighted'   => ''
  830.     ), $atts));
  831.     if($highlighted=='yes'){
  832.         $highlighted = 'highlighted';
  833.     } else {
  834.         $highlighted = '';
  835.     }
  836.    $out = '<div class="price_column '.$id.' '.$highlighted.'">';
  837.    $out .= '<div>';
  838.    $out .= general_cleaner($content);
  839.    $out .= '</div>';
  840.    $out .= '</div><!-- .price_column -->';
  841.    
  842.    return $out;
  843. }
  844. add_shortcode("pix_price_columnm", "pixPriceColumn");
  845.  
  846. /*=========================================================================================*/
  847.  
  848. function pixPriceTitle( $atts, $content = null  ) {
  849.    
  850.    return '<div class="price_title">'.general_cleaner($content).'</div><!-- .price_title -->';
  851.  
  852. }
  853. add_shortcode("pix_price_title", "pixPriceTitle");
  854.  
  855. /*=========================================================================================*/
  856.  
  857. function pixPricePrice( $atts, $content = null  ) {
  858.    
  859.    return '<div class="price_price">'.do_shortcode($content).'</div><!-- .price_price -->';
  860.  
  861. }
  862. add_shortcode("pix_price_price", "pixPricePrice");
  863.  
  864. /*=========================================================================================*/
  865.  
  866. function pixPriceExplanation( $atts, $content = null  ) {
  867.    
  868.    return '<div class="price_explanation">'.do_shortcode($content).'</div><!-- .price_explanation -->';
  869.  
  870. }
  871. add_shortcode("pix_price_explanation", "pixPriceExplanation");
  872.  
  873. /*=========================================================================================*/
  874.  
  875. function pixPriceCheck( $atts, $content = null  ) {
  876.    
  877.    return '<div class="pix_check">'.do_shortcode($content).'</div><!-- .pix_check -->';
  878.  
  879. }
  880. add_shortcode("pix_price_check", "pixPriceCheck");
  881.  
  882. /*=========================================================================================*/
  883.  
  884. function pixPriceRow( $atts, $content = null  ) {
  885.    
  886.    return '<div>'.do_shortcode($content).'</div>';
  887.  
  888. }
  889. add_shortcode("pix_price_row", "pixPriceRow");
  890.  
  891. /*=========================================================================================*/
  892.  
  893. function pixPriceError( $atts, $content = null  ) {
  894.    
  895.    return '<div class="pix_error">'.do_shortcode($content).'</div><!-- .pix_error -->';
  896.  
  897. }
  898. add_shortcode("pix_price_error", "pixPriceError");
  899.  
  900. /*=========================================================================================*/
  901.  
  902. function pixSpan( $atts, $content = null  ) {
  903.     extract(shortcode_atts(array(
  904.         'id'        => '',
  905.         'class' => ''
  906.     ), $atts));
  907.    
  908.    return '<span class="'.$class.'" id="'.$id.'">'.do_shortcode($content).'</span><!-- span.'.$class.'#'.$id.' -->';
  909.  
  910. }
  911. add_shortcode("pix_span", "pixSpan");
  912.  
  913. /*=========================================================================================*/
  914.  
  915. function pixClear( $atts, $content = null ) {
  916.    
  917.     return '<div class="clear"></div>';
  918. }
  919. add_shortcode("clear", "pixClear");
  920.  
  921. /*=========================================================================================*/
  922.  
  923. function pixHr( $atts, $content = null ) {
  924.        
  925.    return '<hr>';
  926. }
  927. add_shortcode("hr", "pixHr");
  928.  
  929. /*=========================================================================================*/
  930.  
  931. function pixTotop( $atts, $content = null ) {
  932.        
  933.    return '<div class="totop"><hr><a href="#topto"></a></div>';
  934. }
  935. add_shortcode("totop", "pixTotop");
  936.  
  937. /*=========================================================================================*/
  938.  
  939. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement