PHPMOTION is great free video script but phpmotion script still missing some important features I am going to add this kind of missing features in my phpmotion series of tutorials.default installation of phpmotion only shows latest members name only.I am sure it will be great to show latest members avatar or thumb at home page.in todays tutorial I am going to show how its really easy to add latest members thumb at homepage.
PHPMOTION Add Latest Member Thumb |
files to update are as below.
01.index.php
02.themes/default/templates/inner_index.htm
Note : please take backup of above files before you proceed.
perform below steps to add this feature.
01.open index.php
goto
[code]
//latest member
$sql = "SELECT user_name, user_id FROM member_profile ORDER BY user_id desc";
$result = @mysql_query($sql);
$row = @mysql_fetch_row($result);
$newest_user_name = $row[0];
$newest_userid = $row[1];
[/code]
and add below code.
[code]
// Members Picture
$sql = "SELECT * FROM pictures WHERE user_id = $newest_userid";
$result1 = @mysql_query($sql);
if (@mysql_num_rows($result1) != 0) {
$result1 = @mysql_fetch_array($result1);
$result1_existing_file = $result1['file_name'];
$result1_approved = $result1['approved'];
if ($result1_approved == "yes") {
// show current picture
$result1_mypicture = $config['site_base_url'] . '/pictures/' . $result1_existing_file;
$image_thumb = $base_path . '/pictures/' . $result1_existing_file;
} else {
// show place holder image for image "awaiting approval"
$result1_mypicture = $config['site_base_url'] . "/themes/$user_theme/images/placeholder.gif";
$image_thumb = $base_path . "/themes/$user_theme/images/placeholder.gif";
}
} else {
// show place holder for no image uploaded by user at all
$result1_mypicture = $config['site_base_url'] . "/themes/$user_theme/images/placeholder.gif";
$image_thumb = $base_path . "/themes/$user_theme/images/placeholder.gif";
}
[/code]
02.open themes/default/templates/inner_index.htm
goto
[code]
<li>
<span class="stats-lable">[var.lang_newest_member]:</span>
[/code]
here comment or remove below code
[code]
<span class="stats-value"><!--[var.newest_user_name;comm]--></span>
[/code]
now add the below code
[code]
<div style="clear:both;width:120px;">
<div style="float:left;width:75px;"> <img src="[var.result1_mypicture]" width="70px"/> </div>
<div style="float:right;width:25px;font-weight:bold"> <!--[var.newest_user_name;comm]--></div>
</div>
[/code]
now that's it .
all the site visitors will see latest site member thumb as shown in below screen shot
Result of Modification |
Good Day,
Comments
Post a Comment
Hi, Thanks for the comment will try to reply at the earliest.
Good Day,
Hiren Patel
http://www.renruhak.org