[x] Navigation

[x] Wer ist wo
 Bots:
1: Google > Forum 9.x
 Visitors:
1: Forum 9.x

[x] Languages

[x] Design
Each user can view the site with a different theme.
Themes marked with a * also change the forum look.

[x] Downloads (Top)

Avatar bei Gallery Kommentaren
Post new topic   Reply to topic   Printer Friendly Page    Forum Index > > HowTo & Allgemeine Fragen

Author Message
clubhouse
Special-Agent


Joined: Nov 04, 2004
Posts: 478
Location: Eine Insel mit 2 Bergen

PostPost subject: Avatar bei Gallery Kommentaren
Posted: 08.01.2009 17:43
Reply with quote

Moin, weiß jemand wie ich bei den Kommentaren in der Bildergallery den Avatar mit einbauen kann?

Es muss aufjedenfall was über die SQL abfrage sein, Sprich der Avatar muss über den Username ausgewählt werden.

Ich weiß leider nicht wie ich das machen kann... irgendwas mit LEFT JOIN in der Datenbank abfrage... aber wie?

Hier mal der Code, der z.Z in der displayimage.php steht, die sql abfrage muss so abgeändert werden das er den Avatar über den username ausgibt:

Array:
// Displays comments for a specific picture
function html_comments($pid)
{
	global $CONFIG, $USER, $CURRENT_ALBUM_DATA, $username, $user_avatar,$FAVPICS,$CURRENT_PIC_DATA,$THEME_DIR;
	global $template_image_comments, $template_add_your_comment, $db;
	$html = '';
	if (!$CONFIG['enable_smilies']) {
		$tmpl_comment_edit_box = template_extract_block($template_image_comments, 'edit_box_no_smilies', '{EDIT}');
		template_extract_block($template_image_comments, 'edit_box_smilies');
		template_extract_block($template_add_your_comment, 'input_box_smilies');
	} else {
		$tmpl_comment_edit_box = template_extract_block($template_image_comments, 'edit_box_smilies', '{EDIT}');
		template_extract_block($template_image_comments, 'edit_box_no_smilies');
		template_extract_block($template_add_your_comment, 'input_box_no_smilies');
	}
	$tmpl_comments_buttons = template_extract_block($template_image_comments, 'buttons', '{BUTTONS}');
	$tmpl_comments_ipinfo = template_extract_block($template_image_comments, 'ipinfo', '{IPINFO}');
	$result = $db->sql_query("SELECT msg_id, msg_author, msg_body, msg_date, author_id, author_md5_id, msg_raw_ip, msg_hdr_ip FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='$pid' ORDER BY msg_id ASC",false, __FILE__,__LINE__);

while ($row = $db->sql_fetchrow($result)) {
		$user_can_edit = (GALLERY_ADMIN_MODE || (USER_ID > 1 && USER_ID == $row['author_id'] && USER_CAN_POST_COMMENTS) || (USER_ID < 2 && USER_CAN_POST_COMMENTS && $USER['ID'] == $row['author_md5_id']));
		$comment_buttons = $user_can_edit ? $tmpl_comments_buttons : '';
		$comment_edit_box = $user_can_edit ? $tmpl_comment_edit_box : '';
		$comment_ipinfo = ($row['msg_raw_ip'] && GALLERY_ADMIN_MODE)?$tmpl_comments_ipinfo : '';
		if ($CONFIG['enable_smilies']) {
			$comment_body = set_smilies(make_clickable($row['msg_body']));
			$smilies = smilies_table('onerow', 'msg_body', "f{$row['msg_id']}");
		} else {
			$comment_body = make_clickable($row['msg_body']);
			$smilies = '';
		}
		$params = array('{EDIT}' => &$comment_edit_box,
			'{BUTTONS}' => &$comment_buttons,
			'{IPINFO}' => &$comment_ipinfo
		);
		$template = template_eval($template_image_comments, $params);
		$info = '';
		if (!in_array($pid, $FAVPICS)) {
			$info = '<a href="' . getlink('&amp;file=addfav&amp;pid=' . $CURRENT_PIC_DATA['pid']) . '" >' . ADDFAV . '</a>';
		} else {
			$info = '<a href="' . getlink('&amp;file=addfav&amp;pid=' . $CURRENT_PIC_DATA['pid']) . '" >' . REMFAV . '</a>';
		}

//Comment Avatar

$poster_avatar = '';
	if ( $row['user_avatar_type'] && $row['user_allowavatar'] ) {
		switch( $row['user_avatar_type'] )
		{
			case "1":
				$poster_avatar = '<img src="uploads/avatars/' . $row['user_avatar'] . '" alt="" border="0" width="50"/><br/>';
				break;
			case "2":
				$poster_avatar = '<img src="' . $row['user_avatar'] . '" alt="" border="0" width="50"/><br/>';
				break;
			case "3":
				$poster_avatar = '<img src="/images/avatars/' . $row['user_avatar'] . '" alt="" border="0" width="50"/><br/>';
				break;
		}
	}

		$params = array('{MSG_AUTHOR}' => $row['msg_author'],
			'{MSG_ID}' => $row['msg_id'],
			'{MSG_TYPE}' => GALLERY_ADMIN_MODE ? 'text' : 'hidden',
			'{EDIT_TITLE}' => COM_EDIT_TITLE,
			'{CONFIRM_DELETE}' => CONFIRM_DELETE_COM,
			'{DELETE_LINK}' => getlink("&file=delete"),
			'{DELETE_TEXT}' => DELETE.' '.COMMENT,
			'{MSG_DATE}' => localised_date($row['msg_date'], COMMENT_DATE_FMT),
			'{MSG_BODY}' => &$comment_body,
			'{MSG_AVATAR}' => &$poster_avatar,
			'{MSG_BODY_RAW}' => $row['msg_body'],
			'{OK}' => OK,
			'{SMILIES}' => $smilies,
			'{HDR_IP}' => decode_ip($row['msg_hdr_ip']),
			'{RAW_IP}' => decode_ip($row['msg_raw_ip']),
			'{ACTION}' => 'action="'.getlink('&file=db_input').'" enctype="multipart/form-data" accept-charset="utf-8"',
			'{ADDFAVLINK}' => getlink("&file=addfav&pid=$pid"),
			'{ADDFAVTEXT}' => $info,
			'{THEMEDIR}' => $THEME_DIR,

		);
		$html .= template_eval($template, $params);
	}
	if (USER_CAN_POST_COMMENTS && $CURRENT_ALBUM_DATA['comments']) {
		if (USER_ID > 1) {
			$username_input = '<input type="hidden" name="msg_author" value="' . CPG_USERNAME . '" />';
			template_extract_block($template_add_your_comment, 'username_input', $username_input);
			// $username = '';
		} else {
			$username = isset($USER['name']) ? '"' . htmlprepare($USER['name']) . '"' : '"' . YOUR_NAME . '" onclick="javascript:this.value=\'\';"';
		}
		if (!in_array($pid, $FAVPICS)) {
			$info = '<a href="' . getlink('&amp;file=addfav&amp;pid=' . $CURRENT_PIC_DATA['pid']) . '" >' . ADDFAV . '</a>';
		} else {
			$info = '<a href="' . getlink('&amp;file=addfav&amp;pid=' . $CURRENT_PIC_DATA['pid']) . '" >' . REMFAV . '</a>';
		}
		$params = array('{ADD_YOUR_COMMENT}' => ADD_YOUR_COMMENT,
			// Modified Name and comment field
			'{NAME}' => COM_NAME,
			'{COMMENT}' => COMMENT,
			'{PIC_ID}' => $pid,
			'{username}' => $username,
			'{MAX_COM_LENGTH}' => $CONFIG['max_com_size'],
			'{OK}' => OK,
			'{SMILIES}' => '',
			'{ACTION}' => 'action="'.getlink("&file=db_input").'" enctype="multipart/form-data" accept-charset="utf-8"',
			'{ADDFAVLINK}' => getlink("&file=addfav&pid=$pid"),
			'{ADDFAVTEXT}' => $info

		);
		if ($CONFIG['enable_smilies']) $params['{SMILIES}'] = smilies_table('onerow', 'message', 'post');
//		if ($CONFIG['enable_smilies']) $params['{SMILIES}'] = generate_smilies();
		$html .= template_eval($template_add_your_comment, $params);
	}
	if (USER_ID > 1 or $CONFIG['allow_anon_fullsize'] or USER_IS_ADMIN) {
		return $html;
	}
}


