nomi
  • Posts: 8
  • Joined: 09/11/2008
Hi
I add a new control in admin folder. Like DeniedMail.ascx .

After adding control I like to add a link on left admin menu. Like below
// create the admin menu...
string [,] adminLinks =
{
{"Admin Index",Forum.GetLink(Pages.admin_admin)},
{"Board Settings",Forum.GetLink(Pages.admin_boardsettings)},
{"Forums",Forum.GetLink(Pages.admin_forums)},
{"Banned IP",Forum.GetLink(Pages.admin_bannedip)},
{"Smilies",Forum.GetLink(Pages.admin_smilies)},
{"Replace Words",Forum.GetLink(Pages.admin_replacewords)},
{"Terms & Conditions",Forum.GetLink(Pages.admin_terms)}
};

I add a new menu like below in above menu array
,{"Denied Mail",Forum.GetLink(Pages.(????))}

But what i need to write in (????) because Pages does not have enumeration.When i check through goto definition it takes me to the yaf.dll. Where i can add new entry in code of yaff.dll or any other option to add a menu.


Thanks
Sponsor
mdlesk
  • Posts: 36
  • Joined: 06/11/2008
You need to add your control name with a prefix of "admin_" to the enumeration. See the example code below. It is really easy to do. Let me know if you need any further help. Also make sure you are using the source code and not the compiled version.


AdminMenu.CS
			if ( PageContext.IsHostAdmin )
			{
				// create database menu
				string [,] dbLinks =
				{
					{"Reindex DB",YafBuildLink.GetLink( ForumPages.admin_reindex)},
					{"Run SQL Query",YafBuildLink.GetLink( ForumPages.admin_runsql)}
				};

				writer.Write( createMenu( "Database", "header2", "post", ref dbLinks ) );

			    string[,] dlesktechControls =
			        {
                        {"View ShoutBox Activity",YafBuildLink.GetLink(ForumPages.admin_dlesktech_shoutboxactivity)},
                        {"Run SQL",YafBuildLink.GetLink(ForumPages.admin_runsql)}
			        };
                writer.Write(createMenu("DLESKTECH Controls","header2","post",ref dlesktechControls));
			}

ForumPages.cs
			add admin_dlesktech_shoutboxactivity to the enum


nomi
  • Posts: 8
  • Joined: 09/11/2008
Hi,
Yes thanks But I did not find a file ForumPages.cs also I download the source and bin project from home page of Yet Another Forum.NET. When i click on ForumPages and right click then goto refrence it takes me to metadata file. That's a yaf.dll metadata file and its not editable. How can i get the yaf.dll source code to edit enumeration.
mdlesk
  • Posts: 36
  • Joined: 06/11/2008
What version are you using? In 1.9.3 it' sin the YAF.Classes.Base project. You will then have to recompile.
nomi
  • Posts: 8
  • Joined: 09/11/2008
Hi,
I just check the Assembly.cs file and i got from there

[assembly: AssemblyVersion("1.9.1.0")]

other info is below
[assembly: AssemblyTitle( "YetAnotherForum.NET" )]
[assembly: AssemblyDescription("ASP.NET Forum Application")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Tiny Gecko")]
[assembly: AssemblyProduct("http://www.yetanotherforum.net/")]
[assembly: AssemblyCopyright("Copyright (c) 2005-2007 by Jaben Cargman. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

I think its 1.9.1.0
Would you like to guide me which files need for yaf.dll and how I will get the source for yaf.dll because enumeration is in this dll.If you have a source code which will run in visual studio 2005 professional edition. I always run the source but its not updatin the menu and any other things.
Your help will be appreciateable.

Thanks.
mdlesk
  • Posts: 36
  • Joined: 06/11/2008
Do a search for YAF.Classes.Utils. Once you find that you will find the enumeration right under the class declaration.
nomi
  • Posts: 8
  • Joined: 09/11/2008
Hi,
I search but did not find it. WOuld you like to send me code via email on nauman77us@yahoo.com .......... Thanks
nomi
  • Posts: 8
  • Joined: 09/11/2008
Hi,
I found the classes in YAF-v1.9.3-BETA-SRC and in YAF-v1.9.3.3-ALPHA-SRC but i am using the download source from below URL
http://sourceforge.net/p...files.php?group_id=90539 
Version 1.9.1.8 Final is there but I did not find the classes in this downloaded source. How I can edit in this downloaded source code.
Mek
  • Posts: 892
  • Joined: 12/07/2005
http://forum.yetanotherf...ET-v20-Dated3272008.aspx 

Funnily enough it's in the same forum as all the other releases are....
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 🙂 )
nomi
  • Posts: 8
  • Joined: 09/11/2008
Yes thats same but i did not get the file ForumPages.cs in this source code to add the enumeration neither i got YAF.Classes.Utils in that source code.Also URLRewriter.NET project opening fine but other gives error so i remove .csproject file and then i open a visual studio2005 and open a website and add all folder into it.ALso make a virtual directory and set frame work 2.0. its loadin forum fine but changes are not working in it.
Mek
  • Posts: 892
  • Joined: 12/07/2005
As stated six million times on the forums, to open you need Visual 2005 with Service Pack 1. It will not open unless you have install SP1.
Install it, open the solution do your changes, and recompile.

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 🙂 )
nomi
  • Posts: 8
  • Joined: 09/11/2008
HI,
I have service pack 2 when i install service pack 1. It's not allowing me to install previous version. Is there any other option to install it.
The main thing is that i can't change enumeration wither i install it or not because when i click on go to refrence it takes me to meta data.
Mek
  • Posts: 892
  • Joined: 12/07/2005
Visual Studio 2005 Service Pack 1.
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 🙂 )
Users browsing this topic
    Forum Jump  
    • You cannot post new topics in this forum.
    • You cannot reply to topics in this forum.
    • You cannot delete your posts in this forum.
    • You cannot edit your posts in this forum.
    • You cannot create polls in this forum.
    • You cannot vote in polls in this forum.

    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