Advertisement
jeffrose

GeoTheme - movable gallery

May 15th, 2012
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 18.28 KB | None | 0 0
  1. <?php if(!$preview){get_header();}?>
  2. <div id="wrapper" class="clearfix">
  3.  
  4.             <div id="inner_pages" class="clearfix" >
  5.  
  6.  
  7.  
  8.                 <h1 class="main_title"><a href="<?php if($preview){echo '#';}else{the_permalink();} ?>" rel="bookmark" title="Permanent Link to <?php if($preview){echo $proprty_name;}else{the_title_attribute();} ?>">
  9.  
  10.                       <?php if($preview){echo $proprty_name;}else{the_title();} ?>
  11.  
  12.                       </a></h1>
  13.  
  14.                        <div class="likethis">
  15.  
  16.                      <?php if ( get_option('ptthemes_tweet_button') ) { ?>
  17.  
  18.                        <a href="http://twitter.com/share" class="twitter-share-button"><?php _e('Tweet');?></a>
  19.  
  20.                      <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
  21.  
  22.                     <?php } ?>
  23.  
  24.                      <?php if ( get_option('ptthemes_facebook_button') ) { ?>
  25.  
  26.                     <iframe <?php if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)){echo 'allowtransparency="true"'; }?> class="facebook" src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0"  style="border:none; overflow:hidden; width:100px; height:20px"></iframe>
  27.                     <?php } ?>
  28.  
  29.                     <?php if ( get_option('ptthemes_google_button') ) { ?>
  30. <div id="plusone-div"></div>
  31. <script type="text/javascript">gapi.plusone.render('plusone-div', {"size": "medium", "count": "true" });</script>
  32.                     <?php } ?>
  33.  
  34.                       </div>
  35.  
  36.  
  37.  
  38.                 <div class="breadcrumb clearfix">
  39.  
  40.                 <?php if ( get_option( 'ptthemes_breadcrumbs' )) {  ?>
  41.  
  42.  
  43.  
  44.                     <div class="breadcrumb_in"><?php if(function_exists('bcn_display')){bcn_display();} ?></div>
  45.  
  46.  
  47.  
  48.             <?php } ?></div>
  49. <div class="clearfix"></div>
  50.         <div id="content" class="content_inner" >
  51.  
  52.         <div class="single_post">
  53.  
  54.       <?php if(have_posts() || $preview) :
  55.        if($preview && !$_REQUEST['alook'] && $_SESSION['property_info']['price_select']){$pkg_limit = get_property_price_info_listing('',$_SESSION['property_info']['price_select']);}
  56.        elseif(($preview && $_REQUEST['alook'] )||($preview && !$_SESSION['property_info']['price_select']) ){$pkg_limit = get_property_price_info_listing($_REQUEST['pid']);}
  57.        else{$pkg_limit = get_property_price_info_listing($post->ID);}
  58.  
  59.       if( is_single() ){
  60.         $about_gallery = get_post_meta( $post->ID, 'gallery_detail', true );
  61.       }
  62.  
  63.     if($preview){
  64.          $thumb_img_counter = 0;
  65.         if($_SESSION["file_info"])
  66.         {   $post_images = array();
  67.             if($_REQUEST['pid']){$post_images = bdw_get_images($_REQUEST['pid'],'large');}
  68.             $thumb_img_counter = $thumb_img_counter+count($_SESSION["file_info"]);
  69.             $image_path = get_image_phy_destination_path();
  70.  
  71.             $tmppath = "/".$upload_folder_path."tmp/";
  72.  
  73.             foreach($_SESSION["file_info"] as $image_id=>$val)
  74.             {
  75.                 $post_images[] = site_url().$tmppath.$image_id.'.jpg';
  76.             $thumb_img_counter++;
  77.             }
  78.         }elseif($_REQUEST['pid']){ $post_images = bdw_get_images($_REQUEST['pid'],'large');}
  79.         }else{ $post_images = bdw_get_images($post->ID,'large');}
  80.  
  81.  
  82.          global $thumb_url; /// get the mutiuser id
  83.  
  84.         $img_p = get_img_p(get_option('ptthemes_image_x_cut'));### added image crop position
  85.  
  86.         $img_zc = get_img_zc(get_option('ptthemes_image_zc'));### added image zoom or crop option
  87.  
  88.         $img_q = '&amp;q='.get_option('ptthemes_image_q');### added image quality option
  89.  
  90.          ?>
  91.  
  92.           <?php  if(!$preview){the_post();}?>
  93.  
  94.               <div id="post-<?php if($preview){echo 'preview';}else{the_ID();} ?>" class="posts post_spacer">
  95.  
  96. <?php
  97.     if ( !isset( $about_gallery ) || 'top' == strtolower( $about_gallery ) ){
  98.         display_gallery( $post_images, $pkg_limit );
  99.     }
  100. ?>
  101.  
  102.  
  103.         <?php if(get_post_meta($post->ID,'video',true) || $video){?>
  104.  
  105.             <div class="video_main">
  106.  
  107.             <?php if($preview){echo str_replace('\"', '', $video);}else{echo get_post_meta($post->ID,'video',true);}?>
  108.  
  109.             </div>
  110.  
  111.          <?php }?>
  112.  
  113.          <?php if($preview){if(strpos($proprty_desc,'<p>')) {echo $proprty_desc;}else{echo '<p>'.$proprty_desc.'</p>';}}else{the_content();} ?>
  114.  
  115.            <?php if(($proprty_feature || get_post_meta($post->ID,'proprty_feature',true)) && $pkg_limit['property_feature_pkg']){?>
  116.  
  117.              <div class="register_info">
  118.  
  119.             <?php if($preview){echo $proprty_feature;}else{echo nl2br(get_post_meta($post->ID,'proprty_feature',true));}?>
  120.  
  121.            </div>
  122.  
  123.            <?php }?>
  124. <?php
  125.     if ( 'bottom' == strtolower( $about_gallery ) ){
  126.         display_gallery( $post_images, $pkg_limit );
  127.     }
  128. ?>
  129.              <p class="post_bottom clearfix">  <?php
  130.              if($preview){echo '<span class="category">'.implode(",", $_SESSION['property_info']['category']).'</span>';
  131.              if($kw_tags){echo '<span class="tags">'.$kw_tags.'</span>';}
  132.              }else{the_taxonomies(array('before'=>'<span class="category">','sep'=>'</span><span class="tags">','after'=>'</span>')); }?> </p>
  133.  
  134.               </div> <!-- post #end -->
  135.  
  136.  
  137.  
  138.  
  139.  
  140. <div class="pos_navigation clearfix">
  141.  
  142.     <div class="post_left fl"><?php GT_previous_post_link('%link',''.__('Previous'), true) ?></div>
  143.  
  144.     <div class="post_right fr"><?php GT_next_post_link('%link',__('Next').'', true) ?></div>
  145.  
  146. </div>
  147.  
  148.               </div> <!-- single post content #end -->
  149.  
  150.               <div class="single_post_advt"><?php dynamic_sidebar(7);  ?> </div>
  151.  
  152.                     <?php if(get_option('ptthemes_related_on_detailpage')!='No'){ get_related_posts($post);} ?>
  153.  
  154.  
  155.  <?php endif; ?>
  156.  
  157.          <div id="comments" class="clearfix"> <?php comments_template(); ?></div>
  158.  
  159.   </div> <!-- content #end -->
  160.  
  161.       <div id="sidebar">
  162.  
  163.       <div class="company_info">
  164.  
  165.      <?php
  166.  
  167. ############################################# Fix for "Edit this Post" link taking user to backend ########################################
  168.  
  169.      //edit_post_link( __( 'Edit this Post' ), "\n\t\t\t\t\t\t<p class=\"edit-link\">", "</p>\n\t\t\t\t\t" );
  170.  
  171.     if(get_edit_post_link() && !$preview){
  172.  
  173.             $var1 = array('wp-admin/post.php?post', '&amp;action=edit');
  174.  
  175.             $var2  = array('?ptype=post_listing&pid', '');
  176.  
  177.             $link    = get_edit_post_link();
  178.  
  179.             $output  = str_replace($var1, $var2, $link);
  180.  
  181.             echo '<p class="edit-link"><a href="'.$output.'">'.__('Edit this Post').'</a><a href="'.$output.'&upgrade=1" style="float:right;">'.__('Upgrade Listing').'</a></p>';
  182.  
  183. }
  184.  
  185. ############################################# Fix for "Edit this Post" link taking user to backend ########################################
  186.  
  187. #######################OWNER VERIFIED FUNCTION ################
  188.  
  189. $post_id = get_post($post->ID);
  190.  
  191. $author_id = $post_id->post_author;
  192.  
  193. $user = new WP_User( $author_id );
  194.  
  195. $author_role = $user->roles[0];
  196.  
  197. if($preview){$is_owned = $claimed;}else{$is_owned = get_post_meta($post->ID,'claimed',true);}
  198.  
  199.  
  200.  
  201. if(get_option('show_owner_verified')==1){
  202.  
  203. if ($author_role =='author' && $is_owned!='0' ){?>
  204.  
  205.  
  206.  
  207.         <p> <span class="i_verified"> <?php echo OWNER_VERIFIED_PLACE;?> </span></p>
  208.  
  209.  
  210.  
  211.  
  212.  
  213. <?php }}
  214.  
  215. ###############################################################
  216.  
  217. #################### claim listing function#######################################
  218.  
  219. if(get_option('claim_listing')==1){
  220.  
  221. if ($author_role =='administrator' || $is_owned=='0' ){
  222.  
  223.     if ( is_user_logged_in() ) { ?>
  224.  
  225.     <p class="edit-link"><a href="#" class="b_claim_listing"><?php echo CLAIM_LISTING_OWNER;?></a></p>
  226.  
  227. <?php } else { ?>
  228.  
  229.     <p class="edit-link"><a href="<?php echo site_url().'/?ptype=login&msg=claim'; ?>" ><?php echo CLAIM_LISTING_OWNER;?></a></p>
  230.  
  231. <?php }} }?>
  232.  
  233.      <?php if(isset($_REQUEST['claim_request']) && $_REQUEST['claim_request']=='success'){?>
  234.  
  235.         <p class="sucess_msg"><?php echo CLAIM_LISTING_SUCCESS;?></p>
  236.  
  237.          <?php }elseif(isset($_REQUEST['emsg']) && $_REQUEST['emsg']=='captch'){?>
  238.  
  239.         <p class="error_msg_fix"><?php echo WRONG_CAPTCH_MSG;?></p>
  240.  
  241.         <?php }
  242.  
  243. ########################### end claim listing function ############################
  244.  
  245. ########################### author link function       ############################
  246.  
  247. if ($is_owned=='1' && get_option('author_link')==1 && !$preview ){
  248.  
  249.      ?>
  250.  
  251.     <p class="author-link"><?php _e('Author : '); the_author_posts_link(); ?></p>
  252.  
  253. <?php }
  254.  
  255.  
  256.  
  257. ########################### end author link function   ############################
  258.  
  259. #################### Google Analytics function #######################################
  260. if(get_option('ga_stats')==1 && get_edit_post_link() && !$preview && $post->post_status=='publish' && $pkg_limit['google_analytics']){
  261.  
  262. if(get_edit_post_link()){
  263.  
  264.     if ( is_user_logged_in() ) {
  265.  
  266.     $page_url = $_SERVER['REQUEST_URI'];
  267.  
  268.     if(isset($_REQUEST['ga_start'])){$ga_start = $_REQUEST['ga_start'];}else{$ga_start = '';}
  269.  
  270.     if(isset($_REQUEST['ga_end'])){$ga_end = $_REQUEST['ga_end'];}else{$ga_end ='';}
  271.  
  272.     ?>
  273. <script type="text/javascript">
  274.         jQuery(document).ready(function(){
  275.  
  276.                 jQuery("#ga_stats p").load("<?php echo get_bloginfo('url').'/?ptype=ga&ga_page='.$page_url; ?>");
  277.  
  278.         });
  279.         </script>
  280.         <div id="ga_stats"><p><img src="<?php echo get_bloginfo('template_directory').'/images/'; ?>ajax-loader.gif" /></p></div>
  281.  
  282. <?php }}}
  283.  
  284. ########################### end Google Analytics function############################
  285.  
  286. ?>
  287.  
  288.  
  289.  
  290.         <p> <span class="i_location"><?php _e('Address :'); ?> </span> <?php if($preview){echo $address;}else{echo get_post_meta($post->ID,'address',true);} ?>   </p>
  291.  
  292.          <?php if(get_post_meta($post->ID,'website',true) || $website){
  293.  
  294.              if($preview){}else{$website = get_post_meta($post->ID,'website',true);}
  295.  
  296.              if(!strstr($website,'http'))
  297.  
  298.              {
  299.  
  300.                  $website = 'http://'.get_post_meta($post->ID,'website',true);
  301.  
  302.              }
  303.  
  304.              ?>
  305.  
  306.         <?php if($website && $pkg_limit['website_pkg']){?>
  307.  
  308.         <p>  <span class="i_website"><a href="<?php echo $website;?>" target="_blank" ><strong><?php _e('Website');?></strong></a>  </span> </p>
  309.  
  310.         <?php }?>
  311.  
  312.         <?php }?>
  313.  
  314.  
  315.  
  316.         <p>  <?php favourite_html($post->post_author,$post->ID); ?></p>
  317.  
  318.  
  319.  
  320.          <?php if(($timing || get_post_meta($post->ID,'timing',true)) && $pkg_limit['timing_pkg']){?>
  321.  
  322.         <p> <span class="i_time"> <?php echo EVENT_TIMING;?> : </span>  <?php if($preview){echo $timing;}else{echo get_post_meta($post->ID,'timing',true);}?>  </p>
  323.  
  324.         <?php }?>
  325.  
  326.          <?php if(($contact || get_post_meta($post->ID,'contact',true)) && $pkg_limit['contact_pkg'] && get_option('ptthemes_contact_on_detailpage')=='Yes' && get_post_meta($post->ID,'contact_show',true)!='No'){?>
  327.  
  328.         <p> <span class="i_contact"> <?php echo EVENT_CONTACT_INFO;?> :</span>  <?php if($preview){echo $contact;}else{echo get_post_meta($post->ID,'contact',true);}?>  </p>
  329.  
  330.         <?php }?>
  331.  
  332.  
  333.  
  334.          <?php if(($email || get_post_meta($post->ID,'email',true)) && $pkg_limit['email_pkg'] && get_option('ptthemes_email_on_detailpage')=='Yes' && get_post_meta($post->ID,'email_show',true)!='No'){?>
  335.  
  336.         <p> <span class="i_email2"><a href="#" class="b_send_inquiry" ><?php echo SEND_INQUIRY;?> </a> | <a href="#" class="b_sendtofriend"><?php echo SEND_TO_FRIEND;?></a></span></p>
  337.  
  338.          <?php if($_REQUEST['send_inquiry']=='success'){?>
  339.  
  340.         <p class="sucess_msg"><?php echo SEND_INQUIRY_SUCCESS;?></p>
  341.  
  342.         <?php }elseif($_REQUEST['sendtofrnd']=='success'){?>
  343.  
  344.         <p class="sucess_msg"><?php echo SEND_FRIEND_SUCCESS;?></p>
  345.  
  346.         <?php }elseif($_REQUEST['emsg']=='captch'){?>
  347.  
  348.         <p class="error_msg_fix"><?php echo WRONG_CAPTCH_MSG;?></p>
  349.  
  350.         <?php }?>
  351.  
  352.         <?php }?>
  353.  
  354.  
  355.  
  356.  
  357.            <?php if(!$preview){echo get_post_custom_listing_single_page($post->ID,'<p><span class="post_cus_field {#HTMLVAR#}">{#TITLE#} : </span>{#VALUE#}</p>');}
  358.            elseif($preview && $_REQUEST['alook']){echo get_post_custom_listing_single_page(mysql_real_escape_string($_REQUEST['pid']),'<p><span class="{#HTMLVAR#}">{#TITLE#}</span> : {#VALUE#}</p>');}else{echo get_post_custom_listing_single_page_preview($post->ID,'<p><span class="post_cus_field {#HTMLVAR#}">{#TITLE#} : </span>{#VALUE#}</p>');} ?>
  359.  
  360.  
  361.  
  362.         </div>
  363.  
  364.  
  365.  
  366.         <div class="company_info2">
  367.         <?php if(!get_option('ptthemes_disable_rating')){ ?>
  368. <div class="hreview-aggregate">
  369.        <p> <span class="i_rating">
  370.  
  371.  
  372.        <?php _e('Rating');?> :</span> <span class="single_rating"> <?php echo get_post_rating_star($post->ID);?></span><br />
  373.  
  374.  
  375.  
  376.       <span class="rating">
  377.       <?php  if($preview){$avg_rating = 0;}else{$avg_rating = get_post_average_rating($post->ID);}
  378. if($avg_rating==0)                          {echo 0;}
  379. if($avg_rating>=1 && $avg_rating<1.25 )     {echo 1;}
  380. if($avg_rating>=1.25 && $avg_rating<1.75 )  {echo 1.5;}
  381. if($avg_rating>=1.75 && $avg_rating<2.25 )  {echo 2;}
  382. if($avg_rating>=2.25 && $avg_rating<2.75 )  {echo 2.5;}
  383. if($avg_rating>=2.75 && $avg_rating<3.25 )  {echo 3;}
  384. if($avg_rating>=3.25 && $avg_rating<3.75 )  {echo 3.5;}
  385. if($avg_rating>=3.75 && $avg_rating<4.25 )  {echo 4;}
  386. if($avg_rating>=4.25 && $avg_rating<4.75 )  {echo 4.5;}
  387. if($avg_rating>=4.75 && $avg_rating<=5 )    {echo 5;}
  388.  ?></span><?php _e('/5 based on');?> <span class="count"><?php  if($preview){$rating_count = 0;}else{$rating_count = get_post_rating_count($post->ID);} echo $rating_count; ?></span>  <?php _e('user');?> <?php if($rating_count == 1){echo 'review.';}else{_e('reviews.');}?>
  389.  <br />
  390.    <span class="item">
  391.       <span class="fn"><?php if($preview){echo $proprty_name;}else{the_title();} ?><br />
  392.    <?php if($post_images[0]){ ?><img src="<?php echo get_bloginfo('template_directory').'/thumb.php?src='.$post_images[0].'&amp;w=75&amp;h=50&amp;zc=1'.$thumb_url; ?>" class="photo" alt="<?php if($preview){echo $proprty_name;}else{the_title();} ?>"/> <?php }?> </span></span>
  393.  
  394.      </p></div><?php }?>
  395.  
  396.        <div class="share clarfix">
  397.  
  398.         <div class="addthis_toolbox addthis_default_style">
  399.  
  400. <a href="http://www.addthis.com/bookmark.php?v=250&amp;username=<?php if(get_option('ptthemes_addthis_username')){echo get_option('ptthemes_addthis_username');}else{ echo 'ra-4facd1303678e5c0';}?>" class="addthis_button_compact sharethis"><?php _e('Share');?></a>
  401.  
  402. </div>
  403.  
  404.  
  405.  
  406.  
  407.   </div>
  408.  
  409.  
  410.  
  411.       <div class="links">
  412.  
  413.        <?php if(($twitter || get_post_meta($post->ID,'twitter',true)) && $pkg_limit['twitter_pkg']){?><a href="<?php if($preview){echo $twitter;}else{echo get_post_meta($post->ID,'twitter',true);}?>" class="i_twitter" target="_blank"> <?php _e('Twitter');?> </a> <?php }?>
  414.  
  415.         <?php if(($facebook || get_post_meta($post->ID,'facebook',true)) && $pkg_limit['facebook_pkg']){?><a href="<?php if($preview){echo $facebook;}else{echo get_post_meta($post->ID,'facebook',true);}?>" class="i_facebook" target="_blank"><?php _e('Facebook');?> </a><?php }?>
  416.  
  417.        </div>
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.         </div>  <?php if($pkg_limit['link_business_pkg'] && get_business_events_new() && !$preview): ?>
  427.  
  428.         <div class="widget">
  429.  
  430.         <div class="links"><h3><?php _e('Events'); ?></h3>
  431.  
  432.     <?php echo get_business_events_new(); ?>
  433.  
  434.     </div></div>
  435.  
  436.     <?php endif; ?>
  437.  
  438.  
  439.  
  440.     <?php if($pkg_limit['link_business_pkg'] && get_business_events_old() && !$preview): ?>
  441.  
  442.         <div class="widget">
  443.  
  444.         <div class="links"><h3><?php _e('Past Events'); ?></h3>
  445.  
  446.     <?php echo get_business_events_old(); ?>
  447.  
  448.     </div></div>
  449.  
  450.     <?php endif; ?>
  451.  
  452.  
  453.  
  454.     <!-- company info -->
  455.  
  456.     <div class="sidebar_in"><?php dynamic_sidebar(8);  ?> </div>
  457.  
  458.     </div> <!-- sidebar #end -->
  459.  
  460.     </div>
  461.  
  462.     <?php if(!$preview){require_once (TEMPLATEPATH . '/library/includes/popup_frms.php');}?>
  463. </div>
  464.  <?php get_footer(); ?>
  465. <?php
  466.  
  467. function display_gallery( $post_images, $pkg_limit ){
  468.  
  469.     echo '<div id="galleria"';
  470.     if ( count( $post_images) == 1 ){
  471.         echo 'style="margin-bottom:-90px;"';
  472.     }
  473.     echo '>';
  474.  
  475.     if(count($post_images)>0){
  476.         if($pkg_limit['image_limit']=='' || count($post_images)<$pkg_limit['image_limit']){
  477.             $img_count = count($post_images);
  478.         }else{
  479.             $img_count =$pkg_limit['image_limit'];
  480.         }
  481.  
  482.         for($im=0;$im<$img_count;$im++){
  483.         ?>
  484.         <div class="small">
  485.             <a href="<?php echo get_bloginfo('template_directory').'/thumb.php?src='.$post_images[$im].'&amp;w=580&amp;h=390'.$img_zc.$img_p.$img_q.$thumb_url; ?>">
  486.                 <img src="<?php  echo get_bloginfo('template_directory').'/thumb.php?src='.$post_images[$im].'&amp;w=75&amp;h=50&amp;zc=1'.$thumb_url; ?>" alt=""  title=""/>
  487.             </a>
  488.         </div>
  489.         <?php
  490.         } // for
  491.     } // if count
  492. ?>
  493.  
  494.     </div>
  495.     <?php
  496.     if($post_images){
  497.     ?>
  498.         <script type="text/javascript">
  499.  
  500.             // Load theme
  501.  
  502.             Galleria.loadTheme('<?php bloginfo('template_directory'); ?>/library/js/galleria.classic.js');
  503.  
  504.             // run galleria and add some options
  505.  
  506.             jQuery('#galleria').galleria({
  507.                 width:580,
  508.                 height:470,
  509.                 image_crop: false, // crop all images to fit
  510.                 thumb_crop: true, // crop all thumbnails to fit
  511.                 <?php if(count($post_images)==1){ echo 'thumbnails: false,';}?>
  512.                 transition: 'fade', // crossfade photos
  513.                 transition_speed: 700, // slow down the crossfade
  514.                 autoplay: <?php if(get_option('ptthemes_photo_gallery')){echo 'true';}else{echo 'false';}?>,
  515.                 data_config: function(img) {
  516.  
  517.                     // will extract and return image captions from the source:
  518.  
  519.                     return  {
  520.                         title: jQuery(img).parent().next('strong').html(),
  521.                         description: jQuery(img).parent().next('strong').next().html()
  522.                     };
  523.  
  524.                 },
  525.                 extend: function() {
  526.                     this.bind(Galleria.IMAGE, function(e) {
  527.                         // bind a click event to the active image
  528.                         jQuery(e.imageTarget).css('cursor','pointer').click(this.proxy(function() {
  529.                             // open the image in a lightbox
  530.                             this.openLightbox();
  531.                         }));
  532.                     });
  533.                 }
  534.             });
  535.         </script>
  536.     <?php
  537.     } //if post images
  538. } //End function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement