jtrac429
  •  jtrac429
  • 57.8% (Neutral)
  • YAF Forumling Topic Starter
2008-03-18T04:56:59Z
2 questions -
YAF 1.9.1.6

How can I get the search form to display on every page rather than having the link to the form in the first row of the "class" table? I'm thinking about an I-frame perhaps that points to that page but where to put that I don't know.

Can the initial post in a topic be styled any differently to give the users of the forum a clearer sense that this post was first and all posts beneath are replies. As I read it now each post is using the "postheader" class. I'd like to see a different class like "initialpost" for the first one in a thread and 'postheader' the rest of the way.

I work for a not for profit organization that has over forty facilities and we're trying to flatten our landscape. I think YAF is an excellent tool to facilitate conversations about protocol, equipment needs, etc. across geographic boundaries. Any help will be greatly appreciated.
Sponsor
Jaben
  •  Jaben
  • 100% (Exalted)
  • YAF Developer
2008-03-18T22:38:07Z
Hello,

Both are possible with a little tweeking. The first one you might want to modify the "Default.aspx" page and add a search box to that. (A form that posts to the search page.) The second one, I suggest you take a look at the /pages/posts.aspx code -- there you should find a way to change the class on the first post.


jtrac429
  •  jtrac429
  • 57.8% (Neutral)
  • YAF Forumling Topic Starter
2008-04-07T11:28:46Z
No luck implementing the search on all pages. Not sure how to wire the search functionality to the default.aspx page. Below is one of numerous attempts, and subsequently numerous failures.

If I remove the Reference to the search page the form will allow me to input text and when I click the Search button I get to the search page but the page loads as if I just clicked the search link in the top row of links.

Any help is always appreciated, in other words "Gunga Goongula" for you Caddy-Shack fans

<%@ Page Language="C#" AutoEventWireup="True" %>
<%@ Register TagPrefix="yaf" Namespace="yaf" Assembly="yaf"  %>
<%@ Register TagPrefix="yc" Namespace="yaf.controls" Assembly="yaf" %>
<%@ Reference Page="~/pages/search.ascx" %>

<script runat="server">
public void Page_Error(object sender,System.EventArgs e)
{
	Exception x = Server.GetLastError();
	string exceptionInfo = "";
	while ( x != null )
	{
		exceptionInfo += DateTime.Now.ToString( "g" );
		exceptionInfo += " in " + x.Source + "\r\n";
		exceptionInfo += x.Message + "\r\n" + x.StackTrace + "\r\n-----------------------------\r\n";
		x = x.InnerException;
	}
	yaf.DB.eventlog_create( forum.PageUserID, this, exceptionInfo );
	yaf.Utils.LogToMail(x);
}
</script>

<html>
<script language="javascript">
<!--

  function yaf_GetForm()
  {
    var theform;
    if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1)
    {
	  theform = document._ctl0;
	}
	else {
	  theform = document.forms["_ctl0"];
    }
    return theform;
  }

  function yaf_SmartScroller_GetCoords()
  {
    var scrollX, scrollY;
    if (document.all)
    {
      if (!document.documentElement.scrollLeft)
        scrollX = document.body.scrollLeft;
      else
        scrollX = document.documentElement.scrollLeft;

      if (!document.documentElement.scrollTop)
        scrollY = document.body.scrollTop;
      else
        scrollY = document.documentElement.scrollTop;
    }
    else
    {
      scrollX = window.pageXOffset;
      scrollY = window.pageYOffset;
    }
	var cForm = yaf_GetForm();
    cForm.forum__ctl0_scrollLeft.value = scrollX;
    cForm.forum__ctl0_scrollTop.value = scrollY;
  }

  function yaf_SmartScroller_Scroll()
  {
    var cForm = yaf_GetForm();
    var x = cForm.forum__ctl0_scrollLeft.value;
    var y = cForm.forum__ctl0_scrollTop.value;
		if (x || y) window.scrollTo(x, y);
		if (oldOnLoad != null) oldOnLoad();
  }
	
	var oldOnLoad = window.onload;
  
  window.onload = yaf_SmartScroller_Scroll;
  window.onscroll = yaf_SmartScroller_GetCoords;
  window.onclick = yaf_SmartScroller_GetCoords;
  window.onkeypress = yaf_SmartScroller_GetCoords;
// -->
</script>
<head runat="Server" id="YafHead">
<meta name="Description" content="A bulletin board system written in ASP.NET" />
<meta name="Keywords" content="Yet Another Forum.net, Forum, ASP.NET, BB, Bulletin Board, opensource" />
<!-- If you don't want the forum to set the page title, you can remove runat and id -->
<title runat="server" id="ForumTitle">This title is overwritten</title>
</head>

<body>
	
<img src="images/yaflogo.jpg" runat="server" id="imgBanner" alt="" />
<form name="_ctl0" id="_ct10" method="post" action="default.aspx?g=search"  enctype="multipart/form-data">
<input name="forum:_ctl0:txtSearchString" id="forum__ctl0_txtSearchString" style="width: 350px;" type="text" />
<input name="forum:_ctl0:btnSearch" value="Search" id="forum__ctl0_btnSearch" class="pbutton" type="submit" />
</form>

<br />

<form runat="server" enctype="multipart/form-data">
	<yaf:forum runat="server" id="forum" />
	
</form>

</body>
</html>
jtrac429
  •  jtrac429
  • 57.8% (Neutral)
  • YAF Forumling Topic Starter
2008-05-28T11:38:18Z
still looking for a solution to this issue. Anyone?

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