Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OUGC Custom Reputation

Please note that this is pretty much a negative criticism post, rather than a balanced review as mentioned in this thread. Also be aware that stuff posted here may be highly subjective.
Please feel free to criticise this post, however.

Plugin Reviewed: OUGC Custom Reputation
Plugin Version: 1.0.1 (last updated 25th November 2012)
Plugin Author: Omar G.
Author Message
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #5
RE: OUGC Custom Reputation
(11-30-2012 07:44 PM)Sama34 Wrote:  Would using int (not int(n)) be any better?
I don't think there's really a difference.

(11-30-2012 07:44 PM)Sama34 Wrote:  What do you suggest? I avoided to add a new column to the posts table since I hate doing so. If I understood correctly.
I don't really have one - it's still a concern nonetheless.
You could cache the counts since that's all that you really need to display, but if you don't want to be modding the posts table, I guess that's out of the question (I suppose you could skirt around it by creating another table, but I wouldn't consider it any better than modding the posts table).

(11-30-2012 07:44 PM)Sama34 Wrote:  Do you think the following is correct?

SQL Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
	$db->write_query("CREATE TABLE `".TABLE_PREFIX."ougc_customrep_log` (
			`lid` int UNSIGNED NOT NULL AUTO_INCREMENT,
			`pid` int NOT NULL DEFAULT '0',
			`uid` int NOT NULL DEFAULT '0',
			`rid` int NOT NULL DEFAULT '0',
			`dateline` int(10) NOT NULL DEFAULT '0',
			PRIMARY KEY (`lid`),
			UNIQUE KEY piduid (pid,uid),
			CREATE INDEX pidrid (pid,rid)
		) ENGINE=MyISAM{$collation};"
	);

///---

	$db->write_query('ALTER TABLE '.TABLE_PREFIX.'ougc_customrep_log ADD UNIQUE KEY piduid (pid,uid)');
	if(!$db->index_exists('ougc_customrep_log', 'pidrid'))
	{
		$db->write_query('CREATE INDEX pidrid ON '.TABLE_PREFIX.'ougc_customrep_log (pid,rid)');
	}

Keys and indexes are the same thing.
In the first, replace "CREATE INDEX " with "KEY " (or "INDEX " if you prefer).

(11-30-2012 07:44 PM)Sama34 Wrote:  I assumed that since it was obvious to me (the one coding it), it would be to anyone.
A common problem in user interface design you'll find.  The developer will always know where everything is and how it's supposed to work Tongue

My Blog
12-01-2012 09:26 AM
Find all posts by this user Quote this message in a reply


Messages In This Thread
OUGC Custom Reputation - ZiNgA BuRgA - 11-26-2012, 04:04 PM
RE: OUGC Custom Reputation - Sama34 - 11-26-2012, 06:00 PM
RE: OUGC Custom Reputation - ZiNgA BuRgA - 11-27-2012, 02:35 PM
RE: OUGC Custom Reputation - ZiNgA BuRgA - 12-01-2012 09:26 AM
RE: OUGC Custom Reputation - Sama34 - 12-01-2012, 05:28 PM
RE: OUGC Custom Reputation - ZiNgA BuRgA - 12-01-2012, 10:20 PM
RE: OUGC Custom Reputation - Sama34 - 12-03-2012, 04:18 PM
RE: OUGC Custom Reputation - ZiNgA BuRgA - 12-03-2012, 04:30 PM

Forum Jump: