|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
my members have started adding photos to their sigs, which i want to stop. how? I want them to keep the photos in their profile though, and which they also use as an avatar. just no photos in sigs!
|
|
|
|
Joined: Jun 2001
Posts: 3,273
That 70's Guy
|
That 70's Guy
Joined: Jun 2001
Posts: 3,273 |
The easiest way is to not allow them to use the [img] markup tag. In your config.inc.php file find this: // Allow the image markup tag. $config['allowimages']= 1; and change it to 0 to turn it off. Also, perhaps your allowing to many characters to be used in the signature. Try lowering the number so it's harder to put an URL to a photo in. Just some thoughts.
|
|
|
|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
if i remove the img tag though, wont that stop them from posting photos?
|
|
|
|
Joined: Jun 2001
Posts: 3,273
That 70's Guy
|
That 70's Guy
Joined: Jun 2001
Posts: 3,273 |
|
|
|
|
Joined: Apr 2002
Posts: 1,768
Addict
|
Addict
Joined: Apr 2002
Posts: 1,768 |
You could hack the script to disallow images in signatures. The code which handles signatures is in changebasic.php. Look for $Signature. This would only affect changes to signatures, not existing signatures.
Last edited by Dave_L; 09/06/2002 9:58 AM.
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
[]if i remove the img tag though, wont that stop them from posting photos?
The most basic solution that was suggested, without hacking would be to decrease the amount of characters allowed in sigs... as an image tag usually takes quite a few characters.
You can adjust that in the config file.
|
|
|
|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
the thing is, i want to keep the sig limit at around the 200 mark, because people were complaining it was too short otherwise. i want people to post images. i just dont want images in sigs. so edit changebasic.php is the way then? what is it I've got to remove? my programming knowledge of php can be written on the back of a stamp! yep, and after a quick look at changebasic.php, i cant see no reference to images in sigs. i found the sig lines though! lol
Last edited by monkeyra; 09/06/2002 10:03 AM.
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
I'm not sure I've got the ability either... but if nobody beats me to it.. I'll take a look at it. If i can figure it out I'll post it.
|
|
|
|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
thanks, i would like to get this fixed one way or another!
|
|
|
|
Joined: Jun 2001
Posts: 3,273
That 70's Guy
|
That 70's Guy
Joined: Jun 2001
Posts: 3,273 |
In your changebasic.php file at around line 185, just above this: $Signature = $html -> do_markup($Signature); Add this: if (eregi("\[img\]",$Signature,$sigimages)) { $Signature = eregi_replace("\[img\].*\[/img\]|\[{$ubbt_lang['TEXT_IMAGE']}\].*\[\/{$ubbt_lang['TEXT_IMAGE']}\]","",$Signature); } This should strip out the img tag.
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
Ha. I knew JustDave would know. I was still hunting for the correct place. Thanks Dave!
|
|
|
|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
excellent, i'll give it a try 2moro (off out in a minute) and let you know! thanks!
|
|
|
|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
ok, just tried quickly. I dont have that line anywhere in my changebasic.php file. what now?
|
|
|
|
Joined: Jun 2001
Posts: 3,273
That 70's Guy
|
That 70's Guy
Joined: Jun 2001
Posts: 3,273 |
What version are you using?
|
|
|
|
Joined: Apr 2002
Posts: 1,768
Addict
|
Addict
Joined: Apr 2002
Posts: 1,768 |
|
|
|
|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
UBB.threadsâ„¢ 6.0.3 recently installed it a few days ago
|
|
|
|
Joined: Apr 2002
Posts: 1,768
Addict
|
Addict
Joined: Apr 2002
Posts: 1,768 |
In 6.0.3 changebasic.php, I would add JustDave's code after this:
// -------------------------------- // Get rid of HTML in the signature $Signature = str_replace("<","<",$Signature); $Signature = str_replace(">",">",$Signature); $Signature = str_replace("<br>","<br />",$Signature);
|
|
|
|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
works like a dream! Cheers guys! mucho appreciated!
|
|
|
|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
ok, lol check this out i *thought* it was solved but now they are using html in their sigs to get around it! anyway, i can see how to disable html in posts, but not sigs! any ideas chaps?
|
|
|
|
Joined: Jun 2001
Posts: 3,273
That 70's Guy
|
That 70's Guy
Joined: Jun 2001
Posts: 3,273 |
Actually, I didn't think they could use html in their sigs...
What version are you using?
|
|
|
|
Joined: Jun 2001
Posts: 3,273
That 70's Guy
|
That 70's Guy
Joined: Jun 2001
Posts: 3,273 |
Never mind, seen your post above.. 6.0.3
In that version the code Dave_L showed you above is what keeps html out:
// -------------------------------- // Get rid of HTML in the signature $Signature = str_replace("<","<",$Signature); $Signature = str_replace(">",">",$Signature); $Signature = str_replace("<br>","<br />",$Signature);
Did you remove this?
|
|
|
|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
no, it's still there. hmmmm, this is most bizarre.
|
|
|
|
Joined: Apr 2002
Posts: 1,768
Addict
|
Addict
Joined: Apr 2002
Posts: 1,768 |
I'm totally confused about how markup and HTML work in signatures now. 6.0.3 was an "emergency" release intended to fix a security bug in 6.0.2, but it also included a few changes from 6.1. I have the 6.0.3 .tar.gz file downloaded for reference, but I'm running 6.1b1 on my server. There have been a couple of bugs posted regarding signatures. Maybe Rick needs to look at this thread. I'll flag it for his attention.
|
|
|
|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
|
|
|
|
Joined: May 1999
Posts: 3,039
Guru
|
Guru
Joined: May 1999
Posts: 3,039 |
Ok, in 6.0.3 the signature wasn't converted until the post was made. So, the actual markup is stored in the database. That means this won't have any effect on users that already have their signature set. So it would require changing everyone's signatures or hacking showflat/showthreaded as well. I don't have a live copy of 6.0.3 to work on at the moment so not sure right off the top of my head where this would go.
UBB.threads Developer
|
|
|
|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
I just found someone on my forums with a photo in his signature, and this was the code for it. [*image] http://image1ex.villagephotos.com/extern/677958.jpg[*/image] (of course removing stars) I doublechecked the changebasic.php file, and the hack was still in there. This is the part with the original code and the hack. // Get rid of HTML in the signature $Signature = str_replace("<","<",$Signature); $Signature = str_replace(">",">",$Signature); $Signature = str_replace("<br>","<br />",$Signature); if (eregi("\[img\]",$Signature,$sigimages)) { $Signature = eregi_replace("\[img\].*\[/img\]|\[{$ubbt_lang['TEXT_IMAGE']}\].*\[\/{$ubbt_lang['TEXT_IMAGE']}\]","",$Signature); } that is correct yeah?
Last edited by monkeyra; 09/10/2002 12:00 PM.
|
|
|
|
Joined: Jun 2001
Posts: 3,273
That 70's Guy
|
That 70's Guy
Joined: Jun 2001
Posts: 3,273 |
The problem is they have already placed this into their signature. The code above will only prevent users that have not added an image to their signature from doing so. You will have to manually edit the user's signature to remove any images that already exist.
|
|
|
|
Joined: Jun 2001
Posts: 356
Junior Member
|
Junior Member
Joined: Jun 2001
Posts: 356 |
ah right. ok! i'll do that now thanks (never occured to me)
|
|
|
|
Joined: Aug 2002
Posts: 45
User
|
User
Joined: Aug 2002
Posts: 45 |
Is it possible that someone make this compatible for 6.2 ? It's very useful I think
|
|
|
|
Joined: Apr 2002
Posts: 1,768
Addict
|
Addict
Joined: Apr 2002
Posts: 1,768 |
[6.2.1]
changebasic.php
Find:
// ----------------------- // Allow markup in the bio $Bio = $html -> do_markup($Bio); $Signature = $html -> do_markup($Signature);
Change it to:
// ----------------------- // Allow markup in the bio $Bio = $html -> do_markup($Bio); [:"red"]$allowimages = $config['allowimages']; // save $config['allowimages'] = 0;[/] $Signature = $html -> do_markup($Signature); [:"red"]$config['allowimages'] = $allowimages; // restore[/]
|
|
|
|
Joined: Aug 2002
Posts: 45
User
|
User
Joined: Aug 2002
Posts: 45 |
Thanks It is working great
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
badfrog
somewhere on the coast of Maine
Posts: 94
Joined: March 2007
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|