Guest User

Untitled

a guest
Oct 17th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. # Find this:
  2.  
  3. // Get Patterns into a drop-down list
  4. $patterns = array();
  5. if(is_dir(TEMPLATEPATH . "/images/backgrounds/")) {
  6. if($open_dirs = opendir(TEMPLATEPATH . "/images/backgrounds/")) {
  7. while(($pattern = readdir($open_dirs)) !== false) {
  8. if(stristr($pattern, ".png") !== false) {
  9. $patterns[] = $pattern;
  10. }
  11. }
  12. }
  13. }
  14. $pattern_dropdown = sort($patterns);
  15. array_unshift($patterns, "None");
  16.  
  17. # Change to this:
  18.  
  19. // Get Patterns into a drop-down list
  20. $patterns = array();
  21. if(is_dir(TEMPLATEPATH . "/images/backgrounds/")) {
  22. if($open_dirs = opendir(TEMPLATEPATH . "/images/backgrounds/")) {
  23. while(($pattern = readdir($open_dirs)) !== false) {
  24. if(stristr($pattern, ".png") !== false || stristr($pattern, ".jpg") !== false) {
  25. $patterns[] = $pattern;
  26. }
  27. }
  28. }
  29. }
  30. $pattern_dropdown = sort($patterns);
  31. array_unshift($patterns, "None");
Add Comment
Please, Sign In to add comment