├── .gitattributes ├── LICENSE.txt ├── README.md ├── admcenter ├── admin.php ├── cron_withdrawal.php ├── donate.php ├── footer.php ├── header.php ├── index.php ├── login.php ├── prize.php ├── setting.php ├── style │ ├── css │ │ ├── bootstrap-reset.css │ │ ├── bootstrap.min.css │ │ └── style.css │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regulard41d.eot │ ├── images │ │ ├── ajax-loader.gif │ │ ├── arrow-up.png │ │ ├── default-avatar.png │ │ └── logo.png │ └── javascripts │ │ └── common-scripts.js └── withdrawal.php ├── conf_donate.php ├── cron_withdrawal.php ├── donate.php ├── fail_donate.php ├── header.php ├── howto.php ├── includes ├── AsmoneyAPI.php ├── csrf.class.php ├── dbconnector.class.php ├── function.php ├── jsonRPCClient.php ├── smarty │ ├── Smarty.class.php │ ├── SmartyBC.class.php │ ├── debug.tpl │ ├── plugins │ │ ├── block.textformat.php │ │ ├── function.counter.php │ │ ├── function.cycle.php │ │ ├── function.fetch.php │ │ ├── function.html_checkboxes.php │ │ ├── function.html_image.php │ │ ├── function.html_options.php │ │ ├── function.html_radios.php │ │ ├── function.html_select_date.php │ │ ├── function.html_select_time.php │ │ ├── function.html_table.php │ │ ├── function.mailto.php │ │ ├── function.math.php │ │ ├── modifier.capitalize.php │ │ ├── modifier.date_format.php │ │ ├── modifier.debug_print_var.php │ │ ├── modifier.escape.php │ │ ├── modifier.regex_replace.php │ │ ├── modifier.replace.php │ │ ├── modifier.spacify.php │ │ ├── modifier.truncate.php │ │ ├── modifiercompiler.cat.php │ │ ├── modifiercompiler.count_characters.php │ │ ├── modifiercompiler.count_paragraphs.php │ │ ├── modifiercompiler.count_sentences.php │ │ ├── modifiercompiler.count_words.php │ │ ├── modifiercompiler.default.php │ │ ├── modifiercompiler.escape.php │ │ ├── modifiercompiler.from_charset.php │ │ ├── modifiercompiler.indent.php │ │ ├── modifiercompiler.lower.php │ │ ├── modifiercompiler.noprint.php │ │ ├── modifiercompiler.string_format.php │ │ ├── modifiercompiler.strip.php │ │ ├── modifiercompiler.strip_tags.php │ │ ├── modifiercompiler.to_charset.php │ │ ├── modifiercompiler.unescape.php │ │ ├── modifiercompiler.upper.php │ │ ├── modifiercompiler.wordwrap.php │ │ ├── outputfilter.trimwhitespace.php │ │ ├── shared.escape_special_chars.php │ │ ├── shared.literal_compiler_param.php │ │ ├── shared.make_timestamp.php │ │ ├── shared.mb_str_replace.php │ │ ├── shared.mb_unicode.php │ │ ├── shared.mb_wordwrap.php │ │ └── variablefilter.htmlspecialchars.php │ └── sysplugins │ │ ├── smarty_cacheresource.php │ │ ├── smarty_cacheresource_custom.php │ │ ├── smarty_cacheresource_keyvaluestore.php │ │ ├── smarty_config_source.php │ │ ├── smarty_internal_cacheresource_file.php │ │ ├── smarty_internal_compile_append.php │ │ ├── smarty_internal_compile_assign.php │ │ ├── smarty_internal_compile_block.php │ │ ├── smarty_internal_compile_break.php │ │ ├── smarty_internal_compile_call.php │ │ ├── smarty_internal_compile_capture.php │ │ ├── smarty_internal_compile_config_load.php │ │ ├── smarty_internal_compile_continue.php │ │ ├── smarty_internal_compile_debug.php │ │ ├── smarty_internal_compile_eval.php │ │ ├── smarty_internal_compile_extends.php │ │ ├── smarty_internal_compile_for.php │ │ ├── smarty_internal_compile_foreach.php │ │ ├── smarty_internal_compile_function.php │ │ ├── smarty_internal_compile_if.php │ │ ├── smarty_internal_compile_include.php │ │ ├── smarty_internal_compile_include_php.php │ │ ├── smarty_internal_compile_insert.php │ │ ├── smarty_internal_compile_ldelim.php │ │ ├── smarty_internal_compile_nocache.php │ │ ├── smarty_internal_compile_private_block_plugin.php │ │ ├── smarty_internal_compile_private_function_plugin.php │ │ ├── smarty_internal_compile_private_modifier.php │ │ ├── smarty_internal_compile_private_object_block_function.php │ │ ├── smarty_internal_compile_private_object_function.php │ │ ├── smarty_internal_compile_private_print_expression.php │ │ ├── smarty_internal_compile_private_registered_block.php │ │ ├── smarty_internal_compile_private_registered_function.php │ │ ├── smarty_internal_compile_private_special_variable.php │ │ ├── smarty_internal_compile_rdelim.php │ │ ├── smarty_internal_compile_section.php │ │ ├── smarty_internal_compile_setfilter.php │ │ ├── smarty_internal_compile_while.php │ │ ├── smarty_internal_compilebase.php │ │ ├── smarty_internal_config.php │ │ ├── smarty_internal_config_file_compiler.php │ │ ├── smarty_internal_configfilelexer.php │ │ ├── smarty_internal_configfileparser.php │ │ ├── smarty_internal_data.php │ │ ├── smarty_internal_debug.php │ │ ├── smarty_internal_filter_handler.php │ │ ├── smarty_internal_function_call_handler.php │ │ ├── smarty_internal_get_include_path.php │ │ ├── smarty_internal_nocache_insert.php │ │ ├── smarty_internal_parsetree.php │ │ ├── smarty_internal_resource_eval.php │ │ ├── smarty_internal_resource_extends.php │ │ ├── smarty_internal_resource_file.php │ │ ├── smarty_internal_resource_php.php │ │ ├── smarty_internal_resource_registered.php │ │ ├── smarty_internal_resource_stream.php │ │ ├── smarty_internal_resource_string.php │ │ ├── smarty_internal_smartytemplatecompiler.php │ │ ├── smarty_internal_template.php │ │ ├── smarty_internal_templatebase.php │ │ ├── smarty_internal_templatecompilerbase.php │ │ ├── smarty_internal_templatelexer.php │ │ ├── smarty_internal_templateparser.php │ │ ├── smarty_internal_utility.php │ │ ├── smarty_internal_write_file.php │ │ ├── smarty_resource.php │ │ ├── smarty_resource_custom.php │ │ ├── smarty_resource_recompiled.php │ │ ├── smarty_resource_uncompiled.php │ │ └── smarty_security.php ├── solvemedialib.php ├── system.class.php └── user.class.php ├── index.php ├── install.php ├── login.php ├── logout.php ├── maincore.php ├── pass.php ├── phpfaucet.sql ├── referral.php ├── register.php ├── setting.php ├── style ├── css │ ├── bootstrap-theme.css │ ├── bootstrap.css │ ├── font-awesome.css │ └── style.css ├── fonts │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.svg │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff └── javascript │ ├── bootstrap.min.js │ └── jquery-1.11.2.min.js ├── template ├── donate.tpl ├── footer.tpl ├── header.tpl ├── howto.tpl ├── index.tpl ├── login.tpl ├── pass.tpl ├── referral.tpl ├── register.tpl └── withdrawal.tpl └── withdrawal.php /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) [year] [fullname] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PHPfaucet 2 | PHPFaucet is an OpenSource software to run faucet for cryptocoins like Bitcoin, Dogecoin, Litecoin, Darkcoin and Peercoin. PHPFaucet allow you to make a faucet website within ten minutes. all PHPFaucet payments handle through AsMoney 3 | 4 | #Installation 5 | 6 | 1 ) Create a MySQL database 7 | 8 | 2 ) Upload and unzip PHPFaucet package on your website 9 | 10 | 3 ) Browse yourdomain.com/install.php and submit database information, please delete install.php when installation get completed 11 | 12 | 4 ) You can set Currency in admin area setting, mBTC-Satoshi-BTC make a Bitcoin faucet, mDoge-Doge make a Dogecoin Faucet and and so on to other cryptocurrencies. 13 | 14 | 15 | #Configure Faucet 16 | 17 | Login to admin url by browsing yourdomain.com/admcenter/ , your default username and password are admin/admin. 18 | 19 | 20 | Captcha setting 21 | Go to solvemedia.com , create an account and add your website, you will receive three hashes from solve media , put the hashes in solvemedia setting. 22 | 23 | AsMoney API setting 24 | for sending payment, Create an AsMoney account, go to merchant section and make an API, you can set your AsMoney username, API name and API password to send faucet payments. 25 | 26 | AsMoney SCI setting 27 | for receive donate, go to merchant section of your AsMoney account, Set your username, sci name and sci password to receive payments. 28 | 29 | #ChangeLog 30 | 31 | v 0.1 : Initial release 32 | -------------------------------------------------------------------------------- /admcenter/admin.php: -------------------------------------------------------------------------------- 1 | query("delete from tbl_admin where admin_id='$aid'"); 5 | header('Location:admin.php'); 6 | }elseif( isset($_POST['add']) ){ 7 | $username=$_POST['username']; 8 | $password=md5($_POST['password']); 9 | $db->Query("insert into tbl_admin (username,password) values ('$username','$password') "); 10 | header('Location:admin.php'); 11 | }else{ 12 | ?> 13 |
14 |
15 | 16 |
17 |
18 | Administrator 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | query("select * from tbl_admin"); 33 | while($res=$db->fetcharray()){ 34 | ?> 35 | 36 | 37 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 |
#UsernameAction
38 | 39 | 40 | 41 |
54 | 55 | 56 |
57 | 58 | 61 | 62 |
63 | 64 | 65 | 66 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 |
108 | 109 |
110 |
111 | -------------------------------------------------------------------------------- /admcenter/cron_withdrawal.php: -------------------------------------------------------------------------------- 1 | queryres("select * from tbl_config where header='currency'"); 8 | $currency=$db->res['value']; 9 | $db->queryres("select * from tbl_config where header='pusername'"); 10 | $pusername=$db->res['value']; 11 | $db->queryres("select * from tbl_config where header='papiname'"); 12 | $papiname=$db->res['value']; 13 | $db->queryres("select * from tbl_config where header='ppassword'"); 14 | $ppassword=$db->res['value']; 15 | $api = new AsmoneyAPI($pusername,$papiname, $ppassword); 16 | //Change to mili bitcoin because asmoney get currencies based on milicoinfunction ChangetoMili($amount,$currency) { switch ($currency) { case "BTC" : $amount = $amount * 1000; return $amount; case "mBTC" : return $amount; case "Satoshi" : $amount = $amount / 10000; return $amount; case "LTC" : $amount = $amount * 1000; return $amount; case "mLTC" : return $amount; case "DOGE" : $amount = $amount * 1000; return $amount; case "mDOGE" : return $amount; case "PPC" : $amount = $amount * 1000; return $amount; case "mPPC" : return $amount; case "DRK" : $amount = $amount * 1000; return $amount; case "mDRK" : return $amount; }} 17 | $db->query("select * from tbl_withdrawal where status=0"); 18 | while($res=$db->fetchArray()){ 19 | 20 | if($res['type']==0){ $amount = ChangetoMili($res['amount'],$currency); 21 | $r = $api->Transfer($res['wallet'],$amount,$currency,'Withdrawal'); // Payment memo 22 | if ($r['result'] == APIerror::OK){ 23 | $batchno = $r['value']; 24 | $db2->query("update tbl_withdrawal set status=1,reccode='$batchno' where withdrawal_id='".$res['withdrawal_id']."'"); echo "Withdrawal has been proceessed" .$res['withdrawal_id']; 25 | } 26 | }else{ 27 | 28 | $db2->queryres("select * from tbl_user where user_id='".$res['user_id']."'"); 29 | $address=$db2->res['address']; 30 | $amount = ChangetoMili($res['amount'],$currency); 31 | 32 | 33 | if( $currency=='mBTC' ){ 34 | $r = $api->TransferBTC($address,$amount,'mBTC','Withdrawal'); 35 | } 36 | 37 | 38 | if( $currency=='mLTC' ){ 39 | $r = $api->TransferLTC($address,$amount,'mLTC','Withdrawal'); 40 | } 41 | 42 | 43 | if( $currency=='mDRK' ){ 44 | $r = $api->TransferDRK($address,$amount,'mDRK','Withdrawal'); 45 | } 46 | 47 | 48 | if( $currency=='mPPC' ){ 49 | $r = $api->TransferPPC($address,$amount,'mPPC','Withdrawal'); 50 | } 51 | 52 | 53 | if( $currency=='mDOGE' ){ 54 | $r = $api->TransferDOGE($address,$amount,'mDOGE','Withdrawal'); 55 | } 56 | 57 | if ($r['result'] == APIerror::OK){ 58 | $batchno = $r['value']; 59 | $db2->query("update tbl_withdrawal set status=1,reccode='$batchno' where withdrawal_id='".$res['withdrawal_id']."'"); echo "Withdrawal has been proceessed" .$res['withdrawal_id']; 60 | } 61 | 62 | } 63 | 64 | } 65 | ?> -------------------------------------------------------------------------------- /admcenter/footer.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 25 | 26 | -------------------------------------------------------------------------------- /admcenter/login.php: -------------------------------------------------------------------------------- 1 | mysqli->prepare("select admin_id,username,password from tbl_admin where username=?"); 7 | $prepare->bind_param('s',$username); 8 | $prepare->execute(); 9 | $prepare->bind_result($aid,$username,$pass); 10 | $prepare->fetch(); 11 | $prepare->close(); 12 | if(is_numeric($aid) && $password==$pass){ 13 | $_SESSION['admin']['logged']=true; 14 | $_SESSION['admin']['aid']=$aid; 15 | header('Location:index.php'); 16 | }else{ 17 | $_SESSION['error']['invalid']=true; 18 | header('Location:login.php'); 19 | } 20 | }else{ 21 | ?> 22 |
23 |
24 | 25 | 46 |
47 |
48 | -------------------------------------------------------------------------------- /admcenter/style/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phpfaucet/faucet/133ea621645c893a5d461b16affd4287293aac9c/admcenter/style/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /admcenter/style/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phpfaucet/faucet/133ea621645c893a5d461b16affd4287293aac9c/admcenter/style/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /admcenter/style/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phpfaucet/faucet/133ea621645c893a5d461b16affd4287293aac9c/admcenter/style/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /admcenter/style/fonts/glyphicons-halflings-regulard41d.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phpfaucet/faucet/133ea621645c893a5d461b16affd4287293aac9c/admcenter/style/fonts/glyphicons-halflings-regulard41d.eot -------------------------------------------------------------------------------- /admcenter/style/images/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phpfaucet/faucet/133ea621645c893a5d461b16affd4287293aac9c/admcenter/style/images/ajax-loader.gif -------------------------------------------------------------------------------- /admcenter/style/images/arrow-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phpfaucet/faucet/133ea621645c893a5d461b16affd4287293aac9c/admcenter/style/images/arrow-up.png -------------------------------------------------------------------------------- /admcenter/style/images/default-avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phpfaucet/faucet/133ea621645c893a5d461b16affd4287293aac9c/admcenter/style/images/default-avatar.png -------------------------------------------------------------------------------- /admcenter/style/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phpfaucet/faucet/133ea621645c893a5d461b16affd4287293aac9c/admcenter/style/images/logo.png -------------------------------------------------------------------------------- /conf_donate.php: -------------------------------------------------------------------------------- 1 | query("update tbl_dobate set status=1 where md5(donate)='$pid' "); 13 | 14 | $_SESSION['succ']['donate']=true; 15 | 16 | 17 | }else{ 18 | 19 | $_SESSION['succ']['penging']=true; 20 | 21 | } 22 | 23 | 24 | header('Location:donate.php'); 25 | 26 | 27 | ?> -------------------------------------------------------------------------------- /donate.php: -------------------------------------------------------------------------------- 1 | mysqli->prepare("insert into tbl_donate (user_id,amount,`date`,link) values (?,?,?,?)"); 8 | $prepare->bind_param('iiis',$uid,$_POST['PAYMENT_AMOUNT'],time(),$_POST['link']); 9 | $prepare->execute(); 10 | $insid=$prepare->insert_id; 11 | $prepare->store_result(); 12 | $prepare->close(); 13 | $db->queryres("select * from tbl_config where header='donate_type'"); 14 | $dtype=$db->res['value']; 15 | 16 | $db->queryres("select * from tbl_config where header='pusername'"); 17 | $pusername=$db->res['value']; 18 | $db->queryres("select * from tbl_config where header='STORE_NAME'"); 19 | $STORE_NAME=$db->res['value']; 20 | 21 | 22 | 23 | ?> 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
32 | 33 | Please wait... 34 | query("select * from tbl_donate where user_id='$uid' order by date desc"); 39 | while($res=$db->fetchArray()){ 40 | $ar=array('amount'=>$res['amount'],'date'=>date('Y/m/d',$res['date']),'status'=>$res['status']); 41 | array_push($with,$ar); 42 | } 43 | 44 | $smarty->assign('with',$with); 45 | 46 | $db->queryres("select * from tbl_config where header='donate_min'"); 47 | $smarty->assign('dmin',$db->res['value']); 48 | 49 | 50 | 51 | if(isset($_SESSION['error']['over'])){ 52 | $smarty->assign('over',true); 53 | unset($_SESSION['error']); 54 | } 55 | 56 | 57 | 58 | if(isset($_SESSION['error']['donate'])){ 59 | $smarty->assign('ed',true); 60 | unset($_SESSION['error']); 61 | } 62 | 63 | 64 | 65 | if(isset($_SESSION['succ']['donate'])){ 66 | $smarty->assign('sd',true); 67 | unset($_SESSION['esuccrror']); 68 | } 69 | 70 | if(isset($_SESSION['succ']['penging'])){ 71 | $smarty->assign('penging',true); 72 | unset($_SESSION['succ']); 73 | } 74 | 75 | 76 | 77 | 78 | $smarty->display('template/donate.tpl'); 79 | } 80 | ?> -------------------------------------------------------------------------------- /fail_donate.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /header.php: -------------------------------------------------------------------------------- 1 | 0){ 7 | 8 | //If IP referral not equal with user IP 9 | 10 | $ruid = $_GET['r']; 11 | $prepare=$db->mysqli->prepare("select ip from tbl_user where user_id=?"); 12 | $prepare->bind_param('i',$ruid); 13 | $prepare->execute(); 14 | $prepare->bind_result($refip); 15 | $prepare->fetch(); 16 | 17 | if ( $ip != $refip ) { 18 | setcookie('r', trim($_GET['r']), time() + 60 * 60 * 24 * 30); 19 | } 20 | $prepare->close(); 21 | 22 | } 23 | 24 | 25 | 26 | if(isset($uid)){ 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | } 38 | 39 | if(isset($uid) ){ 40 | 41 | 42 | $smarty->assign('logged',true); 43 | 44 | 45 | } 46 | 47 | 48 | ?> -------------------------------------------------------------------------------- /howto.php: -------------------------------------------------------------------------------- 1 | display('template/howto.tpl'); 5 | 6 | ?> -------------------------------------------------------------------------------- /includes/csrf.class.php: -------------------------------------------------------------------------------- 1 | random(10); 8 | $_SESSION['token_id'] = $token_id; 9 | return $token_id; 10 | } 11 | } 12 | 13 | public function get_token() { 14 | if(isset($_SESSION['token_value'])) 15 | return $_SESSION['token_value']; 16 | else{ 17 | $token = hash('sha256', $this->random(500)); 18 | $_SESSION['token_value'] = $token; 19 | return $token; 20 | } 21 | } 22 | 23 | public function check_valid($method) { 24 | if($method == 'post' || $method == 'get') { 25 | $post = $_POST; 26 | $get = $_GET; 27 | if(isset(${$method}[$this->get_token_id()]) && (${$method}[$this->get_token_id()] == $this->get_token())) 28 | return true; 29 | else 30 | return false; 31 | }else 32 | return false; 33 | } 34 | 35 | 36 | public function form_names($names, $regenerate) { 37 | 38 | $values = array(); 39 | foreach ($names as $n) { 40 | if($regenerate == true) { 41 | unset($_SESSION[$n]); 42 | } 43 | $s = isset($_SESSION[$n]) ? $_SESSION[$n] : $this->random(10); 44 | $_SESSION[$n] = $s; 45 | $values[$n] = $s; 46 | } 47 | return $values; 48 | } 49 | 50 | private function random($len) { 51 | if (@is_readable('/dev/urandom')) { 52 | $f=fopen('/dev/urandom', 'r'); 53 | $urandom=fread($f, $len); 54 | fclose($f); 55 | } 56 | 57 | $return=''; 58 | for ($i=0;$i<$len;++$i) { 59 | if (!isset($urandom)) { 60 | if ($i%2==0) mt_srand(time()%2147 * 1000000 + (double)microtime() * 1000000); 61 | $rand=48+mt_rand()%64; 62 | } else $rand=48+ord($urandom[$i])%64; 63 | 64 | if ($rand>57) 65 | $rand+=7; 66 | if ($rand>90) 67 | $rand+=6; 68 | 69 | if ($rand==123) $rand=52; 70 | if ($rand==124) $rand=53; 71 | $return.=chr($rand); 72 | } 73 | return $return; 74 | } 75 | } 76 | ?> -------------------------------------------------------------------------------- /includes/dbconnector.class.php: -------------------------------------------------------------------------------- 1 | settings=parent::getSetting(); 10 | $host=$this->settings['dbhost']; 11 | $user=$this->settings['dbusername']; 12 | $pass=$this->settings['dbpassword']; 13 | $db=$this->settings['dbname']; 14 | $this->mysqli=new MySQLi($host,$user,$pass,$db); 15 | if($this->mysqli->connect_errno) 16 | die('Unable to connect to database [' . $this->mysqli->connect_error . ']'); 17 | $this->mysqli->set_charset('utf8'); 18 | } 19 | 20 | function query($query){ 21 | $this->result=$this->mysqli->query($query); 22 | return ($this->result) or die( 'There was an error running the query [' . $this->mysqli->error . ']' ); 23 | } 24 | 25 | function queryres($query){ 26 | $this->result=$this->mysqli->query($query); 27 | if($this->result->num_rows){ 28 | $this->res=$this->result->fetch_assoc(); 29 | return ($this->result) or die( 'There was an error running the query [' . $this->mysqli->error . ']' ); 30 | }else 31 | return false; 32 | 33 | } 34 | 35 | function queryid($query){ 36 | $this->query($query); 37 | return $this->mysqli->insert_id; 38 | } 39 | 40 | function qrownum($query){ 41 | $this->result=$this->mysqli->query($query); 42 | return $this->result->num_rows; 43 | } 44 | 45 | function rownum(){return $this->result->num_rows;} 46 | function fetchArray(){return $this->result->fetch_assoc();} 47 | function affected(){return mysql_affected_rows($this->link);} 48 | 49 | 50 | 51 | } 52 | ?> -------------------------------------------------------------------------------- /includes/function.php: -------------------------------------------------------------------------------- 1 | $multiplier) 12 | $full_reward_list = array_merge($full_reward_list, array_fill(0, $multiplier, $reward)); 13 | 14 | foreach ($rewardList as $reward => $multiplier) { 15 | if ( round($totalMultiplier / $multiplier) > 10000) 16 | $percentage = '<0.01%'; 17 | else 18 | $percentage = rtrim(rtrim(number_format($multiplier / $totalMultiplier * 100, 2), '0'), '.') . '%'; 19 | $result[$reward] =$percentage; 20 | } 21 | return $result; 22 | } 23 | 24 | function chance_creator($entrance){ 25 | $rewards = explode(',', $entrance); 26 | $full_reward_list = array(); 27 | foreach ($rewards as $reward) { 28 | list($reward, $multiplier) = explode('*', $reward); 29 | if (!$reward) continue; 30 | $rewardList[$reward] += $multiplier; 31 | $totalMultiplier += $multiplier; 32 | } 33 | foreach ($rewardList as $reward => $multiplier) 34 | $full_reward_list = array_merge($full_reward_list, array_fill(0, $multiplier, $reward)); 35 | $result = $full_reward_list[mt_rand(0, count($full_reward_list) - 1)]; 36 | return $result; 37 | } 38 | 39 | function get_ip(){ 40 | if ($GLOBALS['settings']['behind_proxy']) { 41 | if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR']) { 42 | $ipList = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); 43 | $_SERVER['HTTP_X_FORWARDED_FOR'] = array_pop($ipList); 44 | } else { 45 | $_SERVER['HTTP_X_FORWARDED_FOR'] = false; 46 | } 47 | 48 | if (filter_var($_SERVER['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { 49 | return $_SERVER['HTTP_X_FORWARDED_FOR']; 50 | } else { 51 | return $_SERVER['REMOTE_ADDR']; 52 | } 53 | } 54 | 55 | return $_SERVER['REMOTE_ADDR']; 56 | } 57 | 58 | 59 | ?> -------------------------------------------------------------------------------- /includes/smarty/plugins/block.textformat.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: textformat
13 | * Purpose: format text a certain way with preset styles 14 | * or custom wrap/indent settings
15 | * Params: 16 | *
 17 |  * - style         - string (email)
 18 |  * - indent        - integer (0)
 19 |  * - wrap          - integer (80)
 20 |  * - wrap_char     - string ("\n")
 21 |  * - indent_char   - string (" ")
 22 |  * - wrap_boundary - boolean (true)
 23 |  * 
24 | * 25 | * @link http://www.smarty.net/manual/en/language.function.textformat.php {textformat} 26 | * (Smarty online manual) 27 | * 28 | * @param array $params parameters 29 | * @param string $content contents of the block 30 | * @param Smarty_Internal_Template $template template object 31 | * @param boolean &$repeat repeat flag 32 | * 33 | * @return string content re-formatted 34 | * @author Monte Ohrt 35 | */ 36 | function smarty_block_textformat($params, $content, $template, &$repeat) 37 | { 38 | if (is_null($content)) { 39 | return; 40 | } 41 | 42 | $style = null; 43 | $indent = 0; 44 | $indent_first = 0; 45 | $indent_char = ' '; 46 | $wrap = 80; 47 | $wrap_char = "\n"; 48 | $wrap_cut = false; 49 | $assign = null; 50 | 51 | foreach ($params as $_key => $_val) { 52 | switch ($_key) { 53 | case 'style': 54 | case 'indent_char': 55 | case 'wrap_char': 56 | case 'assign': 57 | $$_key = (string) $_val; 58 | break; 59 | 60 | case 'indent': 61 | case 'indent_first': 62 | case 'wrap': 63 | $$_key = (int) $_val; 64 | break; 65 | 66 | case 'wrap_cut': 67 | $$_key = (bool) $_val; 68 | break; 69 | 70 | default: 71 | trigger_error("textformat: unknown attribute '$_key'"); 72 | } 73 | } 74 | 75 | if ($style == 'email') { 76 | $wrap = 72; 77 | } 78 | // split into paragraphs 79 | $_paragraphs = preg_split('![\r\n]{2}!', $content); 80 | 81 | foreach ($_paragraphs as &$_paragraph) { 82 | if (!$_paragraph) { 83 | continue; 84 | } 85 | // convert mult. spaces & special chars to single space 86 | $_paragraph = preg_replace(array('!\s+!' . Smarty::$_UTF8_MODIFIER, '!(^\s+)|(\s+$)!' . Smarty::$_UTF8_MODIFIER), array(' ', ''), $_paragraph); 87 | // indent first line 88 | if ($indent_first > 0) { 89 | $_paragraph = str_repeat($indent_char, $indent_first) . $_paragraph; 90 | } 91 | // wordwrap sentences 92 | if (Smarty::$_MBSTRING) { 93 | require_once(SMARTY_PLUGINS_DIR . 'shared.mb_wordwrap.php'); 94 | $_paragraph = smarty_mb_wordwrap($_paragraph, $wrap - $indent, $wrap_char, $wrap_cut); 95 | } else { 96 | $_paragraph = wordwrap($_paragraph, $wrap - $indent, $wrap_char, $wrap_cut); 97 | } 98 | // indent lines 99 | if ($indent > 0) { 100 | $_paragraph = preg_replace('!^!m', str_repeat($indent_char, $indent), $_paragraph); 101 | } 102 | } 103 | $_output = implode($wrap_char . $wrap_char, $_paragraphs); 104 | 105 | if ($assign) { 106 | $template->assign($assign, $_output); 107 | } else { 108 | return $_output; 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /includes/smarty/plugins/function.counter.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: counter
13 | * Purpose: print out a counter value 14 | * 15 | * @author Monte Ohrt 16 | * @link http://www.smarty.net/manual/en/language.function.counter.php {counter} 17 | * (Smarty online manual) 18 | * 19 | * @param array $params parameters 20 | * @param Smarty_Internal_Template $template template object 21 | * 22 | * @return string|null 23 | */ 24 | function smarty_function_counter($params, $template) 25 | { 26 | static $counters = array(); 27 | 28 | $name = (isset($params['name'])) ? $params['name'] : 'default'; 29 | if (!isset($counters[$name])) { 30 | $counters[$name] = array( 31 | 'start' => 1, 32 | 'skip' => 1, 33 | 'direction' => 'up', 34 | 'count' => 1 35 | ); 36 | } 37 | $counter =& $counters[$name]; 38 | 39 | if (isset($params['start'])) { 40 | $counter['start'] = $counter['count'] = (int) $params['start']; 41 | } 42 | 43 | if (!empty($params['assign'])) { 44 | $counter['assign'] = $params['assign']; 45 | } 46 | 47 | if (isset($counter['assign'])) { 48 | $template->assign($counter['assign'], $counter['count']); 49 | } 50 | 51 | if (isset($params['print'])) { 52 | $print = (bool) $params['print']; 53 | } else { 54 | $print = empty($counter['assign']); 55 | } 56 | 57 | if ($print) { 58 | $retval = $counter['count']; 59 | } else { 60 | $retval = null; 61 | } 62 | 63 | if (isset($params['skip'])) { 64 | $counter['skip'] = $params['skip']; 65 | } 66 | 67 | if (isset($params['direction'])) { 68 | $counter['direction'] = $params['direction']; 69 | } 70 | 71 | if ($counter['direction'] == "down") { 72 | $counter['count'] -= $counter['skip']; 73 | } else { 74 | $counter['count'] += $counter['skip']; 75 | } 76 | 77 | return $retval; 78 | } 79 | -------------------------------------------------------------------------------- /includes/smarty/plugins/function.cycle.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: cycle
13 | * Date: May 3, 2002
14 | * Purpose: cycle through given values
15 | * Params: 16 | *
 17 |  * - name      - name of cycle (optional)
 18 |  * - values    - comma separated list of values to cycle, or an array of values to cycle
 19 |  *               (this can be left out for subsequent calls)
 20 |  * - reset     - boolean - resets given var to true
 21 |  * - print     - boolean - print var or not. default is true
 22 |  * - advance   - boolean - whether or not to advance the cycle
 23 |  * - delimiter - the value delimiter, default is ","
 24 |  * - assign    - boolean, assigns to template var instead of printed.
 25 |  * 
26 | * Examples:
27 | *
 28 |  * {cycle values="#eeeeee,#d0d0d0d"}
 29 |  * {cycle name=row values="one,two,three" reset=true}
 30 |  * {cycle name=row}
 31 |  * 
32 | * 33 | * @link http://www.smarty.net/manual/en/language.function.cycle.php {cycle} 34 | * (Smarty online manual) 35 | * @author Monte Ohrt 36 | * @author credit to Mark Priatel 37 | * @author credit to Gerard 38 | * @author credit to Jason Sweat 39 | * @version 1.3 40 | * 41 | * @param array $params parameters 42 | * @param Smarty_Internal_Template $template template object 43 | * 44 | * @return string|null 45 | */ 46 | 47 | function smarty_function_cycle($params, $template) 48 | { 49 | static $cycle_vars; 50 | 51 | $name = (empty($params['name'])) ? 'default' : $params['name']; 52 | $print = (isset($params['print'])) ? (bool) $params['print'] : true; 53 | $advance = (isset($params['advance'])) ? (bool) $params['advance'] : true; 54 | $reset = (isset($params['reset'])) ? (bool) $params['reset'] : false; 55 | 56 | if (!isset($params['values'])) { 57 | if (!isset($cycle_vars[$name]['values'])) { 58 | trigger_error("cycle: missing 'values' parameter"); 59 | 60 | return; 61 | } 62 | } else { 63 | if (isset($cycle_vars[$name]['values']) 64 | && $cycle_vars[$name]['values'] != $params['values'] 65 | ) { 66 | $cycle_vars[$name]['index'] = 0; 67 | } 68 | $cycle_vars[$name]['values'] = $params['values']; 69 | } 70 | 71 | if (isset($params['delimiter'])) { 72 | $cycle_vars[$name]['delimiter'] = $params['delimiter']; 73 | } elseif (!isset($cycle_vars[$name]['delimiter'])) { 74 | $cycle_vars[$name]['delimiter'] = ','; 75 | } 76 | 77 | if (is_array($cycle_vars[$name]['values'])) { 78 | $cycle_array = $cycle_vars[$name]['values']; 79 | } else { 80 | $cycle_array = explode($cycle_vars[$name]['delimiter'], $cycle_vars[$name]['values']); 81 | } 82 | 83 | if (!isset($cycle_vars[$name]['index']) || $reset) { 84 | $cycle_vars[$name]['index'] = 0; 85 | } 86 | 87 | if (isset($params['assign'])) { 88 | $print = false; 89 | $template->assign($params['assign'], $cycle_array[$cycle_vars[$name]['index']]); 90 | } 91 | 92 | if ($print) { 93 | $retval = $cycle_array[$cycle_vars[$name]['index']]; 94 | } else { 95 | $retval = null; 96 | } 97 | 98 | if ($advance) { 99 | if ($cycle_vars[$name]['index'] >= count($cycle_array) - 1) { 100 | $cycle_vars[$name]['index'] = 0; 101 | } else { 102 | $cycle_vars[$name]['index'] ++; 103 | } 104 | } 105 | 106 | return $retval; 107 | } 108 | -------------------------------------------------------------------------------- /includes/smarty/plugins/function.math.php: -------------------------------------------------------------------------------- 1 | 13 | * Name: math
14 | * Purpose: handle math computations in template 15 | * 16 | * @link http://www.smarty.net/manual/en/language.function.math.php {math} 17 | * (Smarty online manual) 18 | * @author Monte Ohrt 19 | * 20 | * @param array $params parameters 21 | * @param Smarty_Internal_Template $template template object 22 | * 23 | * @return string|null 24 | */ 25 | function smarty_function_math($params, $template) 26 | { 27 | static $_allowed_funcs = array( 28 | 'int' => true, 'abs' => true, 'ceil' => true, 'cos' => true, 'exp' => true, 'floor' => true, 29 | 'log' => true, 'log10' => true, 'max' => true, 'min' => true, 'pi' => true, 'pow' => true, 30 | 'rand' => true, 'round' => true, 'sin' => true, 'sqrt' => true, 'srand' => true, 'tan' => true 31 | ); 32 | // be sure equation parameter is present 33 | if (empty($params['equation'])) { 34 | trigger_error("math: missing equation parameter", E_USER_WARNING); 35 | 36 | return; 37 | } 38 | 39 | $equation = $params['equation']; 40 | 41 | // make sure parenthesis are balanced 42 | if (substr_count($equation, "(") != substr_count($equation, ")")) { 43 | trigger_error("math: unbalanced parenthesis", E_USER_WARNING); 44 | 45 | return; 46 | } 47 | 48 | // match all vars in equation, make sure all are passed 49 | preg_match_all("!(?:0x[a-fA-F0-9]+)|([a-zA-Z][a-zA-Z0-9_]*)!", $equation, $match); 50 | 51 | foreach ($match[1] as $curr_var) { 52 | if ($curr_var && !isset($params[$curr_var]) && !isset($_allowed_funcs[$curr_var])) { 53 | trigger_error("math: function call $curr_var not allowed", E_USER_WARNING); 54 | 55 | return; 56 | } 57 | } 58 | 59 | foreach ($params as $key => $val) { 60 | if ($key != "equation" && $key != "format" && $key != "assign") { 61 | // make sure value is not empty 62 | if (strlen($val) == 0) { 63 | trigger_error("math: parameter $key is empty", E_USER_WARNING); 64 | 65 | return; 66 | } 67 | if (!is_numeric($val)) { 68 | trigger_error("math: parameter $key: is not numeric", E_USER_WARNING); 69 | 70 | return; 71 | } 72 | $equation = preg_replace("/\b$key\b/", " \$params['$key'] ", $equation); 73 | } 74 | } 75 | $smarty_math_result = null; 76 | eval("\$smarty_math_result = " . $equation . ";"); 77 | 78 | if (empty($params['format'])) { 79 | if (empty($params['assign'])) { 80 | return $smarty_math_result; 81 | } else { 82 | $template->assign($params['assign'], $smarty_math_result); 83 | } 84 | } else { 85 | if (empty($params['assign'])) { 86 | printf($params['format'], $smarty_math_result); 87 | } else { 88 | $template->assign($params['assign'], sprintf($params['format'], $smarty_math_result)); 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /includes/smarty/plugins/modifier.capitalize.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: capitalize
13 | * Purpose: capitalize words in the string 14 | * {@internal {$string|capitalize:true:true} is the fastest option for MBString enabled systems }} 15 | * 16 | * @param string $string string to capitalize 17 | * @param boolean $uc_digits also capitalize "x123" to "X123" 18 | * @param boolean $lc_rest capitalize first letters, lowercase all following letters "aAa" to "Aaa" 19 | * 20 | * @return string capitalized string 21 | * @author Monte Ohrt 22 | * @author Rodney Rehm 23 | */ 24 | function smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = false) 25 | { 26 | if (Smarty::$_MBSTRING) { 27 | if ($lc_rest) { 28 | // uppercase (including hyphenated words) 29 | $upper_string = mb_convert_case($string, MB_CASE_TITLE, Smarty::$_CHARSET); 30 | } else { 31 | // uppercase word breaks 32 | $upper_string = preg_replace_callback("!(^|[^\p{L}'])([\p{Ll}])!S" . Smarty::$_UTF8_MODIFIER, 'smarty_mod_cap_mbconvert_cb', $string); 33 | } 34 | // check uc_digits case 35 | if (!$uc_digits) { 36 | if (preg_match_all("!\b([\p{L}]*[\p{N}]+[\p{L}]*)\b!" . Smarty::$_UTF8_MODIFIER, $string, $matches, PREG_OFFSET_CAPTURE)) { 37 | foreach ($matches[1] as $match) { 38 | $upper_string = substr_replace($upper_string, mb_strtolower($match[0], Smarty::$_CHARSET), $match[1], strlen($match[0])); 39 | } 40 | } 41 | } 42 | $upper_string = preg_replace_callback("!((^|\s)['\"])(\w)!" . Smarty::$_UTF8_MODIFIER, 'smarty_mod_cap_mbconvert2_cb', $upper_string); 43 | return $upper_string; 44 | } 45 | 46 | // lowercase first 47 | if ($lc_rest) { 48 | $string = strtolower($string); 49 | } 50 | // uppercase (including hyphenated words) 51 | $upper_string = preg_replace_callback("!(^|[^\p{L}'])([\p{Ll}])!S" . Smarty::$_UTF8_MODIFIER, 'smarty_mod_cap_ucfirst_cb', $string); 52 | // check uc_digits case 53 | if (!$uc_digits) { 54 | if (preg_match_all("!\b([\p{L}]*[\p{N}]+[\p{L}]*)\b!" . Smarty::$_UTF8_MODIFIER, $string, $matches, PREG_OFFSET_CAPTURE)) { 55 | foreach ($matches[1] as $match) { 56 | $upper_string = substr_replace($upper_string, strtolower($match[0]), $match[1], strlen($match[0])); 57 | } 58 | } 59 | } 60 | $upper_string = preg_replace_callback("!((^|\s)['\"])(\w)!" . Smarty::$_UTF8_MODIFIER, 'smarty_mod_cap_ucfirst2_cb', $upper_string); 61 | return $upper_string; 62 | } 63 | 64 | /* 65 | * 66 | * Bug: create_function() use exhausts memory when used in long loops 67 | * Fix: use declared functions for callbacks instead of using create_function() 68 | * Note: This can be fixed using anonymous functions instead, but that requires PHP >= 5.3 69 | * 70 | * @author Kyle Renfrow 71 | */ 72 | function smarty_mod_cap_mbconvert_cb($matches) 73 | { 74 | return stripslashes($matches[1]) . mb_convert_case(stripslashes($matches[2]), MB_CASE_UPPER, Smarty::$_CHARSET); 75 | } 76 | 77 | function smarty_mod_cap_mbconvert2_cb($matches) 78 | { 79 | return stripslashes($matches[1]) . mb_convert_case(stripslashes($matches[3]), MB_CASE_UPPER, Smarty::$_CHARSET); 80 | } 81 | 82 | function smarty_mod_cap_ucfirst_cb($matches) 83 | { 84 | return stripslashes($matches[1]) . ucfirst(stripslashes($matches[2])); 85 | } 86 | 87 | function smarty_mod_cap_ucfirst2_cb($matches) 88 | { 89 | return stripslashes($matches[1]) . ucfirst(stripslashes($matches[3])); 90 | } 91 | -------------------------------------------------------------------------------- /includes/smarty/plugins/modifier.date_format.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: date_format
13 | * Purpose: format datestamps via strftime
14 | * Input:
15 | * - string: input date string 16 | * - format: strftime format for output 17 | * - default_date: default date if $string is empty 18 | * 19 | * @link http://www.smarty.net/manual/en/language.modifier.date.format.php date_format (Smarty online manual) 20 | * @author Monte Ohrt 21 | * 22 | * @param string $string input date string 23 | * @param string $format strftime format for output 24 | * @param string $default_date default date if $string is empty 25 | * @param string $formatter either 'strftime' or 'auto' 26 | * 27 | * @return string |void 28 | * @uses smarty_make_timestamp() 29 | */ 30 | function smarty_modifier_date_format($string, $format = null, $default_date = '', $formatter = 'auto') 31 | { 32 | if ($format === null) { 33 | $format = Smarty::$_DATE_FORMAT; 34 | } 35 | /** 36 | * Include the {@link shared.make_timestamp.php} plugin 37 | */ 38 | require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php'); 39 | if ($string != '' && $string != '0000-00-00' && $string != '0000-00-00 00:00:00') { 40 | $timestamp = smarty_make_timestamp($string); 41 | } elseif ($default_date != '') { 42 | $timestamp = smarty_make_timestamp($default_date); 43 | } else { 44 | return; 45 | } 46 | if ($formatter == 'strftime' || ($formatter == 'auto' && strpos($format, '%') !== false)) { 47 | if (DS == '\\') { 48 | $_win_from = array('%D', '%h', '%n', '%r', '%R', '%t', '%T'); 49 | $_win_to = array('%m/%d/%y', '%b', "\n", '%I:%M:%S %p', '%H:%M', "\t", '%H:%M:%S'); 50 | if (strpos($format, '%e') !== false) { 51 | $_win_from[] = '%e'; 52 | $_win_to[] = sprintf('%\' 2d', date('j', $timestamp)); 53 | } 54 | if (strpos($format, '%l') !== false) { 55 | $_win_from[] = '%l'; 56 | $_win_to[] = sprintf('%\' 2d', date('h', $timestamp)); 57 | } 58 | $format = str_replace($_win_from, $_win_to, $format); 59 | } 60 | 61 | return strftime($format, $timestamp); 62 | } else { 63 | return date($format, $timestamp); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /includes/smarty/plugins/modifier.debug_print_var.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: debug_print_var
13 | * Purpose: formats variable contents for display in the console 14 | * 15 | * @author Monte Ohrt 16 | * 17 | * @param array|object $var variable to be formatted 18 | * @param integer $depth maximum recursion depth if $var is an array 19 | * @param integer $length maximum string length if $var is a string 20 | * 21 | * @return string 22 | */ 23 | function smarty_modifier_debug_print_var($var, $depth = 0, $length = 40) 24 | { 25 | $_replace = array("\n" => '\n', 26 | "\r" => '\r', 27 | "\t" => '\t' 28 | ); 29 | 30 | switch (gettype($var)) { 31 | case 'array' : 32 | $results = 'Array (' . count($var) . ')'; 33 | foreach ($var as $curr_key => $curr_val) { 34 | $results .= '
' . str_repeat(' ', $depth * 2) 35 | . '' . strtr($curr_key, $_replace) . ' => ' 36 | . smarty_modifier_debug_print_var($curr_val, ++$depth, $length); 37 | $depth --; 38 | } 39 | break; 40 | 41 | case 'object' : 42 | $object_vars = get_object_vars($var); 43 | $results = '' . get_class($var) . ' Object (' . count($object_vars) . ')'; 44 | foreach ($object_vars as $curr_key => $curr_val) { 45 | $results .= '
' . str_repeat(' ', $depth * 2) 46 | . ' ->' . strtr($curr_key, $_replace) . ' = ' 47 | . smarty_modifier_debug_print_var($curr_val, ++$depth, $length); 48 | $depth --; 49 | } 50 | break; 51 | 52 | case 'boolean' : 53 | case 'NULL' : 54 | case 'resource' : 55 | if (true === $var) { 56 | $results = 'true'; 57 | } elseif (false === $var) { 58 | $results = 'false'; 59 | } elseif (null === $var) { 60 | $results = 'null'; 61 | } else { 62 | $results = htmlspecialchars((string) $var); 63 | } 64 | $results = '' . $results . ''; 65 | break; 66 | 67 | case 'integer' : 68 | case 'float' : 69 | $results = htmlspecialchars((string) $var); 70 | break; 71 | 72 | case 'string' : 73 | $results = strtr($var, $_replace); 74 | if (Smarty::$_MBSTRING) { 75 | if (mb_strlen($var, Smarty::$_CHARSET) > $length) { 76 | $results = mb_substr($var, 0, $length - 3, Smarty::$_CHARSET) . '...'; 77 | } 78 | } else { 79 | if (isset($var[$length])) { 80 | $results = substr($var, 0, $length - 3) . '...'; 81 | } 82 | } 83 | 84 | $results = htmlspecialchars('"' . $results . '"'); 85 | break; 86 | 87 | case 'unknown type' : 88 | default : 89 | $results = strtr((string) $var, $_replace); 90 | if (Smarty::$_MBSTRING) { 91 | if (mb_strlen($results, Smarty::$_CHARSET) > $length) { 92 | $results = mb_substr($results, 0, $length - 3, Smarty::$_CHARSET) . '...'; 93 | } 94 | } else { 95 | if (strlen($results) > $length) { 96 | $results = substr($results, 0, $length - 3) . '...'; 97 | } 98 | } 99 | 100 | $results = htmlspecialchars($results); 101 | } 102 | 103 | return $results; 104 | } 105 | -------------------------------------------------------------------------------- /includes/smarty/plugins/modifier.regex_replace.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: regex_replace
13 | * Purpose: regular expression search/replace 14 | * 15 | * @link http://smarty.php.net/manual/en/language.modifier.regex.replace.php 16 | * regex_replace (Smarty online manual) 17 | * @author Monte Ohrt 18 | * 19 | * @param string $string input string 20 | * @param string|array $search regular expression(s) to search for 21 | * @param string|array $replace string(s) that should be replaced 22 | * 23 | * @return string 24 | */ 25 | function smarty_modifier_regex_replace($string, $search, $replace) 26 | { 27 | if (is_array($search)) { 28 | foreach ($search as $idx => $s) { 29 | $search[$idx] = _smarty_regex_replace_check($s); 30 | } 31 | } else { 32 | $search = _smarty_regex_replace_check($search); 33 | } 34 | 35 | return preg_replace($search, $replace, $string); 36 | } 37 | 38 | /** 39 | * @param string $search string(s) that should be replaced 40 | * 41 | * @return string 42 | * @ignore 43 | */ 44 | function _smarty_regex_replace_check($search) 45 | { 46 | // null-byte injection detection 47 | // anything behind the first null-byte is ignored 48 | if (($pos = strpos($search, "\0")) !== false) { 49 | $search = substr($search, 0, $pos); 50 | } 51 | // remove eval-modifier from $search 52 | if (preg_match('!([a-zA-Z\s]+)$!s', $search, $match) && (strpos($match[1], 'e') !== false)) { 53 | $search = substr($search, 0, - strlen($match[1])) . preg_replace('![e\s]+!', '', $match[1]); 54 | } 55 | 56 | return $search; 57 | } 58 | -------------------------------------------------------------------------------- /includes/smarty/plugins/modifier.replace.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: replace
13 | * Purpose: simple search/replace 14 | * 15 | * @link http://smarty.php.net/manual/en/language.modifier.replace.php replace (Smarty online manual) 16 | * @author Monte Ohrt 17 | * @author Uwe Tews 18 | * 19 | * @param string $string input string 20 | * @param string $search text to search for 21 | * @param string $replace replacement text 22 | * 23 | * @return string 24 | */ 25 | function smarty_modifier_replace($string, $search, $replace) 26 | { 27 | if (Smarty::$_MBSTRING) { 28 | require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php'); 29 | 30 | return smarty_mb_str_replace($search, $replace, $string); 31 | } 32 | 33 | return str_replace($search, $replace, $string); 34 | } 35 | -------------------------------------------------------------------------------- /includes/smarty/plugins/modifier.spacify.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: spacify
13 | * Purpose: add spaces between characters in a string 14 | * 15 | * @link http://smarty.php.net/manual/en/language.modifier.spacify.php spacify (Smarty online manual) 16 | * @author Monte Ohrt 17 | * 18 | * @param string $string input string 19 | * @param string $spacify_char string to insert between characters. 20 | * 21 | * @return string 22 | */ 23 | function smarty_modifier_spacify($string, $spacify_char = ' ') 24 | { 25 | // well… what about charsets besides latin and UTF-8? 26 | return implode($spacify_char, preg_split('//' . Smarty::$_UTF8_MODIFIER, $string, - 1, PREG_SPLIT_NO_EMPTY)); 27 | } 28 | -------------------------------------------------------------------------------- /includes/smarty/plugins/modifier.truncate.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: truncate
13 | * Purpose: Truncate a string to a certain length if necessary, 14 | * optionally splitting in the middle of a word, and 15 | * appending the $etc string or inserting $etc into the middle. 16 | * 17 | * @link http://smarty.php.net/manual/en/language.modifier.truncate.php truncate (Smarty online manual) 18 | * @author Monte Ohrt 19 | * 20 | * @param string $string input string 21 | * @param integer $length length of truncated text 22 | * @param string $etc end string 23 | * @param boolean $break_words truncate at word boundary 24 | * @param boolean $middle truncate in the middle of text 25 | * 26 | * @return string truncated string 27 | */ 28 | function smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_words = false, $middle = false) 29 | { 30 | if ($length == 0) { 31 | return ''; 32 | } 33 | 34 | if (Smarty::$_MBSTRING) { 35 | if (mb_strlen($string, Smarty::$_CHARSET) > $length) { 36 | $length -= min($length, mb_strlen($etc, Smarty::$_CHARSET)); 37 | if (!$break_words && !$middle) { 38 | $string = preg_replace('/\s+?(\S+)?$/' . Smarty::$_UTF8_MODIFIER, '', mb_substr($string, 0, $length + 1, Smarty::$_CHARSET)); 39 | } 40 | if (!$middle) { 41 | return mb_substr($string, 0, $length, Smarty::$_CHARSET) . $etc; 42 | } 43 | 44 | return mb_substr($string, 0, $length / 2, Smarty::$_CHARSET) . $etc . mb_substr($string, - $length / 2, $length, Smarty::$_CHARSET); 45 | } 46 | 47 | return $string; 48 | } 49 | 50 | // no MBString fallback 51 | if (isset($string[$length])) { 52 | $length -= min($length, strlen($etc)); 53 | if (!$break_words && !$middle) { 54 | $string = preg_replace('/\s+?(\S+)?$/', '', substr($string, 0, $length + 1)); 55 | } 56 | if (!$middle) { 57 | return substr($string, 0, $length) . $etc; 58 | } 59 | 60 | return substr($string, 0, $length / 2) . $etc . substr($string, - $length / 2); 61 | } 62 | 63 | return $string; 64 | } 65 | -------------------------------------------------------------------------------- /includes/smarty/plugins/modifiercompiler.cat.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: cat
13 | * Date: Feb 24, 2003
14 | * Purpose: catenate a value to a variable
15 | * Input: string to catenate
16 | * Example: {$var|cat:"foo"} 17 | * 18 | * @link http://smarty.php.net/manual/en/language.modifier.cat.php cat 19 | * (Smarty online manual) 20 | * @author Uwe Tews 21 | * 22 | * @param array $params parameters 23 | * 24 | * @return string with compiled code 25 | */ 26 | function smarty_modifiercompiler_cat($params) 27 | { 28 | return '(' . implode(').(', $params) . ')'; 29 | } 30 | -------------------------------------------------------------------------------- /includes/smarty/plugins/modifiercompiler.count_characters.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: count_characteres
13 | * Purpose: count the number of characters in a text 14 | * 15 | * @link http://www.smarty.net/manual/en/language.modifier.count.characters.php count_characters (Smarty online manual) 16 | * @author Uwe Tews 17 | * 18 | * @param array $params parameters 19 | * 20 | * @return string with compiled code 21 | */ 22 | function smarty_modifiercompiler_count_characters($params) 23 | { 24 | if (!isset($params[1]) || $params[1] != 'true') { 25 | return 'preg_match_all(\'/[^\s]/' . Smarty::$_UTF8_MODIFIER . '\',' . $params[0] . ', $tmp)'; 26 | } 27 | if (Smarty::$_MBSTRING) { 28 | return 'mb_strlen(' . $params[0] . ', \'' . addslashes(Smarty::$_CHARSET) . '\')'; 29 | } 30 | // no MBString fallback 31 | return 'strlen(' . $params[0] . ')'; 32 | } 33 | -------------------------------------------------------------------------------- /includes/smarty/plugins/modifiercompiler.count_paragraphs.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: count_paragraphs
13 | * Purpose: count the number of paragraphs in a text 14 | * 15 | * @link http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php 16 | * count_paragraphs (Smarty online manual) 17 | * @author Uwe Tews 18 | * 19 | * @param array $params parameters 20 | * 21 | * @return string with compiled code 22 | */ 23 | function smarty_modifiercompiler_count_paragraphs($params) 24 | { 25 | // count \r or \n characters 26 | return '(preg_match_all(\'#[\r\n]+#\', ' . $params[0] . ', $tmp)+1)'; 27 | } 28 | -------------------------------------------------------------------------------- /includes/smarty/plugins/modifiercompiler.count_sentences.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: count_sentences 13 | * Purpose: count the number of sentences in a text 14 | * 15 | * @link http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php 16 | * count_sentences (Smarty online manual) 17 | * @author Uwe Tews 18 | * 19 | * @param array $params parameters 20 | * 21 | * @return string with compiled code 22 | */ 23 | function smarty_modifiercompiler_count_sentences($params) 24 | { 25 | // find periods, question marks, exclamation marks with a word before but not after. 26 | return 'preg_match_all("#\w[\.\?\!](\W|$)#S' . Smarty::$_UTF8_MODIFIER . '", ' . $params[0] . ', $tmp)'; 27 | } 28 | -------------------------------------------------------------------------------- /includes/smarty/plugins/modifiercompiler.count_words.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: count_words
13 | * Purpose: count the number of words in a text 14 | * 15 | * @link http://www.smarty.net/manual/en/language.modifier.count.words.php count_words (Smarty online manual) 16 | * @author Uwe Tews 17 | * 18 | * @param array $params parameters 19 | * 20 | * @return string with compiled code 21 | */ 22 | function smarty_modifiercompiler_count_words($params) 23 | { 24 | if (Smarty::$_MBSTRING) { 25 | // return 'preg_match_all(\'#[\w\pL]+#' . Smarty::$_UTF8_MODIFIER . '\', ' . $params[0] . ', $tmp)'; 26 | // expression taken from http://de.php.net/manual/en/function.str-word-count.php#85592 27 | return 'preg_match_all(\'/\p{L}[\p{L}\p{Mn}\p{Pd}\\\'\x{2019}]*/' . Smarty::$_UTF8_MODIFIER . '\', ' . $params[0] . ', $tmp)'; 28 | } 29 | // no MBString fallback 30 | return 'str_word_count(' . $params[0] . ')'; 31 | } 32 | -------------------------------------------------------------------------------- /includes/smarty/plugins/modifiercompiler.default.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: default
13 | * Purpose: designate default value for empty variables 14 | * 15 | * @link http://www.smarty.net/manual/en/language.modifier.default.php default (Smarty online manual) 16 | * @author Uwe Tews 17 | * 18 | * @param array $params parameters 19 | * 20 | * @return string with compiled code 21 | */ 22 | function smarty_modifiercompiler_default($params) 23 | { 24 | $output = $params[0]; 25 | if (!isset($params[1])) { 26 | $params[1] = "''"; 27 | } 28 | 29 | array_shift($params); 30 | foreach ($params as $param) { 31 | $output = '(($tmp = @' . $output . ')===null||$tmp===\'\' ? ' . $param . ' : $tmp)'; 32 | } 33 | 34 | return $output; 35 | } 36 | -------------------------------------------------------------------------------- /includes/smarty/plugins/modifiercompiler.from_charset.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: from_charset
13 | * Purpose: convert character encoding from $charset to internal encoding 14 | * 15 | * @author Rodney Rehm 16 | * 17 | * @param array $params parameters 18 | * 19 | * @return string with compiled code 20 | */ 21 | function smarty_modifiercompiler_from_charset($params) 22 | { 23 | if (!Smarty::$_MBSTRING) { 24 | // FIXME: (rodneyrehm) shouldn't this throw an error? 25 | return $params[0]; 26 | } 27 | 28 | if (!isset($params[1])) { 29 | $params[1] = '"ISO-8859-1"'; 30 | } 31 | 32 | return 'mb_convert_encoding(' . $params[0] . ', "' . addslashes(Smarty::$_CHARSET) . '", ' . $params[1] . ')'; 33 | } 34 | -------------------------------------------------------------------------------- /includes/smarty/plugins/modifiercompiler.indent.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: indent
13 | * Purpose: indent lines of text 14 | * 15 | * @link http://www.smarty.net/manual/en/language.modifier.indent.php indent (Smarty online manual) 16 | * @author Uwe Tews 17 | * 18 | * @param array $params parameters 19 | * 20 | * @return string with compiled code 21 | */ 22 | 23 | function smarty_modifiercompiler_indent($params) 24 | { 25 | if (!isset($params[1])) { 26 | $params[1] = 4; 27 | } 28 | if (!isset($params[2])) { 29 | $params[2] = "' '"; 30 | } 31 | 32 | return 'preg_replace(\'!^!m\',str_repeat(' . $params[2] . ',' . $params[1] . '),' . $params[0] . ')'; 33 | } 34 | -------------------------------------------------------------------------------- /includes/smarty/plugins/modifiercompiler.lower.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: lower
13 | * Purpose: convert string to lowercase 14 | * 15 | * @link http://www.smarty.net/manual/en/language.modifier.lower.php lower (Smarty online manual) 16 | * @author Monte Ohrt 17 | * @author Uwe Tews 18 | * 19 | * @param array $params parameters 20 | * 21 | * @return string with compiled code 22 | */ 23 | 24 | function smarty_modifiercompiler_lower($params) 25 | { 26 | if (Smarty::$_MBSTRING) { 27 | return 'mb_strtolower(' . $params[0] . ', \'' . addslashes(Smarty::$_CHARSET) . '\')'; 28 | } 29 | // no MBString fallback 30 | return 'strtolower(' . $params[0] . ')'; 31 | } 32 | -------------------------------------------------------------------------------- /includes/smarty/plugins/modifiercompiler.noprint.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: noprint
13 | * Purpose: return an empty string 14 | * 15 | * @author Uwe Tews 16 | * @return string with compiled code 17 | */ 18 | function smarty_modifiercompiler_noprint() 19 | { 20 | return "''"; 21 | } 22 | -------------------------------------------------------------------------------- /includes/smarty/plugins/modifiercompiler.string_format.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: string_format
13 | * Purpose: format strings via sprintf 14 | * 15 | * @link http://www.smarty.net/manual/en/language.modifier.string.format.php string_format (Smarty online manual) 16 | * @author Uwe Tews 17 | * 18 | * @param array $params parameters 19 | * 20 | * @return string with compiled code 21 | */ 22 | function smarty_modifiercompiler_string_format($params) 23 | { 24 | return 'sprintf(' . $params[1] . ',' . $params[0] . ')'; 25 | } 26 | -------------------------------------------------------------------------------- /includes/smarty/plugins/modifiercompiler.strip.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: strip
13 | * Purpose: Replace all repeated spaces, newlines, tabs 14 | * with a single space or supplied replacement string.
15 | * Example: {$var|strip} {$var|strip:" "}
16 | * Date: September 25th, 2002 17 | * 18 | * @link http://www.smarty.net/manual/en/language.modifier.strip.php strip (Smarty online manual) 19 | * @author Uwe Tews 20 | * 21 | * @param array $params parameters 22 | * 23 | * @return string with compiled code 24 | */ 25 | 26 | function smarty_modifiercompiler_strip($params) 27 | { 28 | if (!isset($params[1])) { 29 | $params[1] = "' '"; 30 | } 31 | 32 | return "preg_replace('!\s+!" . Smarty::$_UTF8_MODIFIER . "', {$params[1]},{$params[0]})"; 33 | } 34 | -------------------------------------------------------------------------------- /includes/smarty/plugins/modifiercompiler.strip_tags.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: strip_tags
13 | * Purpose: strip html tags from text 14 | * 15 | * @link http://www.smarty.net/manual/en/language.modifier.strip.tags.php strip_tags (Smarty online manual) 16 | * @author Uwe Tews 17 | * 18 | * @param array $params parameters 19 | * 20 | * @return string with compiled code 21 | */ 22 | function smarty_modifiercompiler_strip_tags($params) 23 | { 24 | if (!isset($params[1]) || $params[1] === true || trim($params[1], '"') == 'true') { 25 | return "preg_replace('!<[^>]*?>!', ' ', {$params[0]})"; 26 | } else { 27 | return 'strip_tags(' . $params[0] . ')'; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /includes/smarty/plugins/modifiercompiler.to_charset.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: to_charset
13 | * Purpose: convert character encoding from internal encoding to $charset 14 | * 15 | * @author Rodney Rehm 16 | * 17 | * @param array $params parameters 18 | * 19 | * @return string with compiled code 20 | */ 21 | function smarty_modifiercompiler_to_charset($params) 22 | { 23 | if (!Smarty::$_MBSTRING) { 24 | // FIXME: (rodneyrehm) shouldn't this throw an error? 25 | return $params[0]; 26 | } 27 | 28 | if (!isset($params[1])) { 29 | $params[1] = '"ISO-8859-1"'; 30 | } 31 | 32 | return 'mb_convert_encoding(' . $params[0] . ', ' . $params[1] . ', "' . addslashes(Smarty::$_CHARSET) . '")'; 33 | } 34 | -------------------------------------------------------------------------------- /includes/smarty/plugins/modifiercompiler.unescape.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: unescape
13 | * Purpose: unescape html entities 14 | * 15 | * @author Rodney Rehm 16 | * 17 | * @param array $params parameters 18 | * 19 | * @return string with compiled code 20 | */ 21 | function smarty_modifiercompiler_unescape($params) 22 | { 23 | if (!isset($params[1])) { 24 | $params[1] = 'html'; 25 | } 26 | if (!isset($params[2])) { 27 | $params[2] = '\'' . addslashes(Smarty::$_CHARSET) . '\''; 28 | } else { 29 | $params[2] = "'" . $params[2] . "'"; 30 | } 31 | 32 | switch (trim($params[1], '"\'')) { 33 | case 'entity': 34 | case 'htmlall': 35 | if (Smarty::$_MBSTRING) { 36 | return 'mb_convert_encoding(' . $params[0] . ', ' . $params[2] . ', \'HTML-ENTITIES\')'; 37 | } 38 | 39 | return 'html_entity_decode(' . $params[0] . ', ENT_NOQUOTES, ' . $params[2] . ')'; 40 | 41 | case 'html': 42 | return 'htmlspecialchars_decode(' . $params[0] . ', ENT_QUOTES)'; 43 | 44 | case 'url': 45 | return 'rawurldecode(' . $params[0] . ')'; 46 | 47 | default: 48 | return $params[0]; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /includes/smarty/plugins/modifiercompiler.upper.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: lower
13 | * Purpose: convert string to uppercase 14 | * 15 | * @link http://smarty.php.net/manual/en/language.modifier.upper.php lower (Smarty online manual) 16 | * @author Uwe Tews 17 | * 18 | * @param array $params parameters 19 | * 20 | * @return string with compiled code 21 | */ 22 | function smarty_modifiercompiler_upper($params) 23 | { 24 | if (Smarty::$_MBSTRING) { 25 | return 'mb_strtoupper(' . $params[0] . ', \'' . addslashes(Smarty::$_CHARSET) . '\')'; 26 | } 27 | // no MBString fallback 28 | return 'strtoupper(' . $params[0] . ')'; 29 | } 30 | -------------------------------------------------------------------------------- /includes/smarty/plugins/modifiercompiler.wordwrap.php: -------------------------------------------------------------------------------- 1 | 12 | * Name: wordwrap
13 | * Purpose: wrap a string of text at a given length 14 | * 15 | * @link http://smarty.php.net/manual/en/language.modifier.wordwrap.php wordwrap (Smarty online manual) 16 | * @author Uwe Tews 17 | * 18 | * @param array $params parameters 19 | * @param $compiler 20 | * 21 | * @return string with compiled code 22 | */ 23 | function smarty_modifiercompiler_wordwrap($params, $compiler) 24 | { 25 | if (!isset($params[1])) { 26 | $params[1] = 80; 27 | } 28 | if (!isset($params[2])) { 29 | $params[2] = '"\n"'; 30 | } 31 | if (!isset($params[3])) { 32 | $params[3] = 'false'; 33 | } 34 | $function = 'wordwrap'; 35 | if (Smarty::$_MBSTRING) { 36 | if ($compiler->template->caching && ($compiler->tag_nocache | $compiler->nocache)) { 37 | $compiler->template->required_plugins['nocache']['wordwrap']['modifier']['file'] = SMARTY_PLUGINS_DIR . 'shared.mb_wordwrap.php'; 38 | $compiler->template->required_plugins['nocache']['wordwrap']['modifier']['function'] = 'smarty_mb_wordwrap'; 39 | } else { 40 | $compiler->template->required_plugins['compiled']['wordwrap']['modifier']['file'] = SMARTY_PLUGINS_DIR . 'shared.mb_wordwrap.php'; 41 | $compiler->template->required_plugins['compiled']['wordwrap']['modifier']['function'] = 'smarty_mb_wordwrap'; 42 | } 43 | $function = 'smarty_mb_wordwrap'; 44 | } 45 | 46 | return $function . '(' . $params[0] . ',' . $params[1] . ',' . $params[2] . ',' . $params[3] . ')'; 47 | } 48 | -------------------------------------------------------------------------------- /includes/smarty/plugins/outputfilter.trimwhitespace.php: -------------------------------------------------------------------------------- 1 | .*?#is', $source, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { 31 | foreach ($matches as $match) { 32 | $store[] = $match[0][0]; 33 | $_length = strlen($match[0][0]); 34 | $replace = '@!@SMARTY:' . $_store . ':SMARTY@!@'; 35 | $source = substr_replace($source, $replace, $match[0][1] - $_offset, $_length); 36 | 37 | $_offset += $_length - strlen($replace); 38 | $_store ++; 39 | } 40 | } 41 | 42 | // Strip all HTML-Comments 43 | // yes, even the ones in
-------------------------------------------------------------------------------- /template/howto.tpl: -------------------------------------------------------------------------------- 1 | {include file='template/header.tpl'} 2 | 3 |
4 |
5 |

How it work?

6 |
7 |

How to Earn fee bitcoin?

8 | 9 |
10 |
11 |

1) Register an account for free

12 |

2) Login to your account and solve the Captcha and Earn fee coin

13 |

3) Send a Withdrawal request to receive balane

14 |

15 |

* If you have asmoney account, your withdrawal will be proceed instantly otherwise you should wait until your balance reach to (minimum amount) .

16 | 17 |
18 |
19 | {include file='template/footer.tpl'} 20 | 21 | -------------------------------------------------------------------------------- /template/index.tpl: -------------------------------------------------------------------------------- 1 | {include file='template/header.tpl'} 2 | 3 | 4 |
5 |
6 |

Earn Free CryptoCurrency

7 |
8 |
9 | 10 | 56 | {include file='template/footer.tpl'} -------------------------------------------------------------------------------- /template/login.tpl: -------------------------------------------------------------------------------- 1 | {include file='template/header.tpl'} 2 |

Login to your account

3 | 4 |
5 |

Login

6 | 7 | 8 | 9 | 10 |
11 | 12 | {if $invalid} 13 |
14 |
15 | 18 |
19 |
20 | {/if} 21 | 22 | 23 | 24 | 25 |
26 |
27 | 28 | 29 |
30 | 31 |
32 | 33 | 34 |
35 | 36 | 37 |
38 | 39 |
40 |
41 |
42 | 43 | 44 | 45 | 46 | {include file='template/footer.tpl'} -------------------------------------------------------------------------------- /template/pass.tpl: -------------------------------------------------------------------------------- 1 | {include file='template/header.tpl'} 2 | 3 |

Change Password.

4 | 5 | 6 |
7 |

Change Passwprd

8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 | {if $wrong}
Entered current password is wrong.
{/if} 19 | 20 | {if $succ}
Password changed.
{/if} 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 |
33 | 34 | 35 |
36 | 37 | 38 |
39 | 40 | 41 |
42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 |
51 | 52 | 53 | 54 | 55 | 56 |
57 | 58 | 59 | 60 |
61 |
62 | 63 | 64 | 65 | 66 |
67 | 68 | {include file='template/footer.tpl'} -------------------------------------------------------------------------------- /template/referral.tpl: -------------------------------------------------------------------------------- 1 | {include file='template/header.tpl'} 2 |

Referral Summary

3 | 4 | 5 |
6 |

Referral

7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | Earn {$rfp}% referral bonus! Share your referral URL:
25 | 26 | http://www.link.com/?r={$uid} 27 | 28 | 29 |
30 | 31 | 32 |
33 | 34 | 35 | You have total referral of : {$count} user(s) 36 | 37 |
38 | 39 | 40 | 41 |
42 | 43 | 44 | 45 |
46 |
47 | 48 | 49 | 50 | 51 |
52 | 53 | {include file='template/footer.tpl'} -------------------------------------------------------------------------------- /template/register.tpl: -------------------------------------------------------------------------------- 1 | {include file='template/header.tpl'} 2 |

Open account

3 | 4 |
5 |

Register

6 | 7 | 8 | 9 | 10 |
11 | 12 | {if $rep} 13 |
14 |
15 | 18 |
19 |
20 | {/if} 21 | 22 | 23 | 24 | 44 |
45 |
46 | 47 | 48 |
49 | 50 | 51 |
52 | 53 | 54 |
55 | 56 | 57 |
58 | 59 | 60 |
61 | 62 | 63 |
64 | 65 | 66 |
67 | 68 | 69 | 70 | 71 | 72 | 73 |
74 | 75 |
76 |
77 | 78 | 79 | 80 | 81 | 82 | {include file='template/footer.tpl'} --------------------------------------------------------------------------------