Skip to content

Commit

Permalink
Merge pull request #7 from SMFTricks/v4.1.11
Browse files Browse the repository at this point in the history
V4.1.11
  • Loading branch information
DiegoAndresCortes authored May 11, 2022
2 parents 4fe2891 + 3d0ba22 commit 15c696f
Show file tree
Hide file tree
Showing 24 changed files with 387 additions and 229 deletions.
143 changes: 143 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# Changelog

#### 4.1.11 - 10 May 2022
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Use default theme path for images.
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Improvements for some search queries.
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Defer the version file.
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Improve compatibility on certain queries.
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Various minimal improvements.
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Added language strings for the 'Steal Item' module.
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Various PHP 8+ fixes.
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Fix special characters issues when using items from the inventory.
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Fixed issues caused by a bad template layer.
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Fixed 'remove duplicates' option for the inventory display.

#### 4.1.10 - 27 October 2021
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Improve inventory display in posts.

#### 4.1.9 - 13 October 2021
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Use integrate_register_after for the Simple Referrals integration.

#### 4.1.8 - 03 October 2021
- ![New Feature](https://smftricks.com/assets/changelog/tag--plus.png) Added integration with [Simple Referrals](https://github.com/SMFTricks/Simple-Referrals).
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Sort Addons by name.
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Fixed typo in notifications.
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Fixed some minor issues with settings.

#### 4.1.7 - 30 August 2021
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Display "No stats" message when stats are empty or not available.
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Fixed missing links for user profiles.

#### 4.1.6 - 23 August 2021
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Use unsigned in database columns.

#### 4.1.5 - 20 July 2021
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Added link to the integrations/mods in the settings page.

#### 4.1.4 - 19 July 2021
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Fixed double title in inventory.

#### 4.1.3 - 16 July 2021
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Fixed typos.
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Value type for int columns is now bigger just in case.

#### 4.1.2 - 06 November 2020
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Fixed wrong image name in last purchased icon.
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Fixed typo in installer file.
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Various minor changes.

#### 4.1.1 - 05 November 2020
- ![New Feature](https://smftricks.com/assets/changelog/tag--plus.png) The return of likes, set credits received per like.
- ![New Feature](https://smftricks.com/assets/changelog/tag--plus.png) Added a content table log in the database to prevent duplicates from likes and best answer integration.
- ![New Feature](https://smftricks.com/assets/changelog/tag--plus.png) Improved integration with [SMF Arcade](https://web-develop.ca/index.php?board=9.0). Added settings for personal best, and new champion.
- ![New Feature](https://smftricks.com/assets/changelog/tag--plus.png) Added integration with [Best Answer](https://github.com/SychO9/smf-best-answer).
- ![New Feature](https://smftricks.com/assets/changelog/tag--plus.png) Added language strings support for Primary Member Group Module.
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Added cache inventory in posts and profile.
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Check if there's an usable input for an item instead of printing empty method.
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Fixed issue caused by loading the inventory template.

#### 4.1 - 03 November 2020
- ![New Feature](https://smftricks.com/assets/changelog/tag--plus.png) Added basic integration for SMF Arcade.
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Fixed credits format for standard title placement in posts.
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Fixed major inventory issue, when viewing posts and profiles.
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Don't show alert settings if the shop is disabled.
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Minor tweaks to Modules and Games.
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Big code improvements.
---
#### 4.0 - 31 October 2020
- ![New Feature](https://smftricks.com/assets/changelog/tag--plus.png) Added option to import data from SMF Shop, SA Shop and ST Shop 3.x
- ![New Feature](https://smftricks.com/assets/changelog/tag--plus.png) More hooks.
- ![New Feature](https://smftricks.com/assets/changelog/tag--plus.png) Allow easy creation of Games for the Games Room.
- ![New Feature](https://smftricks.com/assets/changelog/tag--plus.png) Alerts reworked to use background tasks.
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Portions of the mod rewritten and code updated.
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Icons for Shop items updated.
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Code optimization.
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Fixed minor bugs and logic issues.
---
#### 3.2.6.1 - 06 February 2020
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Added a fallback for the credits suffix.
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) License and copyright year updated in every file.
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Properly remove the template file hook.

#### 3.2.6 - 31 December 2019
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Removed the limit in some queries as the uniqueness of the ID would only return 1 value as expected.
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Changed type of value of shopBank to bigint from int so it's even bigger for users having over 1 billion credits in the bank.
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) News feed in the admin is now using plain text for the date, it should display correctly now.

#### 3.2.5 - 03 September 2019
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Little tweak on stats, aiming for a simple usage on Portal Blocks or related.

#### 3.2.4 - 02 September 2019
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Fixed issue on integrate_boardtree_board not checking if board was available.

#### 3.2.3 - 01 September 2019
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Bank interest scheduled task was logging twice.

#### 3.2.2 - 31 August 2019
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Fixed Delete after use field in Shop item options, now it's displaying correctly.

#### 3.2.1 - 29 August 2019
- ![New Feature](https://smftricks.com/assets/changelog/tag--plus.png) [Module] Steal module now allows you to decide if the user receives an alert, pm or both when someone robbed him/her.
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Let the alerts function receive the additional information.
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Improved implementation of different icons for alerts.

#### 3.2 - 28 August 2019
- ![New Feature](https://smftricks.com/assets/changelog/tag--plus.png) Alerts system support. User can receive alerts when someone sends him credits/items and notify of trade sales.
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Corrected very few language strings.
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Fixed classes and template issues.
---
#### 3.1.2 - 28 August 2019
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Remove scheduled task of bank interest on uninstall.

#### 3.1.1 - 27 August 2019
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Updated links and names in modules and credits.
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Updated code for module uploads.
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Fixed wrong function call in buy action.
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Added index.php file to modules directory.
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Corrected items and modules paths.

#### 3.1 - 26 August 2019
- ![New Feature](https://smftricks.com/assets/changelog/tag--plus.png) Hook files removed.
- ![New Feature](https://smftricks.com/assets/changelog/tag--plus.png) Item template added as a standalone file to preserve files order.
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Updated code in most files and some files were renamed.
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Various fixes in the images upload option.
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Fixed duplicated template functions for edit/add items/categories.
---
#### 3.0.2 - 26 July 2019
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Exit action if the external site is down.
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Added a redirection exit when the user didn't select a profile action correctly.
- ![New Feature](https://smftricks.com/assets/changelog/tag--plus.png) Added a hook for the stats.
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Remove unnecessary array from the stats, merging both for a better use.

#### 3.0.1 - 25 July 2019
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Fixed value type for fee in trade center.
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Fixed boards custom shop values, replaced old hook with new one.

#### 3.0 - 28 June 2019
- ![New Feature](https://smftricks.com/assets/changelog/tag--plus.png) Initial Release.

## Legend
- ![Translation](https://smftricks.com/assets/changelog/language.png) Translation
- ![New Feature](https://smftricks.com/assets/changelog/tag--plus.png) New Feature
- ![Bug Fix](https://smftricks.com/assets/changelog/bug--minus.png) Bug Fix
- ![Improvement](https://smftricks.com/assets/changelog/tag--pencil.png) Improvement
41 changes: 17 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
<p align="center">
<img src="https://smftricks.com/logos/logo.png">
</p>

<img src="https://img.shields.io/badge/License-MPL%202.0-a05a3f?style=flat-square"> <img src="https://img.shields.io/badge/SMF-2.1-3f73a0?style=flat-square">
![SMF Tricks - Free & Premium Mods and Themes for SMF](https://smftricks.com/logos/logo.png)


## ST Shop for SMF
- Developed by [Diego Andrés](https://github.com/DiegoAndresCortes)
- Original developer: [Sleepy Arcade™](https://github.com/SAMods)
- Original idea: [Daniel15](https://github.com/Daniel15)
# ST Shop for SMF
![License](https://img.shields.io/badge/License-MPL%202.0-248049) ![Hooks Only](https://img.shields.io/badge/Hooks%20Only-Yes-6041a3) ![SMF 2.1](https://img.shields.io/badge/SMF-2.1-3f73a0)

* Developed by [Diego Andrés](https://github.com/DiegoAndresCortes)
* Original Developer: [Sleepy Arcade™](https://github.com/SAMods)
* Original Idea: [Daniel15](https://github.com/Daniel15)

## Introduction
* ST Shop allows you to add a shop to your forum and gives you a wide variety of options to customize your shop for your users experience.
ST Shop allows you to add a shop to your forum and gives you a wide variety of options to customize your shop for your users experience.

## Features
### Features
- Enable shop
- You can use the shop features as a standalone points system
- Custom credits/currency
Expand All @@ -38,15 +35,11 @@
- Select your favorite items to display
- Shop stats

## Requirements
* SMF 2.1

## How to install
* You can install ST Shop through the package manager of your forum administration.

## More Modules
* You can find some more "official" modules in the [ST Shop Modules](https://github.com/SMFTricks/ST-Shop-Modules) repository.

## Changelog
You can find the changelog for ST Shop on SMF Tricks: [Changelog](https://smftricks.com/index.php?board=51.0)

### Localization
- ![English](https://www.simplemachines.org/site_images/lang/english.gif) English
---
### [Changelog](https://github.com/SMFTricks/ST-Shop/blob/master/CHANGELOG.md)
### [GitHub](https://github.com/SMFTricks/ST-Shop)
---
### [ST Shop Modules](https://github.com/SMFTricks/ST-Shop-Modules)
### [Modules and Addons Discussion](https://smftricks.com/index.php?board=109.0)
10 changes: 6 additions & 4 deletions Sources/Shop/Helper/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,12 @@ public static function Find($table, $column, $search = '', $additional_query = '
$request = $smcFunc['db_query']('','
SELECT ' . $column . '
FROM {db_prefix}{raw:table}'.(!empty($search) ? ('
WHERE ('. $column . (is_array($search) ? ' IN ({array_int:search})' : (' = \''. $search . '\'')) . ') '.$additional_query) : '').'
WHERE ('. $column . (is_array($search) ? ' IN ({array_int:array_search})' : (' = {int:search}')) . ') '.$additional_query) : '').'
LIMIT 1',
[
'table' => $table,
'search' => $search
'array_search' => $search,
'search' => $search,
]
);
$result = $smcFunc['db_num_rows']($request);
Expand All @@ -245,9 +246,10 @@ public static function Delete($table, $column, $search, $additional_query = '')

$smcFunc['db_query']('', '
DELETE FROM {db_prefix}{raw:table}
WHERE '. $column . (is_array($search) ? ' IN ({array_int:search})' : (' = ' . $search)) . $additional_query,
WHERE '. $column . (is_array($search) ? ' IN ({array_int:array_search})' : ' = {int:search}') . $additional_query,
[
'table' => $table,
'array_search' => $search,
'search' => $search,
]
);
Expand Down Expand Up @@ -282,7 +284,7 @@ public static function Update($table, $columns, $types, $query)
global $smcFunc;

$smcFunc['db_query']('','
UPDATE IGNORE {db_prefix}'.$table . '
UPDATE {db_prefix}'.$table . '
SET
'.rtrim($types, ', ') . '
'.$query,
Expand Down
2 changes: 1 addition & 1 deletion Sources/Shop/Helper/Import/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public function insertInventory($inventory)
$this->_types[$column] = str_replace('integer', 'int', gettype($type));

// Insert the items into the database
Database::Insert('stshop_inventory', $this->_shop_inventory, $this->_types, ['id'], 'replace');
Database::Insert('stshop_inventory', $this->_shop_inventory, $this->_types, ['id']);

// Get our total of items imported
$this->_total_imported = $smcFunc['db_affected_rows']();
Expand Down
2 changes: 1 addition & 1 deletion Sources/Shop/Helper/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public function purchase($itemid, $userid, $amount, $seller = 0, $fee = 0, $invi
], $this->_buy);
}

public function bank($userid, $amount, $trans, $fee = 0, $type)
public function bank($userid, $amount, $trans, $fee = 0, $type = 'deposit')
{
// Move forward with the transaction
Database::Update('members', ['user' => $userid, 'amount' => $amount, 'fee' => $fee], 'shopMoney = shopMoney '. ($trans == 'deposit' ? '-' : '+') .' {int:amount}' .(!empty($fee) && empty($type) ? ' - {int:fee}' : '') . ', shopBank = shopBank '. ($trans == 'withdrawal' ? '-' : '+') .' {int:amount}' .(!empty($fee) && !empty($type) ? ' - {int:fee}' : '') . ',', 'WHERE id_member = {int:user}');
Expand Down
2 changes: 1 addition & 1 deletion Sources/Shop/Integration/Boards.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function create_board(&$boardOptions, &$board_columns, &$board_parameters
$boardOptions['Shop_credits_count'] = 1;
}

public function modify_board($id, $boardOptions, &$boardUpdates, &$boardUpdateParameters)
public static function modify_board($id, $boardOptions, &$boardUpdates, &$boardUpdateParameters)
{
$boardOptions['Shop_credits_count'] = isset($_POST['Shop_credits_count']);
$boardOptions['Shop_credits_topic'] = !empty($_POST['Shop_credits_topic']) ? (int) $_POST['Shop_credits_topic'] : 0;
Expand Down
4 changes: 2 additions & 2 deletions Sources/Shop/Integration/Permissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function load_permissions(&$permissionGroups, &$permissionList, &$leftPer
// Shop permissions
$permissionGroups['membergroup'][] = 'shop';
foreach ($this->shop_permissions as $p)
$permissionList['membergroup'][$p] = [false,'shop'];
$permissionList['membergroup'][$p] = [false, 'shop'];

// Shop disabled? No permissions then
if (empty($modSettings['Shop_enable_shop']))
Expand Down Expand Up @@ -81,7 +81,7 @@ public function illegal_guest()
* Loads the admin language file for the help popups in the permissions page
*
*/
public function language()
public static function language()
{
loadLanguage('Shop/ShopAdmin');
}
Expand Down
Loading

0 comments on commit 15c696f

Please sign in to comment.