<?php require_once dirname(__FILE__) . '/src/Csv.php'; require_once dirname(__FILE__) . '/src/PixivArtWorkDownload.php'; $log_file = 'mklink'; list($image_dir, $link_dir, $cookie_file, $userlist_file) = SetParam(); CreateLink(ReadCsv($userlist_file)); function CreateLink($userlist) { global $image_dir, $link_dir; MakeDirectory("{$link_dir}_windows"); $handle = fopen('mklink.bat', 'w'); foreach ($userlist as $user) { @($user_id = $user['user_id']); @($display_name = $user['display_name']); fwrite($handle, "mklink /d {$link_dir}_windows\\{$display_name} {$image_dir}\\{$user_id}" . "\r\n"); } fclose($handle); Msg('succeed', "Create bat file 'mklink.bat'.\n"); }
CreateWFCItemCategory ($WFC10_ConfigId, $tabItem.'_TopRight'.$UId, $tabItem.'_Top', 20, '', '', $categoryId_WebFrontTopRight /*BaseId*/, 'false' /*BarBottomVisible*/); ReloadAllWebFronts(); } // ---------------------------------------------------------------------------------------------------------------------------- // Mobile Installation // ---------------------------------------------------------------------------------------------------------------------------- if ($Mobile_Enabled) { $mobileId = CreateCategoryPath($Mobile_Path, $Mobile_PathOrder, $Mobile_PathIcon); $mobileId = CreateCategoryPath($Mobile_Path.'.'.$Mobile_Name, $Mobile_Order, $Mobile_Icon); $InstanceId = CreateDummyInstance("Sonnen-Aufgang/Untergang", $mobileId, 10); CreateLink('Begin/Ende', $SunriseDisplay, $InstanceId, 10); CreateLink('Limits', $SunriseLimits, $InstanceId, 20); $InstanceId = CreateDummyInstance("Zivile Dämmerung", $mobileId, 20); CreateLink('Begin/Ende', $CivilDisplay, $InstanceId, 10); CreateLink('Limits', $CivilLimits, $InstanceId, 20); $InstanceId = CreateDummyInstance("Nautische Dämmerung", $mobileId, 30); CreateLink('Begin/Ende', $NauticDisplay, $InstanceId, 10); CreateLink('Limits', $NauticLimits, $InstanceId, 20); $InstanceId = CreateDummyInstance("Astronomische Dämmerung", $mobileId, 40); CreateLink('Begin/Ende', $AstronomicDisplay, $InstanceId, 10); CreateLink('Limits', $AstronomicLimits, $InstanceId, 20); CreateLinkByDestination("Jahres Grafik", $YearUnlimitedMediaId, $mobileId, 100); CreateLinkByDestination('Tages Grafik', $DayUnlimitedMediaId, $mobileId, 110); CreateLinkByDestination("Jahres Grafik (limited)", $YearLimitedMediaId, $mobileId, 120); CreateLinkByDestination('Tages Grafik (limited)', $DayLimitedMediaId, $mobileId, 130); } /** @}*/ ?>
<?php if (!defined("IN_SB")) { echo "You should not be here. Only follow links!"; die; } $class = $tabs['active'] == true ? "active" : "nonactive"; echo '<li class="' . $class . '">'; CreateLink($tabs['title'], $tabs['url'], $tabs['desc']); echo '</li>';
function DrawPagesBar($AUrl, $ATotal, $APerPage, $APageIdx) { if ($APerPage > 0 && $ATotal > $APerPage) { $vParams = $_GET; $vPageIdx = $this->BoundPage($ATotal, $APerPage, $APageIdx); $vMaxPageIdx = intval(($ATotal - 1) / $APerPage); $vResult = ''; if ($vPageIdx != 0) { $vResult .= CreateLink(CompoundURL($AUrl, array_merge($vParams, array('PageIdx' => 0))), '[1]'); $vResult .= CreateLink(CompoundURL($AUrl, array_merge($vParams, array('PageIdx' => $APageIdx - 1))), 'prev'); } /* for( $i=0; $i<=$vMaxPageIdx; $i++ ) { if ( $i == $vPageIdx ) $vResult .= CreateLink(CompoundURL($AUrl, array_merge($vParams, array('PageIdx'=>$i))), '<b>' . ($i+1) . '</b>'); else $vResult .= CreateLink(CompoundURL($AUrl, array_merge($vParams, array('PageIdx'=>$i))), ($i+1)); } */ $vMinPage = max($vPageIdx - 10, 0); $vMaxPage = min($vPageIdx + 10, $vMaxPageIdx); /* $vMinPage = max($vPageIdx - ($vPageIdx%10),0); $vMaxPage = min($vMinPage+10,$vMaxPageIdx); */ for ($i = $vMinPage; $i <= $vMaxPage; $i++) { if ($i == $vPageIdx) { $vResult .= CreateLink(CompoundURL($AUrl, array_merge($vParams, array('PageIdx' => $i))), '<b>' . ($i + 1) . '</b>'); } else { if ($i == $vMinPage && $vMinPage > 0 || $i == $vMaxPage && $vMaxPage < $vMaxPageIdx) { $vResult .= CreateLink(CompoundURL($AUrl, array_merge($vParams, array('PageIdx' => $i))), '...'); } else { $vResult .= CreateLink(CompoundURL($AUrl, array_merge($vParams, array('PageIdx' => $i))), $i + 1); } } } if ($vPageIdx < $vMaxPageIdx) { $vResult .= CreateLink(CompoundURL($AUrl, array_merge($vParams, array('PageIdx' => $APageIdx + 1))), 'next'); $vResult .= CreateLink(CompoundURL($AUrl, array_merge($vParams, array('PageIdx' => $vMaxPageIdx))), '[' . ($vMaxPageIdx + 1) . ']'); } return $vResult; } else { return ''; } }
$Forecast3DayOfWeek = CreateVariable("Tomorrow2Day", 3 /*String*/, $categoryId_Data, 400, '~String', null, ''); $Forecast3TempMin = CreateVariable("Tomorrow2TempMin", 1 /*Integer*/, $categoryId_Data, 410, null, null, 0); $Forecast3TempMax = CreateVariable("Tomorrow2TempMax", 1 /*Integer*/, $categoryId_Data, 420, null, null, 0); $Forecast3TextShort = CreateVariable("Tomorrow2ForecastLong", 3 /*String*/, $categoryId_Data, 430, '~String', null, ''); $Forecast3TextLong = CreateVariable("Tomorrow2ForecastShort",3 /*String*/, $categoryId_Data, 440, '~String', null, ''); $Forecast3Icon = CreateVariable("Tomorrow2Icon", 3 /*String*/, $categoryId_Data, 450, '~String', null, ''); $iForecast = CreateVariable("iForecast", 3 /*String*/, $categoryId_Data, 1000, '~HTMLBox', null, '<iframe frameborder="0" width="100%" height="4000px" src="../user/Weather/Weather.php"</iframe>'); // Webfront Installation if ($WFC10_Enabled) { DeleteWFCItems($WFC10_ConfigId, $WFC10_TabPaneItem.$WFC10_TabItem); CreateWFCItemTabPane ($WFC10_ConfigId, $WFC10_TabPaneItem, $WFC10_TabPaneParent, $WFC10_TabPaneOrder, $WFC10_TabPaneName, $WFC10_TabPaneIcon); CreateWFCItemExternalPage ($WFC10_ConfigId, $WFC10_TabPaneItem.$WFC10_TabItem, $WFC10_TabPaneItem, $WFC10_TabOrder, $WFC10_TabName, $WFC10_TabIcon, "user\/IPSWeatherForcastAT\/Weather.php", 'false' /*BarBottomVisible*/); ReloadAllWebFronts(); } // iPhone Installation if ($Mobile_Enabled) { $mobileId = CreateCategoryPath($Mobile_Path, $Mobile_PathOrder, $Mobile_PathIcon); $mobileId = CreateCategoryPath($Mobile_Path.'.'.$Mobile_Name, $Mobile_Order, $Mobile_Icon); CreateLink('Vorhersage', $iForecast, $mobileId, 10); } // Execute Data Refresh IPSUtils_Include ("IPSWeatherForcastAT_Refresh.ips.php", "IPSLibrary::app::modules::Weather::IPSWeatherForcastAT"); /** @}*/ ?>
CreateLink('Output Enabled', $ID_Log4IPSOutEnabled, $ID_Output, 10); CreateLink('Logging Level', $ID_Log4IPSOutLevel, $ID_Output, 20); CreateLink('Purge Files after',$ID_Log4IPSOutDays, $ID_Output, 30); CreateLink('Execute Purge', $ID_ScriptIPSLoggerPurgeLogFiles, $ID_Output, 40); $ID_Output = CreateDummyInstance("EMail", $ID_CategoryiPhone, 600); CreateLink('Output Enabled', $ID_EMailOutEnabled, $ID_Output, 10); CreateLink('Logging Level', $ID_EMailOutLevel, $ID_Output, 20); CreateLink('Priority', $ID_EMailOutPriority, $ID_Output, 30); CreateLink('Send Delay', $ID_EMailOutSendDelay, $ID_Output, 40); CreateLink('Message List', $ID_EMailOutMsgList, $ID_Output, 50); $ID_Output = CreateDummyInstance("Prowl", $ID_CategoryiPhone, 700); CreateLink('Output Enabled', $ID_ProwlOutEnabled, $ID_Output, 10); CreateLink('Logging Level', $ID_ProwlOutLevel, $ID_Output, 20); CreateLink('Priority', $ID_ProwlOutPriority, $ID_Output, 30); } Register_PhpErrorHandler($moduleManager); // ---------------------------------------------------------------------------------------------------------------------------- // Some Tests // ---------------------------------------------------------------------------------------------------------------------------- IPSUtils_Include ("IPSLogger.inc.php", "IPSLibrary::app::core::IPSLogger"); // Some Test Messages IPSLogger_Fat(__file__, 'Test for a Fatal Error'); IPSLogger_Err(__file__, 'Test for a Error ...'); IPSLogger_Wrn(__file__, 'Test for a Warning'); IPSLogger_Not(__file__, 'Test for a Notification with Priority 0 (High)');
// =================================================================================================== // Add Module Details // =================================================================================================== $variableIdStatus = CreateVariable(IPSMMG_VAR_ACTION, 3 /*String*/, $CategoryIdData, 10, '~String', null, 'Overview', ''); $variableIdModule = CreateVariable(IPSMMG_VAR_MODULE, 3 /*String*/, $CategoryIdData, 20, '~String', null, '', ''); $variableIdInfo = CreateVariable(IPSMMG_VAR_INFO, 3 /*String*/, $CategoryIdData, 30, '~String', null, '', ''); $variableIdHTML = CreateVariable(IPSMMG_VAR_HTML, 3 /*String*/, $CategoryIdData, 40, '~HTMLBox', null, '<iframe frameborder="0" width="100%" height="600px" src="../user/IPSModuleManagerGUI/IPSModuleManagerGUI.php"</iframe>', 'Information'); // ---------------------------------------------------------------------------------------------------------------------------- // Webfront Installation // ---------------------------------------------------------------------------------------------------------------------------- if ($WFC10_Enabled) { $categoryId_WebFront = CreateCategoryPath($WFC10_Path); EmptyCategory($categoryId_WebFront); CreateLink('IPSLibrary', $variableIdHTML, $categoryId_WebFront, 10); // System Tabpane CreateWFCItemTabPane ($WFC10_ConfigId, $WFC10_TabPaneItem, $WFC10_TabPaneParent, $WFC10_TabPaneOrder, $WFC10_TabPaneName, $WFC10_TabPaneIcon); // IPSLibrary Tabpane $tabItem = $WFC10_TabPaneItem.$WFC10_TabItem; DeleteWFCItems($WFC10_ConfigId, $tabItem); //CreateWFCItemExternalPage ($WFC10_ConfigId, $tabItem, $WFC10_TabPaneItem, $WFC10_TabOrder, $WFC10_TabName, $WFC10_TabIcon, "user\/IPSModuleManagerGUI\/IPSModuleManagerGUI.php", 'false' /*BarBottomVisible*/); CreateWFCItemCategory ($WFC10_ConfigId, $tabItem, $WFC10_TabPaneItem, $WFC10_TabOrder, $WFC10_TabName, $WFC10_TabIcon, $categoryId_WebFront, 'false' /*BarBottomVisible*/); ReloadAllWebFronts(); } // ---------------------------------------------------------------------------------------------------------------------------- // Mobile Installation
$iPhoneControl = CreateDummyInstance("Steuerung", $WebFrontiPhoneDetailId, 10); CreateLink('Status', get_WateringControlId(c_Control_Active, $CirclyId), $iPhoneControl, 10); CreateLink('Automatik', get_WateringControlId(c_Control_Automatic, $CirclyId), $iPhoneControl, 20); $iPhoneProgram = CreateDummyInstance("Programm", $WebFrontiPhoneDetailId, 20); CreateLink('Programm', get_WateringControlId(c_Control_Program, $CirclyId), $iPhoneProgram, 30); CreateLink('Sensor', get_WateringControlId(c_Control_Sensor, $CirclyId), $iPhoneProgram, 35); CreateLink('Beregnungs Dauer', get_WateringControlId(c_Control_Duration, $CirclyId), $iPhoneProgram, 40); CreateLink('Start Zeit', get_WateringControlId(c_Control_StartTime, $CirclyId), $iPhoneProgram, 50); $iPhoneInfos = CreateDummyInstance("Infos", $WebFrontiPhoneDetailId, 30); CreateLink('Nächste Dauer', get_WateringControlId(c_Control_ToBeDone, $CirclyId), $iPhoneInfos, 60); CreateLink('Nächste Beregnung', get_WateringControlId(c_Control_NextDisplay,$CirclyId), $iPhoneInfos, 70); CreateLink('Nächstes Datum', get_WateringControlId(c_Control_NextDate, $CirclyId), $iPhoneInfos, 80); CreateLink('Letztes Datum', get_WateringControlId(c_Control_LastDate, $CirclyId), $iPhoneInfos, 90); CreateLink('Letzte Zeit', get_WateringControlId(c_Control_LastTime, $CirclyId), $iPhoneInfos, 100); $Idx = $Idx + 10; } } // ------------------------------------------------------------------------------------------------ function get_WateringCirclyId($DeviceName, $ParentId) { $CategoryId = IPS_GetObjectIDByIdent($DeviceName, $ParentId); return $CategoryId; } // ------------------------------------------------------------------------------------------------ function get_WateringControlId($ControlName, $CirclyId) { $VariableId = IPS_GetObjectIDByIdent($ControlName, $CirclyId);