Advertisement
Guest User

Untitled

a guest
Apr 5th, 2012
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.56 KB | None | 0 0
  1. //page with partial html where i call the ajax
  2.  
  3. <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php wpzoom_rss(); ?>" />
  4. <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
  5. <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" media="screen" />
  6. <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/css/dropdown.css" type="text/css" media="screen" />
  7. <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/custom.css" type="text/css" media="screen" />
  8. <?php if (strlen($wpzoom_misc_favicon) > 1 ) { ?><link rel="shortcut icon" href="<?php echo "$wpzoom_misc_favicon";?>" type="image/x-icon" /><?php } ?>
  9. <?php if ($wpzoom_sidebar == 'Left') { ?><style type="text/css">#sidebar { float:left; margin:15px 5px 0 15px;} </style> <?php } ?>
  10. <?php remove_action('wp_print_styles', 'pagenavi_stylesheets'); ?>
  11. <?php wp_enqueue_script('jquery'); ?>
  12. <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
  13. <?php wpzoom_js( "slider");?>
  14.  
  15. <?php wp_head(); ?>
  16.  
  17.  
  18. <script type="text/javascript">
  19. /*emerald script to handle reset*/
  20. function ResetForm() {
  21. var myForm = document.forms['taxonomy-picker'];
  22. /*document.write(myForm);*/
  23. selectTags = myForm.getElementsByTagName("select");
  24.  
  25. for(var i = 0; i < selectTags.length; i++) {
  26. selectTags[i].selectedIndex =0;
  27. }
  28. }
  29. </script>
  30. <script type="text/javascript">
  31.  
  32.  
  33. $(function() {
  34.  
  35. $('#next_five').live('click', function(){
  36.  
  37.  
  38.  
  39. var data = {
  40. action: 'next_five',
  41. next: 5
  42. };
  43. jQuery.post("<?php echo admin_url('admin-ajax.php'); ?>", data,
  44. function(response){
  45. $('#navi').slideDown("slow");
  46.  
  47. $("#slidercontainer").html(response);
  48. },"html");
  49. $.getScript('wp-content/themes/yamidoo_pro/js/slider.js');
  50. });
  51.  
  52. });
  53.  
  54.  
  55. </script>
  56.  
  57. </head>
  58.  
  59.  
  60. <body>
  61. <div style="position:absolute;left:450px;top:0px;">
  62. <input type="button" class="nextfive top-buttons" id="next_five" value="Click five" />
  63. <span id="output"></span>
  64.  
  65. <div id="slidercontainer">
  66. <?php
  67. if ($wpzoom_slideshow_show == 'Yes')
  68. {
  69. include(TEMPLATEPATH . '/wpzoom-featured.php'); // calling Featured Slideshow
  70. }
  71. ?>
  72. </div>
  73. </body>
  74. </html>
  75.  
  76. //wpzoom-featured.php
  77.  
  78. <div id="feature">
  79.  
  80. <?php
  81. $catid5 = $wpzoom_featured_category_5;
  82. $cat5 = get_category($catid5,false);
  83. $catlink5 = get_category_link($catid5);
  84. $breaking_cat5 = "cat=$catid5";
  85. ?>
  86.  
  87.  
  88.  
  89. <div id="panes">
  90.  
  91. <?php
  92. $offset_param="";
  93.  
  94. //$offset_param=$_GET['next'];
  95. //global $paged;
  96. //$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  97. //$my_query = new WP_Query('category_name=Resources&showposts=50&paged=' . $paged');
  98.  
  99. $headline = new WP_Query('showposts=5&' . $breaking_cat5.'&offset='.$offset_param );
  100.  
  101. while($headline->have_posts()) : $headline->the_post(); unset($videocode);
  102. $videocode = get_post_meta($post->ID, 'wpzoom_post_embed_code', true);?>
  103.  
  104. <?php if($wpzoom_autoembed == "Yes") { $AE = new AutoEmbed(); } // loading the AutoEmbed PHP Class ?>
  105. <div>
  106. <?php if (strlen($videocode) > 1 && $wpzoom_autoembed == "Yes") {
  107. if ($videocode && $AE->parseUrl($videocode)) {
  108. $AE->setParam('wmode','transparent');
  109. $AE->setParam('autoplay','false');
  110. $AE->setHeight(280);
  111. $AE->setWidth(520);
  112.  
  113. ?><span class="cover"><?php echo $AE->getEmbedCode(); ?></span><?php
  114. }
  115. }
  116.  
  117. elseif (strlen($videocode) > 1 && $wpzoom_autoembed == "No") {
  118. $videocode = preg_replace("/(width\s*=\s*[\"\'])[0-9]+([\"\'])/i", "$1 520 $2", $videocode);
  119. $videocode = preg_replace("/(height\s*=\s*[\"\'])[0-9]+([\"\'])/i", "$1 280 $2", $videocode);
  120. $videocode = str_replace("<embed","<param name='wmode' value='transparent'></param><embed",$videocode);
  121. $videocode = str_replace("<embed","<embed wmode='transparent' ",$videocode);
  122.  
  123. ?><span class="cover"><?php echo "$videocode"; ?></span><?php
  124. }
  125.  
  126. if (!$videocode) {
  127. ?>
  128.  
  129. <?php unset($img);
  130. if ( current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail() ) {
  131. $thumbURL = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), '' );
  132. $img = $thumbURL[0]; }
  133. else {
  134. unset($img);
  135. if ($wpzoom_cf_use == 'Yes') { $img = get_post_meta($post->ID, $wpzoom_cf_photo, true); }
  136. else {
  137. if (!$img) { $img = catch_that_image($post->ID); } }
  138. }
  139. if ($img) { $img = wpzoom_wpmu($img); ?>
  140. <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo $img ?>&amp;w=520&amp;h=280&amp;zc=1" alt="<?php the_title(); ?>" /></a><?php } else { echo"<img src=\""; bloginfo('template_directory'); echo"/images/blank.jpg\" />"; }
  141. } // if a video does not exist ?>
  142.  
  143.  
  144. <h2><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
  145.  
  146. <ul class="post-meta"><li class="date"><?php the_time("$dateformat $timeformat"); ?></li> <li class="category"><?php the_category(', ') ?></li> <li class="comments"> <?php comments_popup_link('0', '1', '%'); ?></li> <?php edit_post_link( __('Edit', 'wpzoom'), ' ', ''); ?></ul>
  147.  
  148. <?php the_excerpt(); ?>
  149.  
  150.  
  151. </div>
  152. <?php endwhile; ?>
  153.  
  154. </div>
  155.  
  156. <br clear="all" />
  157.  
  158.  
  159. <!-- navigator -->
  160. <div id="navi">
  161.  
  162. <ul>
  163.  
  164. <?php $teaser_small = new WP_Query('showposts=5&' . $breaking_cat5.'&offset='.$offset_param ); while($teaser_small->have_posts()) : $teaser_small->the_post(); ?>
  165.  
  166. <li>
  167. <?php unset($img);
  168. if ( current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail() ) {
  169. $thumbURL = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), '' );
  170. $img = $thumbURL[0]; }
  171. else {
  172. unset($img);
  173. if ($wpzoom_cf_use == 'Yes') { $img = get_post_meta($post->ID, $wpzoom_cf_photo, true); }
  174. else {
  175. if (!$img) { $img = catch_that_image($post->ID); } }
  176. }
  177. if ($img) { $img = wpzoom_wpmu($img); ?>
  178. <a href="#"><img src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo $img ?>&amp;w=60&amp;h=50&amp;zc=1" alt="<?php the_title(); ?>" /></a><?php } else { echo"<img src=\""; bloginfo('template_directory'); echo"/images/blank2.jpg\" />"; } ?>
  179. </li>
  180.  
  181.  
  182.  
  183. <?php endwhile; wp_reset_query(); ?>
  184.  
  185. </ul>
  186.  
  187. </div>
  188.  
  189. </div>
  190.  
  191.  
  192. // ajax call back from admin-ajax.php
  193.  
  194. $breaking_cat5=5;
  195. ?>
  196. <div id="feature">
  197.  
  198. <?php
  199. $catid5 = $wpzoom_featured_category_5;
  200. $cat5 = get_category($catid5,false);
  201. $catlink5 = get_category_link($catid5);
  202. $breaking_cat5 = "cat=$catid5";
  203. ?>
  204.  
  205.  
  206.  
  207. <div id="panes">
  208.  
  209. <?php
  210. $offset_param="";
  211.  
  212. $offset_param=$_POST['next'];
  213. //global $paged;
  214. //$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  215. //$my_query = new WP_Query('category_name=Resources&showposts=50&paged=' . $paged');
  216.  
  217. $headline = new WP_Query('showposts=5&' . $breaking_cat5.'&offset='.$offset_param );
  218.  
  219. while($headline->have_posts()) : $headline->the_post(); unset($videocode);
  220. $videocode = get_post_meta($post->ID, 'wpzoom_post_embed_code', true);?>
  221.  
  222. <?php if($wpzoom_autoembed == "Yes") { $AE = new AutoEmbed(); } // loading the AutoEmbed PHP Class ?>
  223. <div>
  224. <?php if (strlen($videocode) > 1 && $wpzoom_autoembed == "Yes") {
  225. if ($videocode && $AE->parseUrl($videocode)) {
  226. $AE->setParam('wmode','transparent');
  227. $AE->setParam('autoplay','false');
  228. $AE->setHeight(280);
  229. $AE->setWidth(520);
  230.  
  231. ?><span class="cover"><?php echo $AE->getEmbedCode(); ?></span><?php
  232. }
  233. }
  234.  
  235. elseif (strlen($videocode) > 1 && $wpzoom_autoembed == "No") {
  236. $videocode = preg_replace("/(width\s*=\s*[\"\'])[0-9]+([\"\'])/i", "$1 520 $2", $videocode);
  237. $videocode = preg_replace("/(height\s*=\s*[\"\'])[0-9]+([\"\'])/i", "$1 280 $2", $videocode);
  238. $videocode = str_replace("<embed","<param name='wmode' value='transparent'></param><embed",$videocode);
  239. $videocode = str_replace("<embed","<embed wmode='transparent' ",$videocode);
  240.  
  241. ?><span class="cover"><?php echo "$videocode"; ?></span><?php
  242. }
  243.  
  244. if (!$videocode) {
  245. ?>
  246.  
  247. <?php unset($img);
  248. if ( current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail() ) {
  249. $thumbURL = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), '' );
  250. $img = $thumbURL[0]; }
  251. else {
  252. unset($img);
  253. if ($wpzoom_cf_use == 'Yes') { $img = get_post_meta($post->ID, $wpzoom_cf_photo, true); }
  254. else {
  255. if (!$img) { $img = catch_that_image($post->ID); } }
  256. }
  257. if ($img) { $img = wpzoom_wpmu($img); ?>
  258. <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo $img ?>&amp;w=520&amp;h=280&amp;zc=1" alt="<?php the_title(); ?>" /></a><?php } else { echo"<img src=\""; bloginfo('template_directory'); echo"/images/blank.jpg\" />"; }
  259. } // if a video does not exist ?>
  260.  
  261.  
  262. <h2><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
  263.  
  264. <ul class="post-meta"><li class="date"><?php the_time("$dateformat $timeformat"); ?></li> <li class="category"><?php the_category(', ') ?></li> <li class="comments"> <?php comments_popup_link('0', '1', '%'); ?></li> <?php edit_post_link( __('Edit', 'wpzoom'), ' ', ''); ?></ul>
  265.  
  266. <?php the_excerpt(); ?>
  267.  
  268.  
  269. </div>
  270. <?php endwhile; ?>
  271.  
  272. </div>
  273.  
  274. <br clear="all" />
  275.  
  276.  
  277. <!-- navigator -->
  278. <div id="navi">
  279.  
  280. <ul>
  281.  
  282. <?php $teaser_small = new WP_Query('showposts=5&' . $breaking_cat5.'&offset='.$offset_param ); while($teaser_small->have_posts()) : $teaser_small->the_post(); ?>
  283.  
  284. <li>
  285. <?php unset($img);
  286. if ( current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail() ) {
  287. $thumbURL = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), '' );
  288. $img = $thumbURL[0]; }
  289. else {
  290. unset($img);
  291. if ($wpzoom_cf_use == 'Yes') { $img = get_post_meta($post->ID, $wpzoom_cf_photo, true); }
  292. else {
  293. if (!$img) { $img = catch_that_image($post->ID); } }
  294. }
  295. if ($img) { $img = wpzoom_wpmu($img); ?>
  296. <a href="#"><img src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo $img ?>&amp;w=60&amp;h=50&amp;zc=1" alt="<?php the_title(); ?>" /></a><?php } else { echo"<img src=\""; bloginfo('template_directory'); echo"/images/blank2.jpg\" />"; } ?>
  297. </li>
  298.  
  299.  
  300.  
  301. <?php endwhile; wp_reset_query(); ?>
  302.  
  303. </ul>
  304.  
  305. </div>
  306.  
  307. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement