Exemplo n.º 1
0
<?php

#-------------------------------------------------------------------------------
/** @author Alex Keda, for www.host-food.ru */
/******************************************************************************/
/******************************************************************************/
$__args_list = array('IP', 'ExtraIP', 'Length');
/******************************************************************************/
eval(COMP_INIT);
/******************************************************************************/
/******************************************************************************/
$IPs = $ExtraIP ? Explode("\n", $ExtraIP) : array();
#-------------------------------------------------------------------------------
$IPs[] = $IP;
#-------------------------------------------------------------------------------
$IPs = Array_Unique($IPs);
#-------------------------------------------------------------------------------
$Count = Count($IPs);
#-------------------------------------------------------------------------------
if ($Count > 10) {
    $IPs = Array_Slice($IPs, 0, 9);
}
#-------------------------------------------------------------------------------
if (Mb_StrLen($IP) > $Length) {
    $IP = SPrintF('%s...', Mb_SubStr($IP, 0, $Length));
}
#-------------------------------------------------------------------------------
$A = new Tag('A', array('target' => 'blank', 'href' => SPrintF('http://%s/', $IP)), $IP);
#-------------------------------------------------------------------------------
$LinkID = UniqID('IPs');
#-------------------------------------------------------------------------------
Exemplo n.º 2
0
        $Filters[$Order['StatusID']] = array('Name' => isset($Statuses[$Order['StatusID']]) ? $Statuses[$Order['StatusID']]['Name'] : $Order['StatusID'], 'UsersIDs' => array());
    }
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Array = array();
#-------------------------------------------------------------------------------
if ($IsSearch) {
    #-------------------------------------------------------------------------------
    #Debug(SPrintF('[comp/Dispatch/Servers]: IsSearch = %s',print_r($IsSearch,true)));
    #-------------------------------------------------------------------------------
    foreach ($Orders as $Order) {
        if (In_Array($Order['Address'], $IsSearch)) {
            if (In_Array($Order['StatusID'], $IsSearch)) {
                $Array[] = $Order['UserID'];
            }
        }
    }
    #-------------------------------------------------------------------------------
    $Array = Array_Unique($Array);
    #-------------------------------------------------------------------------------
    #Debug(SPrintF('[comp/Dispatch/Servers]: Array = %s',Implode(',',$Array)));
    #-------------------------------------------------------------------------------
    $Filters['UsersIDs'] = $Array;
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return $Filters;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
Exemplo n.º 3
0
                            #---------------------------------------------------------------
                            break;
                        default:
                            return ERROR | @Trigger_Error(101);
                    }
                    #---------------------------------------------------------------
                }
                #---------------------------------------------------------------
                #---------------------------------------------------------------
                foreach ($Employers as $Employer) {
                    $UserIDs[] = $Employer['ID'];
                }
                #---------------------------------------------------------------
                ASort($UserIDs);
                #---------------------------------------------------------------
                $UserIDs = Array_Unique($UserIDs);
                #---------------------------------------------------------------
                Debug(SPrintF("[comp/www/Administrator/PersonalStatistics]: найдено %s сотрудников", SizeOf($UserIDs)));
                break;
            default:
                return ERROR | @Trigger_Error(101);
        }
        break;
    default:
        return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Table = array();
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
Exemplo n.º 4
0
                    continue;
                }
                #-------------------------------------------------------------------------
                $pCity = $Attribs['pCity'];
                #-------------------------------------------------------------------------
                if (!$pCity) {
                    continue;
                }
                #-------------------------------------------------------------------------
                $FilterID = Md5($pCity);
                #-------------------------------------------------------------------------
                if (!isset($Filters[$FilterID])) {
                    $Filters[$FilterID] = array('Name' => $pCity, 'UsersIDs' => array());
                }
                #-------------------------------------------------------------------------
                $Filters[$FilterID]['UsersIDs'][] = $Profile['UserID'];
            }
            #---------------------------------------------------------------------------
            foreach ($Filters as $FilterID => $Filter) {
                $Filters[$FilterID]['UsersIDs'] = Array_Unique($Filters[$FilterID]['UsersIDs']);
            }
            #---------------------------------------------------------------------------
            Array_UnShift($Filters, 'Города');
            #---------------------------------------------------------------------------
            return $Filters;
        default:
            return ERROR | @Trigger_Error(101);
    }
}
return FALSE;
#-------------------------------------------------------------------------------
Exemplo n.º 5
0
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Owners = DB_Select('UsrOwners', '*');
#-------------------------------------------------------------------------------
switch (ValueOf($Owners)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return FALSE;
    case 'array':
        break;
    default:
        return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$UsersIDs = array();
#-------------------------------------------------------------------------------
foreach ($Owners as $Owner) {
    $UsersIDs[] = $Owner['DistinctOwnerID'];
}
#-------------------------------------------------------------------------------
Array_Unique($UsersIDs);
#-------------------------------------------------------------------------------
$Filters['UsersWithReferals']['UsersIDs'] = $UsersIDs;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return $Filters;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
Exemplo n.º 6
0
<?php

#-------------------------------------------------------------------------------
/** @author Великодный В.В. (Joonte Ltd.) */
/******************************************************************************/
/******************************************************************************/
$__args_list = array('Domain', 'Parked', 'Length');
/******************************************************************************/
eval(COMP_INIT);
/******************************************************************************/
/******************************************************************************/
$Domains = $Parked ? Explode(',', $Parked) : array();
#-------------------------------------------------------------------------------
$Domains[] = $Domain;
#-------------------------------------------------------------------------------
$Domains = Array_Unique($Domains);
#-------------------------------------------------------------------------------
$Count = Count($Domains);
#-------------------------------------------------------------------------------
if ($Count > 10) {
    $Domains = Array_Slice($Domains, 0, 9);
}
#-------------------------------------------------------------------------------
$Domain = $Text = Current($Domains);
#-------------------------------------------------------------------------------
if (Mb_StrLen($Text) > $Length) {
    $Text = SPrintF('%s...', Mb_SubStr($Text, 0, $Length));
}
#-------------------------------------------------------------------------------
$A = new Tag('A', array('target' => 'blank', 'href' => SPrintF('http://%s/', $Domain)), $Text);
#-------------------------------------------------------------------------------
Exemplo n.º 7
0
 public function Get_Template_Files()
 {
     $arr_template = Array_Unique(Array_Merge((array) Glob(DirName(__FILE__) . '/templates/*.php'), (array) Glob(DirName(__FILE__) . '/templates/*/*.php'), (array) Glob(Get_StyleSheet_Directory() . '/*.php'), (array) Glob(Get_StyleSheet_Directory() . '/*/*.php'), Is_Child_Theme() ? (array) Glob(Get_Template_Directory() . '/*.php') : array(), Is_Child_Theme() ? (array) Glob(Get_Template_Directory() . '/*/*.php') : array(), (array) Glob($this->template_dir . '/*.php'), (array) Glob($this->template_dir . '/*/*.php')));
     # Filter to add template files - you can use this filter to add template files to the user interface
     $arr_template = Apply_Filters('fancy_gallery_template_files', $arr_template);
     # Check if there template files
     if (empty($arr_template)) {
         return False;
     }
     $arr_result = array();
     $arr_sort = array();
     foreach ($arr_template as $index => $template_file) {
         # Read meta data from the template
         if ($arr_properties = $this->Get_Template_Properties($template_file)) {
             $stylesheet_file = SubStr($template_file, 0, -4) . '.css';
             $stylesheet_url = Is_File($stylesheet_file);
             if ($stylesheet_url) {
                 if (StrPos($stylesheet_file, DirName(__FILE__)) === 0) {
                     # the template is inside the plugin folder
                     $stylesheet_url = $this->base_url . SubStr($stylesheet_file, StrLen(DirName(__FILE__)));
                 } elseif (StrPos($stylesheet_file, ABSPATH) === 0) {
                     # the template is inside the wordpress folder
                     $stylesheet_url = Get_Bloginfo('wpurl') . '/' . SubStr($stylesheet_file, Strlen(ABSPATH));
                 } else {
                     $stylesheet_url = $stylesheet_file = False;
                 }
             }
             $arr_result[$arr_properties['name']] = Array_Merge($arr_properties, array('file' => $template_file, 'stylesheet_file' => Is_File($stylesheet_file) ? $stylesheet_file : False, 'stylesheet_uri' => $stylesheet_url));
             $arr_sort[$arr_properties['name']] = StrToLower($arr_properties['name']);
         } else {
             continue;
         }
     }
     Array_MultiSort($arr_sort, SORT_STRING, SORT_ASC, $arr_result);
     return $arr_result;
 }
 function Get_Template_Files()
 {
     $arr_template = Array_Unique(Array_Merge((array) Glob(DirName(__FILE__) . '/templates/*.php'), (array) Glob(DirName(__FILE__) . '/templates/*/*.php'), (array) Glob(Get_StyleSheet_Directory() . '/*.php'), (array) Glob(Get_StyleSheet_Directory() . '/*/*.php'), Is_Child_Theme() ? (array) Glob(Get_Template_Directory() . '/*.php') : array(), Is_Child_Theme() ? (array) Glob(Get_Template_Directory() . '/*/*.php') : array(), (array) Glob($this->template_dir . '/*.php'), (array) Glob($this->template_dir . '/*/*.php')));
     // Filter to add template files - you can use this filter to add template files to the user interface
     $arr_template = (array) Apply_Filters('fancy_gallery_template_files', $arr_template);
     // Check if there template files
     if (empty($arr_template)) {
         return False;
     }
     $arr_result = array();
     $arr_sort = array();
     foreach ($arr_template as $index => $template_file) {
         // Read meta data from the template
         if (!($arr_properties = $this->Get_Template_Properties($template_file))) {
             continue;
         } else {
             $arr_result[$arr_properties['name']] = Array_Merge($arr_properties, array('file' => $template_file));
             $arr_sort[$arr_properties['name']] = StrToLower($arr_properties['name']);
         }
     }
     Array_MultiSort($arr_sort, SORT_STRING, SORT_ASC, $arr_result);
     return $arr_result;
 }