emlog程序获取用户头像函数
emlog程序制作模版时需要在用户页面添加个注册用户的头像效果,可以使用蓝叶分享的emlog模版文件module.php里,在需要的emlog程序模板位置添加调用代码即可显示效果。
<?php //根据用户UID获取用户头像 function lanye_authorimg($id){ global $CACHE;$user_cache = $CACHE->readCache('user'); $users = $user_cache[$id]; if($users['avatar']){ return BLOG_URL.$users['avatar']; }else{ if($users['mail']){ return 'https://cdn.v2ex.com/gravatar/'.md5($users['mail']); }else{ return TEMPLATE_URL.'images/avatar.png'; } } }?>
- 版权申明:此文如未标注转载均为本站原创,自由转载请表明出处《蓝叶》。
- 本文网址:https://lanye.org/web/928.html
- 上篇文章:emlog程序seo优化之相邻文章优化
- 下篇文章:一串js代码列出当前页面所有图片