• Anonymous
  • Login
  • Register
BlogSphere - Feature Request: PLEASE PLEASE PLEASE remove Rocky's Umlauts code!!!!!!


Rocky broke this a few versions ago and it is still there and I have reported this. Basically if you have more than one picture in the rich text read me or readmore field only the first picture is saved. An easy test is to create a doc copy and paste a few pictures and see them dissapear when publishing. I will be adding a few more as I am testing. Apart from this it is looking awesome!

This is what needs to be removed from the Client Story Form Postsave:

If Not mime Is Nothing Then Call mime.DecodeContent() ' fix to support umlauts
Call child.DecodeContent() ' fix to support umlauts
If Not mime Is Nothing Then Call mime.DecodeContent() ' fix to support umlauts
Call child.DecodeContent() ' fix to support umlauts


Here is the full event with current updates that works:

Sub Postsave(Source As Notesuidocument)

Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim agent As NotesAgent
Dim item As NotesItem
Dim mime As NotesMimeEntity
Dim Permalink As String
Dim blogConfig As NotesDocument
Dim strHTML As String

Set db = s.CurrentDatabase
Set doc = source.Document
Set blogConfig = db.GetProfileDocument("BlogConfig")

If doc.StoryPostStyle(0) = "Plain Text" Then
doc.FinalStoryText = doc.StoryText(0)
doc.FinalReadMoretext = doc.StoryText_1(0)
Else
s.ConvertMime=False
strHTML = ""
Set item = doc.GetFirstItem("StoryRichText")
Set mime = item.GetMimeEntity
Set child = mime.GetFirstChildEntity
If child Is Nothing Then
strHTML = mime.ContentAsText
Else
While Not(child Is Nothing)
If child.ContentSubType="html" Then
strHTML = strHTML + child.ContentAsText
End If
Set child = child.GetNextSibling
Wend
End If
count =2
permalink = doc.PermaLink(0)
startcheck:
x = Instr(1,strHTML,"<img src=cid:")
If x = 0 Then Goto savedoc
y = Instr(x,strHTML,">")
m=Instr(x, strHTML, { alt=}) +5
If m>5 And m<y Then
altTag=Mid$(strHTML, m, y-m)
Else
altTag={A picture named M} + count
End If
NewImg = {<img src="./plinks/}+PermaLink+{/StoryRichText/M} + count + {?OpenElement"}
strHTML = Left(strHTML,x-1) + NewImg + { alt="} + altTag + {">} + Right(strHTML,Len(strHTML)-(y))
count = count +1
Goto startcheck
savedoc:
doc.FinalStoryText = strHTML

strHTML = ""
Set item = doc.GetFirstItem("ReadMoreRichText")
Set mime = item.GetMimeEntity
Set child = mime.GetFirstChildEntity
If child Is Nothing Then
strHTML = mime.ContentAsText
Else
While Not(child Is Nothing)
If child.ContentSubType="html" Then
strHTML = strHTML + child.ContentAsText
End If
Set child = child.GetNextSibling
Wend
End If
count =2
permalink = doc.PermaLink(0)
startcheck2:
x = Instr(1,strHTML,"<img src=cid:")
If x = 0 Then Goto savedoc2
y = Instr(x,strHTML,">")
m=Instr(x, strHTML, { alt=}) +5
If m>5 And m<y Then
altTag=Mid$(strHTML, m, y-m)
Else
altTag={A picture named M} + count
End If
NewImg = {<img src="./plinks/}+PermaLink+{/ReadMoreRichText/M} + count + {?OpenElement"}
strHTML = Left(strHTML,x-1) + NewImg + { alt="} + altTag + {">} + Right(strHTML,Len(strHTML)-(y))
count = count +1
Goto startcheck2
savedoc2:
If Len(strHTML) > 2 Then
doc.FinalReadMoreText = strHTML
Else
doc.FinalReadMoreText = ""
End If

End If

' 13May2003 Joe Litton. Strip HTML from post
doc.txtStoryNoHTML = stripHtmlFromString( doc.FinalStoryText(0) )
doc.txtRSSAbstract = createRSSAbstract( doc.txtStoryNoHTML(0) )

' START Replace HotText with URLs
If blogConfig.conf_Basic_DoHotText(0) = "Yes" Then
Dim htvw As NotesView
Dim htvw_count As Integer
Dim htvw_nav As NotesViewNavigator
Dim htvw_entry As NotesViewEntry
Dim HT_OrigText As String
Dim HT_URLText As String

Set htvw = db.GetView("HotTextLookup")
Set htvw_nav = htvw.CreateViewNav()
Set htvw_entry = htvw_nav.GetFirst()
While Not(htvw_entry Is Nothing)
HT_OrigText = htvw_entry.ColumnValues(0)
HT_URLText = htvw_entry.ColumnValues(1)
doc.FinalStoryText = SearchReplace(doc.FinalStoryText(0),HT_OrigText,HT_URLText)
doc.FinalReadMoreText = SearchReplace(doc.FinalReadMoreText(0),HT_OrigText,HT_URLText)
Set htvw_entry = htvw_nav.GetNext(htvw_entry)
Wend
End If
' END Replace HotText with URLs

' START Replace emoticons
Dim emvw As NotesView
Dim emvw_count As Integer
Dim emvw_nav As NotesViewNavigator
Dim emvw_entry As NotesViewEntry
Dim em_OrigText As String
Dim em_URLText As String

Set emvw = db.GetView("EmoticonLookup")
Set emvw_nav = emvw.CreateViewNav()
Set emvw_entry = emvw_nav.GetFirst()
While Not(emvw_entry Is Nothing)
em_OrigText = emvw_entry.ColumnValues(0)
em_URLText = emvw_entry.ColumnValues(2)
doc.FinalStoryText = SearchReplace(doc.FinalStoryText(0),em_OrigText,em_URLText)
doc.FinalReadMoreText = SearchReplace(doc.FinalReadMoreText(0),em_OrigText,em_URLText)
Set emvw_entry = emvw_nav.GetNext(emvw_entry)
Wend
' END Replace Emoticons

' Check for special chars in the story title and finalStoryText

' doc.FinalStoryText = SearchReplace(doc.FinalStoryText(0),"&","&amp;")
' doc.FinalStoryText = SearchReplace(doc.FinalStoryText(0),"<","&lt;")
' doc.FinalStoryText = SearchReplace(doc.FinalStoryText(0),">","&gt;")
' doc.FinalStoryText = SearchReplace(doc.FinalStoryText(0),"'","&apos;")
' doc.FinalStoryText = SearchReplace(doc.FinalStoryText(0),|"|,"&quot;")

doc.FinalStoryTitle = doc.Storytitle(0)

doc.FinalStoryTitle = SearchReplace(doc.FinalStoryTitle(0),"&","&amp;")
doc.FinalStoryTitle = SearchReplace(doc.FinalStoryTitle(0),"'","&apos;")
doc.FinalStoryTitle = SearchReplace(doc.FinalStoryTitle(0),"<","&lt;")
doc.FinalStoryTitle = SearchReplace(doc.FinalStoryTitle(0),">","&gt;")
doc.FinalStoryTitle = SearchReplace(doc.FinalStoryTitle(0),|"|,"&quot;")

' END Check for special chars in the story title and finalStoryText

doc.txtDocID = doc.UniversalID

Call doc.save(True,True)

If doc.storystatus(0) = "Published" Then
If blogConfig.conf_Basic_Weblogs(0) = "Always" Then
Set agent = db.GetAgent("XmlRpcPing")
agent.Run
Messagebox "Weblogs.com has been updated",, "Success"
Else
If blogConfig.conf_basic_weblogs(0) = "Ask" Then
x = Messagebox("Would you like to send weblogs.com an XML RPC Ping to show that your WebLog has been updated?",36,"WebLogs XML RPC Ping By UNGANISHA.ORG")
If x = 6 Then
Set agent = db.GetAgent("XmlRpcPing")
agent.Run
Messagebox "Weblogs.com has been updated",, "Success"
End If
End If
End If
End If

If blogConfig.conf_Basic_UpdateCalendar(0) = "Yes" Then
Call InitCalendar(source.document.storydate(0))
End If

doc.SearchText = doc.storytitle(0) + " " + doc.finalstorytext(0) + " " + doc.finalreadmoretext(0)

Call doc.Save(True, True)


End Sub



Taken Actions by Owners

Owners are investigating the request.



Documents
In this field you can enter the actual request.

You can use the rich text editor for rich text formating. You can also enter HTML to embed objects, e.g. to embed a YouTube video or a screenshot of the project. In this case use '[' and ']' to mark the passthrough HTML as such.

Please note that the first time you use the new UI your description is converted from rich text to MIME. You might want to copy and paste the raw plain text from the old UI in the new UI so that you don't loose information.
In this field owners can describe what they have done or want to do.

You can use the rich text editor for rich text formating. You can also enter HTML to embed objects, e.g. to embed a YouTube video or a screenshot of the project. In this case use '[' and ']' to mark the passthrough HTML as such.

Please note that the first time you use the new UI your description is converted from rich text to MIME. You might want to copy and paste the raw plain text from the old UI in the new UI so that you don't loose information.