Changeset 18995
- Timestamp:
- Nov 11, 2012, 4:01:09 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/comments.php
r18164 r18995 234 234 { 235 235 check_pwg_token(); 236 update_user_comment(236 $comment_action = update_user_comment( 237 237 array( 238 238 'comment_id' => $_GET['edit'], 239 239 'image_id' => $_POST['image_id'], 240 'content' => $_POST['content'] 240 'content' => $_POST['content'], 241 'website_url' => @$_POST['website_url'], 241 242 ), 242 243 $_POST['key'] 243 244 ); 244 245 $perform_redirect = true; 245 246 switch ($comment_action) 247 { 248 case 'moderate': 249 $_SESSION['page_infos'][] = l10n('An administrator must authorize your comment before it is visible.'); 250 case 'validate': 251 $_SESSION['page_infos'][] = l10n('Your comment has been registered'); 252 $perform_redirect = true; 253 break; 254 case 'reject': 255 $_SESSION['page_errors'][] = l10n('Your comment has NOT been registered because it did not pass the validation rules'); 256 break; 257 default: 258 trigger_error('Invalid comment action '.$comment_action, E_USER_WARNING); 259 } 246 260 } 247 else 248 { 249 $edit_comment = $_GET['edit']; 250 } 261 262 $edit_comment = $_GET['edit']; 251 263 } 252 264 -
trunk/include/functions_comment.inc.php
r18164 r18995 310 310 function update_user_comment($comment, $post_key) 311 311 { 312 global $conf ;312 global $conf, $page; 313 313 314 314 $comment_action = 'validate'; … … 336 336 ); 337 337 338 // website 339 if (!empty($comment['website_url'])) 340 { 341 if (!preg_match('/^https?/i', $comment['website_url'])) 342 { 343 $comment['website_url'] = 'http://'.$comment['website_url']; 344 } 345 if (!url_check_format($comment['website_url'])) 346 { 347 array_push($page['errors'], l10n('Your website URL is invalid')); 348 $comment_action='reject'; 349 } 350 } 351 338 352 if ( $comment_action!='reject' ) 339 353 { … … 348 362 UPDATE '.COMMENTS_TABLE.' 349 363 SET content = \''.$comment['content'].'\', 364 website_url = '.(!empty($comment['website_url']) ? '\''.$comment['website_url'].'\'' : 'NULL').', 350 365 validated = \''.($comment_action=='validate' ? 'true':'false').'\', 351 366 validation_date = '.($comment_action=='validate' ? 'NOW()':'NULL').' -
trunk/language/en_UK/common.lang.php
r18164 r18995 393 393 $lang['Visits, high → low'] = 'Visits, high → low'; 394 394 $lang['Visits, low → high'] = 'Visits, low → high'; 395 $lang['Website'] = 'Website'; 395 396 $lang['Webmaster'] = "Webmaster"; 396 397 $lang['Week %d'] = "Week %d"; … … 410 411 $lang['Your password has been reset'] = 'Your password has been reset'; 411 412 $lang['Your username has been successfully changed to : %s'] = 'Your username has been successfully changed to : %s'; 413 $lang['Your website URL is invalid'] = 'Your website URL is invalid'; 412 414 $lang['mandatory'] = 'mandatory'; 413 415 ?> -
trunk/language/fr_FR/common.lang.php
r18164 r18995 411 411 $lang['Email address is mandatory'] = 'Adresse email obligatoire'; 412 412 $lang['mandatory'] = 'obligatoire'; 413 $lang['Website'] = 'Site web'; 414 $lang['Your website URL is invalid'] = 'L\'adresse de votre site web est invalide'; 413 415 ?> -
trunk/picture.php
r18760 r18995 350 350 'comment_id' => $_GET['comment_to_edit'], 351 351 'image_id' => $page['image_id'], 352 'content' => $_POST['content'] 352 'content' => $_POST['content'], 353 'website_url' => @$_POST['website_url'], 353 354 ), 354 355 $_POST['key'] … … 366 367 case 'reject': 367 368 $_SESSION['page_errors'][] = l10n('Your comment has NOT been registered because it did not pass the validation rules'); 368 $perform_redirect = true;369 369 break; 370 370 default: … … 378 378 unset($_POST['content']); 379 379 } 380 else 381 { 382 $edit_comment = $_GET['comment_to_edit']; 383 } 380 381 $edit_comment = $_GET['comment_to_edit']; 384 382 } 385 383 break; -
trunk/themes/default/template/comment_list.tpl
r18748 r18995 6 6 7 7 .content .commentElement .description{ldelim} 8 height: {$comment_derivative_params->max_height()+5}px8 min-height: {$comment_derivative_params->max_height()+5}px 9 9 } 10 10 {/html_style}{/strip} … … 29 29 </div> 30 30 {/if} 31 <div class="description" {if isset($comment.IN_EDIT)} style="height:200px"{/if}>31 <div class="description"> 32 32 {if isset($comment.U_DELETE) or isset($comment.U_VALIDATE) or isset($comment.U_EDIT)} 33 33 <div class="actions" style="float:right;font-size:90%"> … … 40 40 <a href="{$comment.U_CANCEL}"> 41 41 {'Cancel'|@translate} 42 </a>{if isset($comment.U_VALIDATE) or isset($comment.U_EDIT)} | {/if}42 </a>{if isset($comment.U_VALIDATE)} | {/if} 43 43 {/if} 44 44 {if isset($comment.U_EDIT) and !isset($comment.IN_EDIT)} … … 61 61 <a name="edit_comment"></a> 62 62 <form method="post" action="{$comment.U_EDIT}" id="editComment"> 63 <p><label >{'Edit a comment'|@translate} :</label></p>63 <p><label for="contenteditid">{'Edit a comment'|@translate} :</label></p> 64 64 <p><textarea name="content" id="contenteditid" rows="5" cols="80">{$comment.CONTENT|@escape}</textarea></p> 65 <p><label for="website_url">{'Website'|@translate} :</label></p> 66 <p><input type="text" name="website_url" id="website_url" value="{$comment.WEBSITE_URL}" size="40"></p> 65 67 <p><input type="hidden" name="key" value="{$comment.KEY}"> 66 68 <input type="hidden" name="pwg_token" value="{$comment.PWG_TOKEN}">
Note: See TracChangeset
for help on using the changeset viewer.