offerpage.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. /*
  3. Template Name: Offer Page
  4. */
  5. ?>
  6. <?php
  7. /**
  8. * @package WordPress
  9. * @subpackage Default_Theme
  10. */
  11. get_header(); ?>
  12. <div id="main-content" class="main-content inner-wrapper">
  13. <div id="primary" class="content-area">
  14. <div id="content" class="site-content" role="main">
  15. <link rel="stylesheet" type="text/css" href="<?php bloginfo( 'stylesheet_directory' ); ?>/products.css" />
  16. <h2>Special Offers</h2>
  17. <p>&nbsp;</p>
  18. <?php //echo do_shortcode("[coupon couponid=163]"); ?>
  19. <hr style="border: none;border-top: dashed 2px #000000;" />
  20. <p>&nbsp;</p>
  21. <?php
  22. include "servervars.php";
  23. $ch = curl_init();
  24. $timeout = 5;
  25. $url="http://www.".$serverone."/central/getoffer.php?guid=$guid&width=$width&s=$serverone";
  26. curl_setopt($ch,CURLOPT_URL,$url);
  27. curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
  28. curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
  29. $data = curl_exec($ch);
  30. curl_close($ch);
  31. $offertext= $data;
  32. if($offertext!="")
  33. {
  34. echo $offertext;
  35. }
  36. else
  37. {
  38. ?>
  39. <!-- Enter Offer Text html here -->
  40. <?php if(have_posts()): ?>
  41. <?php while(have_posts()): the_post() ?>
  42. <div id="holder">
  43. <!--<h1><?php the_title() ?></h1>-->
  44. <?php if(is_page() or is_single()): ?>
  45. <?php the_content() ?>
  46. <?php else: ?>
  47. <?php the_excerpt() ?>
  48. <a href="<?php the_permalink() ?>">Read More</a>
  49. <?php endif ?>
  50. <div class="meta">
  51. <p><?php edit_post_link(__('Edit This')); ?></p>
  52. </div>
  53. </div><!-- holder -->
  54. <?php endwhile ?>
  55. <?php endif ?>
  56. <!-- End Offer Text html here -->
  57. <?php }?>
  58. <div id="clear"></div>
  59. </div>
  60. </div>
  61. </div>
  62. <?php get_footer(); ?>