Plugin Directory

Changeset 2845183


Ignore:
Timestamp:
01/08/2023 07:48:06 PM (3 years ago)
Author:
ham3da
Message:
  • Minor changes
Location:
moein-dictionary-free/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • moein-dictionary-free/trunk/assets/style.css

    r2835283 r2845183  
    6969    display: block;
    7070}
     71.mdict-tooltip
     72{
     73    margin-top: 2.3em;
     74}
    7175
    7276.mdict-tooltip a
     
    7478    color: #fff;
    7579    font-family: "Vazirmatn", sans-serif;
     80    height: 2.5em;
     81    padding: 5px;
    7682}
    7783
     
    105111        width: 100%;
    106112    }
     113
     114    .mdict-tooltip
     115    {
     116        margin-top: 3.4em;
     117    }
    107118}
    108119
  • moein-dictionary-free/trunk/assets/tooltip.js

    r2835283 r2845183  
    6060            transition: 'transform 0.2s ease-out',
    6161            top: rect.top + $(window).scrollTop(),
    62             marginTop: '2em',
    6362            left: rect.right - tooltipWidth
    6463        });
  • moein-dictionary-free/trunk/inc/admin/add-word.php

    r2835283 r2845183  
    6969                                    <tr>
    7070                                        <th scope="row"><label for="word"><?php _e('Word', 'mdict'); ?></label></th>
    71                                         <td><input name="word" type="text" id="word" value="<?php echo sanitize_text_field($word)?>" class="regular-text"></td>
     71                                        <td><input name="word" type="text" id="word" value="<?php echo sanitize_text_field($word) ?>" class="regular-text"></td>
    7272                                    </tr>
    7373                                    <tr>
     
    149149            do_action('mdict_word_add', $data_id, $data_array);
    150150
    151             $url = esc_url(admin_url('admin.php?page=mdict-add&item_id=' . $data_id));
    152             wp_redirect($url);
     151            $url = add_query_arg(array('page' => 'mdict-add', 'item_id' => $data_id,), admin_url('admin.php'));
     152            wp_redirect(esc_url_raw($url));
    153153            exit();
    154154        }
  • moein-dictionary-free/trunk/inc/admin/dashboard-template.php

    r2835283 r2845183  
    2828                            ?>
    2929                        </li>
    30                         <li>✔ <?php printf(__('Version: %s', 'mdict'), MDC_PLUGIN_VERSION) . ' - ' . __('free version', 'mdict'); ?></li>
     30                        <li>✔ <?php printf(__('Version: %s', 'mdict'), MDC_PLUGIN_VERSION . ' - ' . __('free version', 'mdict')); ?></li>
    3131
    3232                    </ul>
  • moein-dictionary-free/trunk/inc/admin/import-data.php

    r2835283 r2845183  
    5353    public static function generate_wpdb_prepare($array) {
    5454        $placeholders = array_map(function ($item) {
    55             return is_numeric($item) ? '%f' : ( is_float($item) ? '%f' : (  is_string($item) ? '%s' : '' ) );
     55            return is_numeric($item) ? '%f' : ( is_float($item) ? '%f' : ( is_string($item) ? '%s' : '' ) );
    5656        }, $array);
    5757        return '(' . join(',', $placeholders) . ')';
     
    8080            $in_str = self::generate_wpdb_prepare($items);
    8181            $sql = "SELECT COUNT(*) FROM $table WHERE `id` IN {$in_str}";
    82            // print_r($wpdb->prepare($sql, $items));
     82            // print_r($wpdb->prepare($sql, $items));
    8383            $res = $wpdb->get_var($wpdb->prepare($sql, $items));
    8484            return $res == 2;
     
    112112                mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
    113113            }
    114 
    115114            $con = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
    116 
     115           
    117116            if (mysqli_connect_errno())
    118117            {
    119                 die("Failed to connect to MySQL: " . mysqli_connect_error());
     118                //die("Failed to connect to MySQL: " . mysqli_connect_error());
     119                $error = "Failed to connect to MySQL!";
     120                $result = 0;
     121                return ['result' => 0, 'last_index' => 0, 'error' => $error];
    120122            }
     123           
     124            try
     125            {
     126                $utf8 = mysqli_set_charset($con, "utf8");
     127                $last_index = 0;
     128                // Run the SQL
     129                if (mysqli_multi_query($con, $sql_queries))
     130                {
     131                    do
     132                    {
     133                        mysqli_next_result($con);
     134                        $last_index++;
     135                    }
     136                    while (mysqli_more_results($con));
     137                }
    121138
    122             $utf8 = mysqli_set_charset($con, "utf8");
    123             $last_index = 0;
    124 
    125             // Run the SQL
    126             if (mysqli_multi_query($con, $sql_queries))
     139                $error = "";
     140                $result = 1;
     141                if (mysqli_errno($con))
     142                {
     143                    $error = mysqli_error($con);
     144                    $result = 0;
     145                }
     146            }
     147            catch (mysqli_sql_exception $ex)
    127148            {
    128                 do
    129                 {
    130                     mysqli_next_result($con);
    131                     $last_index++;
    132                 }
    133                 while (mysqli_more_results($con));
    134             }
    135 
    136             $error = "";
    137             $result = 1;
    138             if (mysqli_errno($con))
    139             {
    140                 $error = mysqli_error($con);
     149                $error = $ex->getMessage();
    141150                $result = 0;
    142151            }
    143152
     153            mysqli_close($con);
     154           
    144155            return ['result' => $result, 'last_index' => $last_index, 'error' => $error];
    145156        }
  • moein-dictionary-free/trunk/lang/mdict-fa_IR.po

    r2835283 r2845183  
    22msgstr ""
    33"Project-Id-Version: Moein Dictionary\n"
    4 "POT-Creation-Date: 2022-12-16 15:04+0330\n"
    5 "PO-Revision-Date: 2022-12-16 15:04+0330\n"
     4"POT-Creation-Date: 2023-01-08 23:00+0330\n"
     5"PO-Revision-Date: 2023-01-08 23:01+0330\n"
    66"Last-Translator: \n"
    77"Language-Team: \n"
     
    4747
    4848#: inc/admin/add-word.php:70 inc/admin/words-table.php:9
    49 #: inc/admin/words-table.php:62
     49#: inc/admin/words-table.php:64
    5050msgid "Word"
    5151msgstr "واژه"
    5252
    53 #: inc/admin/add-word.php:74 inc/admin/words-table.php:63
     53#: inc/admin/add-word.php:74 inc/admin/words-table.php:65
    5454msgid "Description"
    5555msgstr "شرح"
     
    169169msgstr "پیشخوان"
    170170
    171 #: inc/admin/import-data.php:91
     171#: inc/admin/import-data.php:101
    172172msgid "It is already installed."
    173173msgstr "قبلاً نصب شده است."
    174174
    175 #: inc/admin/import-data.php:138
     175#: inc/admin/import-data.php:159
    176176msgid "Data not found!"
    177177msgstr "داده‌ها یافت نشد!"
     
    242242msgstr "جستجوی لغت"
    243243
    244 #: inc/admin/words-table.php:36
     244#: inc/admin/words-table.php:38
    245245#, php-format
    246246msgid "%d item(s) were removed."
    247247msgstr "%d مورد حذف شد."
    248248
    249 #: inc/admin/words-table.php:44
     249#: inc/admin/words-table.php:46
    250250msgid "Please select one or more."
    251251msgstr "لطفاً موردی را انتخاب کنید."
    252252
    253 #: inc/admin/words-table.php:56 inc/templates/searchbox.php:65
     253#: inc/admin/words-table.php:58 inc/templates/searchbox.php:65
    254254msgid "Nothing found!"
    255255msgstr "موردی یافت نشد!"
    256256
    257 #: inc/admin/words-table.php:64
     257#: inc/admin/words-table.php:66
    258258msgid "ID"
    259259msgstr "شناسه"
    260260
    261 #: inc/admin/words-table.php:77
     261#: inc/admin/words-table.php:79
    262262msgid "Delete"
    263263msgstr "حذف"
    264264
    265 #: inc/admin/words-table.php:143
     265#: inc/admin/words-table.php:147
    266266msgid "Edit"
    267267msgstr "ویرایش"
  • moein-dictionary-free/trunk/moein-dictionary-free.php

    r2835283 r2845183  
    33  Plugin Name: Moein Dictionary(free)
    44  Description: Moein Persian dictionary(free version)
    5   Version: 1.4.1
     5  Version: 1.5.0
    66  Author: ham3da
    77  Plugin URI: https://wordpress.org/plugins/moein-dictionary-free
     
    1818}
    1919
    20 define('MDC_PLUGIN_VERSION', '1.4.1');
     20define('MDC_PLUGIN_VERSION', '1.5.0');
    2121define('MDC_PLUGIN_FILE', __FILE__);
    2222define('MDC_PLUGIN_DIR', plugin_dir_path(__FILE__));
  • moein-dictionary-free/trunk/readme.txt

    r2835283 r2845183  
    44Requires at least: 5.0
    55Tested up to: 6.1.1
    6 Stable tag: 1.4.1
     6Stable tag: 1.5.0
    77Requires PHP: 7.2
    88License: GPLv2 or later
     
    3636
    3737== Changelog ==
     38= 1.4.2 =
     39* Optimizing data import
    3840
    3941= 1.4.1 =
Note: See TracChangeset for help on using the changeset viewer.