Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Timsn 121 posts 231 karma points
    Dec 27, 2009 @ 22:50
    Timsn
    0

    Blog4Umbraco Gravatar problem

    Hi,

    I've got some problems with the gravatar preview. At first I want to change to default image to something else, how can I do this?

    Where can I see what the "/base/Blog4Umbraco/GetGravatarImage/" method does? What parameters can it take? And which file do I have to edit? I've found two files containing javascript which gets the Gravatar information: blog4umbraco.js and the AjaxCommentForm.ascx

    The second think is, that I can't get a preview image of any existing gravatar image, I can only see the default "G" image when I type in a fantasy email adress. But if I add my real adress, which is registered with gravatar I can't see my image and I'm not able to post my comment. I'm only getting: "Your comment could not be posted, we're very sorry for the inconvenience"

  • Timsn 121 posts 231 karma points
    Dec 28, 2009 @ 14:10
    Timsn
    0

    I've got the preview working now. I added this javascript to get the hash value from the email and changed the preview method from AjaxCommentForm.ascx to this:

              jQuery("#commentform #email").blur(function(){
    var email = jQuery("#commentform #email").val();
    if(email != ""){
    var url = "http://www.gravatar.com/avatar/" + MD5(email) + "?d=identicon&s=80";
    jQuery("#gravatar").css( "background-image","url(" + url + ")" ).show();
    }
    });

    But I still can't post my comment if I type in a valid email which is linked with a gravatar image. The preview shows my image and all fields are filled but I can't post my comment.

    It seems that the CreateComment method returns 0 and the message "Your comment could not be posted, we're very sorry for the inconvenience" gets displayed. Another problem is, that I can't change the code from the CreateComment method because the code soulution is broken or something. Can't open it at all. :(

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Dec 29, 2009 @ 19:10
    Sebastiaan Janssen
    1

    I really don't know what's wrong with the comment posting, check the umbracoLog and windows event log for any exceptions.

    The source of getGravatar is available on codeplex, it should not be difficult to tweak it so you'll get a different default image.

  • Timsn 121 posts 231 karma points
    Jan 01, 2010 @ 13:53
    Timsn
    0

    The umbracoLog looks fine. There are no errors after trying to add a comment. I don't have access to the windows log because it is running at a hosted machine.

    I'll try to alter the code so that I can track where the problem is.

  • Timsn 121 posts 231 karma points
    Jan 01, 2010 @ 14:24
    Timsn
    0

    The problem is the regex that checks for a valid email "isValidEmail" in Base.cs

    The regex does not allow any numbers in the domain name which would be perfectly valid. My email had a number in the domain name so I was refused to post a comment.

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Jan 02, 2010 @ 12:56
    Sebastiaan Janssen
    0

    Aha, you might want to submit a patch, this is what MSDN has to say about an e-mail regex (scroll down to "Table 1. Common Regular Expressions").

  • Timsn 121 posts 231 karma points
    Jan 03, 2010 @ 18:53
    Timsn
    1

    I've submitted a patch, the validation works fine now.

  • heinnge 3 posts 23 karma points
    Jan 06, 2010 @ 14:16
    heinnge
    0

    yes. i had the same problem with certain email address like [email protected] which has two '.' in it. Think the regex might need to be replaced with a better one.

  • TaoistTotty 246 posts 314 karma points
    Jan 11, 2010 @ 18:18
    TaoistTotty
    0

    Timsn, I am seeing the same problem, do you have a copy of your patch available for others to use?

  • Timsn 121 posts 231 karma points
    Jan 11, 2010 @ 19:16
    Timsn
    0

    @TaoistTotty, you can find the patch here. It's just a zip file with the changed code files. You can simply replace the original files and rebuild the hole solution.

    If you need help let me know.

  • Dan 1288 posts 3921 karma points c-trib
    Jan 28, 2010 @ 11:24
    Dan
    0

    Hi Tim,

    I'm looking to implement your fix to allow .co.uk addresses to be used in comments.  I'm wondering how to do this - can I just upload your 'Base.cs' and 'BlogLibrary.cs' files or do I need to set this up in VisualStudio and compile the whole thing as a project?

    Thanks

  • Timsn 121 posts 231 karma points
    Jan 28, 2010 @ 11:39
    Timsn
    1

    It depends on what project you are using. If you are using UComment you have to download the source files from codeplex and change the regex validation like I mentioned in this post. After changing that, you have to rebuild the visual studio solution and put the resulting dll into you umbraco bin-folder.

    If you are using the blog4umbraco package you can do the same thing with the blog source files or you can download my patch and simply replace the two original files with the new ones and rebuild everything.

    If you can't get it to work I can build the fixed dll by myself and upload it somewhere. Just let me know

    Cheers, Tim

  • Dan 1288 posts 3921 karma points c-trib
    Jan 28, 2010 @ 12:23
    Dan
    0

    Thanks Tim.  I'm using blog4Umbraco.  I'm not familiar with building dlls, so if you're able to load it somewhere that would be amazing!

  • Timsn 121 posts 231 karma points
    Jan 28, 2010 @ 13:28
    Timsn
    1

    Hi Dan, you can download the dll here.

  • Dan 1288 posts 3921 karma points c-trib
    Jan 28, 2010 @ 13:34
    Dan
    0

    That's brilliant, thanks Tim.  So I literally just copy that dll to the bin folder and it's job done?

  • Timsn 121 posts 231 karma points
    Jan 28, 2010 @ 13:36
    Timsn
    1

    Yes, just copy it into the bin folder and replace the old one.

    After that you have to recycle the application pool so that the dll gets loaded. To do that, you can simply touch the web.config (just add a space at the end of the file or something).

  • Dan 1288 posts 3921 karma points c-trib
    Jan 28, 2010 @ 13:57
    Dan
    0

    Perfect, thanks very much indeed.

  • BarneyHall 141 posts 210 karma points
    Mar 09, 2010 @ 18:21
    BarneyHall
    0

    Hi there. I've run into the same problem, being that I use an email with more than one "." in its address.

    I've downloaded and replaced the Umlaut.Umb.Blog.dll in the "bin" folder, but when I do I find that the comment section within the dashboard UI has the following problem:

    Could not load control '/usercontrols/Blog4Umbraco/CommentModeration.ascx'.

    Does anyone have any ideas what I can do to get around this?

    Thanks,
    Barney

  • jaygreasley 416 posts 403 karma points
    Mar 09, 2010 @ 20:30
    jaygreasley
    0

    Hey Barney,

    Does the CommentModeration.ascx actually exist in the usercontrols directory?

    Jay

  • BarneyHall 141 posts 210 karma points
    Mar 09, 2010 @ 21:33
    BarneyHall
    0

    Hiya Jay,

    Yeah it is there in the usercontrols folder.

    This is the full error:

    Could not load control '/usercontrols/Blog4Umbraco/CommentModeration.ascx'.
    Error message: System.Web.HttpParseException: The base class includes the field 'UpdatePanel1', but its type (System.Web.UI.UpdatePanel) is not compatible with the type of control (System.Web.UI.UpdatePanel). ---> System.Web.HttpParseException: The base class includes the field 'UpdatePanel1', but its type (System.Web.UI.UpdatePanel) is not compatible with the type of control (System.Web.UI.UpdatePanel). at System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildFieldDeclaration(ControlBuilder builder) at System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildSourceDataTreeFromBuilder(ControlBuilder builder, Boolean fInTemplate, Boolean topLevelControlInTemplate, PropertyEntry pse) at System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildSourceDataTreeFromBuilder(ControlBuilder builder, Boolean fInTemplate, Boolean topLevelControlInTemplate, PropertyEntry pse) at System.Web.Compilation.TemplateControlCodeDomTreeGenerator.BuildMiscClassMembers() at System.Web.Compilation.BaseCodeDomTreeGenerator.BuildSourceDataTree() at System.Web.Compilation.BaseCodeDomTreeGenerator.GetCodeDomTree(CodeDomProvider codeDomProvider, StringResourceBuilder stringResourceBuilder, VirtualPath virtualPath) at System.Web.Compilation.BaseTemplateBuildProvider.GenerateCode(AssemblyBuilder assemblyBuilder) at System.Web.Compilation.AssemblyBuilder.AddBuildProvider(BuildProvider buildProvider) --- End of inner exception stack trace --- at System.Web.Compilation.AssemblyBuilder.AddBuildProvider(BuildProvider buildProvider) at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at System.Web.UI.TemplateControl.LoadControl(String virtualPath) at umbraco.cms.presentation.dashboard.OnInit(EventArgs e)

    I took out the ID="UpdatePanel1" reference and then it started saying something about versions not being compatible. I'm assuming asp.net versions?? Unfortunately I don't know enough about building dlls, but do you think it's something to do with Timsn's dll being built in within a different version of the .net I have running locally?

    Thanks for your time man,
    Barney

  • jaygreasley 416 posts 403 karma points
    Mar 09, 2010 @ 21:43
    jaygreasley
    0

    Evening,

    Just to confirm you are running blog4Umbraco (that's what the dll was built for)? Also, did you recycle the app pool (easy way is to put a space or blankline into web.config and save it) ?

    Do you have .net 3.5 installed locally? If so that should be all you need unless there are other dependencies causing the error.

    It could be that you have a different version of the blog4umbraco code installed.

     

  • jaygreasley 416 posts 403 karma points
    Mar 09, 2010 @ 21:50
    jaygreasley
    0

    Barney,

    It looks like this is a .net 2.0 vs 3.5 issue.

    Mike got the same error as you (see this post for confirmation) http://our.umbraco.org/projects/ucomment/using-ucomment/6456-Comments-not-saving?p=2

    So I suspect you need 3.5 installed.

    hth

    Jay

  • BarneyHall 141 posts 210 karma points
    Mar 09, 2010 @ 22:08
    BarneyHall
    0

    Hey again dude :)

    Yeah it's a clean install of v4.0.3 with an install of the Blog4Umbraco_2.0.24.zip package and nothing else (clean SQL 2005 Express db too)

    The only difference is I've dropped Timsn's Umlaut.Umb.Blog.dll (downloaded from this thread) in the bin folder overwriting the original dll (which when I revert to works - apart from the .co.uk email address issue).

    I'm running asp.net 3.5 and I've "touched" the web.config file. Maybe I should go away and learn how to recompile from Timn's patched source files?

  • BarneyHall 141 posts 210 karma points
    Mar 09, 2010 @ 22:13
    BarneyHall
    0

    Sorry our posts are crossing over. Thanks, I'll have a look in that direction...

    I'm a bit gutted this is even an issue with this package :(

Please Sign in or register to post replies

Write your reply to:

Draft