Changeset 2338473
- Timestamp:
- 07/10/2020 06:04:52 AM (6 years ago)
- Location:
- farazsms-club/trunk
- Files:
-
- 5 edited
-
includes/class-config.php (modified) (8 diffs)
-
includes/class-core.php (modified) (3 diffs)
-
languages/farazsms-club-fa_IR.mo (modified) (previous)
-
languages/farazsms-club-fa_IR.po (modified) (4 diffs)
-
languages/farazsms-club.pot (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
farazsms-club/trunk/includes/class-config.php
r2322025 r2338473 205 205 $uname = self::$_digits_uname; 206 206 $pass = self::$_digits_password; 207 } elseif ( strtolower( $plugin ) == 'woo' ) { 207 } 208 elseif ( strtolower( $plugin ) == 'woo' ) { 208 209 if ( self::isWooSmsInstalled() ) { 209 210 $uname = self::$_woo_uname; … … 213 214 $pass = self::$_options['pass']; 214 215 } 215 } else { 216 return false; 216 } 217 else { 218 $uname = self::options()['uname']; 219 $pass = self::options()['pass']; 217 220 } 218 221 $body = array( … … 249 252 if ( ! $options ) { 250 253 $options = array( 251 "digits" => array(), 252 "woo" => array(), 253 "umame" => array(), 254 "pass" => array(), 254 "digits" => array(), 255 "woo" => array(), 256 "umame" => array(), 257 "pass" => array(), 258 "general_phone_book" => array(), 255 259 ); 256 260 $config = FARAZSMS_CLUB_CONFIG::getInstance(); … … 263 267 } 264 268 add_option( 'farazsms_options', $options ); 269 } elseif ( ! $options['general_phone_book'] ) { 270 $options['general_phone_book'] = array(); 271 update_option( 'farazsms_options', $options ); 265 272 } 266 273 … … 278 285 if ( ! $options ) { 279 286 $options = array( 280 "digits" => array(), 281 "woo" => array(), 282 "umame" => array(), 283 "pass" => array(), 287 "digits" => array(), 288 "woo" => array(), 289 "umame" => array(), 290 "pass" => array(), 291 "general_phone_book" => array(), 284 292 ); 285 293 if ( self::get_woo_sms_configs() !== false ) { … … 293 301 } 294 302 self::$_options = $options; 295 296 303 return $options; 304 } elseif ( ! self::$_options['general_phone_book'] ) { 305 self::$_options['general_phone_book'] = array(); 306 update_option( 'farazsms_options', self::$_options ); 297 307 } 298 308 299 309 return self::$_options; 300 310 } 301 public static function get_credit(){ 302 $options = self::options(); 303 $body = array( 304 "uname"=>$options['uname'], 305 "pass"=>$options['pass'], 306 'op'=>'credit' 311 312 public static function get_credit() { 313 $options = self::options(); 314 $body = array( 315 "uname" => $options['uname'], 316 "pass" => $options['pass'], 317 'op' => 'credit' 307 318 ); 308 319 $response = wp_remote_post( self::url(), array( … … 316 327 ); 317 328 $response = json_decode( $response['body'] ); 318 if($response[0] !== 0) return false; 329 if ( $response[0] !== 0 ) { 330 return false; 331 } 319 332 $credit_rial = explode( ".", $response[1] )[0]; 320 333 321 334 return substr( $credit_rial, 0, - 1 ); 322 335 } 336 323 337 static function createdb() { 324 338 global $wpdb; … … 426 440 return true; 427 441 } 442 public static function save_to_general_phone_book( $phone, $phone_book ) { 443 $uname = self::options()['uname']; 444 $pass = self::options()['pass']; 445 $body = array( 446 'uname' => $uname, 447 'pass' => $pass, 448 'op' => 'phoneBookAdd', 449 'phoneBookId' => $phone_book, 450 'number' => $phone 451 ); 452 453 $response = wp_remote_post( self::url(), array( 454 'method' => 'POST', 455 'headers' => [ 456 'Content-Type' => 'application/json', 457 ], 458 'data_format' => 'body', 459 'body' => json_encode( $body ) 460 ) 461 ); 462 $response = json_decode( $response['body'] ); 463 if ( $response->status->code !== 0 ) { 464 return false; 465 } 466 467 return true; 468 } 428 469 429 470 } -
farazsms-club/trunk/includes/class-core.php
r2322025 r2338473 188 188 <h1><?php _e('Phonebook Configs','farazsms-club') ?></h1> 189 189 <?php 190 $plugins['general_phone_book'] = array( 191 'phoneBookId' => false, 192 'name' => __( 'Genral phones Plugin', 'farazsms-club' ), 193 'phonebookAll'=>$configs::getPhoneBooks( 'general_phone_book' ) 194 195 ); 190 196 if ( $configs::isDigitsInstalled() ) { 191 $plugins['digits'] = array( 192 'phoneBookId' => false, 193 'name' => __( 'Digits Plugin', 'farazsms-club' ), 194 'phonebookAll'=>[] 195 196 ); 197 198 $plugins['digits'] = array( 199 'phoneBookId' => false, 200 'name' => __( 'Digits Plugin', 'farazsms-club' ), 201 'phonebookAll'=>[] 202 203 ); 197 204 198 205 if ( $configs->get_digits_configs() ) { … … 285 292 286 293 function updated_user_meta( $null,$object_id, $meta_key, $meta_value){ 287 if(strtolower($meta_key!=='digits_phone')) {return;} 288 $phone =intval(substr($meta_value,-10)); 294 $mobile_pattern = "/^(\s)*(\+98|0098|98|0)?(9\d{9})(\s*|$)/"; 295 preg_match($mobile_pattern,$meta_value,$matches); 296 if(strtolower($meta_key!=='digits_phone') && sizeof($matches) !== 5) {return;} 297 $phone =intval($matches[3]); 289 298 if ($phone < 9000000000 ){return;} 290 299 $user_id = intval($object_id); 291 300 $user=get_userdata($user_id); 292 301 $config=FARAZSMS_CLUB_CONFIG::getInstance(); 293 $phone_books=$config::options()['digits']; 302 $phone_books=$config::options()['general_phone_book']; 303 if(strtolower($meta_key === 'digits_phone')) $phone_books=$config::options()['digits']; 294 304 foreach ($phone_books as $phone_book){ 295 305 if(FARAZSMS_CLUB_CONFIG::db_find_one($phone,$phone_book)) {continue;} … … 302 312 ); 303 313 if($config::save_to_digits_phone_book($phone,$phone_book)) {$config::db_save($phones);} 314 elseif($config::save_to_general_phone_book($phone,$phone_book)) {$config::db_save($phones);} 315 304 316 } 305 317 } -
farazsms-club/trunk/languages/farazsms-club-fa_IR.po
r2322025 r2338473 1 # Translation of Plugins - FarazSMS-Club - Development (trunk) in Persian 2 # This file is distributed under the same license as the Plugins - FarazSMS-Club - Development (trunk) package. 1 3 msgid "" 2 4 msgstr "" 3 "Project-Id-Version: farazsms-club\n" 4 "Report-Msgid-Bugs-To: \n" 5 "POT-Creation-Date: 2020-06-01 13:45+0000\n" 6 "PO-Revision-Date: 2020-06-01 13:46+0000\n" 7 "Last-Translator: \n" 8 "Language-Team: فارسی\n" 9 "Language: fa_IR\n" 10 "Plural-Forms: nplurals=2; plural=n != 1;\n" 5 "PO-Revision-Date: 2020-07-09 16:25+0000\n" 11 6 "MIME-Version: 1.0\n" 12 7 "Content-Type: text/plain; charset=UTF-8\n" 13 8 "Content-Transfer-Encoding: 8bit\n" 9 "Plural-Forms: nplurals=2; plural=n != 1;\n" 14 10 "X-Generator: Loco https://localise.biz/\n" 15 "X-Loco-Version: 2.4.0; wp-5.4.1" 11 "Language: fa_IR\n" 12 "Project-Id-Version: Plugins - FarazSMS-Club - Development (trunk)\n" 13 "Report-Msgid-Bugs-To: \n" 14 "POT-Creation-Date: 2020-07-09 11:30+0000\n" 15 "Last-Translator: saeb molaee\n" 16 "Language-Team: \n" 17 "X-Loco-Version: 2.4.0; wp-5.4.2\n" 18 "X-Loco-Template: ../../languages/plugins/farazsms-club-fa_IR.po" 16 19 17 #: includes/class-core.php:6 818 #, fuzzy,php-format20 #: includes/class-core.php:60 21 #, php-format 19 22 msgid "" 20 23 "<h2> Special Offer </h2>\n" … … 34 37 " <a href=\"https://farazsms.com/affiliate\" target=\"_blank\" " 35 38 "rel=\"noopener\">اطلاعات بیشتر و شروع کسب درامد\n" 36 " اینترنتی </a>\n"39 " اینترنتی </a>\n" 37 40 38 #: includes/class-core.php:1 8241 #: includes/class-core.php:106 39 42 msgid "FarazSMS Options" 40 43 msgstr "تنظیمات فرازاساماس" 41 44 42 #: includes/class-core.php: 21845 #: includes/class-core.php:142 43 46 msgid "successfully saved" 44 47 msgstr "ذخیره شد" 45 48 46 #: includes/class-core.php: 22949 #: includes/class-core.php:153 47 50 msgid "help" 48 51 msgstr "راهنما" 49 52 50 #: includes/class-core.php: 23553 #: includes/class-core.php:159 51 54 msgid "Phonebook" 52 55 msgstr "دفترتلفن" 53 56 54 #: includes/class-core.php: 24157 #: includes/class-core.php:165 55 58 msgid "Username and password" 56 59 msgstr "نام کاربری و رمز عبور" 57 60 58 #: includes/class-core.php: 24861 #: includes/class-core.php:172 59 62 msgid "" 60 63 "<h1> Guide to Customer Club </h1>\n" … … 88 91 " <br>" 89 92 90 #: includes/class-core.php: 26493 #: includes/class-core.php:188 91 94 msgid "Phonebook Configs" 92 95 msgstr "تنظیمات فعال سازی باشگاه مشتریان" 93 96 94 #: includes/class-core.php:269 97 #: includes/class-core.php:192 98 msgid "Genral phones Plugin" 99 msgstr "دفترتلفن به افزونههای یوزرپنل لیست نشده" 100 101 #: includes/class-core.php:200 95 102 msgid "Digits Plugin" 96 103 msgstr "افزونه دیجیتز" 97 104 98 #: includes/class-core.php:2 81105 #: includes/class-core.php:212 99 106 msgid "WooCommerce" 100 107 msgstr "ووکامرس" 101 108 102 #: includes/class-core.php:2 94109 #: includes/class-core.php:225 103 110 msgid "select phone books for " 104 111 msgstr "انتخاب دفتر تلفن برای " 105 112 106 #: includes/class-core.php: 313 includes/class-core.php:346113 #: includes/class-core.php:244 includes/class-core.php:277 107 114 msgid "save" 108 115 msgstr "ذخیره" 109 116 110 #: includes/class-core.php: 325117 #: includes/class-core.php:256 111 118 msgid "Credit" 112 119 msgstr "اعتبار به تومان:" 113 120 114 #: includes/class-core.php: 333121 #: includes/class-core.php:264 115 122 msgid "It seems user name and password are not working yet are you saved them?" 116 123 msgstr "" … … 118 125 "عبور خود را درست ذخیره کردهاید؟" 119 126 120 #: includes/class-core.php: 339127 #: includes/class-core.php:270 121 128 msgid "User Name" 122 129 msgstr "نامکاربری" 123 130 124 #: includes/class-core.php: 342131 #: includes/class-core.php:273 125 132 msgid "password" 126 133 msgstr "رمزعبور" -
farazsms-club/trunk/languages/farazsms-club.pot
r2322025 r2338473 4 4 "Project-Id-Version: farazsms-club\n" 5 5 "Report-Msgid-Bugs-To: \n" 6 "POT-Creation-Date: 2020-0 6-01 13:45+0000\n"6 "POT-Creation-Date: 2020-07-09 11:30+0000\n" 7 7 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 8 8 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 16 16 "X-Loco-Version: 2.4.0; wp-5.4.1" 17 17 18 #: includes/class-core.php:6 818 #: includes/class-core.php:60 19 19 #, php-format 20 20 msgid "" … … 29 29 msgstr "" 30 30 31 #: includes/class-core.php:1 8231 #: includes/class-core.php:106 32 32 msgid "FarazSMS Options" 33 33 msgstr "" 34 34 35 #: includes/class-core.php: 21835 #: includes/class-core.php:142 36 36 msgid "successfully saved" 37 37 msgstr "" 38 38 39 #: includes/class-core.php: 22939 #: includes/class-core.php:153 40 40 msgid "help" 41 41 msgstr "" 42 42 43 #: includes/class-core.php: 23543 #: includes/class-core.php:159 44 44 msgid "Phonebook" 45 45 msgstr "" 46 46 47 #: includes/class-core.php: 24147 #: includes/class-core.php:165 48 48 msgid "Username and password" 49 49 msgstr "" 50 50 51 #: includes/class-core.php: 24851 #: includes/class-core.php:172 52 52 msgid "" 53 53 "<h1> Guide to Customer Club </h1>\n" … … 67 67 msgstr "" 68 68 69 #: includes/class-core.php: 26469 #: includes/class-core.php:188 70 70 msgid "Phonebook Configs" 71 71 msgstr "" 72 72 73 #: includes/class-core.php:269 73 #: includes/class-core.php:192 74 msgid "Genral phones Plugin" 75 msgstr "" 76 77 #: includes/class-core.php:200 74 78 msgid "Digits Plugin" 75 79 msgstr "" 76 80 77 #: includes/class-core.php:2 8181 #: includes/class-core.php:212 78 82 msgid "WooCommerce" 79 83 msgstr "" 80 84 81 #: includes/class-core.php:2 9485 #: includes/class-core.php:225 82 86 msgid "select phone books for " 83 87 msgstr "" 84 88 85 #: includes/class-core.php: 313 includes/class-core.php:34689 #: includes/class-core.php:244 includes/class-core.php:277 86 90 msgid "save" 87 91 msgstr "" 88 92 89 #: includes/class-core.php: 32593 #: includes/class-core.php:256 90 94 msgid "Credit" 91 95 msgstr "" 92 96 93 #: includes/class-core.php: 33397 #: includes/class-core.php:264 94 98 msgid "It seems user name and password are not working yet are you saved them?" 95 99 msgstr "" 96 100 97 #: includes/class-core.php: 339101 #: includes/class-core.php:270 98 102 msgid "User Name" 99 103 msgstr "" 100 104 101 #: includes/class-core.php: 342105 #: includes/class-core.php:273 102 106 msgid "password" 103 107 msgstr ""
Note: See TracChangeset
for help on using the changeset viewer.