Wednesday 28 December 2011

SharePoint Most Viewed Content Web Part

Introduction

I'm currently working for a cable company that wants to set up a public SharePoint site that will allow customers to view content that will help them set up their home systems (network, XBox, etc.). One great idea that a co-worker came up with is to have a Web Part displayed on the default page to show the most viewed content by our customers. This will allow our customers to have easy access to solutions for the most frequent problems that other customers have.

Background

If you know SharePoint well enough, then you probably already know about Usage Reports. The first thing you are going to need to do is setup Usage Reports for your site collection. A great walkthrough that will help you do this is available here. If you have used them, then you know they are very limited in what they can do. So, I dug down (reflected SharePoint DLLs) and found that the Usage Analysis Job that runs by default every night populates the ANL tables that are located in your SharedServicesDB.

Anl_Tables.png

  • ANLResource - A row represents any given content item in SharePoint whether it be a PDF, ASPX page, etc. There will be no duplicates in this table.
  • ANLHit - A row represents a single hit to a specific resource made by a user.

The ANLResource table is great because it contains two very important fields, the WebGuid and SiteGuid. The will allow us to scope the query to the site that the user is currently browsing to. Also, another important field is the ANLHit.UserId because it allows us to scope our query to a specific user. Then, we'll be able to show only content that the user has clicked. Great!! Right?

Don't forget that the Usage Report runs nightly. So, keep in mind that even if you click a link a thousand times, no changes will be reflected in the Web Part until the job has run.

Installation

Hopefully, most of you already know how to install Web Parts, but if you need help, follow these steps:

  1. GAC both Mullivan.Shared.dll and Mullivan.SharePoint.WebParts.dll.
  2. Register Mullivan.SharePoint.WebParts.dll in the SharePoint Web Config.

    Go to C:\inetpub\wwwroot\wss\VirtualDirectories\\web.config. Add the following in between the SafeControls node:

    <SafeControl   Assembly="Mullivan.SharePoint.WebParts, Version=1.0.0.0,             Culture=neutral, PublicKeyToken=c37a514ec27d3057"  Namespace="Mullivan.SharePoint.WebParts" TypeName="*" Safe="True" />
  3. Go to Site Settings -> Webparts -> click New on the menu.

    Scroll to the bottom and check Mullivan.SharePoint.WebParts.MostViewedWebPart, and then scroll back to the top and click Populate Gallery.

Done! You should see it in your Web Parts collection.

Configuration

Most_Viewed_Content_Config.png

Shown above is the property pane for this Web Part. I'll explain each field below:

  • User Only - If checked, it scopes the query to only display content that the current user has clicked.
  • Scope - Sets the query to either pull content from all the sites or just the site that the Web Part is located in.
  • Return Count - The max items that should be returned from the query.
  • Span - The amount of days that the query should go back from now and determine the hit count from.
  • Extensions - A comma delimited list of file extensions that limits the query to specific file types. So, if you want to display only PDF and Word docs, then you would use "pdf, doc, docx".

The Code

Are you ready?? I'm a bit mischievous and spend a lot of time reflecting DLLs. I'm not one who likes to spend time reading words in a book when I can just get right to it and see what the heck everything is doing. :P

So, I thought long and hard (in my world, that's 5 minutes) about how I'm going to create a connection to the Shared Services database. Well, using Reflection, I found that the TopPages control located onSPUsageSite.aspx uses an internal property called "AnalyticsSqlSession" on the PortalContext object. So, I just decided to use Reflection to dig that out and gain access to it. You may be thinking that's crazy, but it kept me from having to store some kind of connection string to that database.

private SqlDataReader GetSqlReader(SqlCommand cmd) {     PortalContext pContext = PortalApplication.GetContext();     Type tContext = pContext.GetType();     PropertyInfo pSqlSession = tContext.GetProperty("AnalyticsSqlSession",                   BindingFlags.NonPublic | BindingFlags.Instance);     object sqlSession = pSqlSession.GetValue(pContext, null);      Type tSqlSession = sqlSession.GetType();     MethodInfo mExecute = tSqlSession.GetMethod("ExecuteReader",                            new Type[1] { typeof(SqlCommand) });     return mExecute.Invoke(sqlSession, new object[1] { cmd }) as SqlDataReader; }

So now, we are going to want to generate our query string. We want to make sure that values that may frequently change might be built into our query as SQL parameters. So, we are going to use the start date, user's name, and website GUID as SQL parameters. The TOP and file extensions are not going to be changed, so the query should cache and be reused in the SQL Server database.

private string GetQueryText(bool isUserQuery, int returnCount,                 MostViewedScope scope, string[] extensions) {     string query = @"         SELECT TOP {0} ANLResource.ResourceId AS ResourceId,                ANLResource.DocName AS DocName,                ANLResource.FullUrl AS FullUrl,                ANLResource.WebGuid AS WebGuid,               COUNT_BIG(*) AS HitCount          FROM ANLHit          INNER JOIN ANLResource          ON ANLHit.ResourceId = ANLResource.ResourceId";                     if (isUserQuery)                     {                         query += @"                             INNER JOIN ANLUser                             ON ANLHit.UserId = ANLUser.UserId";                     }      query += @"         INNER JOIN ANLDay         ON ANLHit.DayId = ANLDay.DayId          WHERE           ANLDay.FullDate > @StartDate";      if (scope == MostViewedScope.CurrentSite)         query += "AND ANLResource.WebGuid = @WebGuid";     else         query += "AND ANLResource.SiteGuid = @SiteGuid";      if (isUserQuery)     {         query += @"AND ANLUser.UserName = @UserName";     }      if (extensions != null && extensions.Length > 0)     {         query += @"AND (";         for (int i = 0; i < extensions.Length; i++)         {             if (i != 0)                 query += " OR ";              query += string.Format("(CHARINDEX('.{0}', ANLResource.DocName) > 0)",                                     extensions[i].Trim());         }          query += ") ";     }      query += @"         GROUP BY ANLResource.ResourceId,                  ANLResource.DocName,                  ANLResource.FullUrl,                  ANLResource.WebGuid           ORDER BY HitCount DESC";      return string.Format(query, returnCount); ; }

I know that looks a little messy, but that's how it needs to be done. The following is an example of the query after it is generated:

SELECT TOP 10 ANLResource.ResourceId AS ResourceId,                ANLResource.DocName AS DocName,                ANLResource.FullUrl AS FullUrl,                ANLResource.WebGuid AS WebGuid,               COUNT_BIG(*) AS HitCount  FROM ANLHit  INNER JOIN ANLResource  ON ANLHit.ResourceId = ANLResource.ResourceId INNER JOIN ANLUser ON ANLHit.UserId = ANLUser.UserId INNER JOIN ANLDay ON ANLHit.DayId = ANLDay.DayId  WHERE   ANLDay.FullDate > @StartDate AND ANLResource.WebGuid = @WebGuid AND ANLUser.UserName = @UserName AND ((CHARINDEX('.aspx', ANLResource.DocName) > 0)  OR (CHARINDEX('.pdf', ANLResource.DocName) > 0)  OR (CHARINDEX('.docx', ANLResource.DocName) > 0)  OR (CHARINDEX('.doc', ANLResource.DocName) > 0))   GROUP BY ANLResource.ResourceId,          ANLResource.DocName,          ANLResource.FullUrl,          ANLResource.WebGuid           ORDER BY HitCount DESC

OK.. So now, let's execute our query by calling the method GetReportData().

private DataTable GetReportData() {     string currentUser = null;      if (this.IsUserQuery         && this.Page.User != null         && this.Page.User.Identity != null)         currentUser = this.Page.User.Identity.Name;      DataTable table = null;     using (SqlCommand command = new SqlCommand())     {         SqlDataReader reader = null;         command.CommandText = GetQueryText(!string.IsNullOrEmpty(currentUser),                                this.ReturnCount, this.Scope, this.Extensions);         command.CommandType = CommandType.Text;          if (!string.IsNullOrEmpty(currentUser))         {             SqlParameter spUserName =                new SqlParameter("@UserName", SqlDbType.NVarChar, 50);             spUserName.Value = currentUser;             command.Parameters.Add(spUserName);         }          SqlParameter spScope = null;         if (this.Scope == MostViewedScope.CurrentSite)         {             spScope = new SqlParameter("@WebGuid", SqlDbType.UniqueIdentifier);             spScope.Value = SPControl.GetContextWeb(this.Context).ID;         }         else         {             spScope = new SqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier);             spScope.Value = SPControl.GetContextSite(this.Context).ID;         }          command.Parameters.Add(spScope);          SqlParameter spStartDate = new SqlParameter("@StartDate", SqlDbType.DateTime);         spStartDate.Value = DateTime.Today.Subtract(                               TimeSpan.FromDays(Convert.ToDouble(this.SpanDays)));         command.Parameters.Add(spStartDate);          table = new DataTable();         table.Locale = CultureInfo.InvariantCulture;         reader = GetSqlReader(command);         try         {             table.Load(reader);             return table;         }         finally         {             if (reader != null)             {                 reader.Dispose();             }         }     } }

