![]() |
protected void fillUserFromResultSet(User u, ResultSet rs) throws SQLException
{
...
u.setFirstName(rs.getString("first_name"));
u.setLastName(rs.getString("last_name"));
}
protected List processSelectAll(ResultSet rs) throws SQLException
{
...
u.setFirstName(rs.getString("first_name"));
u.setLastName(rs.getString("last_name"));
...
}
public User getLastUserInfo()
{
...
u.setUsername(rs.getString("username"));
u.setId(rs.getInt("user_id"));
u.setFirstName(rs.getString("first_name"));
u.setLastName(rs.getString("last_name"));
return u;
...
}
UserModel.selectAll = SELECT user_email, user_id, user_posts, user_regdate, username, deleted, user_karma, user_from, \
user_website, user_viewemail, first_name, last_name FROM jforum_users ORDER BY user_id
UserModel.selectAllByLimit = SELECT user_email, user_id, user_posts, user_regdate, username, deleted, user_karma, user_from, user_website, user_viewemail, first_name, last_name \
FROM jforum_users ORDER BY username LIMIT ?, ?
UserModel.selectAllByGroup = SELECT user_email, u.user_id, user_posts, user_regdate, username, deleted, user_karma, user_from, \
user_website, user_viewemail, first_name, last_name \
FROM jforum_users u, jforum_user_groups ug \
WHERE u.user_id = ug.user_id \
AND ug.group_id = ? \
ORDER BY user_id LIMIT ?, ?
UserModel.findByName = SELECT user_id, username, user_email, deleted, first_name, last_name FROM jforum_users WHERE UPPER(username) LIKE UPPER(?)
UserModel.update = UPDATE jforum_users SET user_aim = ?, \
user_avatar = ?,\
gender = ?, \
themes_id = ?,\
user_allow_pm = ?, \
user_allowavatar = ?, \
user_allowbbcode = ?, \
user_allowhtml = ?, \
user_allowsmilies = ?, \
user_email = ?, \
user_from = ?, \
user_icq = ?, \
user_interests = ?, \
user_occ = ?, \
user_sig = ?, \
user_website = ?, \
user_yim = ?, \
user_msnm = ?, \
user_password = ?, \
user_viewemail = ?, \
user_viewonline = ?, \
user_notify = ?, \
user_attachsig = ?, \
username = ?, \
user_lang = ?, \
user_notify_pm = ?, \
user_biography = ?, \
user_lastvisit = ?, \
user_notify_always = ?, \
user_notify_text = ?, \
rank_id = ?, \
first_name = ?, \
last_name = ? \
WHERE user_id = ?
UserModel.lastUserRegistered=SELECT user_id, username, first_name, last_name FROM jforum_users ORDER BY user_regdate DESC LIMIT 1
ForumModel.lastPostInfo = SELECT post_time, p.topic_id, t.topic_replies, post_id, u.user_id, username, first_name, last_name \
FROM jforum_posts p, jforum_users u, jforum_topics t , jforum_forums f \
WHERE t.forum_id = f.forum_id \
AND t.topic_id = p.topic_id \
AND f.forum_last_post_id = t.topic_last_post_id \
AND t.topic_last_post_id = p.post_id \
AND p.forum_id = ? \
AND p.user_id = u.user_id \
AND p.need_moderate = 0
TopicModel.topicPosters = SELECT user_id, username, user_karma, user_avatar, user_allowavatar, user_regdate, user_posts, user_icq, \
user_from, user_email, rank_id, user_sig, user_attachsig, user_viewemail, user_msnm, user_yim, user_website, user_sig, user_aim, first_name, last_name \
FROM jforum_users \
WHERE user_id IN (:ids:)
TopicModel.getUserInformation = SELECT user_id, username, first_name, last_name FROM jforum_users WHERE user_id IN (#ID#)
SearchModel.getPostsDataForLucene = SELECT p.post_id, p.forum_id, p.topic_id, p.user_id, u.username, p.enable_bbcode, p.enable_smilies, p.post_time, pt.post_subject, pt.post_text, t.topic_title, u.first_name, u.last_name \
FROM jforum_posts p, jforum_posts_text pt, jforum_users u, jforum_topics t \
WHERE p.post_id IN (:posts:) \
AND p.post_id = pt.post_id \
AND p.topic_id = t.topic_id \
AND p.user_id = u.user_Id
PrivateMessageModel.baseListing = SELECT pm.privmsgs_type, pm.privmsgs_id, pm.privmsgs_date, pm.privmsgs_subject, u.user_id, u.username, u.first_name, u.last_name \
FROM jforum_privmsgs pm, jforum_users u \
#FILTER# \
ORDER BY pm.privmsgs_date DESC
ModerationModel.topicsByForum = SELECT p.post_id, t.topic_id, t.topic_title, t.topic_replies, p.user_id, enable_bbcode, p.attach, \
enable_html, enable_smilies, pt.post_subject, pt.post_text, username, first_name, last_name \
FROM jforum_posts p, jforum_posts_text pt, jforum_users u, jforum_topics t \
WHERE p.post_id = pt.post_id \
AND p.topic_id = t.topic_id \
AND t.forum_id = ? \
AND p.user_id = u.user_id \
AND p.need_moderate = 1 \
ORDER BY t.topic_id, post_time ASC
ModerationLog.selectAll = SELECT l.*, u.username, u2.username AS poster_username, u2.first_name AS poster_first_name, u2.last_name AS poster_last_name FROM jforum_moderation_log l \
LEFT JOIN jforum_users u2 ON u2.user_id = l.post_user_id \
LEFT JOIN jforum_users u ON l.user_id = u.user_id \
ORDER BY log_id DESC \
LIMIT ?, ?
public String getName()
{
String defaultLang = SystemGlobals.getValue(ConfigKeys.I18N_DEFAULT);
if ((this.lang != null && this.lang.startsWith("zh")) || defaultLang.startsWith("zh")) {
return this.lastName + this.firstName;
} else {
return this.firstName + " " + this.lastName;
}
}
public UserSession(UserSession us)
{
...
this.name = us.getName();
...
}
public void dataToUser(User user)
{
...
this.setName(user.getName());
...
}
public UserSession selectById(UserSession us, Connection conn)
{
...
if (rs.next()) {
returnUs.setSessionTime(rs.getLong("session_time"));
returnUs.setStartTime(rs.getTimestamp("session_start"));
found = true;
}
rs.close();
rs = null;
p.close();
p = null;
p = conn.prepareStatement(SystemGlobals.getSql("UserModel.selectById"));
p.setInt(1, us.getUserId());
rs = p.executeQuery();
if (rs.next()) {
String defaultLang = SystemGlobals.getValue(ConfigKeys.I18N_DEFAULT);
String lang = returnUs.getLang();
if ((lang != null && lang.startsWith("zh")) || defaultLang.startsWith("zh")) {
returnUs.setName(rs.getString("last_name")+rs.getString("first_name"));
} else {
returnUs.setName(rs.getString("first_name") + " " + rs.getString("last_name"));
}
}
return (found ? returnUs : null);
}
...
}
public static synchronized void updateForumStats(Topic t, User u, Post p)
{
...
lpi.setUsername(u.getUsername());
lpi.setName(u.getName());
forum.setLastPostInfo(lpi);
...
}
private LastPostInfo getLastPostInfo(int forumId, boolean tryFix)
{
...
if (rs.next()) {
...
String defaultLang = SystemGlobals.getValue(ConfigKeys.I18N_DEFAULT);
if (defaultLang.startsWith("zh")) {
lpi.setName(rs.getString("last_name")+ rs.getString("first_name"));
} else {
lpi.setName(rs.getString("first_name")+ " " + rs.getString("last_name"));
}
...
}
public void edit()
{
...
this.context.put("u", u);
this.context.put("action", "editSave");
this.context.put("pageTitle", I18n.getMessage("UserProfile.profileFor") + " " + u.getName());
...
}
public void profile()
{
...
this.context.put("pageTitle", I18n.getMessage("UserProfile.allAbout")+" "+u.getName());
...
}
public List fillTopicsData(PreparedStatement p)
{
...
while (rs.next()) {
User u = new User();
u.setId(rs.getInt("user_id"));
u.setUsername(rs.getString("username"));
u.setFirstName(rs.getString("first_name"));
u.setLastName(rs.getString("last_name"));
users.put(new Integer(rs.getInt("user_id")), u);
}
...
for (Iterator iter = l.iterator(); iter.hasNext();) {
Topic t = (Topic) iter.next();
t.setPostedBy((User)users.get(new Integer(t.getPostedBy().getId())));
t.setLastPostBy((User)users.get(new Integer(t.getLastPostBy().getId())));
}
...
}
public Map topicPosters(int topicId)
{
...
u.setSignature(rs.getString("user_sig"));
u.setFirstName(rs.getString("first_name"));
u.setLastName(rs.getString("last_name"));
m.put(new Integer(u.getId()), u);
...
}
public List selectFromInbox(User user)
{
...
fromUser.setFirstName(rs.getString("first_name"));
fromUser.setLastName(rs.getString("last_name"));
...
}
public List selectFromSent(User user)
{
...
toUser.setFirstName(rs.getString("first_name"));
toUser.setLastName(rs.getString("last_name"));
...
}
public void sendTo()
{
...
this.context.put("toUsername", recipient.getName());
this.context.put("pageTitle", I18n.getMessage("PrivateMessage.title")
+ " " + I18n.getMessage("PrivateMessage.to")
+ " " + recipient.getName());
...
}
public void quote()
{
...
this.context.put("quote", "true");
this.context.put("quoteUser", pm.getFromUser().getNickname());
this.context.put("post", pm.getPost());
...
}
public List getPostsData(int[] postIds)
{
...
while (rs.next()) {
Post post = this.makePost(rs);
post.setPostUsername(rs.getString("username"));
String lang = SystemGlobals.getValue(ConfigKeys.I18N_DEFAULT);
if (lang.startsWith("zh")) {
post.setAuthorName(rs.getString("last_name") + rs.getString("first_name"));
} else {
post.setAuthorName(rs.getString("first_name") + " " + rs.getString("last_name"));
}
l.add(post);
}
...
}
public void quote()
{
...
this.context.put("quoteUser", u.getName());
...
}
public void listByUser()
{
...
this.context.put("pageTitle", I18n.getMessage("PostShow.userPosts") + " " + u.getName());
...
}
public void showTopicsByUser()
{
...
this.context.put("pageTitle", I18n.getMessage("ForumListing.userTopics") + " " + u.getName());
...
}
public void showTopicsByUser()
{
...
this.context.put("u", u);
this.context.put("pageTitle", I18n.getMessage("ForumListing.userTopics") + " " + u.getNickname());
...
}
protected Post getPost(ResultSet rs) throws SQLException
{
Post p = new Post();
p.setPostUsername(rs.getString("username"));
String lang = SystemGlobals.getValue(ConfigKeys.I18N_DEFAULT);
if (lang.startsWith("zh")) {
p.setAuthorName(rs.getString("last_name") + rs.getString("first_name"));
} else {
p.setAuthorName(rs.getString("first_name") + " " + rs.getString("last_name"));
}
p.setId(rs.getInt("post_id"));
p.setUserId(rs.getInt("user_id"));
p.setBbCodeEnabled(rs.getInt("enable_bbcode") == 1);
p.setHtmlEnabled(rs.getInt("enable_html") == 1);
p.setSmiliesEnabled(rs.getInt("enable_smilies") == 1);
p.setSubject(rs.getString("post_subject"));
p.setText(this.getPostTextFromResultSet(rs));
return p;
}
private void addUser()
{
User u = DataAccessDriver.getInstance().newUserDAO().selectById(
this.request.getIntParameter("relation_id"));
String title = u.getName();
...
}
public void list()
{
...
this.context.put("pageTitle", I18n.getMessage("Bookmarks.for")+" "+u.getName());
}