SHARE
TWEET

BBCode Image Bank

fidle89 Feb 7th, 2019 (edited) 20 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <div class="grid-tab">
  2. <?php foreach ($imgBankArray as $grabCategory) : ?>
  3. <input type="button" class="grid-tab-link" onclick="showCode(event, '<?= $grabCategory['directory'] ?>')" value="<?= $grabCategory['title'] ?>" />
  4. <?php endforeach; ?>
  5. </div>
  6. <?php foreach ($imgBankArray as $grabCategory) : ?>
  7. <div id="<?= $grabCategory['directory'] ?>" class="grid-tab-content">
  8. <?php $bbImgGrab = glob('graphics/'.$grabCategory['directory'].'/*.{png,gif}', GLOB_BRACE); ?>
  9. <?php if ($grabCategory['parse'] == '<br>') {$implodeImg = implode("[/img][/td][td][img]", $bbImgGrab);} else {$implodeImg = implode("[/img][img]", $bbImgGrab);} ?>
  10.     <textarea style="width: 100.7%; min-height: 200px" onclick="this.select()">
  11. <?php if ($grabCategory['parse'] == '<br>') : ?>[table][tr][td]<?= $implodeImg ?>[/td][/tr][/table]<?php else : ?>[img]<?= $implodeImg ?>[/img]<?php endif; ?>
  12.     </textarea>
  13. </div>
  14. <?php endforeach; ?>
  15.  
  16. <script>
  17.     function showCode(evt, res) {
  18.         var i, gridTabContent, gridTabLinks;
  19.         gridTabContent = document.getElementsByClassName("grid-tab-content");
  20.         for (i = 0; i < gridTabContent.length; i++) {
  21.             gridTabContent[i].style.display = "none";
  22.         }
  23.         gridTabLinks = document.getElementsByClassName("grid-tab-link");
  24.         for (i = 0; i < gridTabLinks.length; i++) {
  25.             gridTabLinks[i].className = gridTabLinks[i].className.replace(" active", "");
  26.         }
  27.         document.getElementById(res).style.display = "block";
  28.         evt.currentTarget.className += " active";
  29.     }
  30. </script>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top