Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OUGC Mark PM As Unread

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 Mark PM As Unread
Plugin Version: 1.0
Plugin Author: Omar Gonzalez
Author Message
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #2
RE: OUGC Mark PM As Unread
Quote:Okay, I'm tired and in a weird mood.  This means that I will do a half dazed skim over and blurt out anything that catches my attention.
  • Code:
     * 1.- You may edit whatever you want to fit your needs without permission.
     * 3.- You MUST NOT remove any license comments in any file that comes with this plugin pack.

    Can I make #1 override #3?


You can, but you are no suppose to Tongue

Quote:
  • PHP Code:
    1
    2
    3
    4
    5
    6
    7
    8
    	$return = false;
    	(isset($pmid) && ($pmid = (int)$pmid)) or ($return = true);
    	($pmid && $pmid > 0) or ($return = true);
    
    	if($return)
    	{
    		return 1;
    	}

    Seems the same as

    PHP Code:
    if(($pmid = (int)@$pmid) > 0) return 1;


Didn't know we could use @ to hide variable errors too (just functions). This should probably save code in future.

Quote:
  • I honestly would just chuck the entire contents of the ougc_markpmasunread template into the private_messagebit template - saves a shit-tonne of work, but whatever makes you happy I guess

It is done that way so that the text is only show when necessary, I know nothing about regex, so I will be even more work to hide it using a different way (I like nice details too).

Quote:
  • When marking unread, the pmid isn't validated against a user - eg it's possibly to mark someone else's PMs as unread, if you want to be a bored twat with nothing better to do, that is
  • Also marking unread doesn't have/check postkeys, but I honestly wouldn't care for it myself

Didn't think about that.

Quote:
  • PHP Code:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    		$mark = ougc_markpmasunread_markunread($mybb->input['markunread']);
    		if($mark !== true)
    		{
    			global $lang;
    			$lang->load('ougc_markpmasunread');
    
    			switch((int)$mark)
    			{
    				case 1:
    					$message = $lang->ougc_markpmasunread_error_invalidpm;
    					break;
    				case 2:
    					$message = $lang->ougc_markpmasunread_error_alreadyunread;
    					break;
    				case 3:
    					$message = $lang->ougc_markpmasunread_error_userupdate;
    					break;
    				default:
    					$message = $lang->ougc_markpmasunread_error_unkown;
    					break;
    			}
    			error($message);
    		}

    Okay, that seemed awkward...  Maybe skip the magic numbers and pass back better references?


Probably can reduce the code there, but what exactly do you mean?

Tank you for the review Zinga Burga.

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
(This post was last modified: 08-21-2012 05:12 AM by Sama34.)
08-21-2012 05:12 AM
Visit this user's website Find all posts by this user Quote this message in a reply


Messages In This Thread
OUGC Mark PM As Unread - ZiNgA BuRgA - 08-18-2012, 11:10 PM
RE: OUGC Mark PM As Unread - Sama34 - 08-21-2012 05:12 AM
RE: OUGC Mark PM As Unread - ZiNgA BuRgA - 08-21-2012, 11:17 AM
RE: OUGC Mark PM As Unread - Sama34 - 08-21-2012, 01:57 PM

Forum Jump: