4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: senloel on December 24, 2013, 01:22:36 PM
-
Hey,
this MOD adds checkboxes to the validation area. The ticked boxes will be entered into the textarea.
!! This MOD requires Email image validation results to the user v2 (http://www.4homepages.de/forum/index.php?topic=8286.0) !!
Let's start:
Files to edit:
admin/validateimages.php
lang/yourlang/admin.php
1.1) Open admin/validateimages.php and find
<td class=\"tableseparator\">".$lang['validate_msg']."</td>\n
Add below:
<td class=\"tableseparator\">".$lang['validate_reasons']."</td>\n
1.2) Find:
echo "<td>".(($image_row['user_id'] != GUEST) ? "<textarea name=\"msg_list[".$image_row['image_id']."]\" id=\"msg\" rows=\"3\" cols=\"57\">".((isset($HTTP_POST_VARS['msg_list'][$image_row['image_id']])) ? stripslashes($HTTP_POST_VARS['msg_list'][$image_row['image_id']]) : "")."</textarea>" : "")."</td>";
Add below:
echo "<script>
// Erwartet die ID der Textarea als ersten und den einzufügenden Text als zweiten Parameter
function insertHTML(elementID, content) {
// Fügt über innerHTML den als zweiten Parameter übergebenen Text in die Textarea ein
document.getElementById(elementID).innerHTML += content;
}
</script>";
To insert the checkboxes, add below:
<td style=\"background-color:#F5F5F5; color:#0F5475;\">
<input type=\"checkbox\" onclick=\"insertHTML('msg[".$image_row['image_id']."]','Reason1')\" value=\"Reason1\" > Reason1<br>
<input type=\"checkbox\" onclick=\"insertHTML('msg[".$image_row['image_id']."]','Reason2')\" value=\"Reason2\" > Reason2
</td>\n
2.1) Open lang/yourlang/admin.php and search for ?>
Add above closing ?>:
$lang['validate_reasons'] = "Reasons";
3.1) Have fun :!: ;)
See also: http://www.cwcity.de/community/board/showthread_6_4_44552-In-javascript-onclick-Variable-benutzen.html (http://www.cwcity.de/community/board/showthread_6_4_44552-In-javascript-onclick-Variable-benutzen.html)
Regards,
Patrick