Author |
Topic |
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 20 February 2011 : 11:17:36
|
I'm working on a little mod, ran into a snag getting the URL variable in the func common tags to work right. I'm not getting the first strTempString value to appear.
|
Edited by - Carefree on 21 February 2011 09:42:30 |
|
kyodai
New Member
Azerbaijan
74 Posts |
Posted - 20 February 2011 : 11:27:20
|
I'd personally have put a blank in before the ampersand but i can't see any real error here. |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 20 February 2011 : 21:19:13
|
Never mind. Fixed it using a different approach. |
|
|
Davio
Development Team Member
Jamaica
12217 Posts |
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 21 February 2011 : 06:44:49
|
I'll have to separate my notes and write it up, Davio. Working on too many things at the same time. It still has one bug to work out.
OK, here's what I did for the guy. He wanted a single button added to the editor functions so that he could put in a hotlink to Google images about a particular subject.
Save this to your images folder as "icon_editor_gimage.png":
"inc_func_common.asp"
Search for the following line (appx 1555):
Sub WriteFooter() %>
Above it, insert the following:
' ##### GImage Below #####
Function ReplaceGImageTags(fString)
Dim oTag, cTag
Dim roTag, rcTag
Dim oTagPos, cTagPos
Dim nTagPos
Dim counter1, counter2
Dim strCodeText
Dim Tagcount
Dim strTempString, strResultString
TagCount = 2
Dim CodeTags(2,2,2)
Dim strArray, strArray2
CodeTags(1,1,1) = "[GImage]"
CodeTags(1,2,1) = "[/GImage]"
CodeTags(1,1,2) = "<a href=""http://images.google.com/images?hl=en&source=img&q="
CodeTags(1,2,2) = "</a>"
CodeTags(2,1,1) = "[GImage]"
CodeTags(2,2,1) = "[/GImage]"
CodeTags(2,1,2) = CodeTags(1,1,2)
CodeTags(2,2,2) = CodeTags(1,2,2)
strResultString = ""
strTempString = fString
for counter1 = 1 to TagCount
oTag = CodeTags(counter1,1,1)
roTag = CodeTags(counter1,1,2)
cTag = CodeTags(counter1,2,1)
rcTag = CodeTags(counter1,2,2)
oTagPos = InStr(1, strTempString, oTag, 1)
cTagPos = InStr(1, strTempString, cTag, 1)
if (oTagpos > 0) and (cTagPos > 0) then
strArray = Split(strTempString, oTag, -1)
for counter2 = 0 to Ubound(strArray)
if (Instr(1, strArray(counter2), cTag) > 0) then
strArray2 = split(strArray(counter2), cTag, -1)
strCodeText = trim(strArray2(0))
strResultString = strResultString & roTag & strCodeText & """ target=""_blank"">" & strCodeText & rcTag & strArray2(1)
else
strResultString = strResultString & strArray(counter2)
end if
next
strTempString = strResultString
strResultString = ""
end if
next
ReplaceGImageTags = strTempString
End Function
' ##### GImage Above #####
Next, search for the following line (appx 146):
FormatStr = fString
Above it, insert the following:
' ##### GImage Below #####
fString = ReplaceGImageTags(fString)
' ##### GImage Above #####
"inc_iconfiles.asp"
Search for the following line (appx 148):
Const strIconZap = "icon_zap.gif|16|16"
Below it, add the following:
' ##### GImage Below #####
Const strIconGImage = "icon_editor_gimage.png|23|22"
' ##### GImage Above #####
"inc_post_buttons.asp"
Search for the following lines (appx 61-63):
if strIMGInPosts = "1" then
Response.Write "<a href=""Javascript:image();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorImage,"Insert Image","align=""top""") & "</a>" & vbNewLine
end if
Change them to say:
if strIMGInPosts = "1" then
Response.Write "<a href=""Javascript:image();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorImage,"Insert Image","align=""top""") & "</a>" & vbNewLine
' ##### GImage Below #####
Response.Write "<a href=""Javascript:GImage();"" tabindex=""-1"">" & getCurrentIcon(strIconGImage,"Google Images","align=""top""") & "</a>" & vbNewLine
' ##### GImage Above #####
end if
"inc_code.js"
Add the following to the very bottom of the file:
function GImage() {
var text = getText();
if (helpstat) {
alert("GImage tag searches for related images on Google.\n\nUSE: [GImage](words to search for)[/GImage]");
} else if (basic) {
AddTxt="[GImage]" + text + "[/GImage]";
AddText(AddTxt);
} else {
if (text) {
txt=prompt("Image to search for.",text);
} else {
txt=prompt("Image to search for.","Insert words describing image to search for.");
}
if (txt!=null) {
AddTxt="[GImage]"+txt+"[/GImage]";
AddText(AddTxt);
}
}
}
|
Edited by - Carefree on 06 March 2013 19:45:04 |
|
|
|
Topic |
|
|
|