GRAYBYTE WORDPRESS FILE MANAGER8229

Server IP : 162.213.255.40 / Your IP : 216.73.216.121
System : Linux server146.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
PHP Version : 8.0.30
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF

HOME

/home/hellrfbn/public_html/wp-content/plugins/jetpack/modules/widgets/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/hellrfbn/public_html/wp-content/plugins/jetpack/modules/widgets//upcoming-events.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
/**
 * Upcoming Events widget
 *
 * It relies on the icalendar-reader library.
 *
 * @package automattic/jetpack
 */

// phpcs:disable Universal.Files.SeparateFunctionsFromOO.Mixed -- TODO: Move classes to appropriately-named class files.

/**
 * Register the widget.
 */
function upcoming_events_register_widgets() {
	register_widget( Jetpack_Upcoming_Events_Widget::class );
}
add_action( 'widgets_init', 'upcoming_events_register_widgets' );

/**
 * Widget class.
 */
class Jetpack_Upcoming_Events_Widget extends WP_Widget {
	/**
	 * Constructor
	 */
	public function __construct() {
		parent::__construct(
			'upcoming_events_widget',
			/** This filter is documented in modules/widgets/facebook-likebox.php */
			apply_filters( 'jetpack_widget_name', __( 'Upcoming Events', 'jetpack' ) ),
			array(
				'description'                 => __( 'Display upcoming events from an iCalendar feed.', 'jetpack' ),
				'customize_selective_refresh' => true,
			)
		);
		if ( is_active_widget( false, false, $this->id_base ) ) {
			add_action( 'wp_head', array( $this, 'css' ) );
		}
	}

	/**
	 * Output CSS in the header everywhere where the widget is active.
	 */
	public function css() {
		?>
<style type="text/css">
.upcoming-events li {
	margin-bottom: 10px;
}
.upcoming-events li span {
	display: block;
}
</style>
		<?php
	}