Alright, so now, let's render our data inside of our part.

protected override void OnLoad(EventArgs e) {     try     {         _data = GetReportData();     }     catch (Exception ex)     {         _errorMessage = ex.ToString();     }      base.OnLoad(e); }  protected override void Render(System.Web.UI.HtmlTextWriter writer) {     if (!string.IsNullOrEmpty(_errorMessage))     {         writer.Write(HttpUtility.HtmlEncode(_errorMessage).Replace("\n", "
"
)); return; } StringBuilder sb = new StringBuilder(); #region "Html" string htmlItem = @" "ms-propertysheet"" style=""padding-left:1px""> "0"" cellpadding=""0"" width=""100%"" border=""0"">
"top"" nowrap=""nowrap"" class=""ms-descriptiontext"" width=8px style=""padding-top:5px;""> "{2}"" width=16px height=16px alt='' > top class=""ms-descriptiontext"" style=""padding-top:7px;padding-left: 3px;""> "{0}"" title=""{3}"">{1}
"
; string htmlTable = @"
"ms-linksectionheader"" style=""padding: 4px;"" width=""100%"">

"ms-standardheader""> {0}

"1px""> "/_layouts/images/blank.gif"" width=1 height=1 alt="""">
"100%"" style=""padding: 0px 4px 4px 4px;"" colspan=""2""> "0"" cellspacing=""0"" border=""0""> {1}
"top"" class=""ms-descriptiontext"" style=""padding-top:5px"">
"15px""> "/_layouts/images/blank.gif"" width=1 height=15 alt="""">
"
; #endregion "Html" //DataRow dr1 = _data.NewRow(); //dr1["DocName"] = "Pages/mypage1.aspx"; //dr1["FullUrl"] = "http://sullyserver2008/sites/mullivan/Pages/mypage1.aspx"; //dr1["HitCount"] = 2345L; //dr1["WebGuid"] = new Guid("{db7e891b-18c4-4c00-8c99-160ecbcee67f}"); //_data.Rows.Add(dr1); foreach (DataRow dr in _data.Rows) { string docName = dr["DocName"].ToString(); string fullUrl = dr["FullUrl"].ToString(); long hitCount = (long)dr["HitCount"]; string desc = string.Format("This file has been requested {0} " + "times in the past {1} days.", hitCount, this.SpanDays); Guid webGuid = (Guid)dr["WebGuid"]; string extUrl = "/_layouts/images/icgen.gif"; try { SPSite site = SPControl.GetContextSite(this.Context); using (SPWeb web = site.AllWebs[webGuid]) { string relativeUrl = fullUrl; int idx = relativeUrl.IndexOf(web.ServerRelativeUrl, StringComparison.InvariantCultureIgnoreCase); if (idx > -1) relativeUrl = relativeUrl.Substring(idx, relativeUrl.Length - idx); SPListItem spListItem = web.GetListItem(relativeUrl); docName = spListItem.Title; object icon = spListItem["DocIcon"]; if (icon != null) extUrl = string.Format("/_layouts/images/ic{0}.gif", Convert.ToString(icon)); } } catch { //Item doesn't exist continue; } sb.Append(string.Format(htmlItem, fullUrl, docName, extUrl, desc)); } writer.Write(string.Format(htmlTable, this.Title, sb.ToString())); }

OK.. That's pretty much it. There is an Editor attached to this Web Part for configuration, but I'm not going to get into that. There are many blogs out there that will help understand how that works.

Points of Interest

There are two other Web Parts included in the project. The weather Web Part was taken from a blog made by the Mossman located here. The other is a Web Part that I blogged about yesterday. It's a really great Web Part that displays a navigation bar, check it out here.

Conclusion

Let me know what you think. If you have any ideas, then I'll be sure to take a look and see if I can provide an update. I hope you found this Web Part useful.

History

  • 15th January, 2009: Initial post
  • 19th March, 2009: Updated source code
  • 24th March, 2009: Updated source code

TOP EARNING KEYWORDS FOR-INFOLINKS

TOP EARNING KEYWORDS FOR-INFOLINKS

Here are the top earning keywords with their price.

Los Angeles Criminal Attorneys – 43.88

home mortgages for bad credit – 46.02
selling structured settlements – 45.96
phoenix dui lawyers – 45.90
Consolidating Students Loan – 49.30
Students Loan Consolidation Rates – 49.17
Boston dui lawyers – 49.02
memphis car insurance – 48.86
Los angeles dwi attorneys – 48.20
Consolidation Student Loan – 47.44
Structured Settlement Buyers – 47.31
Culinary Schools California – 47.10
Student Consolidation Loan – 47.06
Instant Car Insurance Quote – 47.00
Iva debt help – 46.90
homeowner consolidation loans – 45.42
Colorado Truck Accident Lawyers – 45.41
Mesothelioma doctor – 45.09
School Loan Consolidation – 45.09
dui attorney San Francisco – 44.95
Arizona dui Attorney – 47.45
UK home owner loan – 46.67
endowment policy sales – 46.58
sell structured Insurance settlements – 46.53
College Loan Consolidation – 46.49
dui attorney sacramento – 46.48
car insurance quotes – 46.47
Philadelphia personal injury lawyers – 46.37
Consolidating Private Student Loans – 47.96
Personal Injury Lawyer Chicago – 47.83
Personal Injury Attorney Pennsylvania – 47.82
Pennsylvania mesothelioma lawyers – 49.87
data recovery Denver – 49.71
adverse credit remortgages – 49.56
bad credit remortgages – 49.47
data recovery service los angeles – 49.37
Break down covers – 44.14
Remortgages Loan – 44.05
Austin Criminal Attorney – 44.14
Car Insurance Quotes online – 44.14
conference calling companies – 48.64
dui attornes los angeles – 48.60
georgia car accident lawyers – 48.36
san diego dui defense – 48.32
Phoenix arizona dui lawyers – 48.28
auto insurance in Michigan – 43.79
dwi fort worth – 43.78
100 Structured Settlement Companies – 43.77
Endowment Selling – 50.35
Mesothelioma Patients – 50.23
Home improvement loan rates – 43.88
Insurance Auto – 50.00
buyer Structured Settlement – 46.17
california mesotheloma attorney – 46.14
Structured Settlement Consumer Info – 44.1
Student Consolidation Loans – 48.15
free quote for car insurance – 48.11
irs tax lawyers – 48.08
nj auto insurance – 48.08
dui san diego – 48.01
Los Angeles Criminal Defense Attorney – 48.00
Lemon Law California – 47.63
Students loan consolidation interest rates – 47.59
Los Angeles Criminal Attorney – 47.59
Auto Insurance – 47.81
Injury Lawyers 4 You – 43.94
Managed Hosting Services – 43.93
Bad Credit Home Equity – 43.90
Consolidation of Student Loan – 43.95
Student Loan Consolidation Calculator – 43.94
Secured Loans – 50.01
Raid Data Recovery Services – 44.33
College loan consolidation – 44.28
compare car insurance rates – 44.14
Arizona dui lawyers – 44.05
eloan mortgage – 43.98
Phoenix dui attorney – 50.00
car free insurance online quote – 50.00
Purchase Structured Settlements – 53.48
Mesothelioma Lawyers San Diego – 51.47
Secured Loan Calculator – 51.35
Structured Settlement Investments – 50.45
students debt consolidation loans – 49.96
Remortgaging – 46.20
irs tax attorney – 46.19
Consolidation Student Loan – 46.1
ny car insurance – 44.83
Mortgage refinance new jersey – 44.77
Structured settlement payments – 44.43
Car Insurance Texas – 44.41
Virginia Car accidents Lawyers – 44.35
Mesothelioma attorney san diego – 50.07
Austin Texas dwi lawyers – 50.03
New York Mesothelioma Lawyers – 50.01
Phoenix dui lawyers – 50.01
sell structured settlement payments – 45.72
Donate your car – 45.56
Student loan consolidation – 45.46
Consolidate School Loans – 45.45
Injury Lawyers 4 You – 45.44
So these where the key words increase your income enjoy:)



Put your fears aside. Just because you have bad credit,

Put your fears aside. Just because you have bad credit, filed bankruptcy or gone through a foreclosure does not mean you cannot buy a home. You most certainly can buy a home with bad credit. But you're going to pay more than a borrower who has sparkling credit.
The Waiting Period After Foreclosure / Bankruptcy

The period between bankruptcy filings is seven years, but the ding to your credit report stays for 10 years.
For better rates with a conforming loan, the wait is four years after filing bankruptcy.
FHA guidelines are two years after aforeclosure, which means you could qualify for as little as 3.5% down.
Hard-money lenders will often make loans six months after filing bankruptcy or a foreclosure, but will a require 20 to 35% down payment. The interest rate will be very high and the loan terms are not as favorable; many will contain prepayment penalties and be adjustable.
Subprime lenders (not to be confused with hard-money lenders) are no longer making 100% financed loans.
How to Improve Your Qualification For a Conforming Loan

Obtain a major credit card. It's easier to get than you would think after a bankruptcy, for three reasons:
A bankruptcy filing gives you a "fresh start."
The lender knows you have no debt.
You can't file bankruptcy again for another 7 years.
Show steady employment on the job for one to two years.
Earn a regular salary or wage (this does not apply to self-employment).
Save a down payment of at least 10%.
Avoid late payments and continue to pay your bills on time; do not fall behind.
How FICO Scores Affect Interest Rates

I spoke to Evelyne Jamet at Vitek Mortgage about the differences among FICO scores and how that relates to the interest rate borrowers are charged. The following numbers are in comparison to the interest rate a borrower with a 600 FICO score would pay who did not file bankruptcy or lost a previous home to foreclosure. This scenario assumes the borrower with bad credit is putting down 10% of the purchase price in cash and met the seasoning requirements above.

FICO Score of 600 to 640: + 1.625% over prevailing rate. This means if a borrower with good credit is paying 5.875%, your interest rate would be 7.5%.
A $200,000 amortized loan at 7.5% would give you a monthly payment of $1,398.

FICO Score of 560 to 580: +2.875% over prevailing rate. This means if a borrower with good credit is paying 5.875%, your interest rate would be 8.75%.
A $200,000 amortized loan at 8.75% would give you a monthly payment of $1,573.

FICO Score of 540 to 559: +3.425% over prevailing rate. This means if a borrower with good credit is paying 5.875%, your interest rate would be 9.3%.
A $200,000 amortized loan at 9.3% would give you a monthly payment of $1,653.

FICO Score Under 540 to 500: +3.875% over prevailing rate. This means if a borrower with good credit is paying 5.875%, your interest rate would be 9.75%.
A $200,000 amortized loan at 9.75% would give you a monthly payment of $1,718.

FICO Score Under 500: +6.25% over prevailing rate. This means if a borrower with good credit is paying 5.875%, your interest rate would be 12%. With a FICO of less than 500, you will not qualify for a 90% loan, but you may qualify for a 65% loan, therefore, you need to increase your down payment from 10% to 35%.
A $200,000 amortized loan at 12% would give you a monthly payment of $2,057.

Comparing Identical FICOs Against Borrowers With No Foreclosure or Bankruptcy

A borrower without a bankruptcy or foreclosure with a 600 FICO would receive an interest rate of 5.875% and pay a monthly payment of $1183 on a $200,000 amortized loan. You can see that filing bankruptcy or having a foreclosure on your record, even with a FICO score of 600, results in an increase in a mortgage payment of $215 over that of a borrower without a bankruptcy or foreclosure. However, that difference in payment will let you buy a home.

Alternative to Bank-Financing

Borrowers who are not satisfied with the rate offered by a conforming lender might want to look at buying a home with seller financing. Land contracts offer a viable alternative. Typically, seller financing offers:

No qualifying.
Lower interest rates.
Flexible terms and down payments.
Fast closing.
You will want to check with your lender every year or so to find out if you qualify for arefinance at a lower rate.

Infolinks high paying keywords 2012 - Write Articles And Earn

TOP EARNING KEYWORDS FOR-INFOLINKS

Here are the top earning keywords with their price.

Los Angeles Criminal Attorneys – 43.88

