SocialEngine GumPercentage

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    SocialEngine GumPercentage

    This mod shows percentage of your profile, how many fields are filled.
    see screenshot.

    Here are the install instructions:

    open include/class_user.php

    find:
    PHP Code:
    function &getProfileValues($user_id) 
    and after:
    PHP Code:
    $user_profiles[$user_id] = $database->database_fetch_assoc($resource); 
    add this code:
    PHP Code:
               $count_values = 1; 
               
    $filled = 1; 
                
               for(
    $i=2;$i<100;$i++) 
               { 
                   if(isset(
    $user_profiles[$user_id]['profilevalue_'.$i.''])) 
                   { 
                    
    $count_values++; 
                       if(!empty(
    $user_profiles[$user_id]['profilevalue_'.$i.''])) 
                       { 
                        
    $filled++; 
                       } 
                 
                    } 
                } 
                
    $user_profiles[$user_id]['percentage_filled'] = round(($filled/$count_values)*100); 
    then open templates/profile.tpl
    and add after the photo table, this code.
    PHP Code:
    {* SHOW PERCENTAGE GUM*} 

    <
    div class="gum_percent"> 

        {if 
    $owner->profile_info.percentage_filled >= 70 } 

            <
    div class="gum_percent_green"> 

                <
    div class="gum_percent_green_percent" style="width:{$owner->profile_info.percentage_filled}%;"></div> 

                <
    div class="gum_percent_green_text">{$owner->profile_info.percentage_filled}% </div> 

            </
    div>  



        {elseif 
    $owner->profile_info.percentage_filled >= 40 } 

            <
    div class="gum_percent_yellow"> 

                <
    div class="gum_percent_yellow_percent" style="width:{$owner->profile_info.percentage_filled}%;"></div> 

                <
    div class="gum_percent_yellow_text">{$owner->profile_info.percentage_filled}%</div> 

            </
    div>  

        {else} 

            <
    div class="gum_percent_red"> 

                <
    div class="gum_percent_red_percent" style="width:{$owner->profile_info.percentage_filled}%;"></div> 

                <
    div class="gum_percent_red_text">{$owner->profile_info.percentage_filled}%</div> 

            </
    div>  

        {/if} 

    </
    div> 
    open styles.css
    and add this style to it:
    PHP Code:
    /* GUM PERCENT */ 
    .gum_percent { 
    width:100%; 
    background-color: #eeeeee; 
    font-weight:bold; 
    height: 20px; 
    line-height: 22px; 
    } 

    .
    gum_percent_green { 
     
    position:relative; 
     
    border-top:1px solid #769C25; 
     
    width: 100%; 
    } 
    .
    gum_percent_green_percent { 
     
    background-color: #C7E38A; 
     
    height: 19px; 
     
    position: absolute; 
     
    top: 0px; 
     
    left: 0px; 
    } 
    .
    gum_percent_green_text { 
     
    position: absolute; 
     
    color: #769C25; 
     
    text-align: center; 
     
    width: 100%; 
    } 

    .
    gum_percent_yellow { 
     
    position:relative; 
     
    border-top:1px solid #ffcc33; 
     
    width: 100%; 
    } 
    .
    gum_percent_yellow_percent { 
     
    background-color: #ffff66; 
     
    height: 19px; 
     
    position: absolute; 
     
    top: 0px; 
     
    left: 0px; 
    } 
    .
    gum_percent_yellow_text { 
     
    position: absolute; 
     
    color: #EC9933; 
     
    text-align: center; 
     
    width: 100%; 
    } 

    .
    gum_percent_red { 
     
    position:relative; 
     
    border-top:1px solid #CC6666; 
     
    width: 100%; 
    } 
    .
    gum_percent_red_percent { 
     
    background-color: #ffcccc; 
     
    height: 19px; 
     
    position: absolute; 
     
    top: 0px; 
     
    left: 0px; 
    } 
    .
    gum_percent_red_text { 
     
    position: absolute; 
     
    color: #CC6666; 
     
    text-align: center; 
     
    width: 100%; 
    } 
    /* END OF GUM PERCENT */ 
    demo site: Сусіди.com - Соціальна мережа України!
    Attached Files
    Advertise your mobile site for FREE with AdTwirl

Working...
X