Skip to main content

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.
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


shows member thumb
Result of Modification


Good Day,


Comments

Popular posts from this blog

PHPMOTION JW Player SD/HD Integration.

jw player is really a great video player.it contains great features like it allows users to choose from SD/HD video. so user may play video as per his/her internet speed. in this post i am going to show how its possible to integrate jw player with its SD/HD options with phpmotion video script.

PHPMOTION VIDEOJS PLAYER INTEGRATION

videojs is the open source HTML5 video player. today we are going to see how videojs player can be integrated with phpmotion video script. some popular sites using videojs are  http://twitpic.com/  ,  http://telly.com/  ,  http://vine.co/  ,  http://www.theonion.com/  , http://web.mit.edu/   ,  https://www.airbnb.com/?cdn_locale_redirect=1

PHPMOTION JW Player Integration

phpmotion  is a popular video script.by default phpmotion uses flash player to show/play videos at home page as well as video play page.The JW Player is the Internet's most advanced and flexible media player. in this tutorial I am going to show how it is really easy to do phpmotion jw player integration.