Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: mystik on March 11, 2005, 10:33:53 AM

Title: Disable showing pictures in Quotes
Post by: mystik on March 11, 2005, 10:33:53 AM
Its rather annoying wen one user post a large image, then subsequent users quote this post so you end up with several posts showing the same  image  >:(


is there a way to disable showing images in QUOTATIONS????

Title: Re: Disable showing pictures in Quotes
Post by: Oldiesmann on March 11, 2005, 05:03:05 PM
Add this to style.css, right after the .quote block:

.quote img
{
  display: none;
}
Title: Re: Disable showing pictures in Quotes
Post by: mystik on March 11, 2005, 05:16:14 PM
daaamn so easy and works like a charm   8) ;D
Title: Re: Disable showing pictures in Quotes
Post by: Oldiesmann on March 11, 2005, 05:20:40 PM
Isn't CSS fun? :)
Title: Re: Disable showing pictures in Quotes
Post by: mystik on March 11, 2005, 05:24:10 PM
hehe  :D :D.......i'm sure other ppl hate this too...hope they find this useful
Title: Re: Disable showing pictures in Quotes
Post by: ivytony on March 14, 2005, 12:02:07 PM
so, similarly, to disable the showing of realplayer or wma files,

I can do like this:

.quote real/wma
{
  display: none;
}
Title: Re: Disable showing pictures in Quotes
Post by: Anguz on March 17, 2005, 03:54:00 AM
Quote from: Oldiesmann on March 11, 2005, 05:03:05 PM
Add this to style.css, right after the .quote block:

.quote img
{
  display: none;
}


The only disadvantage is that smileys don't won't show either, but it's a small price to pay, I guess.

Quote from: ivytony on March 14, 2005, 12:02:07 PM
so, similarly, to disable the showing of realplayer or wma files,

I can do like this:

.quote real/wma
{
  display: none;
}


Not really sure about that one, though. The mime type is not a selector, but you can use the tag used to embed it in HTML.
Title: Re: Disable showing pictures in Quotes
Post by: [Unknown] on March 17, 2005, 02:20:13 PM
So, you'd use:

.quote embed, .quote object

For not showing smileys, hmm... if browsers supported all CSS rules, it'd be easy.

-[Unknown]
Title: Re: Disable showing pictures in Quotes
Post by: 127.0.0.1 on June 26, 2005, 02:40:09 AM
I don't like this particular method because emoticons get hidden too. A better method would result in displaying only the url of images (not including emoticons) in quotes. My PHP is too rusty to attempt this though :(

Invision Power Board has this feature. It'd probably be a good little add-on to future versions of smf :P
Title: Re: Disable showing pictures in Quotes
Post by: dtm.exe on June 26, 2005, 02:54:24 AM
This is an awesome trick :).

-Dan The Man
Title: Re: Disable showing pictures in Quotes
Post by: Dannii on June 26, 2005, 07:17:08 AM
Yes I think it would work better to alter the subs.php file... although I wouldn't know how too.
Title: Re: Disable showing pictures in Quotes
Post by: dtm.exe on June 29, 2005, 10:21:14 PM
OK, I just tried this out and it didn't work.

EDIT: Solved...forgot the "." :P.

-Dan The Man
Title: Re: Disable showing pictures in Quotes
Post by: tekgik on February 23, 2006, 06:37:35 AM
Hi there!

I cant seem to find the where to out this code on smf 1.1 rc2 style.css.


Thanks!
Title: Re: Disable showing pictures in Quotes
Post by: Sverre on September 30, 2006, 04:44:41 AM
Quote from: 127.0.0.1 on June 26, 2005, 02:40:09 AM
I don't like this particular method because emoticons get hidden too. A better method would result in displaying only the url of images (not including emoticons) in quotes. My PHP is too rusty to attempt this though :(

Invision Power Board has this feature. It'd probably be a good little add-on to future versions of smf :P

I totally agree! I've been playing around with the // Remove any nested quotes, if necessary. part in Post.php to achieve this. It was easy to remove images from quotes this way, but since I don't know anything about regex/the preg_replace command, I have no idea how to keep the image url/replace [img][/img] tags with [url][/url] tags...

A nice bonus of doing it this way would be that it doesn't remove the ability to post pictures inside a quote block if you really need to.
Title: Re: Disable showing pictures in Quotes
Post by: Sverre on October 08, 2006, 09:29:12 AM
I've continued to tinker with the piece of code in Post.php, and I think I might have found a solution...

Someone has to verify that the added code won't create any problems or introduce security hazards though, since I have no idea what I'm doing with this regex stuff :P

In Post.php (1.0.x and 1.1.x):

Code (find) Select
// Remove any nested quotes, if necessary.
if (!empty($modSettings['removeNestedQuotes']))
$form_message = preg_replace(array('~\n?\[quote.*?\].+?\[/quote\]\n?~is', '~^\n~', '~\[/quote\]~'), '', $form_message);


Code (add after) Select

// Remove images from quotes.
$form_message = preg_replace(array('~\[/?img.*?\]~is', '""'), '', $form_message);


and for the quick reply:

Code (find) Select
// Remove any nested quotes.
if (!empty($modSettings['removeNestedQuotes']))
$row['body'] = preg_replace(array('~\n?\[quote.*?\].+?\[/quote\]\n?~is', '~^\n~', '~\[/quote\]~'), '', $row['body']);


Code (add after) Select

// Remove images from quotes.
$row['body'] = preg_replace(array('~\[/?img.*?\]~is', '""'), '', $row['body']);


EDIT:
It doesn't work perfectly in situations with [img] tags wrapped in [url] tags to post a thumbnail or add a link to the image (for example back to image hosts such as http://imageshack.us (http://imageshack.us)). Otherwise, the modification seems to do exactly what I wanted it to do :)
Title: Re: Disable showing pictures in Quotes
Post by: Greengoat on January 08, 2007, 12:43:40 AM
Quote from: Oldiesmann on March 11, 2005, 05:03:05 PM
Add this to style.css, right after the .quote block:

.quote img
{
  display: none;
}


Worked perfectly.  Thanks.
Title: Re: Disable showing pictures in Quotes
Post by: Geno15 on January 26, 2009, 07:20:58 PM
Oldiesmann ---- Wow that sure is one hot tip..I was about to ask the same question. Thank you sir!
Title: Re: Disable showing pictures in Quotes
Post by: FlixyaFriend on January 30, 2009, 11:06:30 AM
Quote from: Oldiesmann on March 11, 2005, 05:03:05 PM
Add this to style.css, right after the .quote block:

.quote img
{
  display: none;
}


Thank for this trick. it's work very well.
Title: Re: Disable showing pictures in Quotes
Post by: Skoony on January 13, 2011, 08:34:45 AM
Hello,

I would like to apply this as well, but as you can see, there is no style.css file in the css folder for the theme:
(http://i54.tinypic.com/rhitrr.png)

I'm a complete newbie so please don't run over me :P
Title: Re: Disable showing pictures in Quotes
Post by: Illori on January 13, 2011, 01:19:04 PM
try index.css instead