ngg_show_meta

Show meta data about an image.

Description

ngg_show_meta( $id ); 

Parameters (1)

0. $id
Int The ID of the image.

Usage

  1. if ( !function_exists( 'ngg_show_meta' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'nextcellent-gallery/admin/manage/actions.php'; 
  3.  
  4. // int The ID of the image. 
  5. $id = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = ngg_show_meta($id); 
  9.  

Defined (1)

The function is defined in the following location(s).

/admin/manage/actions.php  
  1. function ngg_show_meta( $id ) { 
  2. include_once( NGGALLERY_ABSPATH . '/lib/meta.php' ); 
  3.  
  4.  
  5. // let's get the meta data' 
  6. $meta = new nggMeta( $id ); 
  7. $dbdata = $meta->get_saved_meta(); 
  8. $exifdata = $meta->get_EXIF(); 
  9. $iptcdata = $meta->get_IPTC(); 
  10. $xmpdata = $meta->get_XMP(); 
  11. $class = ''; 
  12.  
  13. ?> 
  14. <!-- META DATA --> 
  15. <?php if ( $dbdata ) { ?> 
  16. <table id="the-list-x" style="width: 100%"> 
  17. <thead style="text-align: left;"> 
  18. <tr> 
  19. <th scope="col"><?php _e( 'Name', 'nggallery' ); ?></th> 
  20. <th scope="col"><?php _e( 'Value', 'nggallery' ); ?></th> 
  21. </tr> 
  22. </thead> 
  23. <?php 
  24. foreach ( $dbdata as $key => $value ) { 
  25. if ( is_array( $value ) ) { 
  26. continue; 
  27. $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"'; 
  28. echo '<tr ' . $class . '> 
  29. <td style="width:230px">' . esc_html( $meta->i8n_name( $key ) ) . '</td> 
  30. <td>' . esc_html( $value ) . '</td> 
  31. </tr>'; 
  32. ?> 
  33. </table> 
  34. <?php } else { 
  35. echo "<strong>" . __( 'No meta data saved', 'nggallery' ) . "</strong>"; 
  36. } ?> 
  37.  
  38. <!-- EXIF DATA --> 
  39. <?php if ( $exifdata ) { ?> 
  40. <h3><?php _e( 'EXIF Data', 'nggallery' ); ?></h3> 
  41. <?php if ( $exifdata ) { ?> 
  42. <table id="the-list-x" width="100%"> 
  43. <thead style="text-align: left;"> 
  44. <tr> 
  45. <th scope="col"><?php _e( 'Name', 'nggallery' ); ?></th> 
  46. <th scope="col"><?php _e( 'Value', 'nggallery' ); ?></th> 
  47. </tr> 
  48. </thead> 
  49. <?php 
  50. foreach ( $exifdata as $key => $value ) { 
  51. $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"'; 
  52. echo '<tr ' . $class . '> 
  53. <td style="width:230px">' . esc_html( $meta->i8n_name( $key ) ) . '</td> 
  54. <td>' . esc_html( $value ) . '</td> 
  55. </tr>'; 
  56. ?> 
  57. </table> 
  58. <?php } else { 
  59. echo "<strong>" . __( 'No exif data', 'nggallery' ) . "</strong>"; 
  60. } ?> 
  61. <?php } ?> 
  62.  
  63. <!-- IPTC DATA --> 
  64. <?php if ( $iptcdata ) { ?> 
  65. <h3><?php _e( 'IPTC Data', 'nggallery' ); ?></h3> 
  66. <table id="the-list-x" width="100%"> 
  67. <thead style="text-align: left;"> 
  68. <tr> 
  69. <th scope="col"><?php _e( 'Name', 'nggallery' ); ?></th> 
  70. <th scope="col"><?php _e( 'Value', 'nggallery' ); ?></th> 
  71. </tr> 
  72. </thead> 
  73. <?php 
  74. foreach ( $iptcdata as $key => $value ) { 
  75. $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"'; 
  76. echo '<tr ' . $class . '> 
  77. <td style="width:230px">' . esc_html( $meta->i8n_name( $key ) ) . '</td> 
  78. <td>' . esc_html( $value ) . '</td> 
  79. </tr>'; 
  80. ?> 
  81. </table> 
  82. <?php } ?> 
  83.  
  84. <!-- XMP DATA --> 
  85. <?php if ( $xmpdata ) { ?> 
  86. <h3><?php _e( 'XMP Data', 'nggallery' ); ?></h3> 
  87. <table id="the-list-x" width="100%"> 
  88. <thead> 
  89. <tr> 
  90. <th scope="col"><?php _e( 'Name', 'nggallery' ); ?></th> 
  91. <th scope="col"><?php _e( 'Value', 'nggallery' ); ?></th> 
  92. </tr> 
  93. </thead> 
  94. <?php 
  95. foreach ( $xmpdata as $key => $value ) { 
  96. $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"'; 
  97. echo '<tr ' . $class . '> 
  98. <td style="width:230px">' . esc_html( $meta->i8n_name( $key ) ) . '</td> 
  99. <td>' . esc_html( $value ) . '</td> 
  100. </tr>'; 
  101. ?> 
  102. </table> 
  103. <?php 
  104. } ?> 
  105. <script type="text/javascript"> 
  106. doAction = defaultAction; 
  107. </script> 
  108. <?php