Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dumped the "enable_new_pm_count" setting in favor of a live new pm co…
…unt. A new field "pm_new_count" was added to the user table. This field keeps track of the number of new private messages for a user, by means of new updates that were added to the PM functions in the DB layer. By updating the new field when needed, there is no further need to run a query to find the number of new messages. This works around the performance issue for which the "enable_new_pm_count" option was originally introduced. A database integrity check was added to the admin interface to rebuild all new PM counts for all users. In the templates, {USER->new_private_messages} now contains the actual number of new messages, not just TRUE or FALSE.
- Loading branch information
Showing
10 changed files
with
125 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
if (!defined("PHORUM_ADMIN")) return; | ||
|
||
$upgrade_queries[] = | ||
"ALTER TABLE {$PHORUM['user_table']} | ||
ADD COLUMN pm_new_count INT UNSIGNED NOT NULL default 0"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
if (!defined("PHORUM_ADMIN")) return; | ||
|
||
$PHORUM['DB']->rebuild_pm_new_counts(); | ||
|