MyBB Community Forums

Full Version: How to return Inline error on CP?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Guys how to show inline error when user updating profile instead of just using
error();
In-line errors while updating profiles is a core functionality. Are you trying to write some plugin?
Yes I have a plugin hooked to
usercp_do_profile_end
but I don't know how to return inline error instead of
error();
$error = array();
$error[] = 'You don\'t have permissiont o view this page.';
$error[] = 'Second error.';
echo inline_error($error);
Thanks buddy very much should I replace error(); with your code?
The problem is that it shows inline error but also validates update I need to stop validating!
My code was a "guide" actually. You need to properly adapt it to your code.
Omar G. baby please could you give me a clue my PHP knowledge is really bad.

I am using pretty simple conditional.

if(//something)
{
error("");
}
Read:
http://www.php.net/manual/es/function.exit.php

if(//something)
{
	$error = array();
	$error[] = 'You don\'t have permissiont o view this page.';
	$error[] = 'Second error.';
	echo inline_error($error);
	exit;
} 
Instead of showing this:
[attachment=31354]


It shows this:
[attachment=31355]
Just pasting the code in your file will not magically cause the effect you desire, you need to think about the feature you are seeking and then investigate how to make it happen.
Pages: 1 2