Resim

Footer.php Kodlar
Alıntı
</div>
<?php wp_reset_query(); ?>
<?php $showgallery1 = get_settings ( "cp_showpostgallery" );
$showgallery2 = get_settings ( "cp_showarchivegallery" );
if ( (is_home()) || (is_search() && $showheadline2 != "no") || (is_archive() && $showgallery2 != "no") || (is_single() && $showgallery1 != "no") ) { ?>
<div id="gallery" class="clearfloat">
<div id="random">
<h3>Rasgele Yazılar</h3>
<?php $width = get_settings ( "cp_thumbWidth_Gallery" );
$height = get_settings ( "cp_thumbHeight_Gallery" );
if ( $width == 0 ) { $width = 80; }
if ( $height == 0 ) { $height = 80; }
$status = get_settings ( "cp_thumbAuto" );
?>
<?php $randompost = $wpdb->get_results("SELECT ID FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY RAND() LIMIT 12");
foreach ($randompost as $post) {
$ID = $post->ID;
$postid = get_post($post->ID);
$title = $postid->post_title;
$values = $wpdb->get_var("SELECT meta_value FROM $wpdb->postmeta WHERE post_id = $ID AND meta_key = 'Image' ");
?>
<?php if ( $status != "first" ) { ?>
<?php
if (isset($values)) {
?>
<a href="<?php echo get_permalink($postid); ?>" rel="bookmark" title="Permanent Link to <?php echo $title; ?>"><img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=<?php echo get_option('home'); ?>/<?php
echo $values; ?>&w=<?php echo $width; ?>&h=<?php echo $height; ?>&zc=1&q=100"
alt="<?php echo $title; ?>" class="left" width="<?php echo $width; ?>px" height="<?php echo $height; ?>px" /></a>
<?php } ?>
<?php } else { ?>
<?php $id =$post->ID;
$the_content =$wpdb->get_var("SELECT post_content FROM $wpdb->posts WHERE ID = $id");
$pattern = '!<img.*?src="(.*?)"!';
preg_match_all($pattern, $the_content, $matches);
$image_src = $matches['1'][0]; ?>
<a href="<?php echo get_permalink($postid); ?>" rel="bookmark" title="Permanent Link to <?php echo $title; ?>">
<img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=<?php if($image_src != '') { echo $image_src; } ?>&w=<?php echo $width; ?>&h=<?php echo $height; ?>&zc=1&q=100"
alt="<?php echo $title; ?>" class="left" width="<?php echo $width; ?>px" height="<?php echo $height; ?>px" /></a>
<?php } ?>
<?php } ?>
<div class="more" style="margin-top:-10px;padding-right:15px;font-weight:bold;float:right;"><a href="javascript:location.reload()" target="_self">Yenile</a></div>
</div>
<div class="more" style="margin-top:5px;font-weight:bold;"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></div>
</div>
</div>
</div>
<?php } ?>
<div id="front-popular" class="clearfloat">
<div id="recentpost" class="clearfloat">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(5) ) : ?>
<?php endif; ?></div>
</div>
<div id="footer"> <?php wp_footer(); ?> Wordpress<a
<!-- <?php echo get_num_queries(); ?> queries. <?php timer_stop(1); ?> seconds. -->
</div>
<?php
$cp_analytics = get_settings( "cp_analytics" );
if( $cp_analytics != "" ) {
?>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("<?php echo $cp_analytics; ?>");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<?php } ?>
</body>
</html>
<?php wp_reset_query(); ?>
<?php $showgallery1 = get_settings ( "cp_showpostgallery" );
$showgallery2 = get_settings ( "cp_showarchivegallery" );
if ( (is_home()) || (is_search() && $showheadline2 != "no") || (is_archive() && $showgallery2 != "no") || (is_single() && $showgallery1 != "no") ) { ?>
<div id="gallery" class="clearfloat">
<div id="random">
<h3>Rasgele Yazılar</h3>
<?php $width = get_settings ( "cp_thumbWidth_Gallery" );
$height = get_settings ( "cp_thumbHeight_Gallery" );
if ( $width == 0 ) { $width = 80; }
if ( $height == 0 ) { $height = 80; }
$status = get_settings ( "cp_thumbAuto" );
?>
<?php $randompost = $wpdb->get_results("SELECT ID FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY RAND() LIMIT 12");
foreach ($randompost as $post) {
$ID = $post->ID;
$postid = get_post($post->ID);
$title = $postid->post_title;
$values = $wpdb->get_var("SELECT meta_value FROM $wpdb->postmeta WHERE post_id = $ID AND meta_key = 'Image' ");
?>
<?php if ( $status != "first" ) { ?>
<?php
if (isset($values)) {
?>
<a href="<?php echo get_permalink($postid); ?>" rel="bookmark" title="Permanent Link to <?php echo $title; ?>"><img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=<?php echo get_option('home'); ?>/<?php
echo $values; ?>&w=<?php echo $width; ?>&h=<?php echo $height; ?>&zc=1&q=100"
alt="<?php echo $title; ?>" class="left" width="<?php echo $width; ?>px" height="<?php echo $height; ?>px" /></a>
<?php } ?>
<?php } else { ?>
<?php $id =$post->ID;
$the_content =$wpdb->get_var("SELECT post_content FROM $wpdb->posts WHERE ID = $id");
$pattern = '!<img.*?src="(.*?)"!';
preg_match_all($pattern, $the_content, $matches);
$image_src = $matches['1'][0]; ?>
<a href="<?php echo get_permalink($postid); ?>" rel="bookmark" title="Permanent Link to <?php echo $title; ?>">
<img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=<?php if($image_src != '') { echo $image_src; } ?>&w=<?php echo $width; ?>&h=<?php echo $height; ?>&zc=1&q=100"
alt="<?php echo $title; ?>" class="left" width="<?php echo $width; ?>px" height="<?php echo $height; ?>px" /></a>
<?php } ?>
<?php } ?>
<div class="more" style="margin-top:-10px;padding-right:15px;font-weight:bold;float:right;"><a href="javascript:location.reload()" target="_self">Yenile</a></div>
</div>
<div class="more" style="margin-top:5px;font-weight:bold;"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></div>
</div>
</div>
</div>
<?php } ?>
<div id="front-popular" class="clearfloat">
<div id="recentpost" class="clearfloat">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(5) ) : ?>
<?php endif; ?></div>
</div>
<div id="footer"> <?php wp_footer(); ?> Wordpress<a
<!-- <?php echo get_num_queries(); ?> queries. <?php timer_stop(1); ?> seconds. -->
</div>
<?php
$cp_analytics = get_settings( "cp_analytics" );
if( $cp_analytics != "" ) {
?>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("<?php echo $cp_analytics; ?>");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<?php } ?>
</body>
</html>