function jeRobot() { //(funkce převzata z http://seo.nawebu.cz/200301/0287.html) $robot = 0; $agent_test = " " . StrToLower($_SERVER["HTTP_USER_AGENT"]); if (!StrPos($agent_test, "mozilla") && !StrPos($agent_test, "opera") && !StrPos($agent_test, "links") && !StrPos($agent_test, "lynx") && !StrPos($agent_test, "icab") && !StrPos($agent_test, "reqwireless")) { $robot = 1; } else { if (StrPos($agent_test, "@")) { $robot = 1; } if (StrPos($agent_test, "search")) { $robot = 1; } if (StrPos($agent_test, "crawl")) { $robot = 1; } if (StrPos($agent_test, "bot")) { $robot = 1; } if (StrPos($agent_test, "spider")) { $robot = 1; } if (StrPos($agent_test, "jeeves")) { $robot = 1; } } return $robot; }
function __UnEscapeTmp(&$item, $key) { if (Is_Array($item)) { Array_Walk($item, '__UnEscapeTmp'); } else { if (StrPos($item, "%u") !== false) { $item = $GLOBALS["APPLICATION"]->UnJSEscape($item); } } }
static function filterContent($content) { global $post; if ($post->post_type == Post_Type::$post_type_name && Is_Single($post->ID)) { if (StrPos($content, '[glossary_related_terms]') === False && StrPos($content, '[glossary_related_terms ') === False && Options::Get('related_terms') != 'none' && !post_password_required()) { $content .= Shortcodes::Related_Terms(); } } return $content; }
function Get_Active_Extensions() { $arr_extension = array(); foreach ((array) get_option('active_plugins') as $plugin_file) { $plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin_file); if (StrPos(StrToLower($plugin_data['Author']), 'dennis hoppe') !== False) { $arr_extension[$plugin_file] = $plugin_data; } } return $arr_extension; }
function Decrypt($S) { $chars = "KECTDPOSWNMFGQHL"; $S = Substr($S, 1); $s1 = ""; for ($F = 0; $F < StrLen($S) / 2; $F++) { $f1 = StrPos($chars, substr($S, $F, 1)); $f2 = StrPos($chars, substr($S, StrLen($S) / 2 + $F, 1)); $f2 = $f2 << 4; $ff = $f1 | $f2; $s1 = $s1 . Chr($ff); } return $s1; }
function Cpanel_Get_Domains($Settings) { /****************************************************************************/ $__args_types = array('array'); #----------------------------------------------------------------------------- $__args__ = Func_Get_Args(); eval(FUNCTION_INIT); /****************************************************************************/ $HTTP = array('Address' => $Settings['Params']['IP'], 'Port' => $Settings['Port'], 'Host' => $Settings['Address'], 'Protocol' => $Settings['Protocol'], 'Basic' => SPrintF('%s:%s', $Settings['Login'], $Settings['Password']), 'IsLogging' => $Settings['Params']['IsLogging']); #----------------------------------------------------------------------------- $Request = array('nohtml' => 'y'); #----------------------------------------------------------------------------- $Response = HTTP_Send('/scripts2/listsubdomains', $HTTP, $Request); if (Is_Error($Response)) { return ERROR | @Trigger_Error('[Cpanel_Get_Domains]: не удалось осуществить запрос'); } #----------------------------------------------------------------------------- $Result = array(); #----------------------------------------------------------------------------- foreach (Explode("\n", $Response['Body']) as $Invoice) { #--------------------------------------------------------------------------- if (Preg_Match('/.+\\:.+\\:.+/', $Invoice)) { #------------------------------------------------------------------------- $Invoice = Explode(':', $Invoice); #------------------------------------------------------------------------- if (Count($Invoice) != 3) { continue; } #------------------------------------------------------------------------- $Invoice = Array_Combine(array('Domain', 'User', 'Parkeds'), $Invoice); #------------------------------------------------------------------------- $Domains = array($Invoice['Domain']); #------------------------------------------------------------------------- $Parkeds = Explode('|', $Invoice['Parkeds']); #------------------------------------------------------------------------- Array_Pop($Parkeds); #------------------------------------------------------------------------- foreach ($Parkeds as $Parked) { #----------------------------------------------------------------------- $Parked = Explode('=', $Parked); #----------------------------------------------------------------------- if (Count($Parked) != 2) { continue; } #----------------------------------------------------------------------- $Parked = Array_Combine(array('Domain1', 'Domain2'), $Parked); #----------------------------------------------------------------------- $Domain2 = $Parked['Domain2']; #----------------------------------------------------------------------- if ($Parked['Domain1'] || $Domain2) { #--------------------------------------------------------------------- if (StrLen($Domain2) > 1) { #------------------------------------------------------------------- $Domain2 = Explode(',', $Domain2); #------------------------------------------------------------------- Array_Pop($Domain2); #------------------------------------------------------------------- foreach ($Domain2 as $Domain) { $Domains[] = $Domain; } } else { $Domains[] = $Parked['Domain1']; } } } #------------------------------------------------------------------------- $Result[$Invoice['User']] = $Domains; } } #----------------------------------------------------------------------------- $Request = array('nohtml' => 'y'); #----------------------------------------------------------------------------- $Response = HTTP_Send('/scripts2/listparked', $HTTP, $Request); if (Is_Error($Response)) { return ERROR | @Trigger_Error('[Cpanel_Get_Domains]: не удалось осуществить запрос'); } #----------------------------------------------------------------------------- foreach (Explode("\n", $Response['Body']) as $Invoice) { #--------------------------------------------------------------------------- if (Preg_Match('/.+\\:.+\\:.+/', $Invoice)) { #------------------------------------------------------------------------- $Invoice = Explode(':', $Invoice); #------------------------------------------------------------------------- if (Count($Invoice) != 3) { continue; } #------------------------------------------------------------------------- $Invoice = Array_Combine(array('Domain', 'User', 'Parkeds'), $Invoice); #------------------------------------------------------------------------- $User = $Invoice['User']; #------------------------------------------------------------------------- if (isset($Result[$User])) { $Result[$User] = array(); } #------------------------------------------------------------------------- $Result[$User][] = $Invoice['Domain']; } } #----------------------------------------------------------------------------- $Request = array('viewall' => 1, 'nohtml' => 'y'); #----------------------------------------------------------------------------- $Response = HTTP_Send('/scripts2/listaccts', $HTTP, $Request); if (Is_Error($Response)) { return ERROR | @Trigger_Error('[Cpanel_Get_Domains]: не удалось осуществить запрос'); } #----------------------------------------------------------------------------- foreach (Explode("\n", $Response['Body']) as $Invoice) { #--------------------------------------------------------------------------- if (Preg_Match('/.+\\=.+\\,.+\\,.+/', $Invoice)) { #------------------------------------------------------------------------- $Invoice = Array_Combine(array('User', 'Domain'), Explode('=', SubStr($Invoice, 0, StrPos($Invoice, ',')))); #------------------------------------------------------------------------- $User = $Invoice['User']; #------------------------------------------------------------------------- if (isset($Result[$User])) { $Result[$User] = array(); } #------------------------------------------------------------------------- $Result[$User][] = $Invoice['Domain']; } } #----------------------------------------------------------------------------- if (!Count($Result)) { return new gException('DOMAINS_NOT_FOUND', 'Домены не найдены'); } #----------------------------------------------------------------------------- return $Result; }
function mp3_id($file) { // Lux: we keep all variables internal within this function, that way our global namespace // is kept clean, and we can still call this method like a function without instantiating // a whole class to do so. //global $version, $layer, $crc, $bitrate, $bitindex, $freq, $mode, $copy, $genres; // Corrected by Luca (18/06/01): luca@linuxmendoza.org.ar $genres = array('Blues', 'Classic Rock', 'Country', 'Dance', 'Disco', 'Funk', 'Grunge', 'Hip-Hop', 'Jazz', 'Metal', 'New Age', 'Oldies', 'Other', 'Pop', 'R&B', 'Rap', 'Reggae', 'Rock', 'Techno', 'Industrial', 'Alternative', 'Ska', 'Death Metal', 'Pranks', 'Soundtrack', 'Euro-Techno', 'Ambient', 'Trip-Hop', 'Vocal', 'Jazz+Funk', 'Fusion', 'Trance', 'Classical', 'Instrumental', 'Acid', 'House', 'Game', 'Sound Clip', 'Gospel', 'Noise', 'AlternRock', 'Bass', 'Soul', 'Punk', 'Space', 'Meditative', 'Instrumental Pop', 'Instrumental Rock', 'Ethnic', 'Gothic', 'Darkwave', 'Techno-Industrial', 'Electronic', 'Pop-Folk', 'Eurodance', 'Dream', 'Southern Rock', 'Comedy', 'Cult', 'Gangsta', 'Top 40', 'Christian Rap', 'Pop/Funk', 'Jungle', 'Native American', 'Cabaret', 'New Wave', 'Psychadelic', 'Rave', 'Showtunes', 'Trailer', 'Lo-Fi', 'Tribal', 'Acid Punk', 'Acid Jazz', 'Polka', 'Retro', 'Musical', 'Rock & Roll', 'Hard Rock', 'Folk', 'Folk-Rock', 'National Folk', 'Swing', 'Fast Fusion', 'Bebob', 'Latin', 'Revival', 'Celtic', 'Bluegrass', 'Avantgarde', 'Gothic Rock', 'Progressive Rock', 'Psychedelic Rock', 'Symphonic Rock', 'Slow Rock', 'Big Band', 'Chorus', 'Easy Listening', 'Acoustic', 'Humour', 'Speech', 'Chanson', 'Opera', 'Chamber Music', 'Sonata', 'Symphony', 'Booty Bass', 'Primus', 'P**n Groove', 'Satire', 'Slow Jam', 'Club', 'Tango', 'Samba', 'Folklore', 'Ballad', 'Power Ballad', 'Rhythmic Soul', 'Freestyle', 'Duet', 'Punk Rock', 'Drum Solo', 'Acapella', 'Euro-House', 'Dance Hall'); $genreids = array("Blues" => 0, "Classic Rock" => 1, "Country" => 2, "Dance" => 3, "Disco" => 4, "Funk" => 5, "Grunge" => 6, "Hip-Hop" => 7, "Jazz" => 8, "Metal" => 9, "New Age" => 10, "Oldies" => 11, "Other" => 12, "Pop" => 13, "R&B" => 14, "Rap" => 15, "Reggae" => 16, "Rock" => 17, "Techno" => 18, "Industrial" => 19, "Alternative" => 20, "Ska" => 21, "Death Metal" => 22, "Pranks" => 23, "Soundtrack" => 24, "Euro-Techno" => 25, "Ambient" => 26, "Trip-Hop" => 27, "Vocal" => 28, "Jazz+Funk" => 29, "Fusion" => 30, "Trance" => 31, "Classical" => 32, "Instrumental" => 33, "Acid" => 34, "House" => 35, "Game" => 36, "Sound Clip" => 37, "Gospel" => 38, "Noise" => 39, "AlternRock" => 40, "Bass" => 41, "Soul" => 42, "Punk" => 43, "Space" => 44, "Meditative" => 45, "Instrumental Pop" => 46, "Instrumental Rock" => 47, "Ethnic" => 48, "Gothic" => 49, "Darkwave" => 50, "Techno-Industrial" => 51, "Electronic" => 52, "Pop-Folk" => 53, "Eurodance" => 54, "Dream" => 55, "Southern Rock" => 56, "Comedy" => 57, "Cult" => 58, "Gangsta" => 59, "Top 40" => 60, "Christian Rap" => 61, "Pop/Funk" => 62, "Jungle" => 63, "Native American" => 64, "Cabaret" => 65, "New Wave" => 66, "Psychadelic" => 67, "Rave" => 68, "Showtunes" => 69, "Trailer" => 70, "Lo-Fi" => 71, "Tribal" => 72, "Acid Punk" => 73, "Acid Jazz" => 74, "Polka" => 75, "Retro" => 76, "Musical" => 77, "Rock & Roll" => 78, "Hard Rock" => 79, "Folk" => 80, "Folk-Rock" => 81, "National Folk" => 82, "Swing" => 83, "Fast Fusion" => 84, "Bebob" => 85, "Latin" => 86, "Revival" => 87, "Celtic" => 88, "Bluegrass" => 89, "Avantgarde" => 90, "Gothic Rock" => 91, "Progressive Rock" => 92, "Psychedelic Rock" => 93, "Symphonic Rock" => 94, "Slow Rock" => 95, "Big Band" => 96, "Chorus" => 97, "Easy Listening" => 98, "Acoustic" => 99, "Humour" => 100, "Speech" => 101, "Chanson" => 102, "Opera" => 103, "Chamber Music" => 104, "Sonata" => 105, "Symphony" => 106, "Booty Bass" => 107, "Primus" => 108, "P**n Groove" => 109, "Satire" => 110, "Slow Jam" => 111, "Club" => 112, "Tango" => 113, "Samba" => 114, "Folklore" => 115, "Ballad" => 116, "Power Ballad" => 117, "Rhythmic Soul" => 118, "Freestyle" => 119, "Duet" => 120, "Punk Rock" => 121, "Drum Solo" => 122, "Acapella" => 123, "Euro-House" => 124, "Dance Hall" => 125); // end $version = array("00" => 2.5, "10" => 2, "11" => 1); $layer = array("01" => 3, "10" => 2, "11" => 1); $crc = array("Yes", "No"); $bitrate["0001"] = array(32, 32, 32, 32, 8, 8); $bitrate["0010"] = array(64, 48, 40, 48, 16, 16); $bitrate["0011"] = array(96, 56, 48, 56, 24, 24); $bitrate["0100"] = array(128, 64, 56, 64, 32, 32); $bitrate["0101"] = array(160, 80, 64, 80, 40, 40); $bitrate["0110"] = array(192, 96, 80, 96, 48, 48); $bitrate["0111"] = array(224, 112, 96, 112, 56, 56); $bitrate["1000"] = array(256, 128, 112, 128, 64, 64); $bitrate["1001"] = array(288, 160, 128, 144, 80, 80); $bitrate["1010"] = array(320, 192, 160, 160, 96, 96); $bitrate["1011"] = array(352, 224, 192, 176, 112, 112); $bitrate["1100"] = array(384, 256, 224, 192, 128, 128); $bitrate["1101"] = array(416, 320, 256, 224, 144, 144); $bitrate["1110"] = array(448, 384, 320, 256, 160, 160); $bitindex = array("1111" => "0", "1110" => "1", "1101" => "2", "1011" => "3", "1010" => "4", "1001" => "5", "0011" => "3", "0010" => 4, "0001" => "5"); $freq["00"] = array("11" => 44100, "10" => 22050, "00" => 11025); $freq["01"] = array("11" => 48000, "10" => 24000, "00" => 12000); $freq["10"] = array("11" => 32000, "10" => 16000, "00" => 8000); $mode = array("00" => "Stereo", "01" => "Joint stereo", "10" => "Dual channel", "11" => "Mono"); $copy = array("No", "Yes"); if (!($f = @fopen($file, "r"))) { return -1; break; } else { // read first 4 bytes from file and determine if it is wave file if so, header begins five bytes after word 'data' $tmp = fread($f, 4); if ($tmp == "RIFF") { $idtag["ftype"] = "Wave"; fseek($f, 0); $tmp = fread($f, 128); $x = StrPos($tmp, "data"); fseek($f, $x + 8); $tmp = fread($f, 4); } // now convert those four bytes to BIN. maybe it can be faster and easier. dunno how yet. help? for ($y = 0; $y < 4; $y++) { $x = decbin(ord($tmp[$y])); for ($i = 0; $i < 8 - StrLen($x); $i++) { $x .= "0"; } $bajt .= $x; } // every mp3 framesynch begins with eleven ones, lets look for it. if not found continue looking for some 1024 bytes (you can search multiple for it or you can disable this, it will speed up and not many mp3 are like this. anyways its not standart) // if(substr($bajt,1,11)!="11111111111") { // return -1; // break; // } if (substr($bajt, 1, 11) != "11111111111") { fseek($f, 4); $tmp = fread($f, 2048); for ($i = 0; $i < 2048; $i++) { if (ord($tmp[$i]) == 255 && substr(decbin(ord($tmp[$i + 1])), 0, 3) == "111") { $tmp = substr($tmp, $i, 4); $bajt = ""; for ($y = 0; $y < 4; $y++) { $x = decbin(ord($tmp[$y])); for ($i = 0; $i < 8 - StrLen($x); $i++) { $x .= "0"; } $bajt .= $x; } break; } } } if ($bajt == "") { return -1; break; } // now parse all the info from frame header $len = filesize($file); $idtag["version"] = $version[substr($bajt, 11, 2)]; $idtag["layer"] = $layer[substr($bajt, 13, 2)]; $idtag["crc"] = $crc[$bajt[15]]; $idtag["bitrate"] = $bitrate[substr($bajt, 16, 4)][$bitindex[substr($bajt, 11, 4)]]; $idtag["frequency"] = $freq[substr($bajt, 20, 2)][substr($bajt, 11, 2)]; $idtag["padding"] = $copy[$bajt[22]]; $idtag["mode"] = $mode[substr($bajt, 24, 2)]; $idtag["copyright"] = $copy[$bajt[28]]; $idtag["original"] = $copy[$bajt[29]]; // lets count lenght of the song if ($idtag["layer"] == 1) { $fsize = (12 * ($idtag["bitrate"] * 1000) / $idtag["frequency"] + $idtag["padding"]) * 4; } else { $fsize = 144 * ($idtag["bitrate"] * 1000 / $idtag["frequency"] + $idtag["padding"]); } // Modified by Luca (18/02/01): devel@lluca.com $idtag["lenght_sec"] = round($len / Round($fsize) / 38.37); // end $idtag["lenght"] = date("i:s", round($len / Round($fsize) / 38.37)); // now lets see at the end of the file for id3 tag. if exists then parse it. if file doesnt have an id 3 tag if will return -1 in field 'tag' and if title is empty it returns file name. if (!$len) { $len = filesize($file); } fseek($f, $len - 128); $tag = fread($f, 128); if (Substr($tag, 0, 3) == "TAG") { $idtag["file"] = $file; $idtag["tag"] = -1; // Modified by Luca (18/02/01): devel@lluca.com $idtag["title"] = Mp3Parser::strip_nulls(Substr($tag, 3, 30)); $idtag["artist"] = Mp3Parser::strip_nulls(Substr($tag, 33, 30)); $idtag["album"] = Mp3Parser::strip_nulls(Substr($tag, 63, 30)); $idtag["year"] = Mp3Parser::strip_nulls(Substr($tag, 93, 4)); $idtag["comment"] = Mp3Parser::strip_nulls(Substr($tag, 97, 30)); // If the comment is less than 29 chars, we look for the presence of a track # if (strlen($idtag["comment"]) < 29) { if (Ord(Substr($tag, 125, 1)) == chr(0)) { // If char 125 is null then track (maybe) is present $idtag["track"] = Ord(Substr($tag, 126, 1)); } else { // If not, we are sure is not present. $idtag["track"] = 0; } } else { // If the comment is 29 or 30 chars long, there's no way to put track # $idtag["track"] = 0; } // end $idtag["genreid"] = Ord(Substr($tag, 127, 1)); $idtag["genre"] = $genres[$idtag["genreid"]]; $idtag["filesize"] = $len; } else { $idtag["tag"] = 0; } // close opened file and return results. if (!$idtag["title"]) { $idtag["title"] = Str_replace("\\", "/", $file); $idtag["title"] = substr($idtag["title"], strrpos($idtag["title"], "/") + 1, 255); } fclose($f); return $idtag; } }
function CopyComponent($componentName, $newNamespace, $newName = False, $bRewrite = False) { global $APPLICATION; $componentName = trim($componentName); if (strlen($componentName) <= 0) { $APPLICATION->ThrowException(GetMessage("comp_util_err1"), "EMPTY_COMPONENT_NAME"); return false; } $path2Comp = CComponentEngine::MakeComponentPath($componentName); if (strlen($path2Comp) <= 0) { $APPLICATION->ThrowException(str_replace("#NAME#", $componentName, GetMessage("comp_util_err2")), "ERROR_NOT_COMPONENT"); return false; } $componentPath = "/bitrix/components" . $path2Comp; if (!CComponentUtil::isComponent($componentPath)) { $APPLICATION->ThrowException(str_replace("#NAME#", $componentName, GetMessage("comp_util_err2")), "ERROR_NOT_COMPONENT"); return false; } $newNamespace = trim($newNamespace); if (strlen($newNamespace) > 0) { $newNamespaceTmp = preg_replace("#[^A-Za-z0-9_.-]#i", "", $newNamespace); if ($newNamespace != $newNamespaceTmp) { $APPLICATION->ThrowException(str_replace("#NAME#", $newNamespace, GetMessage("comp_util_err3")), "ERROR_NEW_NAMESPACE"); return false; } } if (strlen($newName) <= 0) { $newName = False; } if ($newName !== False) { if (!preg_match("#^([A-Za-z0-9_-]+\\.)*([A-Za-z0-9_-]+)\$#i", $newName)) { $APPLICATION->ThrowException(str_replace("#NAME#", $newName, GetMessage("comp_util_err4")), "ERROR_NEW_NAME"); return false; } } $namespace = ""; $name = $componentName; if (($pos = StrPos($componentName, ":")) !== False) { $namespace = SubStr($componentName, 0, $pos); $name = SubStr($componentName, $pos + 1); } if ($namespace == $newNamespace && ($newName === False || $newName !== False && $name == $newName)) { $APPLICATION->ThrowException(GetMessage("comp_util_err5"), "ERROR_DUPL1"); return false; } if ($newName !== False) { $componentNameNew = $newNamespace . ":" . $newName; } else { $componentNameNew = $newNamespace . ":" . $name; } $path2CompNew = CComponentEngine::MakeComponentPath($componentNameNew); if (strlen($path2CompNew) <= 0) { $APPLICATION->ThrowException(str_replace("#NAME#", $componentNameNew, GetMessage("comp_util_err2")), "ERROR_NOT_COMPONENT"); return false; } $componentPathNew = "/bitrix/components" . $path2CompNew; if (file_exists($_SERVER["DOCUMENT_ROOT"] . $componentPathNew)) { if (!$bRewrite) { $APPLICATION->ThrowException(str_replace("#NAME#", $componentNameNew, GetMessage("comp_util_err6")), "ERROR_EXISTS"); return false; } else { DeleteDirFilesEx($componentPathNew); } } CheckDirPath($_SERVER["DOCUMENT_ROOT"] . $componentPathNew); CopyDirFiles($_SERVER["DOCUMENT_ROOT"] . $componentPath, $_SERVER["DOCUMENT_ROOT"] . $componentPathNew, True, True, False); return null; }
if (IntVal($arParams["USERGROUPS_MODIFY"]) > 0) { $arParams["USERGROUPS_MODIFY"] = array($arParams["USERGROUPS_MODIFY"]); } else { $arParams["USERGROUPS_MODIFY"] = array(); } } if (!Is_Array($arParams["USERGROUPS_RESERVE"])) { if (IntVal($arParams["USERGROUPS_RESERVE"]) > 0) { $arParams["USERGROUPS_RESERVE"] = array($arParams["USERGROUPS_RESERVE"]); } else { $arParams["USERGROUPS_RESERVE"] = array(); } } $meetingId = IntVal($arParams["MEETING_ID"]); if ($meetingId <= 0) { $meetingId = IntVal($_REQUEST[$arParams["MEETING_VAR"]]); } $arResult["Page"] = Trim($arParams["PAGE_ID"]); if (StrLen($arResult["Page"]) <= 0) { $arResult["Page"] = Trim($_REQUEST[$arParams["PAGE_VAR"]]); } $arResult["Urls"]["MeetingList"] = $arParams["PATH_TO_MEETING_LIST"]; $arResult["Urls"]["ModifyMeeting"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_MODIFY_MEETING"], array("meeting_id" => $meetingId)); $arResult["Urls"]["CreateMeeting"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_MODIFY_MEETING"], array("meeting_id" => 0)); $arResult["Urls"]["Meeting"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_MEETING"], array("meeting_id" => $meetingId)); $arResult["Urls"]["Meeting"] .= (StrPos($arResult["Urls"]["Meeting"], "?") === false ? "?" : "&") . "week_start=" . UrlEncode($_REQUEST["week_start"]); $arResult["Urls"]["ReserveMeeting"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_RESERVE_MEETING"], array("meeting_id" => $meetingId, "item_id" => 0)); $arResult["Urls"]["Search"] = $arParams["PATH_TO_SEARCH"]; $arResult["Perms"]["CanModify"] = $GLOBALS["USER"]->IsAuthorized() && ($GLOBALS["USER"]->IsAdmin() || Count(Array_Intersect($GLOBALS["USER"]->GetUserGroupArray(), $arParams["USERGROUPS_MODIFY"])) > 0); $arResult["Perms"]["CanReserve"] = $GLOBALS["USER"]->IsAuthorized() && ($GLOBALS["USER"]->IsAdmin() || Count(Array_Intersect($GLOBALS["USER"]->GetUserGroupArray(), $arParams["USERGROUPS_RESERVE"])) > 0); $this->IncludeComponentTemplate();
} } // USER PROPERIES $arResult["UserPropertiesMain"] = array("SHOW" => "N", "DATA" => array()); $arResult["UserPropertiesContact"] = array("SHOW" => "N", "DATA" => array()); $arResult["UserPropertiesPersonal"] = array("SHOW" => "N", "DATA" => array()); if (count($arParams["USER_PROPERTY_MAIN"]) > 0 || count($arParams["USER_PROPERTY_CONTACT"]) > 0 || count($arParams["USER_PROPERTY_PERSONAL"]) > 0) { $arUserFields = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("USER", $arResult["User"]["ID"], LANGUAGE_ID); foreach ($arUserFields as $fieldName => $arUserField) { //echo "<pre>".print_r($arUserField, true)."</pre>"; $arUserField["EDIT_FORM_LABEL"] = StrLen($arUserField["EDIT_FORM_LABEL"]) > 0 ? $arUserField["EDIT_FORM_LABEL"] : $arUserField["FIELD_NAME"]; $arUserField["EDIT_FORM_LABEL"] = htmlspecialcharsEx($arUserField["EDIT_FORM_LABEL"]); $arUserField["~EDIT_FORM_LABEL"] = $arUserField["EDIT_FORM_LABEL"]; $arUserField["PROPERTY_VALUE_LINK"] = ""; if (in_array($arUserField["FIELD_NAME"], $arParams["SONET_USER_PROPERTY_SEARCHABLE"])) { $arUserField["PROPERTY_VALUE_LINK"] = $arParams["PATH_TO_SEARCH_INNER"] . (StrPos($arParams["PATH_TO_SEARCH_INNER"], "?") !== false ? "&" : "?") . "flt_" . StrToLower($arUserField["FIELD_NAME"]) . "=#VALUE#"; } elseif ($bIntranet) { $arUserField['SETTINGS']['SECTION_URL'] = $arParams["PATH_TO_CONPANY_DEPARTMENT"]; } if (in_array($fieldName, $arParams["USER_PROPERTY_MAIN"])) { $arResult["UserPropertiesMain"]["DATA"][$fieldName] = $arUserField; } if (in_array($fieldName, $arParams["USER_PROPERTY_CONTACT"])) { $arResult["UserPropertiesContact"]["DATA"][$fieldName] = $arUserField; } if (in_array($fieldName, $arParams["USER_PROPERTY_PERSONAL"])) { $arResult["UserPropertiesPersonal"]["DATA"][$fieldName] = $arUserField; } } if (count($arResult["UserPropertiesMain"]["DATA"]) > 0) { $arResult["UserPropertiesMain"]["SHOW"] = "Y";
function PrepareGetListArray($key, &$arFields, &$arPropIDsTmp) { $propIDTmp = false; if (StrPos($key, "PROPERTY_ID_") === 0) { $propIDTmp = IntVal(substr($key, StrLen("PROPERTY_ID_"))); } elseif (StrPos($key, "PROPERTY_NAME_") === 0) { $propIDTmp = IntVal(substr($key, StrLen("PROPERTY_NAME_"))); } elseif (StrPos($key, "PROPERTY_VALUE_") === 0) { $propIDTmp = IntVal(substr($key, StrLen("PROPERTY_VALUE_"))); } elseif (StrPos($key, "PROPERTY_CODE_") === 0) { $propIDTmp = IntVal(substr($key, StrLen("PROPERTY_CODE_"))); } elseif (StrPos($key, "PROPERTY_VAL_BY_CODE_") === 0) { $propIDTmp = preg_replace("/[^a-zA-Z0-9_-]/is", "", trim(substr($key, StrLen("PROPERTY_VAL_BY_CODE_")))); } $locationPropInfo = self::getLocationPropertyInfo(); if (strlen($propIDTmp) > 0 || $propIDTmp > 0) { if (!in_array($propIDTmp, $arPropIDsTmp)) { $arPropIDsTmp[] = $propIDTmp; $arFields["PROPERTY_ID_" . $propIDTmp] = array("FIELD" => "SP_" . $propIDTmp . ".ID", "TYPE" => "int", "FROM" => "INNER JOIN b_sale_order_props_value SP_" . $propIDTmp . " ON (SP_" . $propIDTmp . ".ORDER_PROPS_ID = " . $propIDTmp . " AND O.ID = SP_" . $propIDTmp . ".ORDER_ID)"); $arFields["PROPERTY_ORDER_PROPS_ID_" . $propIDTmp] = array("FIELD" => "SP_" . $propIDTmp . ".ORDER_PROPS_ID", "TYPE" => "int", "FROM" => "INNER JOIN b_sale_order_props_value SP_" . $propIDTmp . " ON (SP_" . $propIDTmp . ".ORDER_PROPS_ID = " . $propIDTmp . " AND O.ID = SP_" . $propIDTmp . ".ORDER_ID)"); $arFields["PROPERTY_NAME_" . $propIDTmp] = array("FIELD" => "SP_" . $propIDTmp . ".NAME", "TYPE" => "string", "FROM" => "INNER JOIN b_sale_order_props_value SP_" . $propIDTmp . " ON (SP_" . $propIDTmp . ".ORDER_PROPS_ID = " . $propIDTmp . " AND O.ID = SP_" . $propIDTmp . ".ORDER_ID)"); if (CSaleLocation::isLocationProMigrated() && isset($locationPropInfo['ID'][$propIDTmp])) { $arFields["PROPERTY_VALUE_" . $propIDTmp] = array("FIELD" => "L_" . $propIDTmp . ".ID", "TYPE" => "string", "FROM" => "INNER JOIN b_sale_order_props_value SP_" . $propIDTmp . " ON (SP_" . $propIDTmp . ".ORDER_PROPS_ID = " . $propIDTmp . " AND O.ID = SP_" . $propIDTmp . ".ORDER_ID) INNER JOIN b_sale_location L_" . $propIDTmp . " ON (SP_" . $propIDTmp . ".VALUE = L_" . $propIDTmp . ".CODE)"); } else { $arFields["PROPERTY_VALUE_" . $propIDTmp] = array("FIELD" => "SP_" . $propIDTmp . ".VALUE", "TYPE" => "string", "FROM" => "INNER JOIN b_sale_order_props_value SP_" . $propIDTmp . " ON (SP_" . $propIDTmp . ".ORDER_PROPS_ID = " . $propIDTmp . " AND O.ID = SP_" . $propIDTmp . ".ORDER_ID)"); } $arFields["PROPERTY_CODE_" . $propIDTmp] = array("FIELD" => "SP_" . $propIDTmp . ".CODE", "TYPE" => "string", "FROM" => "INNER JOIN b_sale_order_props_value SP_" . $propIDTmp . " ON (SP_" . $propIDTmp . ".ORDER_PROPS_ID = " . $propIDTmp . " AND O.ID = SP_" . $propIDTmp . ".ORDER_ID)"); if (CSaleLocation::isLocationProMigrated() && isset($locationPropInfo['CODE'][$propIDTmp])) { $arFields["PROPERTY_VAL_BY_CODE_" . $propIDTmp] = array("FIELD" => "L_" . $propIDTmp . ".ID", "TYPE" => "string", "FROM" => "INNER JOIN b_sale_order_props_value SP_" . $propIDTmp . " ON (SP_" . $propIDTmp . ".CODE = '" . $propIDTmp . "' AND O.ID = SP_" . $propIDTmp . ".ORDER_ID) INNER JOIN b_sale_location L_" . $propIDTmp . " ON (SP_" . $propIDTmp . ".VALUE = L_" . $propIDTmp . ".CODE)"); } else { $arFields["PROPERTY_VAL_BY_CODE_" . $propIDTmp] = array("FIELD" => "SP_" . $propIDTmp . ".VALUE", "TYPE" => "string", "FROM" => "INNER JOIN b_sale_order_props_value SP_" . $propIDTmp . " ON (SP_" . $propIDTmp . ".CODE = '" . $propIDTmp . "' AND O.ID = SP_" . $propIDTmp . ".ORDER_ID)"); } } } }
} } } } if (StrLen($arResult["FatalError"]) <= 0) { $arNavStartParams = array("nPageSize" => $arParams["ITEMS_COUNT"], "bShowAll" => false, "bDescPageNumbering" => false); $arNavigation = CDBResult::GetNavParams($arNavStartParams); $arSelectFields = array("IBLOCK_ID"); foreach ($arResult["ALLOWED_FIELDS"] as $key => $value) { $arSelectFields[] = $key; } $arResult["MEETINGS_LIST"] = array(); $dbMeetingsList = CIBlockSection::GetList($arOrderBy, $arFilter, false, $arSelectFields); while ($arMeeting = $dbMeetingsList->GetNext()) { $arMeeting["URI"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_MEETING"], array("meeting_id" => $arMeeting["ID"])); $arMeeting["ACTIONS"] = array(); $arMeeting["ACTIONS"][] = array("ICON" => "", "TITLE" => GetMessage("INTASK_C23_GRAPH"), "CONTENT" => "<b>" . GetMessage("INTASK_C23_GRAPH_DESCR") . "</b>", "ONCLICK" => "setTimeout(HideThisMenuS" . $arMeeting["ID"] . ", 900); jsUtils.Redirect([], '" . CUtil::JSEscape($arMeeting["URI"]) . "');"); if ($GLOBALS["USER"]->IsAuthorized() && ($GLOBALS["USER"]->IsAdmin() || Count(Array_Intersect($GLOBALS["USER"]->GetUserGroupArray(), $arParams["USERGROUPS_RESERVE"])) > 0)) { $arMeeting["ACTIONS"][] = array("ICON" => "", "TITLE" => GetMessage("INTASK_C23_RESERV"), "CONTENT" => GetMessage("INTASK_C23_RESERV_DESCR"), "ONCLICK" => "setTimeout(HideThisMenuS" . $arMeeting["ID"] . ", 900); jsUtils.Redirect([], '" . CUtil::JSEscape(CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_RESERVE_MEETING"], array("meeting_id" => $arMeeting["ID"], "item_id" => 0))) . "');"); } if ($GLOBALS["USER"]->IsAuthorized() && ($GLOBALS["USER"]->IsAdmin() || Count(Array_Intersect($GLOBALS["USER"]->GetUserGroupArray(), $arParams["USERGROUPS_MODIFY"])) > 0)) { $arMeeting["ACTIONS"][] = array("ICON" => "", "TITLE" => GetMessage("INTASK_C23_EDIT"), "CONTENT" => GetMessage("INTASK_C23_EDIT_DESCR"), "ONCLICK" => "setTimeout(HideThisMenuS" . $arMeeting["ID"] . ", 900); jsUtils.Redirect([], '" . CUtil::JSEscape(CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_MODIFY_MEETING"], array("meeting_id" => $arMeeting["ID"]))) . "');"); $p = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_MEETING_LIST"], array()); $p .= (StrPos($p, "?") === false ? "?" : "&") . "delete_meeting_id=" . $arMeeting["ID"] . "&" . bitrix_sessid_get(); $arMeeting["ACTIONS"][] = array("ICON" => "", "TITLE" => GetMessage("INTASK_C23_DELETE"), "CONTENT" => GetMessage("INTASK_C23_DELETE_DESCR"), "ONCLICK" => "if(confirm('" . CUtil::JSEscape(GetMessage("INTASK_C23_DELETE_CONF")) . "')){jsUtils.Redirect([], '" . CUtil::JSEscape($p) . "')};"); } $arResult["MEETINGS_LIST"][] = $arMeeting; } } //echo "<pre>".print_r($arResult, true)."</pre>"; $this->IncludeComponentTemplate();
public function RunChecks() { if ($this->reportToOutput === false && $this->recipientEmail === null) { throw new BadMethodCallException('No reporting defined. Call "ReportToEmail()" or/and "ReportToOutput()" method.'); } if (Count($this->checks) === 0) { throw new BadMethodCallException('No checks defined. Add at least one check using "AddCheck()" method.'); } $errors = array(); foreach ($this->checks as $key => $check) { if ($check['pre_url'] !== null) { File_Get_Contents($check['pre_url']); } // just fetch the page, we don't need it's contents $response = File_Get_Contents($check['url']); if ($response === false) { $errors[] = array($check, 'URL not reachable'); continue; } $checkFound = false; if ($check['is_regex'] === false) { $checkFound = StrPos($response, $check['check']) !== false; } else { $matchResult = Preg_Match($check['check'], $response); if ($matchResult === false) { $errors[] = array($check, 'Regular expression is not valid'); continue; } else { if ($matchResult > 0) { $checkFound = true; } } } if ($checkFound === false) { $errors[] = array($check, 'Check string not found'); } } if (Count($errors) > 0) { $errorsBody = ''; foreach ($errors as $key => $error) { if ($this->recipientEmail !== null) { if ($this->oneEmailPerError === true) { $errorsBody .= $this->getErrorMessage($error) . "\n\n"; } else { $this->sendErrorEmail($this->getErrorMessage($error)); } } if ($this->reportToOutput === true) { if ($this->inCli === true) { echo $this->getErrorMessage($error) . "\n\n"; } else { echo Nl2Br($this->getErrorMessage($error)) . "<br /><br />"; } } } if ($this->recipientEmail !== null && $this->oneEmailPerError === true) { $this->sendErrorEmail($errorsBody); } } }
/** * [#inc ...#] tag parsing * * @access private * @param string $res template strings * @param array $hash data params * @param string $dir current template directory (for correct [#inc ...#] tags parsing) */ function parseIncludes(&$res, &$hash, $dir) { if (preg_match_all('/\\[#inc (.*?)#\\]/', $res, $matches, PREG_PATTERN_ORDER)) { $count_matches_0 = count($matches[0]); for ($i = 0; $i < $count_matches_0; $i++) { $raw = $matches[1][$i]; if (Is_Integer(strpos($raw, '="'))) { // inc file parameters $new_hash = $hash; preg_match_all('/(\\w+?)="(.*?)"/', $raw, $matches1, PREG_PATTERN_ORDER); $count_matches1_0 = count($matches1[0]); for ($k = 0; $k < $count_matches1_0; $k++) { $new_hash[$matches1[1][$k]] = $matches1[2][$k]; $raw = str_replace($matches1[0][$k], '', $raw); } } else { $new_hash =& $hash; } $file_name = $dir . trim($raw); $new_root = dirname($file_name) . "/"; if (defined('ALTERNATIVE_TEMPLATES')) { $alt_path = str_replace('templates/', ALTERNATIVE_TEMPLATES . '/', $file_name); if (file_exists($alt_path)) { $file_name = $alt_path; } } if (!file_exists($file_name)) { $res = str_replace($matches[0][$i], "<!-- Cannot find file {$file_name} -->", $res); } else { if (Defined("DEBUG_MODE") && !Is_Integer(StrPos($file_name, ".js"))) { $id = "block" . (int) rand(0, 100000); //$res=str_replace($matches[0][$i], "<!-- begin of file $file_name -->".$this->parse($this->loadfile($file_name)."<!-- end of file $file_name -->", $new_hash, $new_root), $res); $res = str_replace($matches[0][$i], "" . $this->parse($this->loadfile($file_name) . "", $new_hash, $new_root), $res); } else { $res = str_replace($matches[0][$i], $this->parse($this->loadfile($file_name), $new_hash, $new_root), $res); } } } } return $res; }
} } if ($arParams["SET_TITLE"] == "Y") { $APPLICATION->SetTitle(GetMessage("SONET_C241_PAGE_TITLE")); } if ($arParams["SET_NAV_CHAIN"] != "N") { $APPLICATION->AddChainItem(GetMessage("SONET_C241_PAGE_TITLE")); } $arResult["Urls"]["UserSearch"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_SEARCH_INNER"], array()); $arResult["Params"]["UserSearch"] = array(); if (StrPos($arResult["Urls"]["UserSearch"], "?") !== false) { $str = SubStr($arResult["Urls"]["UserSearch"], StrPos($arResult["Urls"]["UserSearch"], "?") + 1); $arStr = Explode("&", $str); foreach ($arStr as $str) { $str = Trim($str); $p = StrPos($str, "="); if (StrLen($str) > 0 && $p !== false) { $arResult["Params"]["UserSearch"][htmlspecialcharsbx(SubStr($str, 0, $p))] = htmlspecialcharsbx(SubStr($str, $p + 1)); } } } $arResult["Urls"]["ViewList"] = htmlspecialcharsbx($APPLICATION->GetCurPageParam("current_view=list", array("current_view"))); $arResult["Urls"]["ViewIcon"] = htmlspecialcharsbx($APPLICATION->GetCurPageParam("current_view=icon", array("current_view"))); $arResult["Urls"]["ViewBigIcon"] = htmlspecialcharsbx($APPLICATION->GetCurPageParam("current_view=bigicon", array("current_view"))); $currentFilter = $_REQUEST['current_filter'] == 'adv' ? 'adv' : 'simple'; $arResult['CURRENT_FILTER'] = $currentFilter; $currentView = array_key_exists("current_view", $_REQUEST) ? $_REQUEST["current_view"] : $_SESSION["SONET_SEARCH_current_view"]; if (!in_array($currentView, array("icon", "bigicon", "list"))) { $currentView = "list"; } $_SESSION["SONET_SEARCH_current_view"] = $currentView;
/** * [#inc ...#] tag parsing * * @access private * @param string $res template strings * @param array $hash data params * @param string $dir current template directory (for correct [#inc ...#] tags parsing) */ function parseIncludes(&$res, &$hash, $dir) { if (preg_match_all('/\[#inc (.*?)#\]/', $res, $matches, PREG_PATTERN_ORDER)) { $count_matches_0=count($matches[0]); for($i=0;$i<$count_matches_0;$i++) { $raw=$matches[1][$i]; if (Is_Integer(strpos($raw, '="'))) { // inc file parameters $new_hash=$hash; preg_match_all('/(\w+?)="(.*?)"/', $raw, $matches1, PREG_PATTERN_ORDER); $count_matches1_0=count($matches1[0]); for($k=0;$k<$count_matches1_0;$k++) { $new_hash[$matches1[1][$k]]=$matches1[2][$k]; $raw=str_replace($matches1[0][$k], '', $raw); } } else { $new_hash=&$hash; } $file_name=$dir.trim($raw); if (!file_exists($file_name)) { $res=str_replace($matches[0][$i], "<!-- Cannot find file $file_name -->", $res); } else { $new_root=dirname($file_name)."/"; if ((Defined("DEBUG_TEMPLATES")) && !Is_Integer(StrPos($file_name, ".js"))) { $id="block".(int)rand(0, 100000); $res=str_replace($matches[0][$i], "<div name=\"$file_name\" onMouseOver=\"dmo(event)\" onMouseOut=\"dmu(event)\" style=\"margin:0px\">".$this->parse($this->loadfile($file_name)."</div>", $new_hash, $new_root), $res); } else { $res=str_replace($matches[0][$i], $this->parse($this->loadfile($file_name), $new_hash, $new_root), $res); } } } } return $res; }
if ($arUser = $dbUser->GetNext()) { $arElement["CREATED_BY_NAME"] = CUser::FormatName($arParams['NAME_TEMPLATE_WO_NOBR'], $arUser, $bUseLogin); $arElement["CREATED_BY_FIRST_NAME"] = $arUser["NAME"]; $arElement["CREATED_BY_LAST_NAME"] = $arUser["LAST_NAME"]; $arElement["CREATED_BY_SECOND_NAME"] = $arUser["SECOND_NAME"]; $arElement["CREATED_BY_LOGIN"] = $arUser["LOGIN"]; } if ($GLOBALS["USER"]->IsAuthorized() && ($GLOBALS["USER"]->IsAdmin() || Count(Array_Intersect($GLOBALS["USER"]->GetUserGroupArray(), $arParams["USERGROUPS_CLEAR"])) > 0 || $arElement["CREATED_BY"] == $GLOBALS["USER"]->GetID())) { $arElement["CLEAR_URI"] = $APPLICATION->GetCurPageParam("", array("clear_id")); $arElement["CLEAR_URI"] .= (StrPos($arElement["CLEAR_URI"], "?") === false ? "?" : "&") . "clear_id=" . $arElement["ID"] . "&" . bitrix_sessid_get(); } $arElement["VIEW_ITEM_URI"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_VIEW_ITEM"], array("meeting_id" => $arMeeting["ID"], "item_id" => $arElement["ID"])); $arElement["VIEW_ITEM_URI"] .= (StrPos($arElement["VIEW_ITEM_URI"], "?") === false ? "?" : "&") . "week_start=" . UrlEncode($arResult["WEEK_START"]); if ($GLOBALS["USER"]->IsAuthorized() && ($GLOBALS["USER"]->IsAdmin() || $arElement["CREATED_BY"] == $GLOBALS["USER"]->GetID())) { $arElement["EDIT_ITEM_URI"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_RESERVE_MEETING"], array("meeting_id" => $arMeeting["ID"], "item_id" => $arElement["ID"])); $arElement["EDIT_ITEM_URI"] .= (StrPos($arElement["EDIT_ITEM_URI"], "?") === false ? "?" : "&") . "week_start=" . UrlEncode($arResult["WEEK_START"]); } for ($counter = 0; $counter < Count($arDates); $counter++) { //echo Date("d.m.Y H:i:s", $arDates[$counter]["DATE_ACTIVE_FROM"])." - ".Date("d.m.Y H:i:s", $arDates[$counter]["DATE_ACTIVE_TO"])."<br>"; $arResult["ITEMS"][$arElement["ID"] . "-" . $counter] = $arElement; $arResult["ITEMS"][$arElement["ID"] . "-" . $counter]["DATE_ACTIVE_FROM_TIME"] = Date("H:i", $arDates[$counter]["DATE_ACTIVE_FROM"]); $arResult["ITEMS"][$arElement["ID"] . "-" . $counter]["DATE_ACTIVE_TO_TIME"] = Date("H:i", $arDates[$counter]["DATE_ACTIVE_TO"]); $from = __RM_PrepateDate($arDates[$counter]["DATE_ACTIVE_FROM"], $weekTimeStart, $weekTimeEnd); $to = __RM_PrepateDate($arDates[$counter]["DATE_ACTIVE_TO"], $weekTimeStart, $weekTimeEnd); if ($from["DayOfWeek"] == $to["DayOfWeek"]) { $i1 = $from["Hour"] * 2; if ($from["Minute"] == 30) { $i1++; } $i2 = $to["Hour"] * 2; if ($to["Minute"] == 30) {
return ERROR | @Trigger_Error(101); } #------------------------------------------------------------------------------- $Config = Config(); #------------------------------------------------------------------------------- $Statuses = $Config['Statuses']['DomainOrders']; #------------------------------------------------------------------------------- foreach ($DomainOrders as $DomainOrder) { $NoBody->AddChild(new Tag('P', SPrintF('Доменов в статусе "%s": %u', isset($Statuses[$DomainOrder['StatusID']]) ? $Statuses[$DomainOrder['StatusID']]['Name'] : $DomainOrder['StatusID'], $DomainOrder['Count']))); } #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $Where = array(); #------------------------------------------------------------------------------- foreach ($Servers as $Server) { $Where[] = '`Ns1Name` NOT LIKE "%' . SubStr($Server['Params']['Ns1Name'], StrPos($Server['Params']['Ns1Name'], '.') + 1, StrLen($Server['Params']['Ns1Name'])) . '%"'; } #------------------------------------------------------------------------------- $Where[] = '`Ns1Name` != ""'; $Where[] = '`StatusID` = "Active"'; $Where[] = '`Ns1Name` NOT LIKE CONCAT ("%",`DomainName`,".",`Name`)'; #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- $Columns = array('SUBSTRING_INDEX(`Ns1Name`, ".", -2) AS Address', 'COUNT(*) AS Count'); #------------------------------------------------------------------------------- $DNSs = DB_Select('DomainOrdersOwners', $Columns, array('Where' => $Where, 'SortOn' => 'Count', 'IsDesc' => TRUE, 'GroupBy' => 'Address')); #------------------------------------------------------------------------------- switch (ValueOf($DNSs)) { case 'error': return ERROR | @Trigger_Error(500); case 'exception':
} $_SESSION["INTASK_TASKVIEW_current_view"][$taskType . "-" . $ownerId] = $userSettingsId; } $arResult["CurrentView"] = $userSettingsId; $strBackUrl = "back_url=" . UrlEncode($GLOBALS["APPLICATION"]->GetCurPageParam("", array())); $arResult["Urls"]["CreateView"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_TASKS_VIEW"], array("owner_id" => $ownerId, "view_id" => 0, "action" => "create")); $arResult["Urls"]["CreateView"] .= StrPos($arResult["Urls"]["CreateView"], "?") === false ? "?" : "&"; $arResult["Urls"]["CreateView"] .= $strBackUrl; $arResult["Urls"]["EditView"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_TASKS_VIEW"], array("owner_id" => $ownerId, "view_id" => $userSettingsId, "action" => "edit")); $arResult["Urls"]["EditView"] .= StrPos($arResult["Urls"]["EditView"], "?") === false ? "?" : "&"; $arResult["Urls"]["EditView"] .= $strBackUrl; if ($arResult["Perms"]["create_tasks"]) { $arResult["Urls"]["CreateTask"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_TASKS_TASK"], array("owner_id" => $ownerId, "task_id" => 0, "action" => "create")); if (StrLen($strBackUrl) > 0) { $arResult["Urls"]["CreateTask"] .= StrPos($arResult["Urls"]["CreateTask"], "?") === false ? "?" : "&"; $arResult["Urls"]["CreateTask"] .= $strBackUrl; } if (StrLen($strSectionId) > 0) { $arResult["Urls"]["CreateTask"] .= StrPos($arResult["Urls"]["CreateTask"], "?") === false ? "?" : "&"; $arResult["Urls"]["CreateTask"] .= $strSectionId; } } else { $arResult["Urls"]["CreateTask"] = ""; } $arResult["Urls"]["DeleteView"] = $arResult["Urls"]["ChangeView"] . "0&" . bitrix_sessid_get() . "&action=delete_view&del_view_id=" . $arResult["CurrentView"]; } } if (StrLen($arResult["FatalError"]) <= 0) { $this->IncludeComponentTemplate(); } }
if (!Is_Array($User)) { return ERROR | @Trigger_Error(500); } #------------------------------------------------------------------------------- $IsImmediately = isset($IsImmediately) ? $IsImmediately : FALSE; #------------------------------------------------------------------------------- $TransferTime = FALSE; #------------------------------------------------------------------------------- # возможно, параметры не заданы/требуется немедленная отправка - время не опредлеяем if (!$IsImmediately) { #------------------------------------------------------------------------------- $SMSBeginTime = $User['Params']['Settings']['SMSBeginTime']; $SMSBeginTime = IntVal(SubStr($SMSBeginTime, StrPos($SMSBeginTime, '_') + 1, StrLen($SMSBeginTime))); #------------------------------------------------------------------------------- $SMSEndTime = $User['Params']['Settings']['SMSEndTime']; $SMSEndTime = IntVal(SubStr($SMSEndTime, StrPos($SMSEndTime, '_') + 1, StrLen($SMSEndTime))); #------------------------------------------------------------------------------- # время окончания, если оно 0:00 - это больше чем 23:00, например... надо 0->24 $SMSEndTime = $SMSEndTime == 0 ? 24 : $SMSEndTime; #------------------------------------------------------------------------------- if ($SMSBeginTime != $SMSEndTime) { #------------------------------------------------------------------------------- # если обычный период, например 9:00-18:00 if ($SMSBeginTime < $SMSEndTime) { #------------------------------------------------------------------------------- if (Date('G') >= $SMSBeginTime && Date('G') < $SMSEndTime) { # OK } else { #------------------------------------------------------------------------------- if (Date('G') < $SMSBeginTime) { #-------------------------------------------------------------------------------
/** * Read one string from buffer ending with null byte * * @return string */ public function GetString() { $ZeroBytePosition = StrPos($this->Buffer, "", $this->Position); if ($ZeroBytePosition === false) { $String = ""; } else { $String = $this->Get($ZeroBytePosition - $this->Position); $this->Position++; } return $String; }
throw new Exception("Coudn't load class: " . $ClassPath); } #------------------------------------------------------------------------------- include_once $ClassPath; #------------------------------------------------------------------------------- } #------------------------------------------------------------------------------- spl_autoload_register('JoonteAutoLoad'); #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- /** * Request processing. */ $__URI = $_SERVER['REQUEST_URI']; #------------------------------------------------------------------------------- $Index = StrPos($__URI, '?'); #------------------------------------------------------------------------------- if (Is_Int($Index)) { $__URI = SubStr($__URI, 0, $Index); } #------------------------------------------------------------------------------- unset($Index); #------------------------------------------------------------------------------- Debug(SPrintF('[JBs core]: внешний запрос сформирован как (__URI=%s)', $__URI)); #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- /** * Custom shutdown function. */ function __ShutDown_Function__() {
$cacheId = "socnet_user_groups_" . SITE_ID . '_' . $arParams["PAGE"] . "_" . $USER->GetID() . "_" . "_" . $arResult["User"]["ID"] . "_" . md5(serialize($arCacheKeys)) . "_" . intval(CSocNetUser::IsCurrentUserModuleAdmin()); if ($arParams["CACHE_TIME"] > 0 && $groupCache->InitCache($arParams["CACHE_TIME"], $cacheId, $cachePath)) { $vars = $groupCache->GetVars(); $arCacheResult = $vars["arCacheResult"]; } else { if ($arParams["CACHE_TIME"] > 0 && defined("BX_COMP_MANAGED_CACHE")) { $GLOBALS["CACHE_MANAGER"]->StartTagCache($cachePath); $GLOBALS["CACHE_MANAGER"]->RegisterTag("sonet_user2group_U" . $GLOBALS["USER"]->GetID()); $GLOBALS["CACHE_MANAGER"]->RegisterTag("sonet_group"); } $arGroupID = array(); if (in_array($arParams["PAGE"], array("groups_list", "groups_subject")) || $arResult["CurrentUserPerms"] && $arResult["CurrentUserPerms"]["Operations"]["viewgroups"]) { $arNavParams = array("nPageSize" => $arParams["ITEMS_COUNT"], "bDescPageNumbering" => false); $arCacheResult["Urls"]["GroupsAdd"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP_CREATE"], array("user_id" => $arResult["User"]["ID"])); $arCacheResult["Urls"]["LogGroups"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_LOG"], array()); $arCacheResult["Urls"]["LogGroups"] .= (StrPos($arCacheResult["Urls"]["LogGroups"], "?") !== false ? "&" : "?") . "flt_entity_type=" . SONET_ENTITY_GROUP; $arCacheResult["CanViewLog"] = $arResult["User"]["ID"] == $GLOBALS["USER"]->GetID(); $arCacheResult["Groups"] = false; $arGroupFilter = array("SITE_ID" => SITE_ID, "ACTIVE" => "Y"); if (!CSocNetUser::IsCurrentUserModuleAdmin()) { $arGroupFilter["CHECK_PERMISSIONS"] = $GLOBALS["USER"]->GetID(); } if (COption::GetOptionString("socialnetwork", "work_with_closed_groups", "N") != "Y" && $arResult["filter_tags"] != "Y") { $arGroupFilter["CLOSED"] = $arResult["filter_archive"] == "Y" ? "Y" : "N"; } if (intval($arResult["filter_subject_id"]) > 0) { $arGroupFilter["SUBJECT_ID"] = $arResult["filter_subject_id"]; } if (strlen($arResult["filter_name"]) > 0) { $arGroupFilter["%NAME"] = $arResult["filter_name"]; }
/** * Adds to the "To" recipient collection. * * @param mixed $RecipientEmail An email (or array of emails) to add to the "To" recipient collection. * @param string $RecipientName The recipient name associated with $RecipientEmail. If $RecipientEmail is * an array of email addresses, this value will be ignored. */ public function To($RecipientEmail, $RecipientName = '') { if (is_string($RecipientEmail) && StrPos($RecipientEmail, ',') > 0) { $RecipientEmail = explode(',', $RecipientEmail); $RecipientEmail = array_map('trim', $RecipientEmail); $RecipientName = array_fill(0, Count($RecipientEmail), $RecipientName); } elseif ($RecipientEmail instanceof Gdn_DataSet) { $RecipientEmail = ConsolidateArrayValuesByKey($RecipientEmail->ResultArray(), 'Email', 'Name', ''); } if (!is_array($RecipientEmail)) { // Only allow one address in the "to" field. Append all extras to the "cc" field. if (!$this->_IsToSet) { $this->PhpMailer->AddAddress($RecipientEmail, $RecipientName); $this->_IsToSet = True; } else { $this->Cc($RecipientEmail, $RecipientName); } return $this; } if ($this->PhpMailer->Mailer == 'smtp' || Gdn::Config('Garden.Email.UseSmtp')) { throw new Exception('You cannot address emails to more than one address when using SMTP.'); } $this->PhpMailer->SingleTo = True; if (array_key_exists(0, $RecipientEmail) && is_object($RecipientEmail[0])) { $RecipientName = array(); $Count = Count($RecipientEmail); for ($i = 0; $i < $Count; $i++) { $RecipientName[$i] = ObjectValue('Name', $RecipientEmail[$i]); $RecipientEmail[$i] = ObjectValue('Email', $RecipientEmail[$i]); } } $Count = Count($RecipientEmail); if (is_array($RecipientName) && $Count == Count($RecipientName)) { $RecipientEmail = array_combine($RecipientEmail, $RecipientName); } elseif ($RecipientName == '') { $RecipientEmail = array_combine($RecipientEmail, array_fill(0, $Count, '')); } foreach ($RecipientEmail as $Email => $Name) { $this->PhpMailer->AddAddress($Email, $Name); } return $this; }
function IsGD2() { static $bGD2 = false; static $bGD2Initial = false; if (!$bGD2Initial && function_exists("gd_info")) { $arGDInfo = gd_info(); $bGD2 = StrPos($arGDInfo['GD Version'], "2.") !== false ? true : false; $bGD2Initial = true; } return $bGD2; }
//foreach ($merchants as $merch){ // echo "<option value='" . $merch . "'>" . $merch . "</option>\n"; //} //echo "</select><br><br>\n\n"; $hint = "\"This is Title and title
and title and title\""; $datei = file("hifi_aktuell_neu_2015_09.txt"); echo "<table style=\"background-color:#F0F0F0\" width=\"1024\">"; foreach ($datei as $ausgabe) { echo "<tr>"; $zerlegen = explode(chr(9), $ausgabe); $Artikel = $zerlegen[0]; $EANnumber = $zerlegen[2]; $NetPrice = $zerlegen[1]; $p = strcmp($zerlegen[1], "Netzpreis"); if ($p != 0) { $NetPrice = SubStr($zerlegen[1], 0, StrPos($zerlegen[1], '�') - 1); // $sql = "REPLACE INTO Artikel (Artikelname, Netzpreis, EANnummer) Values('$Artikel', '$NetPrice', '$EANnumber')"; // if ($conn->query($sql) === TRUE) { // //echo "<BR>" . "New record created successfully"; // } else { // echo "<BR>" . "Error: " . $sql . "<br>" . $conn->error; // } } if ($p != 0) { echo "<td title={$hint} align=\"left\"><font face=\"sans-serif\" size=\"2\">{$Artikel}</font></td>\n\n <td align=\"right\"><font face=\"sans-serif\" size=\"2\">{$NetPrice}</font></td>\n <td align=\"right\"><font face=\"sans-serif\" size=\"2\">{$EANnumber}</font></td>"; } else { echo "<th title={$hint} align=\"left\"><font face=\"sans-serif\" size=\"2\">{$Artikel}</font></th>\n\n <th align=\"right\"><font face=\"sans-serif\" size=\"2\">{$NetPrice}</font></th>\n <th align=\"right\"><font face=\"sans-serif\" size=\"2\">{$EANnumber}</font></th>"; } if ($p != 0) { $QStrIdealo = "<a target=\"_blank\" href=\"http://www.idealo.de/preisvergleich/MainSearchProductCategory.html?q=" . $EANnumber . "\">"; $QStrPSM = "<a target=\"_blank\" href=\"http://www.preissuchmaschine.de/preisvergleich/produkt.cgi?suche=" . $EANnumber . "\">";
$arResult["UserSettings"] = $arFields; if ($action == "create") { $newID = 0; $dbUserOptionsList = CUserOptions::GetList(array("ID" => "DESC"), array()); if ($arUserOptionTmp = $dbUserOptionsList->Fetch()) { $newID = IntVal($arUserOptionTmp["ID"]); } $newID++; } else { $newID = $viewId; CUserOptions::DeleteOption($userSettingsCategory, $userSettingsNamePart . $newID, true, $GLOBALS["USER"]->GetID()); CUserOptions::DeleteOption($userSettingsCategory, $userSettingsNamePart . $newID, false, $GLOBALS["USER"]->GetID()); } CUserOptions::SetOption($userSettingsCategory, $userSettingsNamePart . $newID, $arFields, $_POST["COMMON"], $GLOBALS["USER"]->GetID()); $redirectPath = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_TASKS"], array("owner_id" => $ownerId)); if (StrPos($redirectPath, "?") === false) { $redirectPath .= "?user_settings_id=" . $newID; } else { $redirectPath .= "&user_settings_id=" . $newID; } LocalRedirect($redirectPath); } } else { $arResult["ShowStep"] = 1; $arResult["Templates"] = array(); foreach ($arUserTemplatesList as $arUserTemplate) { $arUserTemplate["LINK"] = htmlspecialcharsbx($APPLICATION->GetCurPageParam("user_template_id=" . $arUserTemplate["NAME"], array("user_template_id"))); if (StrLen($arUserTemplate["TITLE"]) <= 0) { $arUserTemplate["TITLE"] = $arUserTemplate["NAME"]; } $arResult["Templates"][] = $arUserTemplate;
function __SearchTemplate($customTemplatePath = "") { $this->__file = ""; $this->__fileAlt = ""; $this->__folder = ""; $arFolders = array(); $relativePath = $this->__component->GetRelativePath(); $parentComponent = & $this->__component->GetParent(); if ($parentComponent) { $parentRelativePath = $parentComponent->GetRelativePath(); $parentTemplate = & $parentComponent->GetTemplate(); $parentTemplateName = $parentTemplate->GetName(); $arFolders[] = BX_PERSONAL_ROOT."/templates/".$this->__siteTemplate."/components".$parentRelativePath."/".$parentTemplateName.$relativePath; $arFolders[] = BX_PERSONAL_ROOT."/templates/.default/components".$parentRelativePath."/".$parentTemplateName.$relativePath; $arFolders[] = "/bitrix/components".$parentRelativePath."/templates/".$parentTemplateName.$relativePath; } $arFolders[] = BX_PERSONAL_ROOT."/templates/".$this->__siteTemplate."/components".$relativePath; $arFolders[] = BX_PERSONAL_ROOT."/templates/.default/components".$relativePath; $arFolders[] = "/bitrix/components".$relativePath."/templates"; if (strlen($customTemplatePath) > 0 && $templatePageFile = $this->__SearchTemplateFile($customTemplatePath, $this->__page)) { $this->__fileAlt = $customTemplatePath."/".$templatePageFile; for ($i = 0, $cnt = count($arFolders); $i < $cnt; $i++) { if (file_exists($_SERVER["DOCUMENT_ROOT"].$arFolders[$i]."/".$this->__name) && is_dir($_SERVER["DOCUMENT_ROOT"].$arFolders[$i]."/".$this->__name)) { $this->__file = $arFolders[$i]."/".$this->__name."/".$templatePageFile; $this->__folder = $arFolders[$i]."/".$this->__name; } if (StrLen($this->__file) > 0) { if ($i == 0 || $i == 3) $this->__siteTemplate = $this->__siteTemplate; elseif ($i == 1 || $i == 4) $this->__siteTemplate = ".default"; else $this->__siteTemplate = ""; if ($parentComponent && $i < 3) $this->__templateInTheme = True; else $this->__templateInTheme = False; break; } } return (strlen($this->__file) > 0); } for ($i = 0, $cnt = count($arFolders); $i < $cnt; $i++) { if (file_exists($_SERVER["DOCUMENT_ROOT"].$arFolders[$i]."/".$this->__name)) { if (is_dir($_SERVER["DOCUMENT_ROOT"].$arFolders[$i]."/".$this->__name)) { if ($templatePageFile = $this->__SearchTemplateFile($arFolders[$i]."/".$this->__name, $this->__page)) { $this->__file = $arFolders[$i]."/".$this->__name."/".$templatePageFile; $this->__folder = $arFolders[$i]."/".$this->__name; } } elseif (is_file($_SERVER["DOCUMENT_ROOT"].$arFolders[$i]."/".$this->__name)) { $this->__file = $arFolders[$i]."/".$this->__name; if (StrPos($this->__name, "/") !== False) $this->__folder = $arFolders[$i]."/".SubStr($this->__name, 0, bxstrrpos($this->__name, "/")); } } else { if ($templatePageFile = $this->__SearchTemplateFile($arFolders[$i], $this->__name)) $this->__file = $arFolders[$i]."/".$templatePageFile; } if (StrLen($this->__file) > 0) { if ($i == 0 || $i == 3) $this->__siteTemplate = $this->__siteTemplate; elseif ($i == 1 || $i == 4) $this->__siteTemplate = ".default"; else $this->__siteTemplate = ""; if ($parentComponent && $i < 3) $this->__templateInTheme = True; else $this->__templateInTheme = False; break; } } return (StrLen($this->__file) > 0); }
public static function MakeTitle($titleTemplate, $title, $url = "", $bHtml = true) { if (StrLen($url) > 0) $title = ($bHtml ? "<a href=\"".$url."\">".$title."</a>" : $title." [".$url."]"); if (StrLen($titleTemplate) > 0) { if (StrPos($titleTemplate, "#TITLE#") !== false) return Str_Replace("#TITLE#", $title, $titleTemplate); else return $titleTemplate." \"".$title."\""; } else { return $title; } }
function ReadLine() { $pos = StrPos($this->logText, "\n"); $line = SubStr($this->logText, 0, $pos); $this->logText = SubStr($this->logText, $pos + 1); return $line; }