1 Jan 2014

Published 10:51 by with 0 comment

PHPMOTION Add Latest Member's Thumb

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
PHPMOTION Add Latest Member Thumb

files to update are as below.

Note : please take backup of above files before you proceed.

perform below steps to add this feature.

01.open index.php


//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];

and add below 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";

02.open themes/default/templates/inner_index.htm

 <span class="stats-lable">[var.lang_newest_member]:</span>

   here comment or remove below code

   <span class="stats-value"><!--[var.newest_user_name;comm]--></span>

    now add the below 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>

    now that's it .

    all the site visitors will see latest site member thumb as shown in below screen shot

shows member thumb
Result of Modification

Good Day,

    email this       edit


Post a Comment

Hi, Thanks for the comment will try to reply at the earliest.

Good Day,
Hiren Patel