| Author | 
                
                  Topic   | 
                  | 
              
              
                | 
                 Jess 
                Starting Member 
                 
                 
                
                15 Posts  | 
                
                  
                    
                      
                       Posted - 06 September 2005 :  17:20:30
                        
                        
                      
  | 
                     
                    
                       Is there a way to prohibit users from putting images in their signatures?  I did some searching and found ways to limit the image sizes, which I will try for the time being, but I wonder if it would be possible to just disallow use of the "[img]" tag in the sigs?
  I've got users putting images in their sigs that are 400x400 and it's getting ridiculous!
  Thanks in advance for any help! | 
                     
                   
                 | 
              
              
                | 
                 ruirib 
                Snitz Forums Admin 
                      
                 
                
                Portugal 
                26364 Posts  | 
                
                  
                 | 
              
              
                | 
                 laser 
                Advanced Member 
                      
                 
                
                Australia 
                3859 Posts  | 
                
                  
                    
                      
                       Posted - 06 September 2005 :  20:46:20
                        
                      
  | 
                     
                    
                      |  There was a semi-mod here before that created a div or layer in the sig - then you could set it to expand only so far then chop off the rest of the image.  I didn't get it fully working though, but I think CSS is your answer. | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 MarcelG 
                Retired Support Moderator 
                      
                 
                
                Netherlands 
                2625 Posts  | 
                
                  
                    
                      
                       Posted - 07 September 2005 :  03:36:02
                        
                        
                      
  | 
                     
                    
                       Well, you can mod inc_func_common.asp to skip parsing the [img] tags if it's a (dynamic) signature....  But, be aware ; this eliminates ALL images in signatures. in inc_func_common.asp find this code:
 
fString = ReplaceImageTags(fString)
  replace it by this:
 if fField_Type <> "signature" then
	fString = ReplaceImageTags(fString)
end if  Haven't tested it though, but I think it should work ok.
  Static signatures are added to the message (T_MESSAGE), so you won't be able to filter those out, unless you filter out all images.
  Handy tool Some time ago I got this handy page from a member here at snitz:  http://www.oxle.com/source.asp?page=admin_SigImage.asp (log on at oxle with user demo/demo if you are not yet registered or do not wish to register) Just copy that code, and save it as admin_sigimage.asp. Add a link to that page from admin_home.asp, and you can edit all signatures which contain images, from 1 page. | 
                     
                    
                        portfolio - linkshrinker - oxle - twitter | 
                     
                    
                       Edited by - MarcelG on 07 September 2005  03:36:14 | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 Jess 
                Starting Member 
                 
                 
                
                15 Posts  | 
                
                  
                    
                      
                       Posted - 08 September 2005 :  19:04:27
                        
                        
                      
  | 
                     
                    
                       Wow! Cool tool -- thanks!  And thanks for the code, I'm going to try that first. 
  Jess | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 Jess 
                Starting Member 
                 
                 
                
                15 Posts  | 
                
                  
                    
                      
                       Posted - 08 September 2005 :  19:10:11
                        
                        
                      
  | 
                     
                    
                       OK, I replaced the code as you suggested, and it doesn't seem to have made any difference. Hmmm...  I am using dynamic sigs, so that's not it. Guess I'll just try that tool and use it as you suggested to modify the images down.  
  Thanks for your help! | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 MarcelG 
                Retired Support Moderator 
                      
                 
                
                Netherlands 
                2625 Posts  | 
                
                  
                 | 
              
              
                | 
                 Shaggy 
                Support Moderator 
                      
                 
                
                Ireland 
                6780 Posts  | 
                
                  
                    
                      
                       Posted - 09 September 2005 :  04:35:28
                        
                      
  | 
                     
                    
                       quote: Originally posted by marcelgoertz
 fString = ReplaceImageTags(fString)  replace it by this:
 if fField_Type <> "signature" then
	fString = ReplaceImageTags(fString)
