Step_1 (#post_step1) | Download attached package (#post_attachment). Extract files and upload them to your 4images folder, preserving this tree structure: admin/userfind.php admin/userfind.css |
Step_2 (#post_step2) | Open admin/admin_functions.php Find: Code: [Select] </head> Insert ABOVE: Code: [Select] <!-- Combo-handled YUI CSS files: --> |
Step_2.1 (#post_step2-1) | Find:function show_user_select_row($title, $user_id, $i = 0) { Replace it with:/* MOD ajax user select start replace function show_user_select_row($title, $user_id, $i = 0) { */ $user_id_name_input = "user_id"; if (isset($HTTP_POST_VARS['user_id_name_input'])) { $user_id_name_input = $HTTP_POST_VARS['user_id_name_input']; } if (isset($HTTP_POST_VARS['user_id_name_i'])) { $n = intval($HTTP_POST_VARS['user_id_name_i']); for ($i = 0; $i <= $n; $i++) { if (isset($HTTP_POST_VARS['user_id_name_'.$i])) { if (isset($HTTP_POST_VARS['user_id_name_array']) && $HTTP_POST_VARS['user_id_name_array']) { $HTTP_POST_VARS[$user_id_name_input][$i] = get_user_id_by_name($HTTP_POST_VARS['user_id_name_'.$i]); } else { $HTTP_POST_VARS[$user_id_name_input.'_'.$i] = get_user_id_by_name($HTTP_POST_VARS['user_id_name_'.$i]); } } } } elseif (isset($HTTP_POST_VARS['user_id_name'])) { $HTTP_POST_VARS[$user_id_name_input] = get_user_id_by_name($HTTP_POST_VARS['user_id_name']); } function get_user_id_by_name($user_name) { global $site_db, $user_table_fields; $sql = "SELECT ".get_user_table_field("", "user_id")." FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = '".$user_name."'"; $result = $site_db->query_firstrow($sql); return @$result['user_id']; } function show_user_select_row($title, $user_id, $i = "", $size = 0, $input = "user_id", $array = 0, $orig = 0, $full = 1) { global $error, $lang, $HTTP_POST_VARS, $site_db, $user_table_fields, $user_select_row_cache, $site_sess, $textinput_size; if ($orig) { return _show_user_select_row($title, $user_id, $i); } $user_id_name = ""; if (isset($error[$input.'_'.$i]) || isset($error[$input])) { $title = sprintf("<span class=\"marktext\">%s *</span>", $title); } if (!$size) { $size = $textinput_size; } if (!$user_id) { $user_id = 0; } $user_id_array = array($user_id); if (isset($HTTP_POST_VARS[$input.'_'.$i])) { $user_id_array[] = $HTTP_POST_VARS[$input.'_'.$i]; } elseif ($array && isset($HTTP_POST_VARS[$input][$i])) { $user_id_array[] = $HTTP_POST_VARS[$input][$i]; } elseif (isset($HTTP_POST_VARS[$input]) && !is_array($HTTP_POST_VARS[$input])) { $user_id_array[] = $HTTP_POST_VARS[$input]; } if (isset($HTTP_POST_VARS['user_id_name_'.$i])) { $user_id_name = stripslashes($HTTP_POST_VARS['user_id_name_'.$i]); } elseif (isset($HTTP_POST_VARS['user_id_name'])) { $user_id_name = stripslashes($HTTP_POST_VARS['user_id_name']); } $sql = "SELECT ".get_user_table_field("", "user_name")." FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_id")." IN (".implode(",", $user_id_array).")"; if ($result = $site_db->query_firstrow($sql)) { $user_id_name = $result['user_name']; } if ($full) { echo "<tr class=\"".get_row_bg()."\">\n<td><p class=\"rowtitle\">".$title."</p></td>\n"; echo "<td>\n"; } if ($input != "user_id") { echo "<input type=\"hidden\" name=\"user_id_name_input\" value=\"".$input."\">\n"; } echo "<input type=\"hidden\" name=\"user_id_name_array\" value=\"".$array."\">\n"; if ($i !== "") { echo "<input type=\"hidden\" name=\"user_id_name_i\" value=\"".$i."\">\n"; $i = "_".$i; } echo '<div class="yui-ac" style="width:'.($size/2).'em; padding-bottom:2em;">'; echo "<input type=\"text\" name=\"user_id_name".$i."\" id=\"user_id_name".$i."\" value=\"".format_text($user_id_name, 2)."\" size=\"".$size."\" style=\"width:".($size/2)."em;\" class=\"yui-ac-input\">\n"; echo ' <div id="usernameauto'.$i.'" class="yui-ac-container" style="width:'.($size/2).'em;"></div> </div> <script type="text/javascript" language="javascript"> YAHOO.example.BasicRemote = function() { // Use an XHRDataSource var oDS = new YAHOO.util.XHRDataSource("'.ROOT_PATH.'admin/userfind.php"); // Set the responseType oDS.responseType = YAHOO.util.XHRDataSource.TYPE_TEXT; // Define the schema of the delimited results oDS.responseSchema = { recordDelim: "\n", fieldDelim: "\t" }; // Enable caching oDS.maxCacheEntries = 10; // Instantiate the AutoComplete var oAC = new YAHOO.widget.AutoComplete("user_id_name'.$i.'", "usernameauto'.$i.'", oDS); // Enable type ahead oAC.typeAhead = false; // Enable a drop-shadow under the container element oAC.useShadow = true; // Display up to 30 results in the container oAC.maxResultsDisplayed = 30; return { oDS: oDS, oAC: oAC }; }(); </script>'; if ($full) { echo "</td>\n</tr>\n"; } } function _show_user_select_row($title, $user_id, $i = 0) { /* MOD ajax user select end replace */ |
1 (#post_tweak1). | If you want inline auto complete (automatically selects and enters first name from the list) then set to true in admin/admin_functions.php: Code: [Select] // Enable type ahead |
2 (#post_tweak2). | By default first 30 names will be showed. You can change that number in admin/admin_functions.php: Code: [Select] // Display up to 30 results in the container And in admin/userfind.php:Code: [Select] LIMIT 30"; |
but can I also integrate this in your Copy/Move/Edit MOD? When I hit submit searching for images using your MOD, it just shows a blank page forever. Is this also related with the large userbase?
Another page it doesn't seem to affect: Send email to users.Yes, send email doesn't use same function, and I don't see how it can be fixed without hustle for admin to type each name...
PS: Small typo in step 2: user_functions.php should be admin_functions.phpThanks