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
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #1
OUGC Mark PM As Unread
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?

  • 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?

  • 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
  • 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;

    Okay, yeah, I'm being pedantic...

  • 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

Okay, there's absolutely nothing wrong with the plugin, I just need some negative points to stick up for my own enjoyment.
I'm going to bed.

My Blog
08-18-2012 11:10 PM
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: