如何在php中配置状态栏(就像linkedin状态栏一样) [英] How to Profile Status bar in php (just like linkedin status bar)

查看:85
本文介绍了如何在php中配置状态栏(就像linkedin状态栏一样)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过Php在完成个人资料时开发个人资料进度条,该信息与linkedin相同.用户完成个人资料,状态百分比(%增加).

How can I develop Profile progress bar on completing profile, which is same as linkedin, through Php. And user completes his/her profile, the status percent(% increases).

预先感谢

推荐答案

要使进度条正常工作,您必须指定一些条件. 例如,在SO上,如果您访问职业,则个人资料上将有completeness report.

For a progress bar to work you have to specify some criteria. For example, on SO, if you go to Careers you will have on you profile a completeness report.

completeness report的每个部分都有一定的积分或您可以赚取的积分总数的一定百分比.

Every part of the completeness report has certain points or a certain percentage of total amount of points you can earn.

根据您的User Profile标准,您可以创建进度条.

Based on your User Profile criteria you can make that progress bar.

例如:

$hasCompletedSkill = 10;
$hasCompletedBooks = 15;
$maximumPoints  = 100;
$percentage = ($hasCompletedSkill+$hasCompletedBooks)*$maximumPoints/100;

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>";

它将输出:

这篇关于如何在php中配置状态栏(就像linkedin状态栏一样)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