MyBB Community Forums
Parse Error - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Development (https://community.mybb.com/forum-68.html)
+---- Thread: Parse Error (/thread-101421.html)



Parse Error - dragonexpert - 2011-08-11

$plugins->add_hook("modcp_reports", "socialgroups_reported_posts"); 

 function socialgroups_reported_posts()
{
	global $db, $mybb, $lang;
	 if ($report['type']==1) 
	{ 
		$report['postlink'] ="<a href='$settings[\'bburl\']/groupthread.php?pid=$report[\'pid\']' target='_blank'>$report['pid']</a>"; 
		$report['threadlink'] ="<a href='$settings[\'bburl\']/groupthread.php?conid=$report[\'tid\']' target='_blank'>$report['tid']</a>";
	 } 
} 

In short, this is supposed to separate reported posts since I'm working on a social groups type feature that vbulletin has. I'm getting close to finishing it, but I'm getting a parse error on the line that says
$report['postlink'] ="<a href='$settings[\'bburl\']/groupthread.php?pid=$report[\'pid\']' target='_blank'>$report['pid']</a>"; 

I can't seem to figure out why.



RE: Parse Error - Steven - 2011-08-11

function socialgroups_reported_posts()
{
    global $db, $mybb, $lang;
    if ($report['type'] == 1) 
    { 
        $report['postlink'] ='<a href="'.$settings['bburl'].'/groupthread.php?pid='.$report['pid'].'" target="_blank">'.$report['pid'].'</a>'; 
        $report['threadlink'] ='<a href="'.$settings['bburl'].'/groupthread.php?conid='.$report['tid'].'" target="_blank">'.$report['tid'].'</a>';
    } 
}

Pay more attention to your quotation marks. Always use single quotes, at least for HTML output so you can properly use double quotes. Concatenate the variables.