Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Signature Image Manager
 New Topic  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 5

laser
Advanced Member

Australia
3859 Posts

Posted - 01 January 2004 :  15:50:11  Show Profile
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

Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 01 January 2004 :  16:10:44  Show Profile
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
Go to Top of Page

Chuck McB
Junior Member

WooYay
196 Posts

Posted - 01 January 2004 :  16:36:28  Show Profile  Visit Chuck McB's Homepage  Send Chuck McB an ICQ Message
Moved

Edited by - Chuck McB on 01 January 2004 16:40:32
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 01 January 2004 :  16:48:12  Show Profile
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
Go to Top of Page

evol
Junior Member

China
157 Posts

Posted - 02 January 2004 :  12:45:11  Show Profile
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!
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 02 January 2004 :  16:07:53  Show Profile
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.
Go to Top of Page

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 02 January 2004 :  16:44:10  Show Profile
Yeah, tried that laser but there's more coding needed further down to strip the image link out

The UK MkIVs Forum
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 02 January 2004 :  18:20:25  Show Profile
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.
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 02 January 2004 :  19:07:56  Show Profile
Can anyone help me with the Regular Expression code ? I think I have the rest fixed, but I'm no good at regular expressions.
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 02 January 2004 :  19:43:19  Show Profile
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
Go to Top of Page

Chuck McB
Junior Member

WooYay
196 Posts

Posted - 02 January 2004 :  20:19:04  Show Profile  Visit Chuck McB's Homepage  Send Chuck McB an ICQ Message
- 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)
Go to Top of Page

AnimeMetro
Starting Member

6 Posts

Posted - 03 January 2004 :  00:28:00  Show Profile
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.
Go to Top of Page

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 03 January 2004 :  08:09:53  Show Profile
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
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 03 January 2004 :  09:21:56  Show Profile
I have some code that will do image dimensions and sizes, I'll dig it up and add to the code.
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 05 January 2004 :  18:08:25  Show Profile
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.
Go to Top of Page
Page: of 5 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.22 seconds. Powered By: Snitz Forums 2000 Version 3.4.07