Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP
Author Message
diabluntd
Hangin' Around



Joined: Mar 19, 2004
Posts: 31

PostPosted: Mon Jun 07, 2004 12:36 pm Reply with quote

###############################################
## Hack Title: Restrict images in signatures
## Hack Version: 0.1.1
## Author: Freakin' Booty ;-P
## Description: Restrict the width, the height and the number of images in signatures. Everything
## is configurable from the Administration Control Panel.


currently this addon only works if a user uses bbcode IMG tags around the image url. I'd like to expand it to also check sigs that use html's <img src=........> format. Here is the line that is setup to check the IMG tags. Anyone out there know how i should format this for img src?

Code:
if( preg_match_all("#\[img(:$signature_bbcode_uid)?\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img(:$signature_bbcode_uid)?\]#sie", $signature, $matches) )



Now, i can see the beginning part for the opening IMG tag...
Code:
[img(:$signature_bbcode_uid)?\]


And the middle part which contains the URL (will remain untouched i assume)
Code:
]((ht|f)tp://)([^\r\n\t<\"]*?)


And finally the closing IMG tag
Code:
[/img(:$signature_bbcode_uid)?\]


Any ideas what the #sie is and if it is playing a part in this?
I've tried a few combinations to replace the img parts with img src but none have worked... probably because i'm not a coder and stink at it. Smile
What's up with the \ before the [ or ]? I'm assuming it's similar to how a \ is needed before a quote which means i can ditch those if i'm using <img src....> right?

Any help would be greatly appreciated and it would really help the community cause this is a great addon but just needs a little bit more to it.
Thanks
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Mon Jun 07, 2004 5:01 pm Reply with quote

Quote:
Any ideas what the #sie is and if it is playing a part in this?
Pattern modifiers - [ Only registered users can see links on this board! Get registered or login! ]
Quote:
What's up with the \ before the [ or ]? I'm assuming it's similar to how a \ is needed before a quote which means i can ditch those if i'm using <img src....> right?
Not altogether. Certain characters have special meaning to the PCRE functions. For instance, if you were trying to pattern match a \, you would use \\. To match a (, you would use \(.

I have never used this addon so I would have to study it a bit more. Maybe someone else can help you along in the meantime.
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©