Saturday, May 25, 2024
 Popular · Latest · Hot · Upcoming
20
rated 0 times [  25] [ 5]  / answers: 1 / hits: 7304  / 11 Years ago, wed, february 5, 2014, 12:00:00

how to show the profile completeness progress bar in php wordpress?, after registration i am displaying the whole values in a user profile page. depending up on the data filled in the edit profile page, i want to show the progress bar in the profile page.is there any way of doing this?



if($firstname!=){
// add some points and show status bar is 2%
}


Like this, any way? please help me


More From » php

 Answers
3
$maximumPoints  = 100;
if ( is_user_logged_in() ) {
if($twitterHandle!=){
$hasCompletedTwitterHandle = 10;

}
if($linkedinHandle!=){
$hasCompletedLinkedinHandle = 10;

}
if($googleplusHandle!=){
$hasCompletedGoogleplusHandle = 10;

}
if($website_url!=){
$hasCompletedWebsite_url = 10;

}

$percentage = ($hasCompletedTwitterHandle+$hasCompletedLinkedinHandle+$hasCompletedGoogleplusHandle+$hasCompletedWebsite_url)*$maximumPoints/100;
echo Your percentage of profile completenes is.$percentage.%;
echo <div style='width:100px; background-color:white; height:30px; border:1px solid #000;'>
<div style='width:.$percentage.px; background-color:red; height:30px;'></div></div>;
}


i have did this code now the progress bar is coming. i have an issue with this code, if a user is logged in he can see the other users profile progress bar. i do not need this, how can i restrict that, if a user is logged in that user want to see his progress bar only


[#48037] Tuesday, February 4, 2014, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
melindab

Total Points: 511
Total Questions: 109
Total Answers: 106

Location: San Marino
Member since Thu, Jun 25, 2020
4 Years ago
;