MyBB Community Forums

Full Version: Quote Username
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
(2010-01-08, 02:48 AM)Mushu Wrote: [ -> ]It is a language file. It's in global.lang.php but the username will be on the left unless you change it around.
I need to know where... I found the "Wrote" thing but not the "{...USERNAME} Wrote:" thing to edit..
That is in inc/class_parser.php on line 679 where it says: "<blockquote>...".
class_parser.php
I have changed this:
		if($text_only)
		{
			return "\n".htmlspecialchars_uni($username)." $lang->wrote{$date}\n--\n{$message}\n--\n";
		}
		else
		{
			$span = "";
			if(!$delete_quote)
			{
				$span = "<span>{$date}</span>";
			}
			
			return "<blockquote><cite>{$span}".htmlspecialchars_uni($username)." $lang->wrote{$linkback}</cite>{$message}</blockquote>\n";
		}
	}

To this:
		if($text_only)
		{
			return "\n $lang->wrote ".htmlspecialchars_uni($username)." {$date}\n--\n{$message}\n--\n";
		}
		else
		{
			$span = "";
			if(!$delete_quote)
			{
				$span = "<span>{$date}</span>";
			}
			
			return "<blockquote><cite>$lang->wrote {$span}".htmlspecialchars_uni($username)." {$linkback}</cite>{$message}</blockquote>\n";
		}
	}


global.lang.php
I have changed this:
$l['wrote'] = "Wrote:";

To this:
$l['wrote'] = "Originally posted by ";

BEFORE THE CHANGES:
[attachment=16907]

AFTER THE CHANGES:
[attachment=16906]

The linkback and the profile link in the username do not work...
What I'm doing wrong??
You can't use that edit if you're using my plugin.
If you're using the vBQuote plugin, open vbquote.php, find:
$user.' '.$lang->wrote
Replace with:
'Originally posted by '.$user

And find
build_profile_link(htmlspecialchars_uni($post['username']), $post['uid']).' '.$lang->wrote
replacing with
'Originally posted by '.build_profile_link(htmlspecialchars_uni($post['username']), $post['uid'])
And why couldn't he use that edit and swap the $lang->wrote to the start of the line?
I got this error:
Quote:Parse error: syntax error, unexpected T_VARIABLE in /home/a3230294/public_html/forums/inc/plugins/vbquote.php on line 138

Here is line 98 to 146:
function vbquote_parse_quote($user, $pid, $text_only=false)
{
	global $lang, $templates, $mybb, $theme;
	
	// if we're processing complex quotes
	if(defined('VBQUOTE_USE_COMPLEX_QUOTES') && !$text_only && !defined('IN_ARCHIVE'))
	{
		global $vbquote_quotedpids, $plugins;
		$vbquote_quotedpids[$pid] = $user;
		
		$plugins->add_hook('pre_output_page', 'vbquote_parse_complex');
		if(defined('IN_XMLHTTP') || $mybb->input['ajax']==1)
		{
			static $ajax_done;
			if(!$ajax_done)
			{
				ob_start();
				function vbquote_xmlhttp_preoutput()
				{
					run_shutdown();	// reconstruct objects if destroyed (urgh, won't fix $lang, $templates and $theme)
					$page = ob_get_clean();
					echo vbquote_parse_complex($page);
				}
				register_shutdown_function('vbquote_xmlhttp_preoutput');
				$ajax_done = true;
			}
		}
		
		return '<!-- VBQUOTE_COMPLEX_QUOTE_'.$pid.' -->';
	}
	
	return vbquote_parse_quote_user($user, $pid, $text_only);
}

function vbquote_parse_quote_user($user, $pid, $text_only=false)
{
	global $lang, $templates, $mybb, $theme;
	if($text_only)
		return 'Originally posted by '.$user 
	
	$url = $mybb->settings['bburl'].'/'.get_post_link($pid).'#pid'.$pid;
	if(defined('IN_ARCHIVE'))
		$linkback = ' <a href="'.$url.'">[ -> ]</a>';
	else
		eval('$linkback = " '.$templates->get('postbit_gotopost', 1, 0).'";');
	
	//return "<p>\n<blockquote><cite>".htmlspecialchars_uni($user)." $lang->wrote{$linkback}</cite>{$msg}</blockquote></p>\n";
	return $user.' '.$lang->wrote.$linkback;
}

Changes I made:
Line 181:
Find:
build_profile_link(htmlspecialchars_uni($post['username']), $post['uid']).' '.$lang->wrote
replacing with
'Originally posted by '.build_profile_link(htmlspecialchars_uni($post['username']), $post['uid'])

Find:
Line 136:
$user.' '.$lang->wrote
Replace with:
'Originally posted by '.$user
return 'Originally posted by '.$user

to:

return 'Originally posted by '.$user;
Quote:Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/a3230294/public_html/forums/inc/plugins/vbquote .php on line 181

Line 168 to 187:
// posts doesn't exist anymore...?
		if(!$post)
		{
			$r = vbquote_parse_quote_user(htmlspecialchars_uni($uname), $pid);
		}
		else
		{
			$url = $mybb->settings['bburl'].'/'.get_post_link($pid).'#pid'.$pid;
			eval('$linkback = " '.$templates->get('postbit_gotopost', 1, 0).'";');
			
			$date = my_date($mybb->settings['dateformat'], $post['dateline']).' '.my_date($mybb->settings['timeformat'], $post['dateline']);
			
			$r = '<span style="float: right; font-weight: normal;"> ('.$date.')</span>'
				'Originally posted by '.build_profile_link(htmlspecialchars_uni($post['username']), $post['uid']).$linkback;
		}
		$replaces['<!-- VBQUOTE_COMPLEX_QUOTE_'.$pid.' -->'] = $r;
	}
	
	return strtr($page, $replaces);
}

Line 181:
	'Originally posted by '.build_profile_link(htmlspecialchars_uni($post['username']), $post['uid']).$linkback;
</span>'
                'Originally posted by '

Either remove the ' from the and of </span> and before Originally or put a . between them.
I have added the . and the plugin didn't show in the plugins list.
			$r = '<span style="float: right; font-weight: normal;"> ('.$date.')</span>'
				.'Originally posted by '.build_profile_link(htmlspecialchars_uni($post['username']), $post['uid']).$linkback;
		}
Pages: 1 2 3 4 5