Page : 1/1

First Page    Prev. Page    Next Page    Last Page


Wednesday, 17 Nov 2004

I had an e-mail from Ron (from Holland) asking a few things about BlogX and making a few suggestions, so I thought it would benefit everyone if I made a post with an FAQ....well more like never asked before questions

--------------------------------------------------------------------------------

Past Entries (Making posts appear from the past)
You can either do this by opening up the access database, finding the "Data" table, if you double click it you will see that you are able to change the dates :-).. I cheat a little like this myself sometimes, if for whatever reason you don't think this is an acceptable solution, then I can help provide a solution to program this functionality in.. The data must follow an order though, e.g. 1st, 3rd, 5th of November, otherwise the page headings can look a little weird (e.g. they wont be in order either)

--------------------------------------------------------------------------------

Default Categories (Making the box for "Category" on AddEntry always filled with a certain category)
Simply make this minor adjustment to "\Admin\Addentry.asp"
Find : Response.Write " or create/edit the selected Category : <input Name=""Category"" type=""text"" style=""width:10%;"" maxlength=""50""></P>"
Replace With : Response.Write " or create/edit the selected Category : <input Name=""Category"" type=""text"" style=""width:10%;"" maxlength=""50"" value=""YOURCATEGORY""></P>"

--------------------------------------------------------------------------------

Category Selection on the "Edit Entry" page (Adding the drop down box to select categories on the Edit Entry page too)
I didn't think to add the category checkboxes on the edit page as I thought you'd only edit the entry to make a minor typo to the category, however should you still want to see the categories..

Find : <% If ShowCat <> False Then Response.Write "<P>Category : <input Name=""Category"" type=""text"" value=""" & Category & """ style=""width:10%;"" onChange=""return setVarChange()""></P>">

Replace With :
<% If (ShowCat <> False) AND (Legacy <> True) Then

'--- Open set ---'
Records.CursorLocation = 3 ' adUseClient
Records.Open "SELECT * FROM Data ORDER BY Category",Database, 1, 3

'--- Set Category ---'
Set Category = Records("Category")

'-- Write Them In ---'
Response.Write "Select an existing category : "
Response.Write "<select name=""SelectCategory"" onChange=""document.AddEntry.Category.value = this[this.selectedIndex].value; "">" & VbCrlf
Response.Write "<option value="""">-- New --" & VbCrlf

Do Until (Records.EOF or Records.BOF)
If (LastCat <> Category) OR (IsNull(LastCat) = True) AND (Category <> "") Then
Response.Write "<option value=""" & Replace(Category, "%20", " ") & """>" & Replace(Category, "%20", " ") & "" & VbCrlf
LastCat = Category
End If
Records.MoveNext
Loop

Response.Write "</select>"

'-- Close The Database & Records ---'
Records.Close

Response.Write " or create/edit the selected Category : <input Name=""Category"" type=""text"" style=""width:10%;"" maxlength=""50""></P>"

ElseIf ShowCat <> False Then
Response.Write "<P>Category : <input Name=""Category"" type=""text"" style=""width:10%;"" maxlength=""50""></P>"

End If %>

--------------------------------------------------------------------------------

Bug : Entering in a &nbsp; in the text box, converts to a space on the "Edit Entry" page
This is down to the HTML Form's TextBox interpreting the character as a space, this is down right annoying, I have fixed this in the ZIP file, but there's no need for you to download the entire ZIP file again just for this.. so to make the same changes I just made, Open up "Admin/EditEntry.asp"

Find : <textarea Name="Content" DESIGNTIMEDRAGDROP="96" style="height:10em;width:100%;" onChange="return setVarChange()"><%=Text%></textarea>
Replace : <textarea Name="Content" DESIGNTIMEDRAGDROP="96" style="height:10em;width:100%;" onChange="return setVarChange()"><%=Replace(Text,"&","&")%></textarea>

--------------------------------------------------------------------------------

Thanks again to Ron for that, I also found another bug fix while going through this article, posting "</textarea>" causes trouble on the "Edit Entry" page (I thought i'd fixed that before).. so the line should look like that "<%=Replace(Replace(Text,"&","&amp;"),"<","&lt;")%>"