home mortgages for bad credit – 46.02
selling structured settlements – 45.96
phoenix dui lawyers – 45.90
Consolidating Students Loan – 49.30
Students Loan Consolidation Rates – 49.17
Boston dui lawyers – 49.02
memphis car insurance – 48.86
Los angeles dwi attorneys – 48.20
Consolidation Student Loan – 47.44
Structured Settlement Buyers – 47.31
Culinary Schools California – 47.10
Student Consolidation Loan – 47.06
Instant Car Insurance Quote – 47.00
Iva debt help – 46.90
homeowner consolidation loans – 45.42
Colorado Truck Accident Lawyers – 45.41
Mesothelioma doctor – 45.09
School Loan Consolidation – 45.09
dui attorney San Francisco – 44.95
Arizona dui Attorney – 47.45
UK home owner loan – 46.67
endowment policy sales – 46.58
sell structured Insurance settlements – 46.53
College Loan Consolidation – 46.49
dui attorney sacramento – 46.48
car insurance quotes – 46.47
Philadelphia personal injury lawyers – 46.37
Consolidating Private Student Loans – 47.96
Personal Injury Lawyer Chicago – 47.83
Personal Injury Attorney Pennsylvania – 47.82
Pennsylvania mesothelioma lawyers – 49.87
data recovery Denver – 49.71
adverse credit remortgages – 49.56
bad credit remortgages – 49.47
data recovery service los angeles – 49.37
Break down covers – 44.14
Remortgages Loan – 44.05
Austin Criminal Attorney – 44.14
Car Insurance Quotes online – 44.14
conference calling companies – 48.64
dui attornes los angeles – 48.60
georgia car accident lawyers – 48.36
san diego dui defense – 48.32
Phoenix arizona dui lawyers – 48.28
auto insurance in Michigan – 43.79
dwi fort worth – 43.78
100 Structured Settlement Companies – 43.77
Endowment Selling – 50.35
Mesothelioma Patients – 50.23
Home improvement loan rates – 43.88
Insurance Auto – 50.00
buyer Structured Settlement – 46.17
california mesotheloma attorney – 46.14
Structured Settlement Consumer Info – 44.1
Student Consolidation Loans – 48.15
free quote for car insurance – 48.11
irs tax lawyers – 48.08
nj auto insurance – 48.08
dui san diego – 48.01
Los Angeles Criminal Defense Attorney – 48.00
Lemon Law California – 47.63
Students loan consolidation interest rates – 47.59
Los Angeles Criminal Attorney – 47.59
Auto Insurance – 47.81
Injury Lawyers 4 You – 43.94
Managed Hosting Services – 43.93
Bad Credit Home Equity – 43.90
Consolidation of Student Loan – 43.95
Student Loan Consolidation Calculator – 43.94
Secured Loans – 50.01
Raid Data Recovery Services – 44.33
College loan consolidation – 44.28
compare car insurance rates – 44.14
Arizona dui lawyers – 44.05
eloan mortgage – 43.98
Phoenix dui attorney – 50.00
car free insurance online quote – 50.00
Purchase Structured Settlements – 53.48
Mesothelioma Lawyers San Diego – 51.47
Secured Loan Calculator – 51.35
Structured Settlement Investments – 50.45
students debt consolidation loans – 49.96
Remortgaging – 46.20
irs tax attorney – 46.19
Consolidation Student Loan – 46.1
ny car insurance – 44.83
Mortgage refinance new jersey – 44.77
Structured settlement payments – 44.43
Car Insurance Texas – 44.41
Virginia Car accidents Lawyers – 44.35
Mesothelioma attorney san diego – 50.07
Austin Texas dwi lawyers – 50.03
New York Mesothelioma Lawyers – 50.01
Phoenix dui lawyers – 50.01
sell structured settlement payments – 45.72
Donate your car – 45.56
Student loan consolidation – 45.46
Consolidate School Loans – 45.45
Injury Lawyers 4 You – 45.44
So these where the key words increase your income enjoy:)

Bad Credit Mortgages Offer Relief

