[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/includes/functions/ -> dynamic_mopics.php (source)

   1  <?php
   2  /*
   3  $Id: dynamic_mopics.php 3 2006-05-27 04:59:07Z user $
   4  
   5    Dynamic MoPics version 3.000, built for osCommerce MS2
   6  
   7    Copyright 2006 osCMax2004-2005 Josh Dechant
   8  
   9    Released under the GNU General Public License
  10  */
  11  
  12  	function mopics_file_exists($file_base, $file_types = DYNAMIC_MOPICS_THUMB_IMAGE_TYPES) {
  13          $file_types = str_replace(' ', '', $file_types);
  14          $file_types = split('[,]', $file_types);
  15          
  16          foreach ($file_types as $file_type) {
  17              if (file_exists($file_base . '.' . $file_type)) {
  18                  return $file_type;
  19              }
  20          }
  21          
  22          return false;
  23      }
  24  
  25  	function mopics_match_pattern($pattern) {
  26          if (preg_match('/{.*}/U', $pattern, $matches)) {
  27              return $matches[0];
  28          }
  29  
  30          return false;
  31      }
  32  
  33  	function mopics_getmethod($pattern) {
  34          return str_replace(array('{', '}'), '', mopics_match_pattern($pattern));
  35      }
  36      
  37  	function mopics_get_imagebase($image, $pre_append = '') {
  38          return $pre_append . substr($image, ((DYNAMIC_MOPICS_MAINTHUMB_IN_THUMBS_DIR == 'true') ? strlen(DYNAMIC_MOPICS_THUMBS_DIR) : 0), ((DYNAMIC_MOPICS_MAINTHUMB_IN_THUMBS_DIR == 'true') ? (strrpos($image, '.') - strlen(DYNAMIC_MOPICS_THUMBS_DIR)) : strrpos($image, '.')) );
  39      }
  40  ?>


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7