$11 GRAYBYTE WORDPRESS FILE MANAGER $34

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.23
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/bravrvjk/kigalix.com/wp-content/themes/houzez/framework/widgets/

HOME
Current File : /home/bravrvjk/kigalix.com/wp-content/themes/houzez/framework/widgets//houzez-flickr-photos.php
<?php
/*
 * Widget Name: Flickr Photos
 * Version: 1.0
 * Author: Waqas Riaz
 * Author URI: http://favethemes.com/
 */

class houzez_Flickr_Feeds extends WP_Widget {

	/**
	 * Register widget
	**/
	public function __construct() {
		
		parent::__construct(
	 		'houzez_flickr_feeds', // Base ID
			esc_html__( 'HOUZEZ: Flickr', 'houzez' ), // Name
			array( 'description' => esc_html__( 'Show photos from Flickr.', 'houzez' ), ) // Args
		);
		
	}
	

	function widget($args, $instance) {

		$instance = wp_parse_args( (array) $instance );

		extract( $args );

		$allowed_html_array = array(
			'div' => array(
				'id' => array(),
				'class' => array()
			),
			'h3' => array(
				'class' => array()
			)
		);

		$title = apply_filters( 'widget_title', $instance['title'] );

		echo wp_kses( $before_widget, $allowed_html_array );

		if ( ! empty( $title ) ) {
			echo wp_kses( $before_title, $allowed_html_array ) . $title . wp_kses( $after_title, $allowed_html_array );
		}

		$photos = $this->get_photos( $instance['userid'], $instance['count'] );

		if ( !empty( $photos ) ) {
			$style = 'style="width: '.esc_attr( $instance['t_width'] ).'px; height: '.esc_attr( $instance['t_height']).'px;"';

			echo '<div class="widget-flickr-thumbs">';
				echo '<div class="widget-body">';
					echo '<div class="module-body">';
						echo '<div class="flickr-thumbs clearfix">';
							
							foreach ( $photos as $photo ) {
								echo '<a href="'.esc_url( $photo['img_url'] ).'" title="'.esc_attr( $photo['title'] ).'" target="_blank"><img src="'.esc_url( $photo['img_src'] ).'" alt="'.esc_attr( $photo['title'] ).'" '.$style.'/></a>';
							}

						echo '</div>';
					echo '</div>';
				echo '</div>';
			echo '</div>';

		}

		echo wp_kses( $after_widget, $allowed_html_array );
	}

	function get_photos( $id, $count = 8 ) {
		if ( empty( $id ) )
			return false;

		$transient_key = md5( 'favethemes_flickr_cache_' . $id . $count );
		$cached = get_transient( $transient_key );
		if ( !empty( $cached ) ) {
			return $cached;
		}

		$output = array();
		$rss = 'http://api.flickr.com/services/feeds/photos_public.gne?id='.esc_attr( $id ).'&lang=en-us&format=rss_200';
		$rss = fetch_feed( $rss );

		if ( is_wp_error( $rss ) ) {
			//check for group feed
			$rss = 'http://api.flickr.com/services/feeds/groups_pool.gne?id='.esc_attr( $id ).'&lang=en-us&format=rss_200';
			$rss = fetch_feed( $rss );

		}
		if ( !is_wp_error( $rss ) ) {
			$maxitems = $rss->get_item_quantity( $count );
			$rss_items = $rss->get_items( 0, $maxitems );

			foreach ( $rss_items as $item ) {
				$temp = array();
				$temp['img_url'] = esc_url( $item->get_permalink() );
				$temp['title'] = esc_html( $item->get_title() );
				$content =  $item->get_content();
				preg_match_all( "/<IMG.+?SRC=[\"']([^\"']+)/si", $content, $sub, PREG_SET_ORDER );
				$photo_url = str_replace( "_m.jpg", "_t.jpg", $sub[0][1] );
				$temp['img_src'] = esc_url( $photo_url );
				$output[] = $temp;
			}

			set_transient( $transient_key, $output, 60 * 60 * 24 );
		}


		return $output;
	}

	