end if 
  Marcel, the problem there is that the FormatStr function doesn't have an fField_Type argument, that's in the chkString function. chkString is called when inserting the message in the database and FormatStr when it's pulled from the database, i.e., the [img] tag is not parsed before the message is inserted in the database.
 
  | 
                     
                    
                         Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 MarcelG 
                Retired Support Moderator 
                      
                 
                
                Netherlands 
                2625 Posts  | 
                
                  
                    
                      
                       Posted - 09 September 2005 :  04:54:34
                        
                        
                      
  | 
                     
                    
                       I've got it!!!
   in inc_func_common.asp, add this function ; 
 function FormatSig(fString)
	on Error resume next
	fString = Replace(fString, CHR(13), "")
	fString = Replace(fString, CHR(10), "<br />")
	if strBadWordFilter = 1 or strBadWordFilter = "1" then
		fString = ChkBadWords(fString)
	end if
	if strAllowForumCode = "1" then
		fString = ReplaceURLs(fString)
		fString = ReplaceCodeTags(fString)
	end if
	fString = ChkURLs(fString, "http://", 1)
	fString = ChkURLs(fString, "https://", 2)
	fString = ChkURLs(fString, "www.", 3)
	fString = ChkMail(fString)
	fString = ChkURLs(fString, "ftp://", 5)
	fString = ChkURLs(fString, "file:///", 6)
	if strIcons = "1" then
		fString = smile(fString)
	end if
	if strAllowForumCode = "1" then
		fString = extratags(fString)
	end if
	FormatSig = fString
	on Error goto 0
end function
  Now, in topic.asp, replace this:
 formatStr(Reply_MemberSig)  by this:
 formatSig(Reply_MemberSig)  and 
 formatStr(Topic_MemberSig)  by
 formatSig(Topic_MemberSig) That't it ; this simply removes the image handling in the signatures, so the [img]-tags will not be processed. Hope this helps.
  Shaggy ; I understood that after I read that it didn't work...makes sense now   | 
                     
                    
                        portfolio - linkshrinker - oxle - twitter | 
                     
                    
                       Edited by - MarcelG on 09 September 2005  04:55:50 | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 Shaggy 
                Support Moderator 
                      
                 
                
                Ireland 
                6780 Posts  | 
                
                  
                    
                      
                       Posted - 09 September 2005 :  05:22:39
                        
                      
  | 
                     
                    
                       Also, find the following on line 70 of pop_preview_sig.asp:"                <td bgcolor=""" & strForumCellColor & """ valign=""bottom""><hr noshade size=""" & strFooterFontSize & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """><span class=""spnMessageText"">" & formatStr(chkString(strSigPreview,"preview")) & "</span></font></td>" & vbNewLine & _ And replace it with the following:"                <td bgcolor=""" & strForumCellColor & """ valign=""bottom""><hr noshade size=""" & strFooterFontSize & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """><span class=""spnMessageText"">" & formatSig(chkString(strSigPreview,"preview")) & "</span></font></td>" & vbNewLine & _  And, on line 89 of pop_preview.asp, find the following:strMessagePreview = formatStr(chkString(strMessagePreview,"preview")) & "<hr noshade size=""" & strFooterFontSize & """>" & formatStr(chkString(cleancode(GetSig(strSigAuthor)),"preview")) And replace it with the following:strMessagePreview = formatStr(chkString(strMessagePreview,"preview")) & "<hr noshade size=""" & strFooterFontSize & """>" & formatSig(chkString(cleancode(GetSig(strSigAuthor)),"preview"))  | 
                     
                    
                         Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 MarcelG 
                Retired Support Moderator 
                      
                 
                
                Netherlands 
                2625 Posts  | 
                
                  
                 | 
              
              
                | 
                 Shaggy 
                Support Moderator 
                      
                 
                
                Ireland 
                6780 Posts  | 
                
                  
                    
                      
                       Posted - 09 September 2005 :  05:44:48
                        
                      
  | 
                     
                    
                       No probs  
  Anyone running the PM Mod will also need to make the relevant changes to those files, as well.
 
  | 
                     
                    
                         Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 Jess 
                Starting Member 
                 
                 
                
                15 Posts  | 
                
                  
                    
                      
                       Posted - 15 September 2005 :  22:18:27
                        
                        
                      
  | 
                     
                    
                      |  Thanks, you guys! I'll give this a shot....  :) | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                | 
                 Jess 
                Starting Member 
                 
                 
                
                15 Posts  | 
                
                  
                    
                      
                       Posted - 18 December 2005 :  13:14:23
                        
                        
                      
  | 
                     
                    
                      |  I have to apologize... I never came back and let you know, but this worked beautifully.  So thank you so much for your help! | 
                     
                    
                        | 
                     
                   
                 | 
              
              
                |   | 
                
                  Topic   | 
                  |