_________________


clubhouse's Serverdaten - verwendete Vers. (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux Debian 4.0 / PHP 5.2.0-8+etch13 / SQL 5.0.32 / CMS 9.2.1
Back to top
View user's profile Visit poster's website ICQ Number
clubhouse
Special-Agent


Joined: Nov 04, 2004
Posts: 478
Location: Eine Insel mit 2 Bergen

PostPost subject: Re: Avatar bei Gallery Kommentaren
Posted: 08.01.2009 17:44
Reply with quote

achja, hier mal nen link wie es aussehen soll, unten bei den Kommentaren, links neben den Eintrag soll das Bild das User erscheinen

emsland-partys.de/copp...esign.html

_________________


clubhouse's Serverdaten - verwendete Vers. (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux Debian 4.0 / PHP 5.2.0-8+etch13 / SQL 5.0.32 / CMS 9.2.1
Back to top
View user's profile Visit poster's website ICQ Number
clubhouse
Special-Agent


Joined: Nov 04, 2004
Posts: 478
Location: Eine Insel mit 2 Bergen

PostPost subject: Re: Avatar bei Gallery Kommentaren
Posted: 13.01.2009 15:39
Reply with quote

mh habs schon. hochgeladen auf der englischen seite
_________________


clubhouse's Serverdaten - verwendete Vers. (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux Debian 4.0 / PHP 5.2.0-8+etch13 / SQL 5.0.32 / CMS 9.2.1
Back to top
View user's profile Visit poster's website ICQ Number
Display posts from previous:   
Post new topic   Reply to topic   Printer Friendly Page    Forum Index > > HowTo & Allgemeine Fragen
Page 1 of 1
All times are GMT + 1 Hour



Jump to:  


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum




Interactive software released under GNU GPL, Code Credits, Privacy Policy