Yes, you can get relief from high mortgage and interest payments with bad credit mortgages, but you can also get much more.

  • Bad credit mortgages give you the chance to clean up your credit.
  • Consolidate all your bills into one, low monthly payment with bad credit home loans.
  • Get relief from the harassing calls of creditors.
  • Bad credit mortgages provide a way to live your life without worrying about every penny you spend.
  • Need extra cash? Bad credit home loans give you what you need for home improvements, back child support, late payments, or a much needed vacation.
  • Bad credit home loans can even give you the leverage you need to avoid bankruptcy.
  • And so much more!
Bad Credit Mortgages Offer Relief

Home mortgages for bad credit

Put your fears aside. Just because you have bad credit, filed bankruptcy or gone through a foreclosure does not mean you cannot buy a home. You most certainly can buy a home with bad credit. But you're going to pay more than a borrower who has sparkling credit.
The Waiting Period After Foreclosure / Bankruptcy

The period between bankruptcy filings is seven years, but the ding to your credit report stays for 10 years.
For better rates with a conforming loan, the wait is four years after filing bankruptcy.
FHA guidelines are two years after aforeclosure, which means you could qualify for as little as 3.5% down.
Hard-money lenders will often make loans six months after filing bankruptcy or a foreclosure, but will a require 20 to 35% down payment. The interest rate will be very high and the loan terms are not as favorable; many will contain prepayment penalties and be adjustable.
Subprime lenders (not to be confused with hard-money lenders) are no longer making 100% financed loans.
How to Improve Your Qualification For a Conforming Loan

Obtain a major credit card. It's easier to get than you would think after a bankruptcy, for three reasons:
A bankruptcy filing gives you a "fresh start."
The lender knows you have no debt.
You can't file bankruptcy again for another 7 years.
Show steady employment on the job for one to two years.
Earn a regular salary or wage (this does not apply to self-employment).
Save a down payment of at least 10%.
Avoid late payments and continue to pay your bills on time; do not fall behind.
How FICO Scores Affect Interest Rates

I spoke to Evelyne Jamet at Vitek Mortgage about the differences among FICO scores and how that relates to the interest rate borrowers are charged. The following numbers are in comparison to the interest rate a borrower with a 600 FICO score would pay who did not file bankruptcy or lost a previous home to foreclosure. This scenario assumes the borrower with bad credit is putting down 10% of the purchase price in cash and met the seasoning requirements above.

FICO Score of 600 to 640: + 1.625% over prevailing rate. This means if a borrower with good credit is paying 5.875%, your interest rate would be 7.5%.
A $200,000 amortized loan at 7.5% would give you a monthly payment of $1,398.

FICO Score of 560 to 580: +2.875% over prevailing rate. This means if a borrower with good credit is paying 5.875%, your interest rate would be 8.75%.
A $200,000 amortized loan at 8.75% would give you a monthly payment of $1,573.

FICO Score of 540 to 559: +3.425% over prevailing rate. This means if a borrower with good credit is paying 5.875%, your interest rate would be 9.3%.
A $200,000 amortized loan at 9.3% would give you a monthly payment of $1,653.

FICO Score Under 540 to 500: +3.875% over prevailing rate. This means if a borrower with good credit is paying 5.875%, your interest rate would be 9.75%.
A $200,000 amortized loan at 9.75% would give you a monthly payment of $1,718.

FICO Score Under 500: +6.25% over prevailing rate. This means if a borrower with good credit is paying 5.875%, your interest rate would be 12%. With a FICO of less than 500, you will not qualify for a 90% loan, but you may qualify for a 65% loan, therefore, you need to increase your down payment from 10% to 35%.
A $200,000 amortized loan at 12% would give you a monthly payment of $2,057.

Comparing Identical FICOs Against Borrowers With No Foreclosure or Bankruptcy

A borrower without a bankruptcy or foreclosure with a 600 FICO would receive an interest rate of 5.875% and pay a monthly payment of $1183 on a $200,000 amortized loan. You can see that filing bankruptcy or having a foreclosure on your record, even with a FICO score of 600, results in an increase in a mortgage payment of $215 over that of a borrower without a bankruptcy or foreclosure. However, that difference in payment will let you buy a home.

Alternative to Bank-Financing

Borrowers who are not satisfied with the rate offered by a conforming lender might want to look at buying a home with seller financing. Land contracts offer a viable alternative. Typically, seller financing offers:

No qualifying.
Lower interest rates.
Flexible terms and down payments.
Fast closing.
You will want to check with your lender every year or so to find out if you qualify for arefinance at a lower rate.