	function update($new_instance, $old_instance)
	{

		$instance = array();
		$instance['title'] = strip_tags( $new_instance['title'] );
		$instance['userid'] = strip_tags( $new_instance['userid'] );
		$instance['count'] = absint( $new_instance['count'] );
		$instance['t_width'] = absint( $new_instance['t_width'] );
		$instance['t_height'] = absint( $new_instance['t_height'] );
		return $new_instance;

	}



	function form($instance)
	{

		$defaults = array(
		 'title' 	 => 'Flickr Photos',
		 'userid' 	 => '',
		 't_height'  => '90',
		 't_width' 	 => '120',
		 'count' 	 => 6
	 );
	 $instance = wp_parse_args( (array) $instance, $defaults );
	 ?>

		

		<p>
			<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title', 'houzez' ); ?>:</label>
			<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>" />
		</p>
		<p>
			<label for="<?php echo esc_attr( $this->get_field_id( 'userid' ) ); ?>"><?php esc_html_e( 'Flickr ID', 'houzez' ); ?>:</label> <small><a href="http://idgettr.com/" target="_blank"><?php esc_html_e( 'What\'s my Flickr ID?', 'houzez' ); ?></a></small>
			<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'userid' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'userid' ) ); ?>" type="text" value="<?php echo esc_attr( $instance['userid'] ); ?>" />
			<small class="howto"><?php esc_html_e( 'Example ID: 23100287@N07', 'houzez' ); ?></small>
		</p>
		<p>
			<label for="<?php echo esc_attr( $this->get_field_id( 'count' ) ); ?>"><?php esc_html_e( 'Number of photos', 'houzez' ); ?>:</label>
			<input class="small-text" type="text" value="<?php echo absint( $instance['count'] ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'count' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'count' ) ); ?>" />
		</p>

		<p>
			<label for="<?php echo esc_attr( $this->get_field_id( 't_width' ) ); ?>"><?php esc_html_e( 'Thumbnail width', 'houzez' ); ?>:</label>
			<input class="small-text" type="text" value="<?php echo absint( $instance['t_width'] ); ?>" id="<?php echo esc_attr( $this->get_field_id( 't_width' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 't_width' ) ); ?>" /> px
		</p>

		<p>
			<label for="<?php echo esc_attr( $this->get_field_id( 't_height' ) ); ?>"><?php esc_html_e( 'Thumbnail height', 'houzez' ); ?>:</label>
			<input class="small-text" type="text" value="<?php echo absint( $instance['t_height'] ); ?>" id="<?php echo esc_attr( $this->get_field_id( 't_height' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 't_height' ) ); ?>" /> px
		</p>

		

	<?php

	}

}

if ( ! function_exists( 'houzez_Flickr_Feeds_loader' ) ) {
    function houzez_Flickr_Feeds_loader (){
     register_widget( 'houzez_Flickr_Feeds' );
    }
     add_action( 'widgets_init', 'houzez_Flickr_Feeds_loader' );
}
?>


Current_dir [ WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
8 May 2025 7.51 AM
bravrvjk / bravrvjk
0755
about.php
4.11 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
advanced-search.php
4.651 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
agency-search.php
3.534 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
agents-search.php
5.709 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
code-banner.php
3.486 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
contact.php
6.288 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
featured-properties.php
5.878 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
houzez-flickr-photos.php
6.108 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
houzez-instagram.php
8.333 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
houzez-login-widget.php
3.999 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
image-banner-300-250.php
4.373 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
latest-posts.php
4.714 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
mortgage-calculator.php
7.044 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
properties-viewed.php
3.939 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
properties.php
9.48 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644
property-taxonomies.php
8.495 KB
28 Apr 2025 7.40 AM
bravrvjk / bravrvjk
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF