### Running PHPExcel Examples Source: https://github.com/zorlan/skycaiji/blob/master/vendor/phpoffice/phpexcel/install.txt Shows how to set up and access the PHPExcel example scripts via a web browser. Ensure the Examples folder is placed alongside your Classes folder. ```text http://example.com/Examples/01simple.php http://example.com/Examples/02types.php ``` -------------------------------- ### Install Phinx dependencies and Box Source: https://github.com/zorlan/skycaiji/blob/master/vendor/topthink/think-migration/phinx/README.md Installs Phinx dependencies using Composer and then installs the Box application for building a Phar archive. ```bash curl -s https://getcomposer.org/installer | php php composer.phar install curl -LSs https://box-project.github.io/box2/installer.php | php ``` -------------------------------- ### Install Ionicons with Component Source: https://github.com/zorlan/skycaiji/blob/master/public/addon/Ionicons/readme.md Install Ionicons using the Component package manager. ```bash $ component install driftyco/ionicons ``` -------------------------------- ### Start Local Development Server Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/tp/README.md Use the router.php file to start a local development server for quick testing. Navigate to the public directory and run the command. ```bash cd public php -S localhost:8888 router.php ``` -------------------------------- ### Install FontForge and Sass Source: https://github.com/zorlan/skycaiji/blob/master/public/addon/Ionicons/readme.md Install necessary tools for building Ionicons from source: FontForge for font creation and Sass for styling. ```bash $ brew install fontforge ttfautohint ``` ```bash $ gem install sass ``` -------------------------------- ### Install Phinx Dependencies Source: https://github.com/zorlan/skycaiji/blob/master/vendor/topthink/think-migration/phinx/CONTRIBUTING.md Installs the necessary dependencies for Phinx using Composer. ```bash php composer.phar install ``` -------------------------------- ### Install Ionicons with Bower Source: https://github.com/zorlan/skycaiji/blob/master/public/addon/Ionicons/readme.md Install Ionicons using the Bower package manager. ```bash $ bower install ionicons ``` -------------------------------- ### PHPExcel Installation Directory Structure Source: https://github.com/zorlan/skycaiji/blob/master/vendor/phpoffice/phpexcel/install.txt Illustrates the recommended directory structure for installing PHPExcel. Copy the contents of the Classes folder to a location accessible by your application. ```text /var/www/Classes/PHPExcel.php /var/www/Classes/PHPExcel/Calculation.php /var/www/Classes/PHPExcel/Cell.php ``` -------------------------------- ### Install Composer Source: https://github.com/zorlan/skycaiji/blob/master/vendor/topthink/think-migration/phinx/CONTRIBUTING.md Installs Composer, a dependency manager for PHP, using a curl script. ```bash curl -sS https://getcomposer.org/installer | php ``` -------------------------------- ### Send Email via SMTP with Authentication Source: https://github.com/zorlan/skycaiji/blob/master/vendor/phpmailer/phpmailer/examples/index.html A simple example demonstrating how to send emails using SMTP with authentication credentials. ```php ``` -------------------------------- ### Install Phinx using Composer Source: https://github.com/zorlan/skycaiji/blob/master/vendor/topthink/think-migration/phinx/README.md Installs Phinx as a project dependency using Composer. This is the recommended method for integrating Phinx into your PHP application. ```bash curl -sS https://getcomposer.org/installer | php php composer.phar require robmorgan/phinx php composer.phar install ``` -------------------------------- ### Send Email with POP Before SMTP Source: https://github.com/zorlan/skycaiji/blob/master/vendor/phpmailer/phpmailer/examples/index.html Example demonstrating email sending using the POP Before SMTP authentication method. ```php // This example demonstrates sending email using the POP Before SMTP method. ``` -------------------------------- ### Send Email with Exception Handling using PHPMailer Source: https://github.com/zorlan/skycaiji/blob/master/vendor/phpmailer/phpmailer/examples/index.html Demonstrates how to use PHPMailer's optional exceptions for robust error handling, similar to the basic mail example. ```php ``` -------------------------------- ### JavaScript Next Step Validation Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/install/view/index/step1.html This JavaScript function validates the installation requirements before proceeding to the next step. It checks for any failed checks and prompts the user for confirmation if issues are detected. ```javascript 'use strict'; function nextStep(){ var notPassNum=$('.install-wrapper .table').find('[data-not-pass]').length; if(notPassNum>0){ if(confirm('检测出问题会影响程序正常使用,是否继续?')){ return true; } else{ return false; } } return true; } ``` -------------------------------- ### Clone Phinx repository Source: https://github.com/zorlan/skycaiji/blob/master/vendor/topthink/think-migration/phinx/README.md Clones the Phinx repository from GitHub to build a Phar archive. This is an alternative installation method. ```bash git clone git://github.com/robmorgan/phinx.git cd phinx ``` -------------------------------- ### Initialize Easy Mode Pattern Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/easymode.html Initializes the Easy Mode pattern with a specified resize width. This is typically used for setting up guided user tutorials or onboarding flows. ```javascript var cpatternEasy=new CpatternEasy(); cpatternEasy.init('{$resizeWidth}'); ``` -------------------------------- ### Execute Phinx commands Source: https://github.com/zorlan/skycaiji/blob/master/vendor/topthink/think-migration/phinx/README.md Runs Phinx commands after installation via Composer. This command is used to manage database migrations. ```bash php vendor/bin/phinx ``` -------------------------------- ### HTML Tag Preservation Example Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/process_module.html Demonstrates how to preserve specific HTML tags during data processing. This is useful when the structure of the content needs to be maintained. ```html {include file="cpattern:rule_module" _type="rule" _name="data-process" _name_pre="extract:extract_" _allow_loop="" /} ``` -------------------------------- ### JavaScript for Handling Agreement Rejection Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/install/view/index/index.html This JavaScript code defines a function to handle the rejection of the installation agreement. It includes a confirmation dialog and logic to close the browser window, with special handling for Internet Explorer. ```javascript 'use strict'; function click_cancel(){ confirmRight('拒绝协议将无法安装,确定退出?',function(){ var regIe=new RegExp("\\bmsie\\b",'i'); if(regIe.test(window.navigator.userAgent)){ //ie window.opener = null; window.open("", "_self"); window.close(); }else{ window.location.href="about:blank"; window.close(); } }); } ``` -------------------------------- ### Send Email from HTML with Attachment using PHP mail() Source: https://github.com/zorlan/skycaiji/blob/master/vendor/phpmailer/phpmailer/examples/index.html A basic example of creating an email from an external HTML file, setting addresses, adding an attachment, and sending using PHP's built-in mail() function. Requires a local mail server. ```php ``` -------------------------------- ### Send Email using Sendmail Source: https://github.com/zorlan/skycaiji/blob/master/vendor/phpmailer/phpmailer/examples/index.html An example of using the sendmail mechanism to submit messages to a local mail server. This is often the fastest sending method but may offer less error reporting. ```php ``` -------------------------------- ### Database Connection and Admin Setup Form Submission Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/install/view/index/step2.html Handles the submission of the database connection and administrator account form using AJAX. It validates the form data and processes the response, including checks for existing data in the database and redirects the user accordingly. The password strength is also dynamically checked. ```javascript 'use strict'; $("#form_db").bind('submit',function(){ var $_o=$(this); $_o.find('button[type="submit"]').attr('disabled',true); ajaxOpen({ type: 'POST', dataType: 'json', url:$(this).attr('action'), data: $(this).serialize(), success: function (data) { if(data.code==1){ //成功 if(data.data.has_data){ confirmRight({yes:'保留数据',no:'强制安装',msg:'检测到当前数据库中已存在同样表前缀的数据表,您可以修改“表前缀”来避免删除旧数据,或者选择强制安装,强制安装会删除旧数据,且无法恢复!'},null,function(){ //强制安装 window.location.href=ulink('install/index/step3'); }); }else{ window.location.href=ulink('install/index/step3'); } }else{ toastr.error(data.msg); } $_o.find('button[type="submit"]').removeAttr('disabled'); } }); return false; }); ``` -------------------------------- ### Send Email via SMTP without Authentication Source: https://github.com/zorlan/skycaiji/blob/master/vendor/phpmailer/phpmailer/examples/index.html A straightforward example for sending emails using SMTP without requiring authentication. ```php ``` -------------------------------- ### Send Email via Gmail SMTP with TLS Source: https://github.com/zorlan/skycaiji/blob/master/vendor/phpmailer/phpmailer/examples/index.html This example shows how to send emails through Google's Gmail service using SMTP with TLS encryption on port 587. ```php ``` -------------------------------- ### Generate Email Code with PHPMailer Source: https://github.com/zorlan/skycaiji/blob/master/vendor/phpmailer/phpmailer/examples/index.html Use this script to generate PHP code for sending emails based on your form inputs. It's a good starting point for quick implementation. ```php ``` -------------------------------- ### Initialize Front URL Configuration Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/front_url.html Initializes the front-end URL configuration. Use the provided URL if available, otherwise use the default. ```javascript c_pattern.cpFrontUrl.init({$front_url|json_encode}); ``` ```javascript c_pattern.cpFrontUrl.init(); ``` -------------------------------- ### Initialize SkyCaiji Callback Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/browser.html Initializes the skycaiji callback with configuration tips. This should be called when the document is ready. ```javascript $(document).ready(function() { window.skycaijiCB.init({"configTips": "some_config_value"}); }); ``` -------------------------------- ### Initialize and Load CMS Parameters Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/develop/cmsAddParam.html Initializes the CMS parameter system and optionally loads existing parameters. Ensure 'developClass' is available in the global scope. ```javascript developClass.init_cms_param(); if (!empty($param)) { developClass.load_cms_param($param|json_encode); } ``` -------------------------------- ### Initialize Dataset Class Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/dataset/set.html Initializes the dataset class with provided data. This is typically called on page load. ```javascript datasetClass.init({"id":null,"name":"","description":"","sort":0,"fields":[],"indexes":[]}); ``` -------------------------------- ### Provider Initialization Script Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/provider/save.html Initializes the provider configuration with existing data if available. This script is typically used on page load or form submission. ```javascript providerClass.init_prov({$proData?json_encode($proData):''}); ``` -------------------------------- ### Initialize Site Configuration JavaScript Object Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/common/header_public.html Initializes a JavaScript object with essential site configuration parameters. This object is used client-side for various application functionalities, including root path, public path, user token, client information, and admin control panel settings. ```javascript var site_config = { root: "__ROOT__", pub: "__PUBLIC__", usertoken: "{:g_sc('usertoken')}", clientinfo: "{:g_sc('clientinfo')}", admincp: {:json_encode(g_sc_c('admincp'))} }; ``` -------------------------------- ### Initialize Source Operation Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/source.html Initializes the source operation, either with existing source data or without it. Use this when setting up the source pattern configuration interface. ```javascript {if condition="$source"} c_pattern.source_op('init',{source:{$source|json_encode}}); {else /} c_pattern.source_op('init'); {/if} ``` -------------------------------- ### Build Phinx Phar archive Source: https://github.com/zorlan/skycaiji/blob/master/vendor/topthink/think-migration/phinx/README.md Creates a Phar archive of Phinx using the Box application. This allows Phinx to be used as a standalone executable. ```bash php box.phar build ``` -------------------------------- ### Build Ionicons from Source Source: https://github.com/zorlan/skycaiji/blob/master/public/addon/Ionicons/readme.md Generate font files and CSS from source SVG files using a Python script. This process requires Python, FontForge, and Sass. ```bash python ./builder/generate.py ``` -------------------------------- ### Conditional Logic in Data Processing Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/process_module.html Illustrates how to implement conditional logic for data processing. This allows for dynamic actions based on specific criteria. ```html {if !empty($transUrl)} [请先开启并配置翻译]({$transUrl}) {/if} ``` -------------------------------- ### Initialize Proxy List Data Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/proxy/list.html Initializes the proxy list with search parameters. This script should be run on page load to populate the table and enable interactive features. ```javascript window.proxyClass.init_list({"search"|json_encode}); ``` -------------------------------- ### Display Available Process Functions Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/content_sign.html Iterates through and displays available global and extended process functions. ```html {foreach $Think.config.allow_process_func as $k=>$v} {$k}:{$v} {/foreach} {if is_array($Think.config.EXTEND_PROCESS_FUNC)} {foreach $Think.config.EXTEND_PROCESS_FUNC as $k=>$v} {$k}:{$v} {/foreach} {/if} ``` -------------------------------- ### Initialize API Variable Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/develop/apiVariable.html Initializes API variables using a JavaScript function. Pass the variable configuration encoded as JSON. ```javascript developClass.api_init_variable({$variable|json_encode}); ``` -------------------------------- ### Initialize Content Sign Pattern Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/content_sign.html Initializes the content sign pattern with provided data, page type, and configuration. ```javascript c_pattern.cpContentSign.init({:empty($content_sign)?'null':json_encode($content_sign)},'{$page_type}',{$page_config|json_encode}); ``` -------------------------------- ### Batch Replacement Configuration Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/process_module.html Sets up batch replacement rules for text content. This allows for multiple find-and-replace operations to be performed efficiently. ```html 一行一对替换词,用“=”分隔,例如:aa=bb,即将“aa”替换成“bb" ``` -------------------------------- ### JavaScript Initialization for Release Settings Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/release/set.html Initializes the ReleaseClass JavaScript object with form data and loads existing release settings. This is crucial for the dynamic behavior of the release settings page. ```javascript var releaseClass=new ReleaseClass('form_rele',{$releData["id"]|intval}); releaseClass.init(); {if condition="!empty($releData)"} releaseClass.load({$releData|json_encode}); {/if} ``` -------------------------------- ### JavaScript Initialization for Caiji Settings Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/setting/caiji.html Initializes the Caiji settings interface using a JavaScript function. It takes the Caiji configuration object, encoded as JSON, as an argument. ```javascript settingClass.caiji_init({"web_root":"","cli_root":"","swoole_root":"","swoole_host":"","swoole_port":"","swoole_key":"","swoole_interval":"","auto_open":"1","run_mode":"2","api_open":"0","api_type":"1","api_key":"","api_interval":"","api_params":"","max_process":"0","collect_num":"0","collect_interval":"0","collect_timeout":"0","page_interval":"0","fail_wait":"0","fail_retry":"0","same_url":"0","same_title":"0","same_content":"0","realtime_publish":"0","ip_type":"0","redirect_num":"0"}); ``` -------------------------------- ### Initialize Add Proxy Interface Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/proxy/add.html Call this JavaScript function to initialize the interface for adding a new proxy. Ensure the `proxyClass` object and its `init_add` method are available in the global scope. ```javascript window.proxyClass.init_add(); ``` -------------------------------- ### Initialize Relation URL Pattern Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/relation_url.html Initializes the relation URL pattern with provided data or defaults. Use this when setting up dynamic content page associations. ```javascript c_pattern.cpRelationUrl.init({$relation_url|json_encode}); ``` ```javascript c_pattern.cpRelationUrl.init(); ``` -------------------------------- ### Run Phinx Unit Tests Source: https://github.com/zorlan/skycaiji/blob/master/vendor/topthink/think-migration/phinx/CONTRIBUTING.md Executes the unit tests for Phinx locally using PHPUnit, with a custom configuration file. ```bash php vendor/bin/phpunit --config phpunit.xml ``` -------------------------------- ### Initialize Code Editor Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/develop/editor.html Initializes the code editor with provided configuration. Ensure the 'codeEditorClass' object is available in the global scope. ```javascript codeEditorClass.init_deve({"config": "value"}); ``` -------------------------------- ### Initialize API Request Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/develop/apiRequest.html Initializes the API request configuration using a JSON-encoded request object. ```javascript developClass.api_init_request({"$request"|json_encode}); ``` -------------------------------- ### Initialize CpTestUrl with Script Loading Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/test_test_url_ajax.html Loads the necessary JavaScript file for cpattern testing and initializes the CpTestUrl object. This is used to test URL fetching and AJAX interactions. ```javascript 'use strict'; //严格模式 $.getScript("__PUBLIC__/ elative/static/js/admin/cpattern_test.js?{$Think.config.html_v}", function() { var cpTestUrl = new CpTestUrl("{$collData['id']}", "{$test}", "{$pageSource}"); $(document).ready(function() { cpTestUrl.init(); }); }); ``` -------------------------------- ### Include Rule Matching Extraction Module Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/develop/apiVariable.html Includes a module for rule matching extraction. Used when configuring variable extraction based on defined rules. ```html {include file="cpattern:rule_module" _type="rule" _name="variable[extract]" _name_pre="" _allow_loop="" /} ``` -------------------------------- ### Basic HTML Usage Source: https://github.com/zorlan/skycaiji/blob/master/public/addon/Ionicons/readme.md Use Ionicons in HTML by adding the 'icon' class and the specific icon class (e.g., 'ion-home') to an HTML element. ```html ``` -------------------------------- ### Initialize JSON Tree Display Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/browser_json.html This snippet initializes the JSON tree display when the document is ready. It sets the target tree element and loads the JSON data from a textarea. ```javascript 'use strict'; //严格模式 $(document).ready(function(){ window.tool_json_tree.treeId='#tool_json_tree'; window.tool_json_tree.load($('#txt_json').val()); }); ``` -------------------------------- ### Include Rule Module for Rule Matching Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/process_module.html Include the rule module for general rule matching. This is applicable when the API response needs to be processed based on a set of predefined rules. ```smarty {include file="cpattern:rule_module" _type="rule" _name="data-process" _name_pre="api:api_" _allow_loop="" /} ``` -------------------------------- ### Regular Expression Usage for Extraction Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/process_module.html Demonstrates the use of regular expressions for data extraction and manipulation. It allows for complex pattern matching and content capturing. ```html [{$Think.lang.sign_wildcard}](javascript:; "{$Think.lang.tips_sign_wildcard}") 正则[](javascript:; "提示信息") ``` ```html [{$Think.lang.sign_wildcard}](javascript:; "{$Think.lang.tips_sign_wildcard}") 正则 ``` ```html [{$Think.lang.sign_wildcard}](javascript:; "{$Think.lang.tips_sign_wildcard}") 正则 ``` ```html [{$Think.lang.sign_wildcard}](javascript:; "{$Think.lang.tips_sign_wildcard}") 正则 ``` -------------------------------- ### Include Rule Module for Content Sign Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/content_sign.html Includes the rule module for content sign pattern matching. ```html {include file="cpattern:rule_module" _type="rule" _name="content_sign" _name_pre="" _allow_loop="" /} ``` -------------------------------- ### HTML Tag Attribute File Download Configuration Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/process_module.html Configures the system to download files from specified HTML tag attributes. This is useful for extracting resources linked within HTML content. ```html * [object标签data属性](javascript:;) * [embed标签src属性](javascript:;) * [source标签src属性](javascript:;) * [link标签href属性](javascript:;) * [script标签src属性](javascript:;) * [a标签href属性](javascript:;) ``` -------------------------------- ### Include Rule Module for XPath Extraction Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/content_sign.html Includes the rule module for content sign pattern extraction using XPath. ```html {include file="cpattern:rule_module" _type="xpath" _name="content_sign" _name_pre="" _allow_loop="" /} ``` -------------------------------- ### Initialize Field Extraction Logic Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/field.html Initializes the field extraction logic based on whether field configuration data exists. This is typically called on page load. ```javascript c_pattern.cpField.init(); ``` ```javascript c_pattern.cpField.init({"field":"value"}); ``` -------------------------------- ### API Key Generation and URL Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/release/set.html Generates an API key and constructs the API URL for accessing task data. This is useful for external systems to retrieve data collected by the task. ```php {php}$apiKeyStr=isset($releData['config']['api']['url'])?$releData['config']['api']['url']:md5($releData['config']['api']['key']);{/php} API网址:[{$apiRootUrl}/api_task/{$taskData['id']}/{$apiKeyStr}]({$apiRootUrl}/api_task/{$taskData['id']}/{$apiKeyStr}) ``` -------------------------------- ### Displaying Database Names Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/release/dbNames.html Iterates through a list of database names and displays each one. This is typically used within an HTML template to populate a selection list or dropdown. ```smarty {foreach name="dbNames" item="dbName"} {$dbName} {/foreach} ``` -------------------------------- ### Initialize Pagination Field Operation Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/pagination_field.html Initializes the pagination field operation. Use this when a pagination field is defined. If no pagination field is defined, it uses a default initialization. ```javascript c_pattern.cpPagination.field_op('url','init',{pagination_field:{$pnField|json_encode}}); ``` ```javascript c_pattern.cpPagination.field_op('url','init'); ``` -------------------------------- ### Include Rule Module for JSON Extraction Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/content_sign.html Includes the rule module for content sign pattern extraction using JSON. ```html {include file="cpattern:rule_module" _type="json" _name="content_sign" _name_pre="" _allow_loop="" /} ``` -------------------------------- ### PHPfmt Plugin Configuration for Sublime Text Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/tp/CONTRIBUTING.md This JSON configuration enables PSR-2 code formatting on save for the phpfmt plugin in Sublime Text. ```json { "autocomplete": true, "enable_auto_align": true, "format_on_save": true, "indent_with_space": true, "psr1_naming": false, "psr2": true, "version": 4 } ``` -------------------------------- ### Include Rule Module for XPath Matching Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/process_module.html Include the rule module for XPath matching. This is used when the API response is XML or HTML, and data needs to be extracted using XPath expressions. ```smarty {include file="cpattern:rule_module" _type="xpath" _name="data-process" _name_pre="api:api_" _allow_loop="" /} ``` -------------------------------- ### URL Processing and Localization Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/process_module.html Handles URL processing, including marking text links as images or files, and localizing them. This is useful for managing external resources. ```html {if !empty($downImgUrl)} [请先开启并配置图片本地化]({$downImgUrl}) {/if} ``` ```html {if !empty($downFileUrl)} [请先开启并配置文件本地化]({$downFileUrl}) {/if} ``` -------------------------------- ### PHP Code for Data Release Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/release/set.html Provides a template for custom PHP code used in data release. It outlines available variables and the required return format for successful data insertion. ```php 可用变量:$fields = 采集到的字段数据列表,$url = 采集的页面网址,$this->db() = 数据库操作, 可参考thinkphp5的数据库操作 获取字段值必须使用 $this->get_field_val($field);方法(可处理图片、文件本地化等),否则使用$field['value']调用字段原始值 必须以数组形式返回: * id(必填)表示入库返回的自增id或状态 target(可选)记录入库的数据位置(发布的网址等) desc(可选)记录入库的数据位置附加信息 error(可选)入库的错误信息 return array('id'=>0,'target'=>'','desc'=>'','error'=>''); 入库的信息可在“已采集数据”中查看 ``` -------------------------------- ### Call Global Content Tag Function Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/content_sign.html Provides a link to call the global content tag function for matching. ```html [{:cp_sign('match','N')}](javascript:; "调用全局内容标签") ``` -------------------------------- ### Conditional Database Configuration Display Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/release/set.html Conditionally displays a message if the database configuration has not been saved yet. This ensures users are prompted to save settings before proceeding with database-related actions. ```html {if condition="empty($releData['config']['db'])"} 请先保存“数据库配置” {else /} {/if} ``` -------------------------------- ### Include Rule Module for Data Extraction Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/process_module.html Includes a rule module for data processing, specifically for extraction tasks. This is used when defining extraction rules. ```html {include file="cpattern:rule_module" _type="rule" _name="data-process" _name_pre="extract:extract_" _allow_loop="" /} ``` ```html {include file="cpattern:rule_module" _type="xpath" _name="data-process" _name_pre="extract:extract_" _allow_loop="" /} ``` ```html {include file="cpattern:rule_module" _type="json" _name="data-process" _name_pre="extract:extract_" _allow_loop="" /} ``` -------------------------------- ### Log File Click Handler Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/tool/logs.html Handles clicks on log file links to display log content in an iframe and provides an option to upload the log. ```javascript var file=$(this).attr('data-file'); var url=ulink('tool/log?file=\_file\_',{\_file\_:file}); var uploadTxt='上报日志'; windowIframe('日志:'+file+' ',url,{lg:1}); $('#upload\_log').bind('click',function(){ $(this).text(uploadTxt+'...'); $(this).attr('disabled',true); ajaxOpen({ type: 'post', dataType: 'json', url:ulink('tool/log?upload=1&file=\_file\_',{\_file\_:file}), success: function (data) { $('#upload\_log').text(uploadTxt); $('#upload\_log').attr('disabled',false); ajaxDataMsg(data); } }); }); ``` -------------------------------- ### Security Warning for Custom Code Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/release/set.html Displays a security warning and instructions on how to enable the custom code feature for data release. This is a security measure to prevent unauthorized code execution. ```html {if condition="!config('OPEN_DIY_CODE')"} 出于安全考虑,如需开启该功能,请在根目录配置文件"data/config.php"中添加设置 **'OPEN_DIY_CODE'=>TRUE** {else /} {/if} ``` -------------------------------- ### Display Similar Elements Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/browser.html A JavaScript link to display elements of the same type based on their XPath. ```javascript [显示](javascript:;) ``` -------------------------------- ### Include JSON Extraction Rule Module Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/develop/apiVariable.html Includes a module for JSON extraction rules. Used when configuring variable extraction from JSON data. ```html {include file="cpattern:rule_module" _type="json" _name="variable[extract]" _name_pre="" _allow_loop="" /} ``` -------------------------------- ### Conditional Test Release Button Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/release/set.html Displays a 'Test Release' button only if a release task ID is present. This allows users to test the release functionality after saving the settings. ```html {if condition="!empty($releData['id'])"} [测试发布(需先保存设置)](javascript:;) {/if} ``` -------------------------------- ### Include XPath Extraction Module Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/develop/apiVariable.html Includes a module for XPath extraction. Used when configuring variable extraction from XML or HTML content using XPath. ```html {include file="cpattern:rule_module" _type="xpath" _name="variable[extract]" _name_pre="" _allow_loop="" /} ``` -------------------------------- ### Browser Element Actions Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/browser.html Provides JavaScript links for common browser element interactions like displaying, clearing, viewing attributes, and navigating parent/child elements. ```javascript [显示](javascript:;) ``` ```javascript [清理](javascript:; "清理界面") ``` ```javascript [属性](javascript:; "当前元素的所有属性") ``` ```javascript [父元素](javascript:; "当前元素的父元素") ``` ```javascript [子元素](javascript:; "当前元素的子元素") ``` -------------------------------- ### Password Strength Indicator Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/install/view/index/step2.html Provides real-time feedback on the strength of the entered password as the user types. It categorizes the password strength into 'very weak', 'weak', 'medium', and 'strong' based on its length. ```javascript /*判断密码强弱*/ $('#form_db input[name="user_pwd"]').bind('keyup',function(){ var pwd=$(this).val(); if(pwd.length>=6){ $('#box_pwd').addClass('input-group'); $('#pwd_status').show(); if((/^.{6,7}$/i).test(pwd)){ $('#pwd_status').html('极弱'); }else if((/^.{8,9}$/i).test(pwd)){ $('#pwd_status').html('弱'); }else if((/^.{10,13}$/i).test(pwd)){ $('#pwd_status').html('中'); }else if((/^.{14,}$/i).test(pwd)){ $('#pwd_status').html('强'); } }else{ $('#box_pwd').removeClass('input-group'); $('#pwd_status').hide(); } }); ``` -------------------------------- ### PHP Function Integration for Data Processing Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/process_module.html Allows integration with PHP functions for advanced data manipulation. This enables custom processing logic to be applied to the data. ```html PHP函数名 [](javascript:; "刷新") --请选择-- {foreach $Think.config.allow_process_func as $k=>$v} {$k}:{$v} {/foreach} {if is_array($Think.config.EXTEND_PROCESS_FUNC)} {foreach $Think.config.EXTEND_PROCESS_FUNC as $k=>$v} {$k}:{$v} {/foreach} {/if} ``` -------------------------------- ### Handle File Upload Form Submission Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/mystore/upload.html This JavaScript function binds a submit event to the upload form. It uses AJAX to handle the submission and dynamically updates the UI based on the server response, such as showing password input fields or plugin selection options. ```javascript function win_upload_submit(){ $('#win_form_upload').bind('submit',function(){ var settings = getFormAjaxSettings($(this), function(data) { var show = data['show']; var showData = isObject(data['show_data']) ? data['show_data'] : []; if (show == 'show_ipt_pwd') { //显示密码 $('#win_form_upload .upload-ipt-pwd').show(); } else if (show == 'show_plugins') { //选择插件 var plugins = showData; if (isObject(plugins)) { var html = ''; //导入规则显示了选择插件 for (var app in plugins) { html += '
' } $('#win_form_upload .upload-plugins').show().find('.upload-plugins-info').html(html); } } else if (show == 'show_replace') { confirmRight('插件已存在,是否覆盖?', function() { //替换 $('#win_form_upload').find('[name="replace"]').val(1); $('#win_form_upload').submit(); }); } else if (show == 'show_rule_data') { //显示规则配置 taskOpClass.import_rule(showData[0], showData[1]); } else if (show == 'show_release_data') { //显示发布设置 releaseClass.import_rele(showData[0], showData[1]); } }); ajaxOpen(settings); return false; }); } win_upload_submit(); ``` -------------------------------- ### Include Rule Module for JSON Extraction Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/process_module.html Include the rule module for JSON data extraction. This is used when the API response is in JSON format and needs to be processed using defined rules. ```smarty {include file="cpattern:rule_module" _type="json" _name="data-process" _name_pre="api:api_" _allow_loop="" /} ``` -------------------------------- ### Generate HTML Tag Title Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/common/header_public.html Dynamically generates the HTML tag title, appending ' - SkyCaiji Admin' if a specific title is set. This ensures a consistent and informative page title for the admin interface. ```html {:g_sc('html_tag_title')?(g_sc('html_tag_title').' - '):''}蓝天采集器后台管理 ``` -------------------------------- ### Keyword-Based Data Filtering Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/process_module.html Configures data filtering based on keywords. This can be used to either include or exclude data that contains specific terms. ```html 一行一个关键词 ``` -------------------------------- ### Confirming Database Selection Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/release/dbNames.html Handles the click event for a button to confirm the selected database name. It assigns the selected value to a form field and then hides a modal dialog. This snippet is intended for use with jQuery and Bootstrap's modal component. ```javascript $('#win_db_names button').bind('click',function(){ $(releaseClass.formid).find('[name="db[name]"]').val($('#win_db_names select').val());//赋值 $('#myModal').modal('hide');//隐藏 }); ``` -------------------------------- ### Conditional Variable Operation Call Source: https://github.com/zorlan/skycaiji/blob/master/vendor/skycaiji/app/admin/view/cpattern/variable.html Calls the 'variable_op' function with 'form' as the operation type. It conditionally passes parameters based on whether the 'params' variable is empty, ensuring correct function execution. ```javascript {if !empty($params)} c_pattern.variable_op('form',{$params|json_encode}); {else} c_pattern.variable_op('form'); {/if} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.