YAFLogo

TommyB
  • TommyB
  • 100% (Exalted)
  • YAF Commander Topic Starter
16 years ago
Hey

I'm a bit frustrated now. I simply can't find the control that builds the top menu (messages, search, active discusions, ...)

Also I seek for the breadcrumb control, or a simple way to create it by myself.

Xml Comments like:

DataTable DB.forum_listpath(object forumID)
Sorry no idea what this does
Is funy, but not very helpful ^^
- Sry for my english ;)

BattCursor.Net  - Official homepage of that tool for vista laptops!

Sponsor
TommyB
  • TommyB
  • 100% (Exalted)
  • YAF Commander Topic Starter
16 years ago
ok forget the header, got it :)

But I'm still on the breadcrump :/ The function is the right one, but is does not return the full path, only the last (in my case) 2 forums, not the full path which should be 4 items


- Sry for my english ;)

BattCursor.Net  - Official homepage of that tool for vista laptops!

Mek
  • Mek
  • 100% (Exalted)
  • YAF Developer
16 years ago
The breadcrumb (if you can call it that) control is YAF.Controls.PageLinks.


UserPostedImage

"It's a case of RTFM.. the only problem being we don't have a manual!"

When I post FP:Mek 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 Ederon 🙂 )

TommyB
  • TommyB
  • 100% (Exalted)
  • YAF Commander Topic Starter
16 years ago
fine, then I was already in the correct file.

I was confused a long time because this function doesn't return anything (I thought).

It seems the function (DB.forum_listpath) does only skip the root url and the category, or not? But in the resulting html they are included. But where they came from? ^^

Well, it makes no sense, I only need the correct output. And if I'm right, something like this should do the job, or I'm missing something? At least for my installation it seems to work.

...
' Forum Root
Dim RootLink As New HyperLink
RootLink.NavigateUrl = LinkUtil.GetLinkURL("~/default.aspx")
RootLink.Text = YafContext.BoardSettings.Name
LinkList.Add(RootLink)
			
' Category (if exists)
If Not String.IsNullOrEmpty(YafContext.PageCategoryName) Then
	Dim Link As New HyperLink
	Link.NavigateUrl = LinkUtil.GetLinkURL("~/default.aspx?g=forum&c=" & YafContext.PageCategoryID)
	Link.Text = YafContext.PageCategoryName
	LinkList.Add(Link)
End If

' Crump's
Dim dt As System.Data.DataTable = YAF.Classes.Data.DB.forum_listpath(YafContext.PageForumID)
For Each dr As Data.DataRow In dt.Rows
	Dim Link As New HyperLink
	Link.NavigateUrl = LinkUtil.GetLinkURL("~/default.aspx?g=topics&f=" & dr("ForumID"))
	Link.Text = dr("Name")
	LinkList.Add(Link)
Next
...

Thanks in advance 🙂


- Sry for my english ;)

BattCursor.Net  - Official homepage of that tool for vista laptops!

Mek
  • Mek
  • 100% (Exalted)
  • YAF Developer
16 years ago
Yup what your saying is fine; for clarification look at pages/topic.ascx.cs


				if ( PageContext.Settings.LockedForum == 0 )
				{
					PageLinks.AddLink( PageContext.BoardSettings.Name, YAF.Classes.Utils.YafBuildLink.GetLink( YAF.Classes.Utils.ForumPages.forum ) );
					PageLinks.AddLink( PageContext.PageCategoryName, YAF.Classes.Utils.YafBuildLink.GetLink( YAF.Classes.Utils.ForumPages.forum, "c={0}", PageContext.PageCategoryID ) );
				}

				PageLinks.AddForumLinks( PageContext.PageForumID, true );

UserPostedImage

"It's a case of RTFM.. the only problem being we don't have a manual!"

When I post FP:Mek 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 Ederon 🙂 )

TommyB
  • TommyB
  • 100% (Exalted)
  • YAF Commander Topic Starter
16 years ago
That I haven't found.

Many thanks 🙂


- Sry for my english ;)

BattCursor.Net  - Official homepage of that tool for vista laptops!

TommyB
  • TommyB
  • 100% (Exalted)
  • YAF Commander Topic Starter
16 years ago
I'm blind again, another question about user profile.

I search for a function like IsAdmin and IsModerator (for active users list).

Ok, yaf has no 'global moderator' so IsModerator should return true if the user is a moderator somewhere in the forum.

Any suggestions? thanks again 🙂


- Sry for my english ;)

BattCursor.Net  - Official homepage of that tool for vista laptops!

Mek
  • Mek
  • 100% (Exalted)
  • YAF Developer
16 years ago
Nope you've got it wrong; there is a board level moderator same as there is a IsHost, and IsAdmin. Its nothing to do with forum permissions. The flags in the yaf_user table dictate what board/host perms these accounts has (IsGuest is also there).

I'll see if i can find it and get back to you.


UserPostedImage

"It's a case of RTFM.. the only problem being we don't have a manual!"

When I post FP:Mek 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 Ederon 🙂 )

Mek
  • Mek
  • 100% (Exalted)
  • YAF Developer
16 years ago
YAF.Classes.Utils

Context.cs

Thats your huckleberry!!!!

you'd want something like


YafContext myContext = YafContext.Current();
if (myContext.IsAdmin)
throw new applicationexception("Euraka");

note: the incorrect case in my example. I'm useless without intellisense.


UserPostedImage

"It's a case of RTFM.. the only problem being we don't have a manual!"

When I post FP:Mek 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 Ederon 🙂 )

TommyB
  • TommyB
  • 100% (Exalted)
  • YAF Commander Topic Starter
16 years ago
argh sorry I missed the most importend part.

Yepp I know about the context. I need that property, but for a given userid, not for the calling user.

To do something like ipb, active users. There the admins and moderators have different colors than users.

The flags are not provided directly in my case, which is:

ActiveUserTable = YAF.Classes.Data.DB.active_list(YafContext.PageBoardID, Nothing)
How to get it and which bit is for what?

(sorry for the amount of questions and vb code ^^)


- Sry for my english ;)

BattCursor.Net  - Official homepage of that tool for vista laptops!

Mek
  • Mek
  • 100% (Exalted)
  • YAF Developer
16 years ago
You will have to write your own helper, nothing I can see in YAF will give you the answer you need.

In your helper use YAF.Classes.Data.UserFlags class.

Load the user information into a datarow(in the example below this dataRow is _userData by using their userid


 _userFlags = new UserFlags(_userData["UserFlags"]);

you sohuld then be able to call _userFlags.IsAdmin; its a bit beyond the scope of what I'm willing to support. Basically just look at how context works; and write your own version to suit your needs.


UserPostedImage

"It's a case of RTFM.. the only problem being we don't have a manual!"

When I post FP:Mek 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 Ederon 🙂 )

TommyB
  • TommyB
  • 100% (Exalted)
  • YAF Commander Topic Starter
16 years ago
Ok, thanks already 🙂 I'll try to give my best.

... its a bit beyond the scope of what I'm willing to support. ...

Mek wrote:

Sounds a bit confusing, why you don't want to do so?

Just for my interests, what's your work on yaf? More ui or db or ... ?


- Sry for my english ;)

BattCursor.Net  - Official homepage of that tool for vista laptops!

Mek
  • Mek
  • 100% (Exalted)
  • YAF Developer
16 years ago
Yeah i phrased that a bit badly; as in your looking for something that YAF doesn't do. So I'll point you in the direction I think you should go in to achieve your aim, but highlighting the fact if you say why doesn't this helper I wrote work and wanting me to debug it is beyond my scope of technical support. (Note this is from a pure time management view).

Hope thats makes sense without being too arsy.

I'm not sure what my work on YAF is anymore 😉 I come up with a lot of test theories for Jaben; and bug fixing. Too busy working on my Portal project for anything else.


UserPostedImage

"It's a case of RTFM.. the only problem being we don't have a manual!"

When I post FP:Mek 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 Ederon 🙂 )

TommyB
  • TommyB
  • 100% (Exalted)
  • YAF Commander Topic Starter
16 years ago
hehe ok, this is fine :)

Sometimes you can't see the tree in the forrest. It is not my code and also not my preferred programming language, which makes it a bit harder to find some things, a direction helps much, too :)

oh your portal project is still in development? must be a great project :)

Anything of your work already visible?

One more time I've started to beautify yaf's html as you may see ^^

But now I have to do it, we are creating a mobile site, and sad but true mobile devices keep stuck on yaf's html

//Jepp I know this was offtopic now ^^


- Sry for my english ;)

BattCursor.Net  - Official homepage of that tool for vista laptops!

Mek
  • Mek
  • 100% (Exalted)
  • YAF Developer
16 years ago
Well theres just me; so yeah its take ages. I'll send you the link when i hit alpha.

The plan as I see it is to really have a go at YAFs HTML output in the YAF 2.0; and make it much easier to edit said html. (Yes we're already thinking about the next version).

Shout me when the mobile sites done; would really like to see it.


UserPostedImage

"It's a case of RTFM.. the only problem being we don't have a manual!"

When I post FP:Mek 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 Ederon 🙂 )