Author Topic: [MOD] - Rating on one set of thumbnails per cat page under your category page  (Read 5845 times)

0 Members and 1 Guest are viewing this topic.

TheOracle

  • Guest

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
can I ask why do u use everywhere
Code: [Select]
  "1" => "1",
  "2" => "2",
instead of
Code: [Select]
  "1" => "Yes",
  "2" => "No",
?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

TheOracle

  • Guest
Due to languaging selections, it is easier to use values than words since the if statements from includes/functions.php file needs to select the proper field from the SQL settings table - which must be precise. If not, the functions will not work correctly.

Example :

- Choose this option :

- Yes
    -  No


- Oui
    - Non


Quote

if (check_permission("auth_cat_vote", $image_row['cat_id']) && $config['cat_voting_restriction_options'] != "yes") {


So, if it's selected from another language pack - assuming french - it would become :

Quote

if (check_permission("auth_cat_vote", $image_row['cat_id']) && $config['cat_voting_restriction_options'] != "oui") {


Since the settings column only contains one content of information, the if statement will become useless.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
I think u are confused there.
You are already using keys of the array to store in the database and values to show to the user:
Quote
  foreach ($cat_voting_restriction_optionlist as $key => $val) {
    echo "<option value=\"$key\"";
    if ($setting_value == $key) {
      echo " selected=\"selected\"";
    }
    echo ">".$val."</option>";
  }
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)