Author |
Topic |
laser
Advanced Member
Australia
3859 Posts |
Posted - 01 January 2004 : 15:50:11
|
quote: Originally posted by DavidRhodes
images are not found if the user uses [img=left] or [img=right]
Easy fix :
Line 135 was :
If InStr(rst("M_SIG"), "[img]") > 0 Then
Change to :
If InStr(rst("M_SIG"), "[img]") > 0 or InStr(rst("M_SIG"), "[img=left]") > 0 or InStr(rst("M_SIG"), "[img=right]") > 0 Then
|
|
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 01 January 2004 : 16:10:44
|
I thought it would have been more efficient to change :
SELECT M_NAME, Member_ID, M_SIG FROM FORUM_MEMBERS WHERE M_SIG IS NOT NULL ORDER BY M_Name ASC
into
SELECT M_NAME, Member_ID, M_SIG FROM FORUM_MEMBERS WHERE M_SIG LIKE '%%[img%%' ORDER BY M_Name ASC
but I can only test on Access and it's not working
if anyone can fix this ? (and also test for uppercase img tag as well |
|
|
Chuck McB
Junior Member
WooYay
196 Posts |
Posted - 01 January 2004 : 16:36:28
|
Moved |
Edited by - Chuck McB on 01 January 2004 16:40:32 |
|
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 01 January 2004 : 16:48:12
|
OK, so ...
this doesn't work :
SELECT M_NAME, Member_ID, M_SIG FROM FORUM_MEMBERS WHERE M_SIG LIKE '%%[img%%' ORDER BY M_Name ASC
but this DOES work
SELECT M_NAME, Member_ID, M_SIG FROM FORUM_MEMBERS WHERE M_SIG LIKE '%img%%' ORDER BY M_Name ASC
(i.e. NO [ in the like) - it will reduce the recordset anyway |
|
|
evol
Junior Member
China
157 Posts |
Posted - 02 January 2004 : 12:45:11
|
quote: Originally posted by laser
quote: Originally posted by DavidRhodes
images are not found if the user uses [img=left] or [img=right]
Easy fix :
Line 135 was :
If InStr(rst("M_SIG"), "[img]") > 0 Then
Change to :
If InStr(rst("M_SIG"), "[img]") > 0 or InStr(rst("M_SIG"), "[img=left]") > 0 or InStr(rst("M_SIG"), "[img=right]") > 0 Then
thanks laser,but in Signature Image Manager the Image previewcan't display the picuyre. |
Who am i? I lost my dream! |
|
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 02 January 2004 : 16:07:53
|
Sorry I didn't actually test the code, I just looked for [img] tags to see what happened. I'll work on it later today. |
|
|
DavidRhodes
Senior Member
United Kingdom
1222 Posts |
Posted - 02 January 2004 : 16:44:10
|
Yeah, tried that laser but there's more coding needed further down to strip the image link out |
The UK MkIVs Forum |
|
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 02 January 2004 : 18:20:25
|
I'll fix that now I don't think any of my members use that format, they mainly use the center tag, but I'll change one to test. |
|
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 02 January 2004 : 19:07:56
|
Can anyone help me with the Regular Expression code ? I think I have the rest fixed, but I'm no good at regular expressions. |
|
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 02 January 2004 : 19:43:19
|
OK, fixed without playing with the RegExp (although I think my code is a bit dodgy it really does work)
at the very bottom of the file you'll find this code, add the red lines :
Function grabImage(strHTML)
dim regEx
set regEx = New RegExp
regEx.IgnoreCase = True
regEx.Global = True
regEx.Pattern = "(\[img)([\s\S]*?)(img\])"
strHTML = Replace(strHTML, "=left", "")
strHTML = Replace(strHTML, "=center", "")
strHTML = Replace(strHTML, "=right", "")
Set objMatches = regEx.Execute(strHTML)
' If there could be multiple images then...
For Each objMatch in objMatches
strHTML = objMatch.Value
Next
set regEx = nothing
grabImage = strHTML
end function
Other bugs I've discovered, but not fixed yet :
- the comments seem to infer the code works with multiple images ... it doesn't
- image names containing spaces don't display properly.
Are both of these issues linked to the RegExp syntax ? |
Edited by - laser on 02 January 2004 19:47:40 |
|
|
Chuck McB
Junior Member
WooYay
196 Posts |
Posted - 02 January 2004 : 20:19:04
|
- image names containing spaces don't display properly. ****...I fixed that bug...can't remember how :( Anyhow here's my latest version of the script (incudes some failed attempts at grabbing the image size using onload events) |
|
|
AnimeMetro
Starting Member
6 Posts |
Posted - 03 January 2004 : 00:28:00
|
I get this error when I run the script:
Microsoft VBScript runtime error '800a005e' Invalid use of Null: 'Replace'
?, line 0
If this has to do with "turning regular expressions on", I have checked a ton of places on the net and cannot find any instructions on how to do so. I own my own server and have full access to it. If anyone can give exact details on this subject it would be very much appreciated.
Thanks in advance. |
|
|
DavidRhodes
Senior Member
United Kingdom
1222 Posts |
Posted - 03 January 2004 : 08:09:53
|
quote: Originally posted by Chuck McB
- image names containing spaces don't display properly. ****...I fixed that bug...can't remember how :( Anyhow here's my latest version of the script (incudes some failed attempts at grabbing the image size using onload events)
Cheers, seems to work fine |
The UK MkIVs Forum |
|
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 03 January 2004 : 09:21:56
|
I have some code that will do image dimensions and sizes, I'll dig it up and add to the code. |
|
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 05 January 2004 : 18:08:25
|
OK, I have dimensions and size working just that the size isn't always reported properly. When I get it perfected I'll post the code. |
|
|
Topic |
|