[RC] Avatar in view forum แสดงรูป avatar หน้า forum

แนะนำ Mod ต่างๆ ของ PHPBB3 แนะนำความสามารถ ของ mod การติดตั้ง การเข้ากันได้กับเวอร์ชั่น

Moderator: mindphp

User avatar
M009
PHP Super Member
PHP Super Member
Posts: 205
Joined: 23/04/2013 10:57 am

[RC] Avatar in view forum แสดงรูป avatar หน้า forum

Post by M009 »

รายละเอียดเกี่ยวกับ [RC1] Avatar in view forum
พัฒนาโดย : primehalo
Version : 1.0
phpBB Version(s) : phpBB 3.0 ขึ้นไป
ดาวน์โหลดได้ที่ : https://www.phpbb.com/community/viewtop ... 2156131url
avtarforum.jpg
avtarforum.jpg (34.58 KiB) Viewed 1043 times
เปิดไฟล์: viewforum.php
ค้นหา

Code: Select all

		// Send vars to template
		$template->assign_block_vars('topicrow', array(
เติมก่อน

Code: Select all

// Topic user avatar by vinaphpbb.com
$sqlavt = 'SELECT *
	FROM ' . USERS_TABLE . '
		WHERE user_id = ' . $row['topic_poster'];
$resultavt = $db->sql_query($sqlavt);	
	$rowavt = $db->sql_fetchrow($resultavt);
	$u_avt = $rowavt['user_avatar'];
	$u_avt_type = $rowavt['user_avatar_type'];
	$u_avt_w = 40;
	$u_avt_h = 40;
	
// Topic user avatar by vinaphpbb.com
ค้นหา

Code: Select all

			'FIRST_POST_TIME'			=> $user->format_date($row['topic_time']),
เติมก่อน

Code: Select all

// Topic user avatar by vinaphpbb.com
    		'TOPIC_AUTHOR_AVATAR_SRC'        =>($user->optionget('viewavatars')) ? get_user_avatar_src($u_avt, $u_avt_type, $u_avt_w, $u_avt_h) : '',		
// Topic user avatar by vinaphpbb.com
เปิดไฟล์: includes/functions_display.php
ค้นหา

Code: Select all

?>
เติมก่อน

Code: Select all

// Topic user avatar by vinaphpbb.com
function get_user_avatar_src($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR', $ignore_config = false)
{
	global $user, $config, $phpbb_root_path, $phpEx;

	if (empty($avatar) || !$avatar_type || (!$config['allow_avatar'] && !$ignore_config))
	{
		return '';
	}

	$avatar_img = '';

	switch ($avatar_type)
	{
		case AVATAR_UPLOAD:
			if (!$config['allow_avatar_upload'] && !$ignore_config)
			{
				return '';
			}
			$avatar_img = $phpbb_root_path . "download/file.$phpEx?avatar=";
		break;

		case AVATAR_GALLERY:
			if (!$config['allow_avatar_local'] && !$ignore_config)
			{
				return '';
			}
			$avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
		break;

		case AVATAR_REMOTE:
			if (!$config['allow_avatar_remote'] && !$ignore_config)
			{
				return '';
			}
		break;
	}

	$avatar_img .= $avatar;
	return str_replace(' ', '%20', $avatar_img);
}
// Topic user avatar by vinaphpbb.com
เปิดไฟล์: styles/prosilver/template/overall_header.html
ค้นหา

Code: Select all

</head>
เติมก่อน

Code: Select all

<!-- jQuery topic user avatar by vinaphpbb.com -->
<script type="text/javascript">
$(document).ready(function(){
  $(".rounded").load(function() {
    $(this).wrap(function(){
      return '<span class="' + $(this).attr('class') + '" style="background:url(' + $(this).attr('src') + ') no-repeat center center; width: ' + $(this).width() + 'px; height: ' + $(this).height() + 'px;" />';
    });
    $(this).css("opacity","0");
  });
});
</script> 
<!-- jQuery topic user avatar by vinaphpbb.com -->
เปิดไฟล์: styles/prosilver/template/viewforum_body.html
ค้นหา

Code: Select all

		<li class="row<!-- IF topicrow.S_ROW_COUNT is even --> bg1<!-- ELSE --> bg2<!-- ENDIF --><!-- IF topicrow.S_POST_GLOBAL --> global-announce<!-- ENDIF --><!-- IF topicrow.S_POST_ANNOUNCE --> announce<!-- ENDIF --><!-- IF topicrow.S_POST_STICKY --> sticky<!-- ENDIF --><!-- IF topicrow.S_TOPIC_REPORTED --> reported<!-- ENDIF -->">
			<dl class="icon" style="background-image: url({topicrow.TOPIC_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
				<dt<!-- IF topicrow.TOPIC_ICON_IMG and S_TOPIC_ICONS --> style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF --> title="{topicrow.TOPIC_FOLDER_IMG_ALT}"><!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
					<!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --><a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a> <!-- ENDIF -->
					<!-- IF topicrow.S_TOPIC_REPORTED --><a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --><br />
					<!-- IF topicrow.PAGINATION --><strong class="pagination"><span>{topicrow.PAGINATION}</span></strong><!-- ENDIF -->
					<!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->{L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} &raquo; {topicrow.FIRST_POST_TIME}
				</dt>
				<dd class="posts">{topicrow.REPLIES} <dfn>{L_REPLIES}</dfn></dd>
				<dd class="views">{topicrow.VIEWS} <dfn>{L_VIEWS}</dfn></dd>
				<dd class="lastpost"><span><dfn>{L_LAST_POST} </dfn>{L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL}
					<a href="{topicrow.U_LAST_POST}">{LAST_POST_IMG}</a> <br />{topicrow.LAST_POST_TIME}</span>
				</dd>
			</dl>
		</li>
แทนนที่

Code: Select all

<!-- Topic user avatar by vinaphpbb.com -->
		<li class="row<!-- IF topicrow.S_ROW_COUNT is even --> bg1<!-- ELSE --> bg2<!-- ENDIF --><!-- IF topicrow.S_POST_GLOBAL --> global-announce<!-- ENDIF --><!-- IF topicrow.S_POST_ANNOUNCE --> announce<!-- ENDIF --><!-- IF topicrow.S_POST_STICKY --> sticky<!-- ENDIF --><!-- IF topicrow.S_TOPIC_REPORTED --> reported<!-- ENDIF -->">
			<dl>
				<dd><a href="{topicrow.U_TOPIC_AUTHOR}" class="rounded"><img src="{topicrow.TOPIC_AUTHOR_AVATAR_SRC}" alt="{topicrow.TOPIC_AUTHOR}" title="{topicrow.TOPIC_AUTHOR}" height="48" width="48"></a></dd>			
				<dt title="{topicrow.TOPIC_FOLDER_IMG_ALT}"><!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><!-- IF topicrow.TOPIC_ICON_IMG and S_TOPIC_ICONS --><img src="{T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}"> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
					<!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --><a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a> <!-- ENDIF -->
					<!-- IF topicrow.S_TOPIC_REPORTED --><a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --><br />
					<!-- IF topicrow.PAGINATION --><strong class="pagination"><span>{topicrow.PAGINATION}</span></strong><!-- ENDIF -->
					<!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->{L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} &raquo; {topicrow.FIRST_POST_TIME}
				</dt>
				<dd class="posts">{topicrow.REPLIES} <dfn>{L_REPLIES}</dfn></dd>
				<dd class="views">{topicrow.VIEWS} <dfn>{L_VIEWS}</dfn></dd>
				<dd class="lastpost"><span><dfn>{L_LAST_POST} </dfn>{L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL}
					<a href="{topicrow.U_LAST_POST}">{LAST_POST_IMG}</a> <br />{topicrow.LAST_POST_TIME}</span>
				</dd>
			</dl>
		</li>
<!-- Topic user avatar by vinaphpbb.com -->
เปิดไฟล์: styles/prosilver/theme/common.css
ค้นหา

Code: Select all

.clear {
	display: block;
	clear: both;
	font-size: 1px;
	line-height: 1px;
	background: transparent;
}
เติมหลัง

Code: Select all

/* CSS Topic user avatar by vinaphpbb.com */
.rounded {
	display: inline-block;
	border: solid 2px #fff;
	overflow: hidden;
	-webkit-border-radius: 10px;
	-moz-border-radius: 10px;
	border-radius: 10px;
	-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
	-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
	box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}
จากนั้นเคลียล์แคช และ Refresh เทมเพลต ACP
  • Similar Topics
    Replies
    Views
    Last post

Return to “PHPBB3.0 Mod Review”

Who is online

Users browsing this forum: No registered users and 2 guests