	/**
	 * Displays the form for this widget on the Widgets page of the WP Admin area.
	 *
	 * @param array $instance Instance configuration.
	 *
	 * @return void
	 */
	public function form( $instance ) {
		$defaults = array(
			'title'    => __( 'Upcoming Events', 'jetpack' ),
			'feed-url' => '',
			'count'    => 3,
		);
		$instance = array_merge( $defaults, (array) $instance );
		?>

		<p>
		<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title:', 'jetpack' ); ?></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( 'feed-url' ) ); ?>"><?php esc_html_e( 'iCalendar Feed URL:', 'jetpack' ); ?></label>
		<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'feed-url' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'feed-url' ) ); ?>" type="text" value="<?php echo esc_attr( $instance['feed-url'] ); ?>" />
		</p>

		<p>
		<label for="<?php echo esc_attr( $this->get_field_id( 'count' ) ); ?>"><?php esc_html_e( 'Items to show:', 'jetpack' ); ?></label>
		<select id="<?php echo esc_attr( $this->get_field_id( 'count' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'count' ) ); ?>">
			<?php for ( $i = 1; $i <= 10; $i++ ) { ?>
				<option <?php selected( $instance['count'], $i ); ?>><?php echo (int) $i; ?></option>
			<?php } ?>
			<option value="0" <?php selected( $instance['count'], 0 ); ?>><?php esc_html_e( 'All', 'jetpack' ); ?></option>
		</select>
		</p>
		<?php
	}

	/**
	 * Deals with the settings when they are saved by the admin.
	 *
	 * @param array $new_instance New configuration values.
	 * @param array $old_instance Old configuration values.
	 *
	 * @return array
	 */
	public function update( $new_instance, $old_instance ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
		$instance             = array();
		$instance['title']    = wp_strip_all_tags( $new_instance['title'] );
		$instance['feed-url'] = wp_strip_all_tags( $new_instance['feed-url'] );
		$instance['count']    = min( absint( $new_instance['count'] ), 10 ); // 10 or less
		return $instance;
	}

	/**
	 * Outputs the HTML for this widget.
	 *
	 * @param array $args     An array of standard parameters for widgets in this theme.
	 * @param array $instance An array of settings for this widget instance.
	 *
	 * @return void Echoes it's output
	 */
	public function widget( $args, $instance ) {
		require_once JETPACK__PLUGIN_DIR . '/_inc/lib/icalendar-reader.php';

		$ical   = new iCalendarReader();
		$events = array();
		if ( ! empty( $instance['feed-url'] ) ) {
			$events = $ical->get_events( $instance['feed-url'], $instance['count'] );
			$events = $this->apply_timezone_offset( $events );
		}
		$ical->timezone = null;

		echo $args['before_widget']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
		if ( ! empty( $instance['title'] ) ) {
			echo $args['before_title']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
			echo esc_html( $instance['title'] );
			echo $args['after_title']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
		}

		if ( empty( $instance['feed-url'] ) ) {
			if ( current_user_can( 'manage_options' ) ) {
				echo '<div class="error-message">';
				esc_html_e( 'The events feed URL is not properly set up in this widget.', 'jetpack' );
				echo '</div>';
			}
		} elseif ( ! $events ) {
			echo '<p>';
			esc_html_e( 'No upcoming events', 'jetpack' );
			echo '</p>';
		} else {
			?>
			<ul class="upcoming-events">
				<?php foreach ( $events as $event ) : ?>
				<li>
					<strong class="event-summary">
						<?php
						echo $ical->escape( stripslashes( $event['SUMMARY'] ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- this method is built to escape.
						?>
					</strong>
					<span class="event-when"><?php echo esc_html( $ical->formatted_date( $event ) ); ?></span>
					<?php if ( ! empty( $event['LOCATION'] ) ) : ?>
						<span class="event-location">
							<?php
							echo $ical->escape( stripslashes( $event['LOCATION'] ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- this method is built to escape.
							?>
						</span>
					<?php endif; ?>
					<?php if ( ! empty( $event['DESCRIPTION'] ) ) : ?>
						<span class="event-description">
							<?php
							echo wp_trim_words( $ical->escape( stripcslashes( $event['DESCRIPTION'] ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- this method is built to escape.
							?>
						</span>
					<?php endif; ?>
				</li>
				<?php endforeach; ?>
			</ul>
			<?php
		}

		echo $args['after_widget']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped

		/** This action is documented in modules/widgets/gravatar-profile.php */
		do_action( 'jetpack_stats_extra', 'widget_view', 'upcoming_events' );
	}

	/**
	 * Left this function here for backward compatibility
	 * just incase a site using jetpack is also using this function
	 *
	 * @param array|false $events Array of events, false on failure.
	 */
	private function apply_timezone_offset( $events ) {
		require_once JETPACK__PLUGIN_DIR . '/_inc/lib/icalendar-reader.php';

		return ( new iCalendarReader() )->apply_timezone_offset( $events );
	}
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
authors
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
contact-info
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
eu-cookie-law
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
facebook-likebox
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
flickr
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
gallery
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
goodreads
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
google-translate
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
image-widget
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
instagram
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
internet-defense-league
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
milestone
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
my-community
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
simple-payments
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
social-icons
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
social-media-icons
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
top-posts
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
wordpress-post-widget
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
.htaccess
0.41 KB
July 23 2025 07:38:28
hellrfbn / hellrfbn
0644
authors.php
8.996 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
blog-stats.php
6.11 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
class-jetpack-eu-cookie-law-widget.php
10.556 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
class-jetpack-instagram-widget.php
24.046 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
contact-info.php
17.948 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
customizer-controls.css
0.161 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
customizer-utils.js
4.057 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
facebook-likebox.php
15.281 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
flickr.php
7.462 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
gallery.php
16.009 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
goodreads.php
8.714 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
google-translate.php
6.449 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
gravatar-profile.css
1.226 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
gravatar-profile.php
16.035 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
image-widget.php
12.09 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
internet-defense-league.php
5.651 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
mailchimp.php
4.288 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
milestone.php
0.338 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
my-community.php
10.931 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
rsslinks-widget.php
10.604 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
simple-payments.php
21.914 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
social-icons.php
22.41 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
social-media-icons.php
10.716 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
top-posts.php
27.647 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
twitter-timeline-admin.js
2.182 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
twitter-timeline.php
19.899 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
upcoming-events.php
6.732 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644
wordpress-post-widget.php
3.71 KB
February 05 2025 15:45:00
hellrfbn / hellrfbn
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF