1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-19 20:21:51 +02:00

Merge pull request #3121 from yesszus/patch-2

Issue #6  Update userposts.php
This commit is contained in:
Cameron 2018-05-09 15:47:15 -07:00 committed by GitHub
commit a3092e1d42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 10 deletions

View File

@ -49,7 +49,8 @@ class news {
if(empty($news['news_title']))
{
$error = true;
$emessage->add('Validation error: News title can\'t be empty!', E_MESSAGE_ERROR, $smessages);
$message = LAN_ERROR_47;
$emessage->add(LAN_ERROR_47, E_MESSAGE_ERROR, $smessages);
if(!empty($news['news_sef']))
{
$news['news_sef'] = eHelper::secureSef($news['news_sef']);
@ -72,18 +73,21 @@ class news {
if(empty($news['news_sef']))
{
$error = true;
$emessage->add('Validation error: News SEF URL value is required field and can\'t be empty!', E_MESSAGE_ERROR, $smessages);
$message = LAN_ERROR_48;
$emessage->add(LAN_ERROR_48, E_MESSAGE_ERROR, $smessages);
}
elseif($sql->db_Count('news', '(news_id)', ($news['news_sef'] ? 'news_id<>'.intval($news['news_id']).' AND ' : '')."news_sef='".$tp->toDB($news['news_sef'])."'"))
{
$error = true;
$emessage->add('Validation error: News SEF URL is unique field - current value already in use! Please choose another SEF URL value.', E_MESSAGE_ERROR, $smessages);
$message = LAN_ERROR_49;
$emessage->add(LAN_ERROR_49, E_MESSAGE_ERROR, $smessages);
}
if(empty($news['news_category']))
{
$error = true;
$emessage->add('Validation error: News category can\'t be empty!', E_MESSAGE_ERROR, $smessages);
$message = LAN_ERROR_50;
$emessage->add(LAN_ERROR_50, E_MESSAGE_ERROR, $smessages);
}

View File

@ -64,4 +64,8 @@ define("LAN_ERROR_44", "Site logo");
define("LAN_ERROR_45", "What can you do now?");
define("LAN_ERROR_46", "Check log for details.");
define("LAN_ERROR_47", "Validation error: News title can't be empty!");
define("LAN_ERROR_48", "Validation error: News SEF URL value is required field and can't be empty!");
define("LAN_ERROR_49", "Validation error: News SEF URL is unique field - current value already in use! Please choose another SEF URL value.");
define("LAN_ERROR_50", "Validation error: News category can't be empty!");
?>

View File

@ -11,8 +11,8 @@
*/
define("PAGE_NAME", "User Posts");
define("UP_LAN_0", "All Forum Posts for ");
define("UP_LAN_1", "All Comments for ");
define("UP_LAN_0", "All Forum Posts for [x]");
define("UP_LAN_1", "All Comments for [x]");
define("UP_LAN_2", "Thread");
define("UP_LAN_3", "Views");
define("UP_LAN_4", "Replies");
@ -28,4 +28,4 @@ define("UP_LAN_12", "Search");
define("UP_LAN_14", "Forum Posts");
define("UP_LAN_15", "Re");
define("UP_LAN_16", "IP Address");
?>
?>

View File

@ -70,7 +70,8 @@ if ($action == "comments")
$sql2 = e107::getDb('sql2');
if($user_name)
{
$ccaption = UP_LAN_1.$user_name;
// $ccaption = UP_LAN_1.$user_name;
$ccaption = str_replace('[x]', $user_name, UP_LAN_1);
/*$sql->db_Select("user", "user_comments", "user_id=".$id);
$row = $sql->db_Fetch();
$ctotal = $row['user_comments'];*/
@ -159,7 +160,8 @@ elseif ($action == 'forums')
exit;
}
$fcaption = UP_LAN_0.' '.$user_name;
// $fcaption = UP_LAN_0.' '.$user_name;
$fcaption = str_replace('[x]', $user_name, UP_LAN_0);
/*
if (!$USERPOSTS_FORUM_TABLE)
{
@ -312,4 +314,4 @@ function parse_userposts_comments_table($row, $template)
return e107::getParser()->simpleParse($template, $vars);
}
?>
?>