Sindbad~EG File Manager

Current Path : /var/www/html/wordpress_tahouas/wp-content/themes/newsbt/
Upload File :
Current File : /var/www/html/wordpress_tahouas/wp-content/themes/newsbt/attachment.php

<?php 
/*
 * Security 	: blocking direct access
 * Source		: http://codex.wordpress.org/Theme_Development#Template_Files
*/
defined('ABSPATH') or die("Access Restricted");
get_header(); 
?>	
<div id="content">

	<div class="content-width content-typography <?php echo mwp_csa_border_top(); ?>">

		<?php mwp_display_breadcrumbs(); ?>
				
		<?php if ( have_posts() ) : ?>
				
			<?php while ( have_posts() ) : the_post(); ?>

				<h1 class="title <?php echo mwp_csa_color(); ?>"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>

				<div class="meta"><span class="post-date"><?php the_time('j F Y'); ?></span></div>

				<div class="el-content heading-typography">
					<?php
					$type = get_post_mime_type( $post->ID );
					switch( $type ) {
						
						case 'image/jpeg':
						case 'image/gif':
						case 'image/png':
						case 'image/bmp':
							$att_image = wp_get_attachment_image_src( $post->id, "full");
							$url = $att_image['0'];
							$image = $url;
							if (mwp_option('lightbox-library') == 1) {
									$class = 'class="swipebox"';
							} elseif (mwp_option('lightbox-library') == 2) {
									$class = 'data-lightbox="roadtrip"';
							} elseif (mwp_option('lightbox-library') == 3) {
									$class = 'class="venobox"';
							}
							?>
							<div class="entry-attachment">
								<a <?php echo $class; ?> href="<?php echo $att_image[0];?>" title="Click To see Full size of <?php the_title(); ?>">
									<img class="aligncenter" src="<?php echo $image; ?>"  alt="<?php the_title(); ?>" title="<?php $post->post_excerpt; ?>" />
								</a>
							</div>
							<div class="nav-attachment alignleft"><?php previous_image_link( false, __( '&larr; Previous Photo' , MWP_TEXT_DOMAIN )); ?></div>
							<div class="nav-attachment alignright"><?php next_image_link( false, __( 'Next Photo &rarr;' , MWP_TEXT_DOMAIN )  ); ?></div>
							<?php
						break;
						
						case 'application/pdf':
						case 'application/msword':
						case 'application/vnd.ms-excel':
						case 'application/vnd.ms-powerpoint':
						case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
						case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':
						case 'application/vnd.openxmlformats-officedocument.presentationml.presentation':
							?>
							<div class="gdocsviewer"><iframe class="docview" src="https://docs.google.com/viewer?url=<?php echo wp_get_attachment_url( $post->ID ) ?>&embedded=true" style="border: none;"></iframe></div>
							<div class="clearfix"></div>
							<p><a target="_blank" title="<?php _e( 'Click Right and save' , MWP_TEXT_DOMAIN ); ?>" rel="nofollow" role="button" class="btn btn-success btn-lg" href="<?php echo wp_get_attachment_url( $post->ID ) ?>"><?php _e( 'Download ' , MWP_TEXT_DOMAIN ); ?><?php the_title(); ?></a></p>
							<?php 
						break;
							
						case 'video/mp4':
						case 'video/webm':
						case 'video/ogg':
						case 'video/x-ms-wmv':
						case 'video/x-flv':
							echo do_shortcode( '[video src="'. wp_get_attachment_url( $post->ID ). '"]' );
							?><p><a target="_blank" title="<?php _e( 'Click Right and save' , MWP_TEXT_DOMAIN ); ?>" rel="nofollow" role="button" class="btn btn-success btn-lg" href="<?php echo wp_get_attachment_url( $post->ID ) ?>"><?php _e( 'Download ' , MWP_TEXT_DOMAIN ); ?></a></p><?php
						break;
							
						case 'audio/mpeg':
							echo do_shortcode( '[audio src="'. wp_get_attachment_url( $post->ID ). '"]' );
							?><p><a target="_blank" title="<?php _e( 'Click Right and save' , MWP_TEXT_DOMAIN ); ?>" rel="nofollow" role="button" class="btn btn-success btn-lg" href="<?php echo wp_get_attachment_url( $post->ID ) ?>"><?php _e( 'Download ' , MWP_TEXT_DOMAIN ); ?></a></p><?php
						break;

						default:
							$attachment_ID = mwp_get_attachment_id_from_src(wp_get_attachment_url( $post->ID ));
							$file_url = wp_get_attachment_url( $attachment_ID);	
							$file_type = wp_check_filetype( $file_url );
							$file_size = filesize( get_attached_file($attachment_ID) );
							$queried_object = get_queried_object();
							?>
							<p><?php echo $queried_object->post_content; ?></p>
							<table class="table table-striped">
								<tbody>
									<tr>
										<td><?php _e( 'Name' , MWP_TEXT_DOMAIN ); ?></td>
										<td><?php the_title(); ?></td>
									</tr>
									<tr>
										<td><?php _e( 'Size' , MWP_TEXT_DOMAIN ); ?></td>
										<td><?php echo size_format($file_size, 2); ?></td>
									</tr>
									<tr>
										<td><?php _e( 'Type' , MWP_TEXT_DOMAIN ); ?></td>
										<td><?php echo $file_type['type']; ?></td>
									</tr>
									<tr>
										<td><?php _e( 'Extension' , MWP_TEXT_DOMAIN ); ?></td>
										<td><?php echo $file_type['ext']; ?></td>
									</tr>
									<tr>
										<td><?php _e( 'Uploaded by' , MWP_TEXT_DOMAIN ); ?></td>
										<td><?php the_author(); ?></td>
									</tr>
									<tr>
										<td><?php _e( 'Uploaded on' , MWP_TEXT_DOMAIN ); ?></td>
										<td><?php echo $queried_object->post_date; ?></td>
									</tr>
									<tr>
										<td colspan="2">
											<a target="_blank" rel="nofollow" title="<?php _e( 'Click Right and save' , MWP_TEXT_DOMAIN ); ?>" role="button" class="btn btn-success btn-lg" href="<?php echo wp_get_attachment_url( $post->ID ) ?>">
												<?php _e( 'Download ' , MWP_TEXT_DOMAIN ); ?><?php the_title(); ?>
											</a>
										</td>
									</tr>
								</tbody>
							</table>								
							<?php
						break;
					}
					?>
				</div>

				<?php mwp_single_comments($post->ID); ?>
					
			<?php endwhile; ?>
				
			<?php endif; ?>
				
		<div class="clearfix"></div>
	</div>
	
	<div class="clearfix"></div>
</div>
<?php
/*
 * Hide Sidebar in Mobile and Tablet
 *
*/
if(mwp_option('sidebar-hide-small') == 1) {
	$device_hide = ' screen-l';
} else {
	$device_hide = '';
}
	/*
	 * Custom Sidebar For Categories
	 *
	*/
	if (mwp_option('sidebar-archive') == 1) { 
		?>
		<div id="sidebar" class="sidebar stick-sidebar<?php echo esc_attr($device_hide); ?>">
			<div class="theiaStickySidebar">	
				<?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('attachment')) : else : ?>		
				<?php endif; ?>	
			</div>
		</div>
		<?php
	} 
	/*
	 * One Sidebar For All Archives
	 *
	*/ 
	else { 
		?>
		<div id="sidebar" class="sidebar stick-sidebar<?php echo esc_attr($device_hide); ?>">
			<div class="theiaStickySidebar">	
				<?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('archive')) : else : ?>		
				<?php endif; ?>	
			</div>
		</div>
		<?php 
	} 

get_footer();

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists