Bug fixe: comnet avatar
* web/Controllers/AccountController.cs: Fixes the avatar icon in comments * .gitignore: ignore `bfiles` * web/images/musician-923526_1.nb.jpg: * web/images/musician-923526_1.nb.xs.jpg: * web/images/musician-923526_1.nb.xxs.jpg: * web/images/musician-923526_1.nbb.jpg: * web/images/musician-923526_1.nbb.xs.jpg: * web/images/musician-923526_1.nbb.xxs.jpg: * totem-banner.xxs.xcf: * totem.xcf: totem custo
This commit is contained in:
parent
30cebd7751
commit
3fd8578c07
12 changed files with 58 additions and 38 deletions
|
|
@ -33,21 +33,25 @@ namespace Yavsc.Controllers
|
|||
/// <summary>
|
||||
/// Avatar the specified user.
|
||||
/// </summary>
|
||||
/// <param name="user">User.</param>
|
||||
/// <param name="id">User.</param>
|
||||
[AcceptVerbs (HttpVerbs.Get)]
|
||||
public ActionResult Avatar (string user)
|
||||
public ActionResult Avatar (string id)
|
||||
{
|
||||
ProfileBase pr = ProfileBase.Create (user);
|
||||
string avpath = (string ) pr.GetPropertyValue("Avatar") ;
|
||||
if (id == null)
|
||||
return new EmptyResult ();
|
||||
|
||||
ProfileBase pr = ProfileBase.Create (id);
|
||||
var avpath = pr.GetPropertyValue("Avatar");
|
||||
if (avpath == null) {
|
||||
FileInfo fia = new FileInfo (Server.MapPath (defaultAvatar));
|
||||
return File (fia.OpenRead (), defaultAvatarMimetype);
|
||||
}
|
||||
if (avpath.StartsWith ("~/")) {
|
||||
avpath = Server.MapPath (avpath);
|
||||
string avatarLocation = avpath as string;
|
||||
if (avatarLocation.StartsWith ("~/")) {
|
||||
avatarLocation = Server.MapPath (avatarLocation);
|
||||
}
|
||||
|
||||
WebRequest wr = WebRequest.Create (avpath);
|
||||
WebRequest wr = WebRequest.Create (avatarLocation);
|
||||
FileContentResult res;
|
||||
using (WebResponse resp = wr.GetResponse ()) {
|
||||
using (Stream str = resp.GetResponseStream ()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue