SocialEngine GumPercentage

Started on the old forum in April 2010 · view the original in the archive · old links redirect here

No replies · 1,709 views · started 16 years ago · 1 min read

GumSlone Administrator Principal · 1,690 posts #1

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:

function &getProfileValues($user_id) 

and after:

$user_profiles[$user_id] = $database->database_fetch_assoc($resource);

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

{* 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:

/* 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 - Соціальна мережа України!

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

Attachments: Bildschirmfoto 2010-04-17 um 12.46.50.jpg

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close