<%@ language="javascript" %> <% /* Filename: dispBB.asp Version : 2.1 Author : Niranjan Mysore Date : start: 07/24/2003 Last Modified: 2004/08/20 Purpose : Bulletin Board on TS site Description: * Same BB used on HCS site * For the common user to view the messages (only the approved ones). To do : * some e-mail IDs are too long to create havoc in formatting of other fields and disturbing the table. Add a function to add line breaks after certain number of characters. implement the good programming practice: receive all the resultset fields together and then use them. Version History: * V1.0 - 1.1 added summary and reply fields to DB; entailing formatting changes. * V1.1 - 1.11 summary field displayed again with the msg & reply; descending order of mID * V1.11 - 1.12 post your msg is just 'mailto:BB@TS.com' in stead of 'tsBB.asp?tgt=tsBB' * V1.x - 2.0 view msgs by groups i.e., in groups of say 10, 1-10, 11-20, etc. or view ALL. * V2.0 - 2.1 BB in main window; displayed with left navigation bar */ %> The Truth-seeker Bulletin Board <% // v1.1 function printTxtAreaInHTML(str) { var len, opStr; if(str=="null") // works with MS-Access { Response.Write(""); return; } len = str.length; opStr = "" + str.charAt(0); for(i=1;i <% // links for msg posting page, FAQ page, close window //var links = "

\n Post your message\n     \n Frequently Asked Questions\n     \n Close Bulletin Board\n

"; var links = "

\n The Truth Seeker Principles\n     \n Post your message\n     \n Frequently Asked Questions\n     \n

"; var conn=Server.CreateObject("ADODB.Connection") ; //conn.Open(Session("Server")); conn.Open("DSN=thetrut_seeker"); var rs=Server.CreateObject("ADODB.recordset"); var count=0; var mySQL = ""; // handle page view of records var pageLength=Session.Contents("viewSetLengthV"); var dispSet1; var dispSet = String(Request.QueryString("st")); if(dispSet == "undefined") { Session("viewPageV")=1; dispSet1=""; } else if(dispSet == "0") { Session("viewPageV")=0; dispSet1=""; } else { Session("viewPageV")=1; dispSet1 = "AND mID <= " + dispSet; } var pageNum = String(Request.QueryString("page")); // receive the page # to be displayed var pageNum1; if(pageNum=="undefined") pageNum1=1; // default to first page else pageNum1 = parseInt(pageNum); // current page num var dispMany1=""; // query part indicating how many recs to be displayed viewPageV = Session.Contents("viewPageV"); if(viewPageV!=0) dispMany1 = "TOP " + pageLength; else dispMany1 = ""; %>

THE TRUTH-SEEKER BULLETIN BOARD

TS Disclaimer: The opinions expressed on this bulletin board are those of contributors, and do not necessarily reflect the views of the Truth-Seeker. For bulletin board posting guidelines, please click here.

Current Discussion Topic on HCS:

Topic for the month: Whose truth is it anyway: Is there transcendent truth? Or, is Truth only relative? How does the answer relate to spiritual unfoldment?

Practicing the Master Technique -Exercise for the Month: A minimum of three times per day, in sets of twenty five, repeat -with feeling and conviction- “I accept this perfect day in my life!” Experiment as needed. Observe the impact this has on your life. Share your experiences and findings with the BB.

<%=links%> <% // get all the IDs and create page links var mIDAr; mIDAr=new Array(0); mySQL = "SELECT mID FROM BulletinBoard WHERE approved = 'y' ORDER BY mID DESC"; rs.Open(mySQL, conn); count = 0; while(!rs.EOF) { mIDAr[count]=rs.Fields("mID").Value; rs.MoveNext(); count++; } rs.close; var pages = mIDAr.length/pageLength; if(mIDAr.length % pageLength > 0)pages += 1; if(pages>1) { Response.Write("

Page "); for(i=1;i"+i+" "); else { Response.Write(""); Response.Write( i + " "); } } /* No All link as on 20040220 // print the word ALL appropriately if(viewPageV==0)Response.Write("ALL  "); else Response.Write("ALL  "); */ Response.Write("

"); } %>

  print-friendly


<% var mID1, postedBy1, postDate1, summary1, msg1, reply1; // print the subject (summary) list first mySQL = "SELECT " + dispMany1 + " mID, postedBy, postDate, summary FROM BulletinBoard WHERE approved = 'y' " + dispSet1 +" ORDER BY mID DESC"; rs.Open(mySQL, conn); while(!rs.EOF) { mID1 = rs.Fields("mID").Value; postedBy1 = rs.Fields("postedBy").Value; postDate1 = rs.Fields("postDate").Value; summary1 = rs.Fields.Item("summary").Value; %> <% rs.MoveNext(); } // end while #1 rs.close; mySQL = "SELECT " + dispMany1 + " mID, postedBy, postDate, summary, msg, reply FROM BulletinBoard WHERE approved = 'y' " + dispSet1 +" ORDER BY mID DESC"; rs.Open(mySQL, conn); %>
Posted by Date Subject
<% =postedBy1 %> <% =postDate1 %>

<%=summary1%>

(Click on the message subject to view the entire message & the reply)


<%=links%> <% // print the message and reply while(!rs.EOF) { mID1 = rs.Fields("mID").Value; postedBy1 = rs.Fields("postedBy").Value; postDate1 = rs.Fields("postDate").Value; summary1 = rs.Fields.Item("summary").Value; msg1= rs.Fields.Item("msg").Value; reply1 = rs.Fields.Item("reply").Value; %>
<% =postedBy1 %>
<% =postDate1 %>

<%=summary1%>

<%printTxtAreaInHTML(String(msg1).replace(/\r/g, "
"))%>
<%printTxtAreaInHTML(String(reply1).replace(/\r/g, "
"))%>

Go to Top <% rs.MoveNext(); } rs.close; conn.close; %> <%=links%>