Yikes, where do I start, 2.5 years of fumbling in the dark and really only in the last few months has it started to come together (some here might dispute that mind you).
OK, for this site I have a custom table with some fields like:
TOPIC_ID, FORUM_ID, Status, ClearanceLevel, Client ... then a whole heap of date fields allocateDate, ASIODate,ASIOCompleteDate,InvoicedDate etc etc.
I setup every client with their own Forum (Members Only Hidden).
I add all the client forums to an array in inc_header:
intAllowedCategoryArray = Array(1,2,3,4,5,6,7,8 etc etc)
With this site the clients can login and request jobs (cases) using a custom posting form that I present to them instead of the normal post new topic form. Eg from forum.aspFor x = 0 to UBound(intAllowedCategoryArray)
If cLng(Request("FORUM_ID")) = intAllowedCategoryArray(x) Then
blnForumCheck = 1
x = UBound(intAllowedCategoryArray)
End If
Next
If blnForumCheck = 1 Then
Response.Write "<td align=""center"" bgcolor=""" & strHeadCellColor & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Applicant</font></b></td>" & vbNewLine
else
Response.Write " <td align=""center"" bgcolor=""" & strHeadCellColor & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Topic</font></b></td>" & vbNewLine
end if
I also set all clients as normal users and Company employees as Moderators. Makes it easy to hide custom pages/links. Also allows the employees the ability to modify the job request posted by the client.
I write to my custom table every time a new topic (job) is posted, replied to, deleted. Basically you go through post_info.asp (in my case I've got a custom post_info.asp with all the URL, Forum and Category code posting stripped out leaving just topic and reply). Excerpt: '**************CUSTOM POST FIELDS ************
dim ApplicantMessage
ApplicantMessage = "Name: " & Request.Form("Subject1") & ", " & Request.Form("Subject2") & vbNewLine
ApplicantMessage = ApplicantMessage & "Designation: " & Request.Form("Designation") & vbNewLine
ApplicantMessage = ApplicantMessage & "Division: " & Request.Form("Division") & vbNewLine
ApplicantMessage = ApplicantMessage & "Position: " & Request.Form("Position") & vbNewLine
ApplicantMessage = ApplicantMessage & "Phone No: " & Request.Form("Phone") & vbNewLine
ApplicantMessage = ApplicantMessage & "Email: " & Request.Form("Email") & vbNewLine
ApplicantMessage = ApplicantMessage & "Send Pack to: " & Request.Form("mailing_address")
ApplicantMessage = ApplicantMessage & ", " & Request.Form("Suburb")
ApplicantMessage = ApplicantMessage & ", " & Request.Form("state")
ApplicantMessage = ApplicantMessage & " " & Request.Form("postal_code") & vbNewLine
ApplicantMessage = ApplicantMessage & "
" & "Level: " & Request.Form("Level") & vbNewLine
ApplicantMessage = ApplicantMessage & "Type: " & Request.Form("Apptype") & vbNewLine
ApplicantMessage = ApplicantMessage & "Previous Clearance: " & Request.Form("Previous") & vbNewLine
txtMessage = ChkString(ApplicantMessage & vbNewLine & "Reason for Request: " & Request.Form("Message"),"message")
'******************************
clearanceLevel = ChkString(Request.Form("Level"),"message")
clearanceType = ChkString(Request.Form("AppType"),"message")
txtLocation = ChkString(Request.Form("Location"),"message")
pulls the data from my posting form. '###################################################
'## Forum_SQL - Add new post to Clearances Table
strSql = "INSERT INTO " & strTablePrefix & "CLEARANCES (TOPIC_ID"
strSql = strSql & ", FORUM_ID"
strSql = strSql & ", ClearanceLevel"
strSql = strSql & ", ClearanceType"
strSql = strSql & ", Customer"
strSql = strSql & ", NewRequestDate"
strSql = strSql & ", CaseOfficer"
strSql = strSql & ", Status"
strSql = strSql & ") VALUES ("
strSql = strSql & NewTopicID
strSql = strSql & "," & FORUM_ID
strSql = strSql & ", '" & clearanceLevel & "'"
strSql = strSql & ", '" & clearanceType & "'"
strSql = strSql & ", '" & strForum_Title & "'"
strSql = strSql & ", '" & DateToStr(strForumTimeAdjust) & "'"
strSql = strSql & ", 'TBA' "
strSql = strSql & ", 1 "
strSql = strSql & ")"
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
inserts new record in my custom table.
I don't know how I can describe how I modified topic.asp. I looked at the syndication or articles mod and saw how they modified topic.asp to look like an article. I played around with that and then inserted this code into topic.asp: if isevent="1" then
Response.Write "<DIV style=""float:left"">" & vbnewline
DrawMonth dateHolder, 1, 0, 1
Response.Write "</DIV>" & vbnewline & _
"<B>" & ChkString(Topic_Subject,"title") & "<BR />" & vbnewline & _
FormatDateTime(dateHolder, vbLongDate) & "</B><BR /><BR />" & vbnewline
end if
if not isnumeric(right(Topic_Subject,3)) then CaseNo = "TBA"
if isnumeric (right(Topic_Subject,3)) then CaseNo = right(Topic_Subject,9)
if isnumeric (right(Topic_Subject,3)) then
strLength = len(Topic_Subject)
Topic_Subject = left(Topic_Subject, strLength-9)
end if
%>
<table border="0" cellspacing="0" cellpadding="5" width="100%" align="center" class="textBlock">
<tr>
<td nowrap><b>Vettee Name:</b></td>
<td><%=Topic_Subject%> </td>
<td nowrap><b>Case No: </b></td>
<td nowrap><%=CaseNo%></td>
</tr>
<tr>
<td nowrap><b>Client:</b></td>
<td><%=Customer%> </td>
<td nowrap><b>Submitted: </b></td>
<td nowrap><%=ChkDate(NewRequestDate, vbLongDate,false)%> by: <%=Member_Name%></td>
</tr>
<tr>
<td nowrap><b>Case Officer:</b></td>
<td><%=CaseOfficer%> </td>
<td nowrap><b>Priority: </b></td>
<td nowrap>
<%
if sticky=0 then response.write "<b>Normal</b>"
if sticky=1 then response.write "<b><font color=""red"">*** URGENT ***</b></font>"
%>
</td>
</tr>
<tr>
<td nowrap bgcolor="FFEBCD"><b>Clearance Level:</b></td>
<td bgcolor="FFEBCD"><%=ClearanceLevel%> </td>
<td nowrap bgcolor="FFEBCD"><b>Clearance Type:</b></td>
<td bgcolor="FFEBCD"><%=ClearanceType%> </td>
</tr>
<tr>
<td valign="top"><b>Progress Meter: </b></td>
<td valign="top" colspan="3">
<%
Response.Write "<b>"
if AwaitingPackDate > 1 and isnull(AllocateDate) then
Response.Write "<font color=""red""> Awaiting Pack </font>" & "»"
end if
if AllocateDate > 1 and CaseOfficer = "TBA" then
Response.Write "<font color=""green"">Pack IN </font>" & "»"
Response.Write "<font color=""red""> Awaiting Allocation </font>" & "»"
else
if AllocateDate > 1 then
Response.Write "<font color=""green"">Pack IN </font>" & "»"
Response.Write "<font color=""green""> In Progress </font>" & "»"
end if
end if
if GADSDate > 1 and isnull(GADSinDate) then
Response.Write "<font color=""green""> Await GADS </font>" & "»"
end if
if GADSinDate > 1 then
Response.Write "<font color=""green""> GADS COMPLETED </font>" & "»"
end if
if ASIODate > 1 and isnull(ASIOinDate) then
Response.Write "<font color=""green""> Await ASIO </font>" & "»"
end if
if ASIOinDate > 1 then
Response.Write "<font color=""green""> ASIO COMPLETED </font>" & "»"
end if
if CompleteDate > 1 then
Response.Write "<font color=""blue""> Completed </font>" & "»"
end if
if invoicedDate > 1 then
Response.Write "<font color=""blue""> Invoiced </font>" & "»"
end if
if Paiddate > 1 then
Response.Write "<font color=""blue""> Paid </font>"
end if
if CancelledDate > 1 then
Response.Write "»" & "<font color=""red""> Cancelled </font>"
end if
Response.Write "</b><hr>"
%>
</td>
</tr>
<tr>
<td valign="top"><b>Status Dates: </b></td>
<td valign="top" width="150"><font color="black"><%=formatStr(Summary)%></font></td>
<td valign="top"><b>Original Posted Request: </b></td>
<td valign="top"><font color="black"><%=formatStr(Topic_Message)%></font></td>
</tr>
</table>
<%
' end if
Response.Write "</span id=""msg""></font></td>" & vbNewLine
if is_event = "1" and strList = "1" then
Response.Write " <tr>" & vbNewLine & _
" <td valign=""bottom""><hr noshade size=""" & """>" & vbNewLine & _
"<input type=""button"" value=""View Attendees"" onClick=""eventattendees(this)"">" & vbNewLine & _
There's a lot more behind this. My Quick Reply has been modified to show a dropdown box with last "Update" value selected. Changing the selection and posting correspondence changes the status in my custom table and appends a date/time stamp record in a Summary text field (see Status Dates in the screenshot). I have a function in inc_func_common that gets the name of the status and assigns font colour.
I've also got a heap of custom reports, views, printer-friendly reports that can exported to Word or Excel.
This site has taken a while to get to where it is but the clients love it. It absolutely rocks.
I did a similar site last year (I never get to do sites I can show off or win awards with for some reason!) that tracked loan equipment and equipment repairs for an IT company. Again, custom posting forms, custom views and reports.
I couldn't have done any of this without the fantastic support I get from all the guys here .. you know who you are!!
I've missed heaps of explanations out.