http://www.icyphoenix.com/viewtopic.php?f=24&t=1780
-----------------------------------
krisbfunk
Sun 29 Apr, 2007 22:39

Consistant Pic_detail Forum Wide
-----------------------------------
I modified the formatting of the pic_detail in album_cat_body.tpl and want it to be consistant forum wide, but I can't seem to find the pic_detail section for album_allpics, which tpl file is it located in? I thought it was in album_box.tpl, but don't see similar code there.


-----------------------------------
Artie
Mon 30 Apr, 2007 00:55

Re: Consistant Pic_detail Forum Wide
-----------------------------------
I'm pretty sure it's [b]album_memberlist_body.tpl[/b]


-----------------------------------
krisbfunk
Mon 30 Apr, 2007 02:37

Re: Consistant Pic_detail Forum Wide
-----------------------------------
ok, it is. I'd like to add a 'Poster' feild in there, can you help with that?


-----------------------------------
Artie
Mon 30 Apr, 2007 21:18

Re: Consistant Pic_detail Forum Wide
-----------------------------------
Give this a try.

OPEN [b]templates/YOUR TEMPLATE/album_memberlist_body.tpl[/b]

FIND
[codeblock]{L_PIC_ID}: {picrow.pic_detail.PIC_ID}<br />
			[/codeblock]
AFTER ADD
[codeblock]{L_POSTER}: {picrow.pic_detail.POSTER}<br />[/codeblock]

OPEN [b]album_allpics.php[/b]

FIND
[codeblock]$list_sql = "SELECT DISTINCT(p.pic_id), ct.cat_user_id, ct.cat_id, ct.cat_title, p.pic_title, p.pic_desc, p.pic_user_id, p.pic_user_ip, p.pic_time, p.pic_view_count, p.pic_lock, p.pic_filename, p.pic_thumbnail, r.rate_pic_id,
						AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments, MAX(c.comment_id) as new_comment
					FROM ".ALBUM_TABLE. " AS p
						LEFT JOIN ".ALBUM_RATE_TABLE." AS r ON p.pic_id = r.rate_pic_id
						LEFT JOIN ".ALBUM_COMMENT_TABLE." AS c ON p.pic_id = c.comment_pic_id
						LEFT JOIN ".ALBUM_CAT_TABLE." AS ct ON p.pic_cat_id = ct.cat_id					
					          WHERE ct.cat_id IN ($allowed_cat)
					GROUP BY p.pic_id
					ORDER BY $sort_method $sort_order
					LIMIT $limit_sql";[/codeblock]
REPLACE WITH
[codeblock]$list_sql = "SELECT DISTINCT(p.pic_id), ct.cat_user_id, ct.cat_id, ct.cat_title, p.pic_title, p.pic_desc, p.pic_user_id, p.pic_user_ip, p.pic_time, p.pic_view_count, p.pic_lock, p.pic_filename, p.pic_thumbnail, r.rate_pic_id,
						AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments, MAX(c.comment_id) as new_comment, u.username AS username
					FROM ".ALBUM_TABLE. " AS p
						LEFT JOIN ".ALBUM_RATE_TABLE." AS r ON p.pic_id = r.rate_pic_id
						LEFT JOIN ".ALBUM_COMMENT_TABLE." AS c ON p.pic_id = c.comment_pic_id
						LEFT JOIN ".ALBUM_CAT_TABLE." AS ct ON p.pic_cat_id = ct.cat_id					
					LEFT JOIN ".USERS_TABLE." AS u ON p.pic_user_id = u.user_id
          WHERE ct.cat_id IN ($allowed_cat)
					GROUP BY p.pic_id
					ORDER BY $sort_method $sort_order
					LIMIT $limit_sql";[/codeblock]


FIND
[codeblock]$image_cat_url = append_sid(album_append_uid($album_page_url . '?cat_id=' . $picrow[$j]['cat_id'] . '&amp;user_id=' . $picrow[$j]['cat_user_id']));[/codeblock]
AFTER ADD
[codeblock]	if( ($picrow[$j]['pic_user_id'] == ALBUM_GUEST) || ($picrow[$j]['username'] == '') )
				{
					$pic_poster = ($picrow[$j]['pic_username'] == '') ? $lang['Guest'] : $picrow[$j]['pic_username'];
				}
				else
				{
					$pic_poster = '<a href="'. append_sid(PROFILE_MG . '?mode=viewprofile&amp;' . POST_USERS_URL .'='. $picrow[$j]['pic_user_id']) .'">'. $picrow[$j]['username'] .'</a>';
				}[/codeblock]

FIND
[codeblock]'TITLE' => $picrow[$j]['pic_title'],[/codeblock]
AFTER ADD
[codeblock]'POSTER' => $pic_poster,[/codeblock]


FIND
[codeblock]'L_PICTURES_OF_USER' => $list_title,[/codeblock]
AFTER ADD
[codeblock]
'L_POSTER' => $lang['Pic_Poster'],[/codeblock]

[highlight=#FFFFAA]album_mod/album_memberlist.php[/highlight] also uses this same tpl file (for all pics of user)...I suspect it is very similar to album_allpics.php, but I did not check....so if you want the poster name here, you will need to modify it as well


