Mercury
  •  Mercury
  • 52.4% (Neutral)
  • YAF Forumling Topic Starter
2008-12-29T12:30:07Z
Problem: signature editor width not set

Cause: forum.css not loaded

Fix:

YAF.Classes\YAF.Classes.Utils\Context.cs line 1202

should be:

static public string GetURLToResource( string resourceName )
{
return string.Format( "{1}resources/{0}", resourceName, YafForumInfo.ForumFileRoot );
}

YAF 1.9.3 RC2

HTH,
Nick

Sponsor
Jaben
  •  Jaben
  • 100% (Exalted)
  • YAF Developer
2008-12-29T13:10:43Z
Thanks mercury. Updated and committed.
Mercury
  •  Mercury
  • 52.4% (Neutral)
  • YAF Forumling Topic Starter
2008-12-31T00:12:13Z
Hi Jaben,

I looked into this a bit more this last night.

My site is at //localhost/dir and I have created a page at //localhost/dir/forum.aspx which contains a YAF:forum control. I have put yaf in dir/forum/ and converted it to a web application. In app.config, I set root="~/forum" and BaseUrl="~/".

This doesn't work as there are 67 places where relative paths are built using YafForumInfo.ForumRoot ( which reads YAF.Classes.Config.BaseUrl ) and 11 places where they are built using YafForumInfo.ForumFileRoot ( which reads YAF.Classes.Config.Root ).

I fixed this by changing UrlBuilder.BuildUrl(string url) from:
return String.Format( "{0}{1}?{2}", UrlBuilder.BaseUrl, UrlBuilder.ScriptName, url );
to
return String.Format( "{0}?{1}", HttpContext.Current.Request.FilePath, url );
and setting BaseUrl="~/forum" too.

I don't understand the need for the two config settings - they seem to be used interchangeably and must be set the same?

If you want some help fixing this, let me know. I've got svn set up, so I can send you a patch.

Nick
mddubs
2008-12-31T07:48:29Z
I'm also curious about the specifics on the Root and BaseUrl config keys. I finally commented out BaseUrl and now just use Root, which solved that problem I was having with the admin page & multiple boards.
UserPostedImage 
www.bunkerhollow.com  | www.careercomputing.com 
When I post fp:mddubs in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting. (Yes I stole this off Mek 🙂, who stole this off Ederon 🙂 )
Jaben
  •  Jaben
  • 100% (Exalted)
  • YAF Developer
2008-12-31T12:17:42Z
Looking at your fix mercury, it's actually a bug.

ForumRoot is the URL to the client of the forum which is based on BaseURL.

ForumFileRoot is the URL of the forum TO ASP.NET -- which is based on Root. This is for internal file paths.

BaseUrl = "http://mypetgoat.forum.com"

Where as the actual file root could be:

Root = "~/forum"

But the client would see the BaseURL above because the "Root" url would be incorrect.

That is why your fix to resources above is actually a bug. The URL to resources is external and thus based on BaseURL -- not forum file root (which is used internally).

Yes most of the time they are the same. One addition would be to calculate from Root is BaseURL is empty and Root is specified.

I think I'll add that.
Mercury
  •  Mercury
  • 52.4% (Neutral)
  • YAF Forumling Topic Starter
2009-01-01T02:51:33Z
Jaben wrote:

Looking at your fix mercury, it's actually a bug.



Sorry Jaben - sincere apologies.

I think I understand now. Could you check these lines too? Line numbers are from trunk rev. 2222:

trunk\yafsrc\YetAnotherForum.NET\pages\admin\editcategory.ascx.cs line 126
trunk\yafsrc\YetAnotherForum.NET\pages\admin\editmedal.ascx.cs lines 476 & 666
trunk\yafsrc\YetAnotherForum.NET\pages\admin\editrank.ascx.cs line 116
trunk\yafsrc\YetAnotherForum.NET\pages\admin\smilies_edit.ascx.cs line 67
trunk\yafsrc\YetAnotherForum.NET\pages\admin\smilies_import.ascx.cs lines 64 & 90
trunk\yafsrc\YetAnotherForum.NET\pages\avatar.ascx.cs line 102




I want to put my forum.aspx page ( which contains a YAF:forum control ) in my app root: ~/, but put yaf in a subdirectory: ~/forum/. I've changed UrlBuilder.BuildUrl as in my last post and it seems to work, but I haven't tested exhaustively. Is this not supported?

Thanks
Nick
Jaben
  •  Jaben
  • 100% (Exalted)
  • YAF Developer
2009-01-08T12:58:31Z
I don't believe what you are trying to do is supported, sorry. The page the forum control is must be the in the YAF directory.

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved