/** * Given a string find the @ mentioned users. The return list is a valid * list of valid mentioned users. The list will be empty if the mentions * feature is disabled. * * @param string $p_text The text to process. * @return array with valid usernames as keys and their ids as values. */ function mention_get_users($p_text) { if (!mention_enabled()) { return array(); } $t_matches = mention_get_candidates($p_text); if (empty($t_matches)) { return array(); } $t_mentioned_users = array(); foreach ($t_matches as $t_candidate) { if ($t_user_id = user_get_id_by_name($t_candidate)) { if (false === $t_user_id) { continue; } $t_mentioned_users[$t_candidate] = $t_user_id; } } return $t_mentioned_users; }
<span class="textarea"> <textarea id="reminder" name="body" cols="85" rows="10"></textarea> </span> <span class="label-style"></span> </div> <span class="info-text"> <?php echo lang_get('reminder_explain') . ' '; if (ON == config_get('reminder_recipients_monitor_bug')) { echo lang_get('reminder_monitor') . ' '; } if (ON == config_get('store_reminders')) { echo lang_get('reminder_store'); } if (mention_enabled()) { echo '<br /><br />', sprintf(lang_get('reminder_mentions'), '<strong>' . mentions_tag() . user_get_field(auth_get_current_user_id(), 'username') . '</strong>'); } ?> </span> <span class="submit-button"> <input type="submit" class="button" value="<?php echo lang_get('bug_send_button'); ?> " /> </span> </fieldset> </form> </div>