Advertisement
duskopro

functions.php old

Mar 25th, 2024
851
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 48.15 KB | Source Code | 0 0
  1. <?php
  2. /**
  3.  * Piha functions and definitions
  4.  *
  5.  * @package WordPress
  6.  * @subpackage Piha
  7.  */
  8.  
  9. /*-----------------------------------------------------------------------------------*/
  10. /* Make theme available for translation
  11. /* Translations can be filed in the /languages/ directory
  12. /*-----------------------------------------------------------------------------------*/
  13.  
  14. load_theme_textdomain( 'piha', TEMPLATEPATH . '/languages' );
  15.  
  16. $locale = get_locale();
  17. $locale_file = TEMPLATEPATH . "/languages/$locale.php";
  18.     if ( is_readable( $locale_file ) )
  19.         require_once( $locale_file );
  20.  
  21. /*-----------------------------------------------------------------------------------*/
  22. /* Set the content width based on the theme's design and stylesheet.
  23. /*-----------------------------------------------------------------------------------*/
  24.  
  25. if ( ! isset( $content_width ) )
  26.     $content_width = 680;
  27.  
  28. /*-----------------------------------------------------------------------------------*/
  29. /* Tell WordPress to run piha() when the 'after_setup_theme' hook is run.
  30. /*-----------------------------------------------------------------------------------*/
  31.  
  32. add_action( 'after_setup_theme', 'piha' );
  33.  
  34. if ( ! function_exists( 'piha' ) ):
  35.  
  36. /*-----------------------------------------------------------------------------------*/
  37. /* Create the Piha Theme Options Page
  38. /*-----------------------------------------------------------------------------------*/
  39.  
  40. require_once ( get_template_directory() . '/includes/theme-options.php' );
  41.  
  42. /*-----------------------------------------------------------------------------------*/
  43. /* Call JavaScript Scripts for Piha (Fitvids for Elasic Videos and Custom)
  44. /*-----------------------------------------------------------------------------------*/
  45.  
  46. add_action('wp_enqueue_scripts','piha_scripts_function');
  47.     function piha_scripts_function() {
  48.         wp_enqueue_script( 'fitvids', get_template_directory_uri() . '/js/jquery.fitvids.js', false, '1.0');
  49.         wp_enqueue_script( 'respond', get_template_directory_uri() . '/js/respond.min.js', false, '1.0.1');
  50.         wp_enqueue_script( 'custom', get_template_directory_uri() . '/js/custom.js', false, '1.0.1');
  51. }
  52.  
  53. /*-----------------------------------------------------------------------------------*/
  54. /* Sets up theme defaults and registers support for WordPress features.
  55. /*-----------------------------------------------------------------------------------*/
  56.  
  57. function piha() {
  58.  
  59.     // This theme styles the visual editor with editor-style.css to match the theme style.
  60.     add_editor_style();
  61.  
  62.     // This theme uses post thumbnails
  63.     add_theme_support( 'post-thumbnails' );
  64.  
  65.     // Add default posts and comments RSS feed links to head
  66.     add_theme_support( 'automatic-feed-links' );
  67.  
  68.     // This theme uses wp_nav_menu() in one location.
  69.     register_nav_menus( array(
  70.         'primary' => __( 'Primary Navigation', 'piha' ),
  71.         'top' => __( 'Optional Top Navigation (no sub menus supported)', 'piha' ),
  72.         'footer' => __( 'Optional Footer Navigation (no sub menus supported)', 'piha' )
  73.     ) );
  74.    
  75.     // Add support for Post Formats
  76.     add_theme_support( 'post-formats', array( 'aside', 'status', 'link', 'quote', 'chat', 'image', 'gallery', 'video', 'audio' ) );
  77.  
  78.     // This theme allows users to set a custom background
  79.     add_custom_background();
  80.    
  81.     // The default header text color
  82.     define( 'HEADER_TEXTCOLOR', '222' );
  83.    
  84.     // By leaving empty, we allow for random image rotation.
  85.     define( 'HEADER_IMAGE', '' );
  86.  
  87.     // The height and width of your custom header. You can hook into the theme's own filters to change these values.
  88.     // Add a filter to piha_header_image_width and piha_header_image_height to change these values.
  89.     define( 'HEADER_IMAGE_WIDTH', apply_filters( 'piha_header_image_width', 750 ) );
  90.     define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'piha_header_image_height', 200 ) );
  91.  
  92.     // Don't support text inside the header image.
  93.     define( 'NO_HEADER_TEXT', true );
  94.  
  95.     // Add a way for the custom header to be styled in the admin panel that controls
  96.     // custom headers. See piha_admin_header_style(), below.
  97.     add_custom_image_header( '', 'piha_admin_header_style' );
  98.  
  99.     // ... and thus ends the changeable header business.
  100.  
  101.     // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI.
  102.     register_default_headers( array(
  103.             'numbers' => array(
  104.                 'url' => '%s/images/headers/headerimage.jpg',
  105.                 'thumbnail_url' => '%s/images/headers/headerimage-thumbnail.jpg',
  106.                 /* translators: header image description */
  107.                 'description' => __( 'Numbers', 'piha' )
  108.             ),
  109.             'mosaik' => array(
  110.                 'url' => '%s/images/headers/headerimage02.jpg',
  111.                 'thumbnail_url' => '%s/images/headers/headerimage02-thumbnail.jpg',
  112.                 /* translators: header image description */
  113.                 'description' => __( 'Mosaik', 'piha' )
  114.         )
  115.     ) );
  116. }
  117. endif;
  118.  
  119. if ( ! function_exists( 'piha_admin_header_style' ) ) :
  120.  
  121. /*-----------------------------------------------------------------------------------*/
  122. /* Styles the header image displayed on the Appearance > Header admin panel.
  123. /* Referenced via add_custom_image_header() in piha_setup().
  124. /*-----------------------------------------------------------------------------------*/
  125.  
  126. function piha_admin_header_style() {
  127. ?>
  128. <style type="text/css">
  129. /* Shows the same border as on front end */
  130. #heading {
  131.     border-bottom: 1px solid #000;
  132.     border-top: 4px solid #000;
  133. }
  134. /* If NO_HEADER_TEXT is false, you would style the text with these selectors:
  135.     #headimg #name { }
  136.     #headimg #desc { }
  137. */
  138. </style>
  139. <?php
  140. }
  141. endif;
  142.  
  143. /*-----------------------------------------------------------------------------------*/
  144. /* Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
  145. /*-----------------------------------------------------------------------------------*/
  146.  
  147. function piha_page_menu_args( $args ) {
  148.     $args['show_home'] = true;
  149.     return $args;
  150. }
  151. add_filter( 'wp_page_menu_args', 'piha_page_menu_args' );
  152.  
  153. /*-----------------------------------------------------------------------------------*/
  154. /* Sets the post excerpt length to 40 characters.
  155. /*-----------------------------------------------------------------------------------*/
  156.  
  157. function piha_excerpt_length( $length ) {
  158.     return 40;
  159. }
  160. add_filter( 'excerpt_length', 'piha_excerpt_length' );
  161.  
  162. /*-----------------------------------------------------------------------------------*/
  163. /* Returns a "Continue Reading" link for excerpts
  164. /*-----------------------------------------------------------------------------------*/
  165.  
  166. function piha_continue_reading_link() {
  167.     return ' <a href="'. get_permalink() . '">' . __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'piha' ) . '</a>';
  168. }
  169.  
  170. /*-----------------------------------------------------------------------------------*/
  171. /* Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and piha_continue_reading_link().
  172. /*
  173. /* To override this in a child theme, remove the filter and add your own
  174. /* function tied to the excerpt_more filter hook.
  175. /*-----------------------------------------------------------------------------------*/
  176.  
  177. function piha_auto_excerpt_more( $more ) {
  178.     return ' &hellip;' . piha_continue_reading_link();
  179. }
  180. add_filter( 'excerpt_more', 'piha_auto_excerpt_more' );
  181.  
  182. /*-----------------------------------------------------------------------------------*/
  183. /* Adds a pretty "Continue Reading" link to custom post excerpts.
  184. /*
  185. /* To override this link in a child theme, remove the filter and add your own
  186. /* function tied to the get_the_excerpt filter hook.
  187. /*-----------------------------------------------------------------------------------*/
  188.  
  189. function piha_custom_excerpt_more( $output ) {
  190.     if ( has_excerpt() && ! is_attachment() ) {
  191.         $output .= piha_continue_reading_link();
  192.     }
  193.     return $output;
  194. }
  195. add_filter( 'get_the_excerpt', 'piha_custom_excerpt_more' );
  196.  
  197. /*-----------------------------------------------------------------------------------*/
  198. /* Remove inline styles printed when the gallery shortcode is used.
  199. /*-----------------------------------------------------------------------------------*/
  200.  
  201. function piha_remove_gallery_css( $css ) {
  202.     return preg_replace( "#<style type='text/css'>(.*?)</style>#s", '', $css );
  203. }
  204. add_filter( 'gallery_style', 'piha_remove_gallery_css' );
  205.  
  206.  
  207.  
  208. if ( ! function_exists( 'piha_comment' ) ) :
  209.  
  210. /*-----------------------------------------------------------------------------------*/
  211. /* Comments template piha_comment
  212. /*-----------------------------------------------------------------------------------*/
  213.  
  214. function piha_comment( $comment, $args, $depth ) {
  215.     $GLOBALS['comment'] = $comment;
  216.     switch ( $comment->comment_type ) :
  217.         case '' :
  218.     ?>
  219.  
  220.     <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
  221.         <article id="comment-<?php comment_ID(); ?>" class="comment">
  222.                        
  223.             <div class="comment-header">
  224.                 <?php echo get_avatar( $comment, 40 ); ?>
  225.                 <?php printf( __( '%s', 'piha' ), sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) ); ?>
  226.                 <p><a class="comment-time" href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
  227.                 <?php
  228.                     /* translators: 1: date, 2: time */
  229.                     printf( __( '%1$s &#64; %2$s', 'piha' ),
  230.                     get_comment_date('d/m/Y'),
  231.                     get_comment_time() );
  232.                 ?></a></p>
  233.                
  234.                 <p><?php edit_comment_link( __( 'Edit comment &raquo;', 'piha' ), ' ' );?></p>
  235.             </div><!-- end .comment-header --> 
  236.        
  237.             <div class="comment-content">
  238.                 <?php comment_text(); ?>   
  239.                 <?php if ( $comment->comment_approved == '0' ) : ?>
  240.                     <p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'piha' ); ?></p>
  241.                 <?php endif; ?>
  242.             <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'piha' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
  243.             </div><!-- end .comment-content -->
  244.         </article><!-- end .comment -->
  245.  
  246.     <?php
  247.             break;
  248.         case 'pingback'  :
  249.         case 'trackback' :
  250.     ?>
  251.     <li class="post pingback">
  252.         <p><?php _e( 'Pingback:', 'piha' ); ?> <?php comment_author_link(); ?></p>
  253.         <p><?php edit_comment_link( __('Edit pingback &raquo;', 'piha'), ' ' ); ?></p>
  254.     <?php
  255.             break;
  256.     endswitch;
  257. }
  258. endif;
  259.  
  260. /*-----------------------------------------------------------------------------------*/
  261. /* Register widgetized area and update sidebar with default widgets
  262. /*-----------------------------------------------------------------------------------*/
  263.  
  264. function piha_widgets_init() {
  265.  
  266.     register_sidebar( array (
  267.         'name' => __( 'Main Sidebar', 'piha' ),
  268.         'id' => 'sidebar-1',
  269.         'description' => __( 'Add your sidebar widgets here.', 'piha' ),
  270.         'before_widget' => '<aside id="%1$s" class="widget %2$s">',
  271.         'after_widget' => "</aside>",
  272.         'before_title' => '<h3 class="widget-title">',
  273.         'after_title' => '</h3>',
  274.     ) );
  275.  
  276. }
  277. add_action( 'init', 'piha_widgets_init' );
  278.  
  279. /*-----------------------------------------------------------------------------------*/
  280. /* Customized Piha search form
  281. /*-----------------------------------------------------------------------------------*/
  282.  
  283. function piha_search_form( $form ) {
  284.  
  285.     $form = '   <form method="get" class="searchform" action="'.get_bloginfo('url').'">
  286.             <input type="text" class="field s" name="s" placeholder="'. esc_attr__('Search', 'piha') .'" />
  287.             <input type="submit" class="searchsubmit" name="submit" value="'. esc_attr__('Search', 'piha') .'" />
  288.     </form>';
  289.  
  290.     return $form;
  291. }
  292. add_filter( 'get_search_form', 'piha_search_form' );
  293.  
  294. /**
  295.  * Removes the default CSS style from the WP image gallery
  296.  */
  297. add_filter('gallery_style', create_function('$a', 'return "
  298. <div class=\'gallery\'>";'));
  299.  
  300. /*-----------------------------------------------------------------------------------*/
  301. /* Piha Shortcodes
  302. /*-----------------------------------------------------------------------------------*/
  303.  
  304. // Enable shortcodes in widget areas
  305. add_filter( 'widget_text', 'do_shortcode' );
  306.  
  307. // Replace WP autop formatting
  308. if (!function_exists( "piha_remove_wpautop")) {
  309.     function piha_remove_wpautop($content) {
  310.         $content = do_shortcode( shortcode_unautop( $content ) );
  311.         $content = preg_replace( '#^<\/p>|^<br \/>|<p>$#', '', $content);
  312.         return $content;
  313.     }
  314. }
  315.  
  316. /*-----------------------------------------------------------------------------------*/
  317. /* Multi Columns Shortcodes
  318. /* Don't forget to add "_last" behind the shortcode if it is the last column.
  319. /*-----------------------------------------------------------------------------------*/
  320.  
  321. // Two Columns
  322. function piha_shortcode_two_columns_one( $atts, $content = null ) {
  323.    return '<div class="two-columns-one">' . piha_remove_wpautop($content) . '</div>';
  324. }
  325. add_shortcode( 'two_columns_one', 'piha_shortcode_two_columns_one' );
  326.  
  327. function piha_shortcode_two_columns_one_last( $atts, $content = null ) {
  328.    return '<div class="two-columns-one last">' . piha_remove_wpautop($content) . '</div>';
  329. }
  330. add_shortcode( 'two_columns_one_last', 'piha_shortcode_two_columns_one_last' );
  331.  
  332. // Three Columns
  333. function piha_shortcode_three_columns_one($atts, $content = null) {
  334.    return '<div class="three-columns-one">' . piha_remove_wpautop($content) . '</div>';
  335. }
  336. add_shortcode( 'three_columns_one', 'piha_shortcode_three_columns_one' );
  337.  
  338. function piha_shortcode_three_columns_one_last($atts, $content = null) {
  339.    return '<div class="three-columns-one last">' . piha_remove_wpautop($content) . '</div>';
  340. }
  341. add_shortcode( 'three_columns_one_last', 'piha_shortcode_three_columns_one_last' );
  342.  
  343. function piha_shortcode_three_columns_two($atts, $content = null) {
  344.    return '<div class="three-columns-two">' . piha_remove_wpautop($content) . '</div>';
  345. }
  346. add_shortcode( 'three_columns_two', 'piha_shortcode_three_columns' );
  347.  
  348. function piha_shortcode_three_columns_two_last($atts, $content = null) {
  349.    return '<div class="three-columns-two last">' . piha_remove_wpautop($content) . '</div>';
  350. }
  351. add_shortcode( 'three_columns_two_last', 'piha_shortcode_three_columns_two_last' );
  352.  
  353. // Four Columns
  354. function piha_shortcode_four_columns_one($atts, $content = null) {
  355.    return '<div class="four-columns-one">' . piha_remove_wpautop($content) . '</div>';
  356. }
  357. add_shortcode( 'four_columns_one', 'piha_shortcode_four_columns_one' );
  358.  
  359. function piha_shortcode_four_columns_one_last($atts, $content = null) {
  360.    return '<div class="four-columns-one last">' . piha_remove_wpautop($content) . '</div>';
  361. }
  362. add_shortcode( 'four_columns_one_last', 'piha_shortcode_four_columns_one_last' );
  363.  
  364. function piha_shortcode_four_columns_two($atts, $content = null) {
  365.    return '<div class="four-columns-two">' . piha_remove_wpautop($content) . '</div>';
  366. }
  367. add_shortcode( 'four_columns_two', 'piha_shortcode_four_columns_two' );
  368.  
  369. function piha_shortcode_four_columns_two_last($atts, $content = null) {
  370.    return '<div class="four-columns-two last">' . piha_remove_wpautop($content) . '</div>';
  371. }
  372. add_shortcode( 'four_columns_two_last', 'piha_shortcode_four_columns_two_last' );
  373.  
  374. function piha_shortcode_four_columns_three($atts, $content = null) {
  375.    return '<div class="four-columns-three">' . piha_remove_wpautop($content) . '</div>';
  376. }
  377. add_shortcode( 'four_columns_three', 'piha_shortcode_four_columns_three' );
  378.  
  379. function piha_shortcode_four_columns_three_last($atts, $content = null) {
  380.    return '<div class="four-columns-three last">' . piha_remove_wpautop($content) . '</div>';
  381. }
  382. add_shortcode( 'four_columns_three_last', 'piha_shortcode_four_columns_three_last' );
  383.  
  384. // Divide Text Shortcode
  385. function piha_shortcode_divider($atts, $content = null) {
  386.    return '<div class="divider"></div>';
  387. }
  388. add_shortcode( 'divider', 'piha_shortcode_divider' );
  389.  
  390. /*-----------------------------------------------------------------------------------*/
  391. /* Text Highlight and Info Boxes Shortcodes
  392. /*-----------------------------------------------------------------------------------*/
  393.  
  394. function piha_shortcode_white_box($atts, $content = null) {
  395.    return '<div class="white-box">' . do_shortcode( piha_remove_wpautop($content) ) . '</div>';
  396. }
  397. add_shortcode( 'white_box', 'piha_shortcode_white_box' );
  398.  
  399. function piha_shortcode_yellow_box($atts, $content = null) {
  400.    return '<div class="yellow-box">' . do_shortcode( piha_remove_wpautop($content) ) . '</div>';
  401. }
  402. add_shortcode( 'yellow_box', 'piha_shortcode_yellow_box' );
  403.  
  404. function piha_shortcode_red_box($atts, $content = null) {
  405.    return '<div class="red-box">' . do_shortcode( piha_remove_wpautop($content) ) . '</div>';
  406. }
  407. add_shortcode( 'red_box', 'piha_shortcode_red_box' );
  408.  
  409. function piha_shortcode_blue_box($atts, $content = null) {
  410.    return '<div class="blue-box">' . do_shortcode( piha_remove_wpautop($content) ) . '</div>';
  411. }
  412. add_shortcode( 'blue_box', 'piha_shortcode_blue_box' );
  413.  
  414. function piha_shortcode_green_box($atts, $content = null) {
  415.    return '<div class="green-box">' . do_shortcode( piha_remove_wpautop($content) ) . '</div>';
  416. }
  417. add_shortcode( 'green_box', 'piha_shortcode_green_box' );
  418.  
  419. function piha_shortcode_lightgrey_box($atts, $content = null) {
  420.    return '<div class="lightgrey-box">' . do_shortcode( piha_remove_wpautop($content) ) . '</div>';
  421. }
  422. add_shortcode( 'lightgrey_box', 'piha_shortcode_lightgrey_box' );
  423.  
  424. function piha_shortcode_grey_box($atts, $content = null) {
  425.    return '<div class="grey-box">' . do_shortcode( piha_remove_wpautop($content) ) . '</div>';
  426. }
  427. add_shortcode( 'grey_box', 'piha_shortcode_grey_box' );
  428.  
  429. function piha_shortcode_darkgrey_box($atts, $content = null) {
  430.    return '<div class="darkgrey-box">' . do_shortcode( piha_remove_wpautop($content) ) . '</div>';
  431. }
  432. add_shortcode( 'darkgrey_box', 'piha_shortcode_darkgrey_box' );
  433.  
  434. /*-----------------------------------------------------------------------------------*/
  435. /* General Buttons Shortcodes
  436. /*-----------------------------------------------------------------------------------*/
  437.  
  438. function piha_button( $atts, $content = null ) {
  439.     extract(shortcode_atts(array(
  440.     'link'  => '#',
  441.     'target'    => '',
  442.     'color' => '',
  443.     'size'  => '',
  444.     'form'  => '',
  445.     'style' => '',
  446.     ), $atts));
  447.  
  448.     $color = ($color) ? ' '.$color. '-btn' : '';
  449.     $size = ($size) ? ' '.$size. '-btn' : '';
  450.     $form = ($form) ? ' '.$form. '-btn' : '';
  451.     $target = ($target == 'blank') ? ' target="_blank"' : '';
  452.  
  453.     $out = '<a' .$target. ' class="standard-btn' .$color.$size.$form. '" href="' .$link. '"><span>' .do_shortcode($content). '</span></a>';
  454.  
  455.     return $out;
  456. }
  457. add_shortcode('button', 'piha_button');
  458.  
  459. /*-----------------------------------------------------------------------------------*/
  460. /* PDF, Info and Add Buttons Shortcodes
  461. /*-----------------------------------------------------------------------------------*/
  462.  
  463. function piha_icons_button( $atts, $content = null ) {
  464.     extract(shortcode_atts(array(
  465.     'link'  => '#',
  466.     'target'    => '',
  467.     'color' => '',
  468.     'style' => '',
  469.     'form'  => '',
  470.     ), $atts));
  471.  
  472.     $color = ($color) ? ' '.$color. '-btn' : '';
  473.     $style = ($style) ? ' '.$style. '-btn' : '';
  474.     $form = ($form) ? ' '.$form. '-btn' : '';
  475.     $target = ($target == 'blank') ? ' target="_blank"' : '';
  476.  
  477.     $out = '<a' .$target. ' class="icons-btn' .$color.$style.$form. '" href="' .$link. '"><span>' .do_shortcode($content). '</span></a>';
  478.  
  479.     return $out;
  480. }
  481. add_shortcode('icons_button', 'piha_icons_button');
  482.  
  483. /*-----------------------------------------------------------------------------------*/
  484. /* Simple PDF, Info and Add Buttons Shortcodes
  485. /*-----------------------------------------------------------------------------------*/
  486.  
  487. function piha_simple_icons_button( $atts, $content = null ) {
  488.     extract(shortcode_atts(array(
  489.         'link'  => '#',
  490.         'target'    => '',
  491.         'style' => '',
  492.     ), $atts));
  493.  
  494.     $style = ($style) ? ' '.$style. '-btn' : '';
  495.     $target = ($target == 'blank') ? ' target="_blank"' : '';
  496.  
  497.     $out = '<a' .$target. ' class="simple-icons-btn' .$style. '" href="' .$link. '"><span>' .do_shortcode($content). '</span></a>';
  498.  
  499.     return $out;
  500. }
  501. add_shortcode('simple_icons_button', 'piha_simple_icons_button');
  502.  
  503. /*-----------------------------------------------------------------------------------*/
  504. /* Link Post Format Button Shortcode
  505. /*-----------------------------------------------------------------------------------*/
  506.  
  507. function piha_link_format( $atts, $content = null ) {
  508.     extract(shortcode_atts(array(
  509.     'link'  => '#',
  510.     'target'    => '',
  511.      'style'    => '',
  512.     ), $atts));
  513.  
  514.     $target = ($target == 'blank') ? ' target="_blank"' : '';
  515.  
  516.     $out = '<a' .$target. ' class="link-format-btn' .$style. '" href="' .$link. '"><span>' .do_shortcode($content). '</span></a>';
  517.  
  518.     return $out;
  519. }
  520. add_shortcode('link_format', 'piha_link_format');
  521.  
  522.  
  523. /*-----------------------------------------------------------------------------------*/
  524. /* Deactives the default CSS styles for the Smart Archives Reloaded plugin
  525. /*-----------------------------------------------------------------------------------*/
  526.  
  527. add_filter('smart_archives_load_default_styles', '__return_false');
  528.  
  529. /*-----------------------------------------------------------------------------------*/
  530. /* Include a custom Flickr Widget
  531. /*-----------------------------------------------------------------------------------*/
  532.  
  533. class piha_flickr extends WP_Widget {
  534.  
  535.     function piha_flickr() {
  536.         $widget_ops = array('description' => 'Show preview images from a flickr account or group.' , 'piha');
  537.  
  538.         parent::WP_Widget(false, __('Flickr Widget', 'piha'),$widget_ops);
  539.     }
  540.  
  541.     function widget($args, $instance) {  
  542.         extract( $args );
  543.         $title = $instance['title'];
  544.         $id = $instance['id'];
  545.         $linktext = $instance['linktext'];
  546.         $linkurl = $instance['linkurl'];
  547.         $number = $instance['number'];
  548.         $type = $instance['type'];
  549.         $sorting = $instance['sorting'];
  550.        
  551.         echo $before_widget; ?>
  552.         <?php if($title != '')
  553.             echo '<h3 class="widget-title">'.$title.'</h3>'; ?>
  554.            
  555.         <div class="flickr_badge_wrapper"><script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gne?count=<?php echo $number; ?>&amp;display=<?php echo $sorting; ?>&amp;&amp;source=<?php echo $type; ?>&amp;<?php echo $type; ?>=<?php echo $id; ?>&amp;size=m"></script><div class="clear"></div>
  556.         <?php if($linktext == ''){echo '';} else {echo '<div class="flickr-bottom"><a href="'.$linkurl.'" class="flickr-home" target="_blank">'.$linktext.'</a></div>';}?>
  557.         </div><!-- end .flickr_badge_wrapper -->
  558.        
  559.    
  560.        <?php           
  561.        echo $after_widget;
  562.    }
  563.  
  564.    function update($new_instance, $old_instance) {                
  565.        return $new_instance;
  566.    }
  567.  
  568.    function form($instance) {
  569.         $title = esc_attr($instance['title']);
  570.         $id = esc_attr($instance['id']);
  571.         $linktext = esc_attr($instance['linktext']);
  572.         $linkurl = esc_attr($instance['linkurl']);
  573.         $number = esc_attr($instance['number']);
  574.         $type = esc_attr($instance['type']);
  575.         $sorting = esc_attr($instance['sorting']);
  576.         ?>
  577.        
  578.          <p>
  579.             <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:','piha'); ?></label>
  580.             <input type="text" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $title; ?>" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" />
  581.         </p>
  582.  
  583.         <p>
  584.             <label for="<?php echo $this->get_field_id('id'); ?>"><?php _e('Flickr ID (<a href="http://www.idgettr.com" target="_blank">idGettr</a>):','piha'); ?></label>
  585.             <input type="text" name="<?php echo $this->get_field_name('id'); ?>" value="<?php echo $id; ?>" class="widefat" id="<?php echo $this->get_field_id('id'); ?>" />
  586.         </p>
  587.  
  588.         <p>
  589.             <label for="<?php echo $this->get_field_id('linktext'); ?>"><?php _e('Flickr Profile Link Text:','piha'); ?></label>
  590.             <input type="text" name="<?php echo $this->get_field_name('linktext'); ?>" value="<?php echo $linktext; ?>" class="widefat" id="<?php echo $this->get_field_id('linktext'); ?>" />
  591.         </p>
  592.        
  593.         <p>
  594.             <label for="<?php echo $this->get_field_id('linkurl'); ?>"><?php _e('Flickr Profile URL:','piha'); ?></label>
  595.             <input type="text" name="<?php echo $this->get_field_name('linkurl'); ?>" value="<?php echo $linkurl; ?>" class="widefat" id="<?php echo $this->get_field_id('linkurl'); ?>" />
  596.         </p>
  597.  
  598.         <p>
  599.             <label for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of photos:','piha'); ?></label>
  600.             <select name="<?php echo $this->get_field_name('number'); ?>" class="widefat" id="<?php echo $this->get_field_id('number'); ?>">
  601.                 <?php for ( $i = 1; $i <= 10; $i += 1) { ?>
  602.                 <option value="<?php echo $i; ?>" <?php if($number == $i){ echo "selected='selected'";} ?>><?php echo $i; ?></option>
  603.                 <?php } ?>
  604.             </select>
  605.         </p>
  606.  
  607.         <p>
  608.             <label for="<?php echo $this->get_field_id('type'); ?>"><?php _e('Choose user or group:','piha'); ?></label>
  609.             <select name="<?php echo $this->get_field_name('type'); ?>" class="widefat" id="<?php echo $this->get_field_id('type'); ?>">
  610.                 <option value="user" <?php if($type == "user"){ echo "selected='selected'";} ?>><?php _e('User', 'piha'); ?></option>
  611.                 <option value="group" <?php if($type == "group"){ echo "selected='selected'";} ?>><?php _e('Group', 'piha'); ?></option>            
  612.             </select>
  613.         </p>
  614.         <p>
  615.             <label for="<?php echo $this->get_field_id('sorting'); ?>"><?php _e('Show latest or random pictures:','piha'); ?></label>
  616.             <select name="<?php echo $this->get_field_name('sorting'); ?>" class="widefat" id="<?php echo $this->get_field_id('sorting'); ?>">
  617.                 <option value="latest" <?php if($sorting == "latest"){ echo "selected='selected'";} ?>><?php _e('Latest', 'piha'); ?></option>
  618.                 <option value="random" <?php if($sorting == "random"){ echo "selected='selected'";} ?>><?php _e('Random', 'piha'); ?></option>            
  619.             </select>
  620.         </p>
  621.         <?php
  622.     }
  623. }
  624.  
  625. register_widget('piha_flickr');
  626.  
  627. /*-----------------------------------------------------------------------------------*/
  628. /* Include a custom Video Widget
  629. /*-----------------------------------------------------------------------------------*/
  630.  
  631. class piha_video extends WP_Widget {
  632.  
  633.     function piha_video() {
  634.         $widget_ops = array('description' => 'Show a custom featured video.' , 'piha');
  635.  
  636.         parent::WP_Widget(false, __('Video Widget', 'piha'),$widget_ops);
  637.     }
  638.  
  639.     function widget($args, $instance) {  
  640.         extract( $args );
  641.         $title = $instance['title'];
  642.         $embedcode = $instance['embedcode'];
  643.        
  644.         echo $before_widget; ?>
  645.         <?php if($title != '')
  646.             echo '<h3 class="widget-title">'.$title.'</h3>'; ?>
  647.            
  648.         <div class="video_widget">
  649.           <div class="featured-video"><?php echo $embedcode; ?></div>
  650.           </div><!-- end .video_widget -->
  651.    
  652.        <?php           
  653.        echo $after_widget;
  654.    }
  655.  
  656.    function update($new_instance, $old_instance) {                
  657.        return $new_instance;
  658.    }
  659.  
  660.    function form($instance) {
  661.         $title = esc_attr($instance['title']);
  662.         $embedcode = esc_attr($instance['embedcode']);
  663.         ?>
  664.        
  665.          <p>
  666.             <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:','piha'); ?></label>
  667.             <input type="text" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $title; ?>" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" />
  668.         </p>
  669.  
  670.         <p>
  671.             <label for="<?php echo $this->get_field_id('id'); ?>"><?php _e('Video embed code:','piha'); ?></label>
  672.                 <textarea name="<?php echo $this->get_field_name('embedcode'); ?>" class="widefat" rows="6" id="<?php echo $this->get_field_id('embedcode'); ?>"><?php echo( $embedcode ); ?></textarea>
  673.         </p>
  674.  
  675.         <?php
  676.     }
  677. }
  678.  
  679. register_widget('piha_video');
  680.  
  681. /*-----------------------------------------------------------------------------------*/
  682. /* Including a custom Social Media Widget
  683. /*-----------------------------------------------------------------------------------*/
  684.  
  685.  class piha_sociallinks extends WP_Widget {
  686.  
  687.     function piha_sociallinks() {
  688.         $widget_ops = array('description' => 'Link to your social profiles.' , 'piha');
  689.  
  690.         parent::WP_Widget(false, __('Social Links Widget', 'piha'),$widget_ops);
  691.     }
  692.  
  693.     function widget($args, $instance) {  
  694.         extract( $args );
  695.         $title = $instance['title'];
  696.         $twitter = $instance['twitter'];
  697.         $facebook = $instance['facebook'];
  698.         $googleplus = $instance['googleplus'];
  699.         $flickr = $instance['flickr'];
  700.         $picasa = $instance['picasa'];
  701.         $fivehundredpx = $instance['fivehundredpx'];
  702.         $delicious = $instance['delicious'];
  703.         $youtube = $instance['youtube'];
  704.         $vimeo = $instance['vimeo'];
  705.         $dribbble = $instance['dribbble'];
  706.         $ffffound = $instance['ffffound'];
  707.         $pinterest = $instance['pinterest'];
  708.         $zootool = $instance['zootool'];
  709.         $behance = $instance['behance'];
  710.         $squidoo = $instance['squidoo'];
  711.         $slideshare = $instance['slideshare'];
  712.         $lastfm = $instance['lastfm'];
  713.         $grooveshark = $instance['grooveshark'];
  714.         $soundcloud = $instance['soundcloud'];
  715.         $foursquare = $instance['foursquare'];
  716.         $gowalla = $instance['gowalla'];
  717.         $linkedin = $instance['linkedin'];
  718.         $xing = $instance['xing'];
  719.         $wordpress = $instance['wordpress'];
  720.         $tumblr = $instance['tumblr'];
  721.         $rss = $instance['rss'];
  722.         $rsscomments = $instance['rsscomments'];
  723.         $target = $instance['target'];
  724.        
  725.        
  726.         echo $before_widget; ?>
  727.         <?php if($title != '')
  728.             echo '<h3 class="widget-title">'.$title.'</h3>'; ?>
  729.            
  730.         <ul class="sociallinks">
  731.             <?php
  732.             if($twitter != '' && $target != ''){
  733.                 echo '<li><a href="'.$twitter.'" class="twitter" title="Twitter" target="_blank">Twitter</a></li>';
  734.             } elseif($twitter != '') {
  735.                 echo '<li><a href="'.$twitter.'" class="twitter" title="Twitter">Twitter</a></li>';
  736.             }
  737.             ?>
  738.             <?php
  739.             if($facebook != '' && $target != ''){
  740.                 echo '<li><a href="'.$facebook.'" class="facebook" title="Facebook" target="_blank">Facebook</a></li>';
  741.             } elseif($facebook != '') {
  742.                 echo '<li><a href="'.$facebook.'" class="facebook" title="Facebook">Facebook</a></li>';
  743.             }
  744.             ?>
  745.             <?php
  746.             if($googleplus != '' && $target != ''){
  747.                 echo '<li><a href="'.$googleplus.'" class="googleplus" title="Google+" target="_blank">Google+</a></li>';
  748.             } elseif($googleplus != '') {
  749.                 echo '<li><a href="'.$googleplus.'" class="googleplus" title="Google+">Google+</a></li>';
  750.             }
  751.             ?>
  752.             <?php if($flickr != '' && $target != ''){
  753.                 echo '<li><a href="'.$flickr.'" class="flickr" title="Flickr" target="_blank">Flickr</a></li>';
  754.             } elseif($flickr != '') {
  755.                 echo '<li><a href="'.$flickr.'" class="flickr" title="Flickr">Flickr</a></li>';
  756.             }
  757.             ?>
  758.        
  759.             <?php if($picasa != '' && $target != ''){
  760.                 echo '<li><a href="'.$picasa.'" class="picasa" title="Picasa" target="_blank">Picasa</a></li>';
  761.             } elseif($picasa != '') {
  762.                 echo '<li><a href="'.$picasa.'" class="picasa" title="Picasa">Picasa</a></li>';
  763.             }
  764.             ?>
  765.            
  766.             <?php if($fivehundredpx != '' && $target != ''){
  767.                 echo '<li><a href="'.$fivehundredpx.'" class="fivehundredpx" title="500px" target="_blank">500px</a></li>';
  768.             } elseif($fivehundredpx != '') {
  769.                 echo '<li><a href="'.$fivehundredpx.'" class="fivehundredpx" title="500px">500px</a></li>';
  770.             }
  771.             ?> 
  772.             <?php if($delicious != '' && $target != ''){
  773.             echo '<li><a href="'.$delicious.'" class="delicious" title="Delicious" target="_blank">Delicious</a></li>';
  774.             } elseif($delicious != '') {
  775.                 echo '<li><a href="'.$delicious.'" class="delicious" title="Delicious">Delicious</a></li>';
  776.             }
  777.             ?>
  778.             <?php if($youtube != '' && $target != ''){
  779.             echo '<li><a href="'.$youtube.'" class="youtube" title="YouTube" target="_blank">YouTube</a></li>';
  780.             } elseif($youtube != '') {
  781.                 echo '<li><a href="'.$youtube.'" class="youtube" title="YouTube">YouTube</a></li>';
  782.             }
  783.             ?>
  784.             <?php if($vimeo != '' && $target != ''){
  785.             echo '<li><a href="'.$vimeo.'" class="vimeo" title="Vimeo" target="_blank">Vimeo</a></li>';
  786.             } elseif($vimeo != '') {
  787.                 echo '<li><a href="'.$vimeo.'" class="vimeo" title="Vimeo">Vimeo</a></li>';
  788.             }
  789.             ?>
  790.             <?php if($dribbble != '' && $target != ''){
  791.             echo '<li><a href="'.$dribbble.'" class="dribbble" title="Dribbble" target="_blank">Dribbble</a></li>';
  792.             } elseif($dribbble != '') {
  793.                 echo '<li><a href="'.$dribbble.'" class="dribbble" title="Dribbble">Dribbble</a></li>';
  794.             }
  795.             ?>
  796.             <?php if($ffffound != '' && $target != ''){
  797.             echo '<li><a href="'.$ffffound.'" class="ffffound" title="Ffffound" target="_blank">Ffffound</a></li>';
  798.             } elseif($ffffound != '') {
  799.                 echo '<li><a href="'.$ffffound.'" class="ffffound" title="Ffffound">Ffffound</a></li>';
  800.             }
  801.             ?>
  802.             <?php if($pinterest != '' && $target != ''){
  803.             echo '<li><a href="'.$pinterest.'" class="pinterest" title="Pinterest" target="_blank">Pinterest</a></li>';
  804.             } elseif($pinterest != '') {
  805.                 echo '<li><a href="'.$pinterest.'" class="pinterest" title="Pinterest">Pinterest</a></li>';
  806.             }
  807.             ?>
  808.             <?php if($zootool != '' && $target != ''){
  809.                 echo '<li><a href="'.$zootool.'" class="zootool" title="Zootool" target="_blank">Zootool</a></li>';
  810.             } elseif($zootool != '') {
  811.                 echo '<li><a href="'.$zootool.'" class="zootool" title="Zootool">Zootool</a></li>';
  812.             }
  813.             ?>
  814.             <?php if($behance != '' && $target != ''){
  815.                 echo '<li><a href="'.$behance.'" class="behance" title="Behance Network" target="_blank">Behance Network</a></li>';
  816.             } elseif($behance != '') {
  817.                 echo '<li><a href="'.$behance.'" class="behance" title="Behance Network">Behance Network</a></li>';
  818.             }
  819.             ?>
  820.             <?php if($squidoo != '' && $target != ''){
  821.                 echo '<li><a href="'.$squidoo.'" class="squidoo" title="Squidoo" target="_blank">Squidoo</a></li>';
  822.             } elseif($squidoo != '') {
  823.                 echo '<li><a href="'.$squidoo.'" class="squidoo" title="Squidoo">Squidoo</a></li>';
  824.             }
  825.             ?>
  826.             <?php if($slideshare != '' && $target != ''){
  827.                 echo '<li><a href="'.$slideshare.'" class="slideshare" title="Slideshare" target="_blank">Slideshare</a></li>';
  828.             } elseif($slideshare != '') {
  829.                 echo '<li><a href="'.$slideshare.'" class="slideshare" title="Slideshare">Slideshare</a></li>';
  830.             }
  831.             ?>
  832.             <?php if($lastfm != '' && $target != ''){
  833.                 echo '<li><a href="'.$lastfm.'" class="lastfm" title="Lastfm" target="_blank">Lastfm</a></li>';
  834.             } elseif($lastfm != '') {
  835.                 echo '<li><a href="'.$lastfm.'" class="lastfm" title="Lastfm">Lastfm</a></li>';
  836.             }
  837.             ?>
  838.             <?php if($grooveshark != '' && $target != ''){
  839.                 echo '<li><a href="'.$grooveshark.'" class="grooveshark" title="Grooveshark" target="_blank">Grooveshark</a></li>';
  840.             } elseif($grooveshark != '') {
  841.                 echo '<li><a href="'.$grooveshark.'" class="grooveshark" title="Grooveshark">Grooveshark</a></li>';
  842.             }
  843.             ?>
  844.             <?php if($soundcloud != '' && $target != ''){
  845.                 echo '<li><a href="'.$soundcloud.'" class="soundcloud" title="Soundcloud" target="_blank">Soundcloud</a></li>';
  846.             } elseif($soundcloud != '') {
  847.                 echo '<li><a href="'.$soundcloud.'" class="soundcloud" title="Soundcloud">Soundcloud</a></li>';
  848.             }
  849.             ?>
  850.             <?php if($foursquare != '' && $target != ''){
  851.                 echo '<li><a href="'.$foursquare.'" class="foursquare" title="Foursquare" target="_blank">Foursquare</a></li>';
  852.             } elseif($foursquare != '') {
  853.                 echo '<li><a href="'.$foursquare.'" class="foursquare" title="Foursquare">Foursquare</a></li>';
  854.             }
  855.             ?>
  856.             <?php if($gowalla != '' && $target != ''){
  857.                 echo '<li><a href="'.$gowalla.'" class="gowalla" title="Gowalla" target="_blank">Gowalla</a></li>';
  858.             } elseif($gowalla != '') {
  859.                 echo '<li><a href="'.$gowalla.'" class="gowalla" title="Gowalla">Gowalla</a></li>';
  860.             }
  861.             ?>
  862.             <?php if($linkedin != '' && $target != ''){
  863.                 echo '<li><a href="'.$linkedin.'" class="linkedin" title="LinkedIn" target="_blank">LinkedIn</a></li>';
  864.             } elseif($linkedin != '') {
  865.                 echo '<li><a href="'.$linkedin.'" class="linkedin" title="LinkedIn">LinkedIn</a></li>';
  866.             }
  867.             ?>
  868.             <?php if($xing != '' && $target != ''){
  869.                 echo '<li><a href="'.$xing.'" class="xing" title="Xing" target="_blank">Xing</a></li>';
  870.             } elseif($xing != '') {
  871.                 echo '<li><a href="'.$xing.'" class="xing" title="Xing">Xing</a></li>';
  872.             }
  873.             ?>
  874.             <?php if($wordpress != '' && $target != ''){
  875.                 echo '<li><a href="'.$wordpress.'" class="wordpress" title="WordPress" target="_blank">WordPress</a></li>';
  876.             } elseif($wordpress != '') {
  877.                 echo '<li><a href="'.$wordpress.'" class="wordpress" title="WordPress">WordPress</a></li>';
  878.             }
  879.             ?>
  880.             <?php if($tumblr != '' && $target != ''){
  881.                 echo '<li><a href="'.$tumblr.'" class="tumblr" title="Tumblr" target="_blank">Tumblr</a></li>';
  882.             } elseif($tumblr != '') {
  883.                 echo '<li><a href="'.$tumblr.'" class="tumblr" title="Tumblr">Tumblr</a></li>';
  884.             }
  885.             ?>
  886.             <?php if($rss != '' && $target != ''){
  887.                 echo '<li><a href="'.$rss.'" class="rss" title="RSS Feed" target="_blank">RSS Feed</a></li>';
  888.             } elseif($rss != '') {
  889.                 echo '<li><a href="'.$rss.'" class="rss" title="RSS Feed">RSS Feed</a></li>';
  890.             }
  891.             ?>
  892.             <?php if($rsscomments != '' && $target != ''){
  893.                 echo '<li><a href="'.$rsscomments.'" class="rsscomments" title="RSS Comments" target="_blank">RSS Comments</a></li>';
  894.             } elseif($rsscomments != '') {
  895.                 echo '<li><a href="'.$rsscomments.'" class="rsscomments" title="RSS Comments">RSS Comments</a></li>';
  896.             }
  897.             ?> 
  898.         </ul><!-- end .sociallinks -->
  899.  
  900.        <?php           
  901.        echo $after_widget;
  902.    }
  903.  
  904.    function update($new_instance, $old_instance) {                
  905.        return $new_instance;
  906.    }
  907.  
  908.    function form($instance) {
  909.         $title = esc_attr($instance['title']);
  910.         $twitter = esc_attr($instance['twitter']);
  911.         $facebook = esc_attr($instance['facebook']);
  912.         $googleplus = esc_attr($instance['googleplus']);
  913.         $flickr = esc_attr($instance['flickr']);
  914.         $picasa = esc_attr($instance['picasa']);
  915.         $fivehundredpx = esc_attr($instance['fivehundredpx']);
  916.         $delicious = esc_attr($instance['delicious']);
  917.         $youtube = esc_attr($instance['youtube']);
  918.         $vimeo = esc_attr($instance['vimeo']);
  919.         $dribbble = esc_attr($instance['dribbble']);
  920.         $ffffound = esc_attr($instance['ffffound']);
  921.         $pinterest = esc_attr($instance['pinterest']);
  922.         $zootool = esc_attr($instance['zootool']);
  923.         $behance = esc_attr($instance['behance']);
  924.         $squidoo = esc_attr($instance['squidoo']);
  925.         $slideshare = esc_attr($instance['slideshare']);
  926.         $lastfm = esc_attr($instance['lastfm']);
  927.         $grooveshark = esc_attr($instance['grooveshark']);
  928.         $soundcloud = esc_attr($instance['soundcloud']);
  929.         $foursquare = esc_attr($instance['foursquare']);
  930.         $gowalla = esc_attr($instance['gowalla']);
  931.         $linkedin = esc_attr($instance['linkedin']);
  932.         $xing = esc_attr($instance['xing']);
  933.         $wordpress = esc_attr($instance['wordpress']);
  934.         $tumblr = esc_attr($instance['tumblr']);
  935.         $rss = esc_attr($instance['rss']);
  936.         $rsscomments = esc_attr($instance['rsscomments']);
  937.         $target = esc_attr($instance['target']);
  938.        
  939.         ?>
  940.          
  941.          <p>
  942.             <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:','piha'); ?></label>
  943.             <input type="text" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $title; ?>" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" />
  944.         </p>
  945.        
  946.         <p>
  947.             <label for="<?php echo $this->get_field_id('twitter'); ?>"><?php _e('Twitter URL:','piha'); ?></label>
  948.             <input type="text" name="<?php echo $this->get_field_name('twitter'); ?>" value="<?php echo $twitter; ?>" class="widefat" id="<?php echo $this->get_field_id('twitter'); ?>" />
  949.         </p>
  950.        
  951.         <p>
  952.             <label for="<?php echo $this->get_field_id('facebook'); ?>"><?php _e('Facebook URL:','piha'); ?></label>
  953.             <input type="text" name="<?php echo $this->get_field_name('facebook'); ?>" value="<?php echo $facebook; ?>" class="widefat" id="<?php echo $this->get_field_id('facebook'); ?>" />
  954.         </p>
  955.        
  956.         <p>
  957.             <label for="<?php echo $this->get_field_id('googleplus'); ?>"><?php _e('Google+ URL:','piha'); ?></label>
  958.             <input type="text" name="<?php echo $this->get_field_name('googleplus'); ?>" value="<?php echo $googleplus; ?>" class="widefat" id="<?php echo $this->get_field_id('googleplus'); ?>" />
  959.         </p>
  960.        
  961.         <p>
  962.             <label for="<?php echo $this->get_field_id('flickr'); ?>"><?php _e('Flickr URL:','piha'); ?></label>
  963.             <input type="text" name="<?php echo $this->get_field_name('flickr'); ?>" value="<?php echo $flickr; ?>" class="widefat" id="<?php echo $this->get_field_id('flickr'); ?>" />
  964.         </p>
  965.        
  966.         <p>
  967.             <label for="<?php echo $this->get_field_id('picasa'); ?>"><?php _e('Picasa URL:','piha'); ?></label>
  968.             <input type="text" name="<?php echo $this->get_field_name('picasa'); ?>" value="<?php echo $picasa; ?>" class="widefat" id="<?php echo $this->get_field_id('picasa'); ?>" />
  969.         </p>
  970.        
  971.         <p>
  972.             <label for="<?php echo $this->get_field_id('fivehundredpx'); ?>"><?php _e('500px URL:','piha'); ?></label>
  973.             <input type="text" name="<?php echo $this->get_field_name('fivehundredpx'); ?>" value="<?php echo $fivehundredpx; ?>" class="widefat" id="<?php echo $this->get_field_id('fivehundredpx'); ?>" />
  974.         </p>
  975.        
  976.         <p>
  977.             <label for="<?php echo $this->get_field_id('delicious'); ?>"><?php _e('Delicious URL:','piha'); ?></label>
  978.             <input type="text" name="<?php echo $this->get_field_name('delicious'); ?>" value="<?php echo $delicious; ?>" class="widefat" id="<?php echo $this->get_field_id('delicious'); ?>" />
  979.         </p>
  980.        
  981.         <p>
  982.             <label for="<?php echo $this->get_field_id('youtube'); ?>"><?php _e('YouTube URL:','piha'); ?></label>
  983.             <input type="text" name="<?php echo $this->get_field_name('youtube'); ?>" value="<?php echo $youtube; ?>" class="widefat" id="<?php echo $this->get_field_id('youtube'); ?>" />
  984.         </p>
  985.        
  986.         <p>
  987.             <label for="<?php echo $this->get_field_id('vimeo'); ?>"><?php _e('Vimeo URL:','piha'); ?></label>
  988.             <input type="text" name="<?php echo $this->get_field_name('vimeo'); ?>" value="<?php echo $vimeo; ?>" class="widefat" id="<?php echo $this->get_field_id('vimeo'); ?>" />
  989.         </p>
  990.        
  991.         <p>
  992.             <label for="<?php echo $this->get_field_id('dribbble'); ?>"><?php _e('Dribbble URL:','piha'); ?></label>
  993.             <input type="text" name="<?php echo $this->get_field_name('dribbble'); ?>" value="<?php echo $dribbble; ?>" class="widefat" id="<?php echo $this->get_field_id('dribbble'); ?>" />
  994.         </p>
  995.        
  996.         <p>
  997.             <label for="<?php echo $this->get_field_id('ffffound'); ?>"><?php _e('Ffffound URL:','piha'); ?></label>
  998.             <input type="text" name="<?php echo $this->get_field_name('ffffound'); ?>" value="<?php echo $ffffound; ?>" class="widefat" id="<?php echo $this->get_field_id('ffffound'); ?>" />
  999.         </p>
  1000.        
  1001.         <p>
  1002.             <label for="<?php echo $this->get_field_id('pinterest'); ?>"><?php _e('Pinterest URL:','piha'); ?></label>
  1003.             <input type="text" name="<?php echo $this->get_field_name('pinterest'); ?>" value="<?php echo $pinterest; ?>" class="widefat" id="<?php echo $this->get_field_id('pinterest'); ?>" />
  1004.         </p>
  1005.  
  1006.         <p>
  1007.             <label for="<?php echo $this->get_field_id('zootool'); ?>"><?php _e('Zootool URL:','piha'); ?></label>
  1008.             <input type="text" name="<?php echo $this->get_field_name('zootool'); ?>" value="<?php echo $zootool; ?>" class="widefat" id="<?php echo $this->get_field_id('zootool'); ?>" />
  1009.         </p>
  1010.        
  1011.         <p>
  1012.             <label for="<?php echo $this->get_field_id('behance'); ?>"><?php _e('Behance Network URL:','piha'); ?></label>
  1013.             <input type="text" name="<?php echo $this->get_field_name('behance'); ?>" value="<?php echo $behance; ?>" class="widefat" id="<?php echo $this->get_field_id('behance'); ?>" />
  1014.         </p>
  1015.        
  1016.         <p>
  1017.             <label for="<?php echo $this->get_field_id('squidoo'); ?>"><?php _e('Squidoo URL:','piha'); ?></label>
  1018.             <input type="text" name="<?php echo $this->get_field_name('squidoo'); ?>" value="<?php echo $squidoo; ?>" class="widefat" id="<?php echo $this->get_field_id('squidoo'); ?>" />
  1019.         </p>
  1020.        
  1021.         <p>
  1022.             <label for="<?php echo $this->get_field_id('slideshare'); ?>"><?php _e('Slideshare URL:','piha'); ?></label>
  1023.             <input type="text" name="<?php echo $this->get_field_name('slideshare'); ?>" value="<?php echo $slideshare; ?>" class="widefat" id="<?php echo $this->get_field_id('slideshare'); ?>" />
  1024.         </p>
  1025.        
  1026.         <p>
  1027.             <label for="<?php echo $this->get_field_id('lastfm'); ?>"><?php _e('Last.fm URL:','piha'); ?></label>
  1028.             <input type="text" name="<?php echo $this->get_field_name('lastfm'); ?>" value="<?php echo $lastfm; ?>" class="widefat" id="<?php echo $this->get_field_id('lastfm'); ?>" />
  1029.         </p>
  1030.        
  1031.         <p>
  1032.             <label for="<?php echo $this->get_field_id('grooveshark'); ?>"><?php _e('Grooveshark URL:','piha'); ?></label>
  1033.             <input type="text" name="<?php echo $this->get_field_name('grooveshark'); ?>" value="<?php echo $grooveshark; ?>" class="widefat" id="<?php echo $this->get_field_id('grooveshark'); ?>" />
  1034.         </p>
  1035.        
  1036.         <p>
  1037.             <label for="<?php echo $this->get_field_id('soundcloud'); ?>"><?php _e('Soundcloud URL:','piha'); ?></label>
  1038.             <input type="text" name="<?php echo $this->get_field_name('soundcloud'); ?>" value="<?php echo $soundcloud; ?>" class="widefat" id="<?php echo $this->get_field_id('soundcloud'); ?>" />
  1039.         </p>
  1040.        
  1041.         <p>
  1042.             <label for="<?php echo $this->get_field_id('foursquare'); ?>"><?php _e('Foursquare URL:','piha'); ?></label>
  1043.             <input type="text" name="<?php echo $this->get_field_name('foursquare'); ?>" value="<?php echo $foursquare; ?>" class="widefat" id="<?php echo $this->get_field_id('foursquare'); ?>" />
  1044.         </p>
  1045.        
  1046.         <p>
  1047.             <label for="<?php echo $this->get_field_id('gowalla'); ?>"><?php _e('Gowalla URL:','piha'); ?></label>
  1048.             <input type="text" name="<?php echo $this->get_field_name('gowalla'); ?>" value="<?php echo $gowalla; ?>" class="widefat" id="<?php echo $this->get_field_id('gowalla'); ?>" />
  1049.         </p>
  1050.        
  1051.         <p>
  1052.             <label for="<?php echo $this->get_field_id('linkedin'); ?>"><?php _e('Linkedin URL:','piha'); ?></label>
  1053.             <input type="text" name="<?php echo $this->get_field_name('linkedin'); ?>" value="<?php echo $linkedin; ?>" class="widefat" id="<?php echo $this->get_field_id('linkedin'); ?>" />
  1054.         </p>
  1055.        
  1056.         <p>
  1057.             <label for="<?php echo $this->get_field_id('xing'); ?>"><?php _e('Xing URL:','piha'); ?></label>
  1058.             <input type="text" name="<?php echo $this->get_field_name('xing'); ?>" value="<?php echo $xing; ?>" class="widefat" id="<?php echo $this->get_field_id('xing'); ?>" />
  1059.         </p>
  1060.        
  1061.         <p>
  1062.             <label for="<?php echo $this->get_field_id('wordpress'); ?>"><?php _e('WordPress URL:','piha'); ?></label>
  1063.             <input type="text" name="<?php echo $this->get_field_name('wordpress'); ?>" value="<?php echo $wordpress; ?>" class="widefat" id="<?php echo $this->get_field_id('wordpress'); ?>" />
  1064.         </p>
  1065.        
  1066.         <p>
  1067.             <label for="<?php echo $this->get_field_id('tumblr'); ?>"><?php _e('Tumblr URL:','piha'); ?></label>
  1068.             <input type="text" name="<?php echo $this->get_field_name('tumblr'); ?>" value="<?php echo $tumblr; ?>" class="widefat" id="<?php echo $this->get_field_id('tumblr'); ?>" />
  1069.         </p>
  1070.        
  1071.         <p>
  1072.             <label for="<?php echo $this->get_field_id('rss'); ?>"><?php _e('RSS-Feed URL:','piha'); ?></label>
  1073.             <input type="text" name="<?php echo $this->get_field_name('rss'); ?>" value="<?php echo $rss; ?>" class="widefat" id="<?php echo $this->get_field_id('rss'); ?>" />
  1074.         </p>
  1075.        
  1076.         <p>
  1077.             <label for="<?php echo $this->get_field_id('rsscomments'); ?>"><?php _e('RSS for Comments URL:','piha'); ?></label>
  1078.             <input type="text" name="<?php echo $this->get_field_name('rsscomments'); ?>" value="<?php echo $rsscomments; ?>" class="widefat" id="<?php echo $this->get_field_id('rsscomments'); ?>" />
  1079.         </p>
  1080.          
  1081.         <p>
  1082.             <input class="checkbox" type="checkbox" <?php checked( $instance['target'], true ); ?> id="<?php echo $this->get_field_id('target'); ?>" name="<?php echo $this->get_field_name('target'); ?>" <?php checked( $target, 'on' ); ?>> <?php _e('Open all links in a new browser tab', 'piha'); ?></input>
  1083.         </p>
  1084.        
  1085.         <?php
  1086.     }
  1087. }
  1088.  
  1089. register_widget('piha_sociallinks');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement