This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* ВОДНЫЕ ЗНАКИ */ | |
| http://brianium.github.io/watermarkjs/ | |
| /*ПРИКОЛЬНЫЙ ЗУММЕР ИЗОБРАЖЕНИЙ*/ | |
| http://fat.github.io/zoom.js/ | |
| /*PHP XML parcer*/ | |
| http://sabre.io/xml/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE table_new LIKE databasename.table_old; | |
| INSERT table_new SELECT * FROM databasename.table_old; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function cut_title($string) | |
| { | |
| $desired_width = 70; | |
| $string = substr($string, 0, $desired_width+1); | |
| if (strlen($string) > $desired_width) | |
| { | |
| $string = wordwrap($string, $desired_width); | |
| $i = strpos($string, "\n"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <input id="usersmodel-pwd" name="UsersModel[pwd]" value="" type="text"> | |
| <a href="#generatepassword" id="generatepassword"><span>сгенерировать пароль</span></a> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| private function generateRandomPwd($length = 8) | |
| { | |
| $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
| $charactersLength = strlen($characters); | |
| $randomString = ''; | |
| for ($i = 0; $i < $length; $i++) { | |
| $randomString .= $characters[rand(0, $charactersLength - 1)]; | |
| } | |
| return $randomString; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| try | |
| { | |
| switch (__DIR__) { | |
| case 'D:\open-server500\OpenServer\domains\sitename.loc': | |
| $dbh = new PDO("mysql:host=127.0.0.1; dbname=sitename_db", 'root', ''); | |
| break; | |
| default: | |
| $dbh = new PDO("mysql:host=localhost; dbname=dbname", 'dbusr', 'dbpwd'); | |
| break; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| include_once('simple_html_dom.php'); | |
| // %progdir%\modules\wget\bin\wget.exe -q --no-cache http://forexfactory.loc/forexfactory.php | |
| define ("PATH_TO_FOLDER", "C:/Users/Vadim/AppData/Roaming/MetaQuotes/Terminal/D0E8209F77C8CF37AD8BF550E51FF075/MQL5/Files/"); | |
| // define ("PATH_TO_FOLDER", "E:/openserver522/openserver/domains/forexfactory.loc/"); | |
| define ("CSV_FILE_NAME", "forexfactoryparce.csv"); | |
| if(!file_exists(PATH_TO_FOLDER.CSV_FILE_NAME)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| include_once('simple_html_dom.php'); | |
| // %progdir%\modules\wget\bin\wget.exe -q --no-cache http://forexfactory.loc/forexfactory.php | |
| define ("PATH_TO_FOLDER", "C:/Users/Vadim/AppData/Roaming/MetaQuotes/Terminal/D0E8209F77C8CF37AD8BF550E51FF075/MQL5/Files/"); | |
| // define ("PATH_TO_FOLDER", "E:/openserver522/openserver/domains/forexfactory.loc/"); | |
| define ("CSV_FILE_NAME", "forexfactoryparce.csv"); | |
| if(!file_exists(PATH_TO_FOLDER.CSV_FILE_NAME)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $key = 'password to (en/de)crypt'; | |
| $string = ' string to be encrypted '; // данные для шифровки/дешифровки | |
| /////////////// Шифрование ////////////////// | |
| $iv = mcrypt_create_iv( | |
| mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC), | |
| MCRYPT_DEV_URANDOM | |
| ); | |
| $encrypted = base64_encode( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function actionSearch() | |
| { | |
| // ---------SphinxSearch---------- | |
| if($_SERVER['REQUEST_METHOD'] == 'GET') | |
| { | |
| $searchText = HtmlPurifier::process(Yii::$app->request->get('search')); | |
| $searchText = trim($searchText); | |
| $sphinxQuery = new Query(); | |
| $sphinxResult = $sphinxQuery->from('post_index')->match($searchText)->all(); |