Advertisement
Guest User

test

a guest
Sep 29th, 2011
462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.80 KB | None | 0 0
  1. <?php
  2.  
  3. global $imgDimensions, $substrExcerpt, $itemCaption, $shortname, $paged;
  4.  
  5. $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  6.  
  7. $pageInfo = get_post_meta($post->ID, 'max_show_gallery_info', true);
  8.  
  9. // get the gallery name
  10. $taxonomy_name = get_post_meta($post->ID, 'max_select_gallery', true);
  11.  
  12. // Test leading numeric title sort
  13. query_posts("posts_per_page=".PER_PAGE_DEFAULT."&post_type=gallery&".GALLERY_TAXONOMY."=".$taxonomy_name."&paged=".$paged."&caller_get_posts=1&orderby=title&order=asc");
  14. if (have_posts()) {
  15. usort($wp_query->posts, 'my_post_sort');
  16. while (have_posts()) {
  17. the_post();
  18. echo "<br />";the_title();
  19. }
  20. }
  21. function my_post_sort($a,$b) {
  22. $akey = $a->post_title;
  23. if (preg_match('/^(\d+) /',$akey,$matches)) {
  24. $akey = sprintf('%010d ',$matches[0]) . $akey;
  25. }
  26. $bkey = $b->post_title;
  27. if (preg_match('/^(\d+) /',$bkey,$matches)) {
  28. $bkey = sprintf('%010d ',$matches[0]) . $bkey;
  29. }
  30. if ($akey == $bkey) {
  31. return 0;
  32. }
  33. return ($akey < $bkey) ? -1 : 1;
  34. }
  35.  
  36. ?>
  37.  
  38. <?php if (have_posts()) : ?>
  39.  
  40.  
  41. <ul id="portfolioList" class="clearfix portfolio-list">
  42.  
  43.  
  44. <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  45.  
  46.  
  47. <li class="item <?php echo max_get_post_lightbox_class() ?>">
  48.  
  49.  
  50.  
  51. <span class="shadow">
  52. <?php
  53.  
  54. // get the gallery item
  55. max_get_post_custom_image();
  56.  
  57. if($itemCaption === true) {
  58.  
  59. // check if caption option is selected
  60. if ( get_option_max( 'image_show_caption' ) == 'true' ) {
  61.  
  62. ?>
  63.  
  64. <div class="item-caption">
  65. <strong><?php echo get_the_title() ?></strong><br />
  66. <?php
  67. // check if there is a excerpt
  68. if( max_get_the_excerpt() ){
  69. max_get_the_excerpt(true);
  70. }
  71. ?>
  72. </div>
  73.  
  74. <?php
  75. }
  76. }
  77.  
  78. ?>
  79. </span>
  80.  
  81.  
  82. <?php
  83.  
  84. // check if additional options is selected
  85. if ( $pageInfo == 'true' ) {
  86.  
  87. ?>
  88.  
  89. <div class="item-information">
  90. <ul>
  91. <?php if( get_post_meta($post->ID, $shortname.'_photo_copyright_link_value', true) != "" ){ ?>
  92.  
  93. <li><?php _e('Copyright','pictree') ?>: <a href="<?php echo get_post_meta($post->ID, $shortname.'_photo_copyright_link_value', true) ?>" title="<?php echo get_post_meta($post->ID, $shortname.'_photo_copyright_information_value', true) ?>" target="_blank"><?php echo get_post_meta($post->ID, $shortname.'_photo_copyright_information_value', true) ?></a></li>
  94.  
  95. <?php } else { ?>
  96.  
  97. <li>Copyright<?php _e('Copyright','pictree') ?>: <?php echo get_post_meta($post->ID, $shortname.'_photo_copyright_information_value', true) ?></li>
  98.  
  99. <?php } ?>
  100.  
  101. <li><?php _e('Location','pictree') ?>: <span><?php echo get_post_meta($post->ID, $shortname.'_photo_location_value', true) ?></span></li>
  102. <li><?php _e('Date','pictree') ?>: <span><?php echo get_post_meta($post->ID, $shortname.'_photo_date_value', true) ?></span></li>
  103. </ul>
  104. </div>
  105.  
  106. <?php
  107. }
  108. ?>
  109.  
  110. </li>
  111.  
  112.  
  113.  
  114. <?php endwhile; ?>
  115.  
  116. <?php else : ?>
  117.  
  118. <h2><?php _e('No Entries found','pictree') ?></h2>
  119.  
  120. <?php endif; ?>
  121.  
  122. </ul>
  123.  
  124. <?php
  125.  
  126. /* Display navigation to next/previous pages when applicable */
  127. if (function_exists("max_pagination")) {
  128.  
  129. max_pagination();
  130.  
  131. }
  132.  
  133. ?>
  134. <?php endif; ?>
  135.  
  136.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement