// 1 START: Front-end Render (safe guards + shortcode + stats footer + pagination + one-level whitelist + grouped + jump menu + colors) if (!defined('ABSPATH')) { exit; } /** ABS→URL mapper (works when folder is under ABSPATH or DOCUMENT_ROOT). */ if (!function_exists('gmm_temp_abs_to_url')) { function gmm_temp_abs_to_url($abs) { $abs = wp_normalize_path($abs); $root = wp_normalize_path(ABSPATH); if (strpos($abs, $root) === 0 && function_exists('home_url')) { $rel = ltrim(substr($abs, strlen($root)), '/'); return home_url('/' . $rel); } if (!empty($_SERVER['DOCUMENT_ROOT'])) { $doc = wp_normalize_path($_SERVER['DOCUMENT_ROOT']); if (strpos($abs, $doc) === 0 && function_exists('home_url')) { $rel = ltrim(substr($abs, strlen($doc)), '/'); return home_url('/' . $rel); } } return ''; } } if (!function_exists('gmm_temp_build_gallery_html')) { function gmm_temp_build_gallery_html($post_id) { $t0 = microtime(true); $abs_dir = (string) get_post_meta($post_id, 'gmm_path', true); if (!$abs_dir) { return ''; } $abs_dir = wp_normalize_path($abs_dir); if (!is_dir($abs_dir)) { return '

Folder not found.

'; } // One-level whitelist: only immediate subfolders listed here $whitelist = ['animated','transparent','docs','images','video','audio','icons','textures','overlays','music','memes']; // Allowed extensions $img_ext = ['jpg','jpeg','png','webp','gif']; $other_ext = ['mp4','mov','m4v','mp3','ogg','pdf','zip']; // Exclusions (case-insensitive compare) $skip_file_names = ['index.php','index.html','thumbs.db','.ds_store']; $items = []; $top = @scandir($abs_dir); if (is_array($top)) { foreach ($top as $f) { if ($f === '.' || $f === '..' || $f[0] === '.') { continue; } $p = wp_normalize_path($abs_dir . '/' . $f); if (is_link($p)) { continue; } // never follow symlinks if (!is_dir($p)) { continue; } $group = strtolower($f); if (!in_array($group, $whitelist, true)) { continue; } // Only files directly inside this whitelisted subfolder (NOT deeper) $sub = @scandir($p); if (!is_array($sub)) { continue; } foreach ($sub as $s) { if ($s === '.' || $s === '..' || $s[0] === '.') { continue; } $pp = wp_normalize_path($p . '/' . $s); if (is_link($pp) || !is_file($pp)) { continue; } $bn_l = strtolower($s); if (in_array($bn_l, $skip_file_names, true)) { continue; } $ext = strtolower(pathinfo($pp, PATHINFO_EXTENSION)); if ($ext === 'json') { continue; } // hard exclude .json $url = gmm_temp_abs_to_url($pp); if (!$url) { continue; } if (in_array($ext, $img_ext, true)) { $items[] = ['type'=>'image','url'=>$url,'name'=>$s,'rel'=>$f.'/'.$s,'group'=>$group]; } elseif (in_array($ext, $other_ext, true)) { $items[] = ['type'=>'other','url'=>$url,'name'=>$s,'rel'=>$f.'/'.$s,'group'=>$group]; } } } } if (!$items) { return '

No media found in the immediate whitelisted subfolders.

'; } // Group counts $group_counts = []; foreach ($items as $it) { $group_counts[$it['group']] = ($group_counts[$it['group']] ?? 0) + 1; } // Sort by group then file name usort($items, function($a, $b) { $x = strnatcasecmp($a['group'], $b['group']); return $x !== 0 ? $x : strnatcasecmp($a['name'], $b['name']); }); // Pagination $per_page = function_exists('gmm_temp_get_per_page') ? gmm_temp_get_per_page(48) : 48; $page = isset($_GET['gmm_page']) ? max(1, (int) $_GET['gmm_page']) : 1; $total = count($items); $pages = max(1, (int) ceil($total / $per_page)); if ($page > $pages) { $page = $pages; } $offset = ($page - 1) * $per_page; $page_items = array_slice($items, $offset, $per_page); // Colors per group (used via CSS var --gmm-accent) $group_colors = [ 'images' => '#1e88e5', 'video' => '#e53935', 'audio' => '#8e24aa', 'docs' => '#00897b', 'animated' => '#fb8c00', 'transparent' => '#546e7a', 'icons' => '#5e35b1', 'textures' => '#6d4c41', 'overlays' => '#3949ab', 'music' => '#7b1fa2', 'memes' => '#d81b60', ]; // Minimal CSS (scoped) $css = ''; // Jump Menu (present groups + counts) $html = $css; $present_groups = array_keys($group_counts); natcasesort($present_groups); if (!empty($present_groups)) { $html .= '
Jump:'; foreach ($present_groups as $g) { $label = ucwords(str_replace('-', ' ', $g)); $count = (int) ($group_counts[$g] ?? 0); $color = $group_colors[$g] ?? '#777'; $html .= ''.$label.' ('.esc_html($count).')'; } $html .= '
'; } // Render grouped: open a grid per group encountered on this page $current_group = null; foreach ($page_items as $it) { if ($it['group'] !== $current_group) { if ($current_group !== null) { $html .= ''; } // close previous grid $current_group = $it['group']; $label = ucwords(str_replace('-', ' ', $current_group)); $count = (int) ($group_counts[$current_group] ?? 0); $color = $group_colors[$current_group] ?? '#444'; $html .= '
' . esc_html($label).' ('.esc_html($count).')
'; } if ($it['type'] === 'image') { $html .= '
' . '' . '
'.esc_html($it['name']).'
' . '
'.esc_html($it['rel']).'
' . '
'; } else { $html .= '
' . '
Download: '.esc_html($it['name']).'
' . '
'.esc_html($it['rel']).'
' . '
'; } } if ($current_group !== null) { $html .= '
'; } // close last grid // Pager if ($pages > 1) { $html .= '
'; if ($page > 1) { $html .= '« Prev'; } else { $html .= '« Prev'; } for ($i = 1; $i <= $pages; $i++) { if ($i === 1 || $i === $pages || abs($i - $page) <= 2) { $html .= ($i === $page) ? ''.esc_html($i).'' : ''.esc_html($i).''; } elseif ($i === 2 && $page > 4) { $html .= ''; } elseif ($i === $pages - 1 && $page < $pages - 3) { $html .= ''; } } if ($page < $pages) { $html .= 'Next »'; } else { $html .= 'Next »'; } $html .= '
'; } // Stats Footer $elapsed = max(0, microtime(true) - $t0); $ver = defined('GMM_TEMP_VERSION') ? GMM_TEMP_VERSION : 'v0.0'; $html .= '
Gameznet Media Manager — Temp Plugin ' . esc_html($ver) . ' • Render: ' . (function_exists('number_format_i18n') ? number_format_i18n($elapsed, 3) : number_format($elapsed, 3)) . 's • Items: '.esc_html($total).' • Page '.esc_html($page).' / '.esc_html($pages).'
'; return $html; } } if (!function_exists('gmm_temp_filter_the_content')) { function gmm_temp_filter_the_content($content) { if (!is_singular('post')) { return $content; } $post_id = get_the_ID(); if (!$post_id) { return $content; } $abs_dir = (string) get_post_meta($post_id, 'gmm_path', true); if (!$abs_dir) { return $content; } $gallery = gmm_temp_build_gallery_html($post_id); if (!$gallery) { return $content; } return $content . "\n\n" . $gallery; } add_filter('the_content', 'gmm_temp_filter_the_content', 12); } if (!function_exists('gmm_temp_shortcode_gallery')) { function gmm_temp_shortcode_gallery($atts = []) { $post_id = get_the_ID(); if (!$post_id) { return ''; } return gmm_temp_build_gallery_html($post_id); } add_shortcode('gmm_gallery', 'gmm_temp_shortcode_gallery'); } // 1 STOP: Front-end Render (safe guards + shortcode + stats footer + pagination + one-level whitelist + grouped + jump menu + colors) Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the bbpress domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/web/site/public_html/wp-includes/functions.php on line 6121 Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wpmudev domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/web/site/public_html/wp-includes/functions.php on line 6121 Warning: Cannot modify header information - headers already sent by (output started at /var/web/site/public_html/wp-content/plugins/gmm-temp-posts/core/render.php:1) in /var/web/site/public_html/wp-content/plugins/advanced-iframe/advanced-iframe.php on line 392 Warning: Cannot modify header information - headers already sent by (output started at /var/web/site/public_html/wp-content/plugins/gmm-temp-posts/core/render.php:1) in /var/web/site/public_html/wp-content/plugins/paid-memberships-pro/adminpages/reports/logins.php on line 458 Warning: session_start(): Session cannot be started after headers have already been sent in /var/web/site/public_html/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/masonry_entries/masonry_entries.php on line 112 Warning: session_start(): Session cannot be started after headers have already been sent in /var/web/site/public_html/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/portfolio/portfolio.php on line 65 Deprecated: Function bp_get_group_permalink is deprecated since version 12.0.0! Use bp_get_group_url() instead. in /var/web/site/public_html/wp-includes/functions.php on line 6121 Gallery – 3D Development – Gameznet Creators Hub
Profile Photo

3D Development

  • Public Group
  • 1 month ago
  • 6

    Posts

  • 1

    Members

3D Development's gallery/3D Analglyph Fun/3d-analglyph-wallpaper-gameznet-00035
3d-analglyph-wallpaper-gameznet-00035
3d-analglyph-wallpaper-gameznet-00035
Total Views: 119

The USS Enterprise

Description

For lovers and creators of 3D, augmented (AR) and virtual reality (VR) content.
If this is one of your passions then this is a group that you should join.