Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Thema gestartet von: mystik in März 11, 2005, 10:33:53 VORMITTAG

Titel: Disable showing pictures in Quotes
Beitrag von: mystik in März 11, 2005, 10:33:53 VORMITTAG
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????

Titel: Re: Disable showing pictures in Quotes
Beitrag von: Oldiesmann in März 11, 2005, 05:03:05 NACHMITTAGS
Add this to style.css, right after the .quote block:

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

I can do like this:

.quote real/wma
{
  display: none;
}
Titel: Re: Disable showing pictures in Quotes
Beitrag von: Anguz in März 17, 2005, 03:54:00 VORMITTAG
Zitat von: Oldiesmann in März 11, 2005, 05:03:05 NACHMITTAGS
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.

Zitat von: ivytony in März 14, 2005, 12:02:07 NACHMITTAGS
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.
Titel: Re: Disable showing pictures in Quotes
Beitrag von: [Unknown] in März 17, 2005, 02:20:13 NACHMITTAGS
So, you'd use:

.quote embed, .quote object

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

-[Unknown]
Titel: Re: Disable showing pictures in Quotes
Beitrag von: 127.0.0.1 in Juni 26, 2005, 02:40:09 VORMITTAG
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
Titel: Re: Disable showing pictures in Quotes
Beitrag von: dtm.exe in Juni 26, 2005, 02:54:24 VORMITTAG
This is an awesome trick :).

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

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

-Dan The Man
Titel: Re: Disable showing pictures in Quotes
Beitrag von: tekgik in Februar 23, 2006, 06:37:35 VORMITTAG
Hi there!

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


Thanks!
Titel: Re: Disable showing pictures in Quotes
Beitrag von: Sverre in September 30, 2006, 04:44:41 VORMITTAG
Zitat von: 127.0.0.1 in Juni 26, 2005, 02:40:09 VORMITTAG
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.
Titel: Re: Disable showing pictures in Quotes
Beitrag von: Sverre in Oktober 08, 2006, 09:29:12 VORMITTAG
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) Auswählen
// 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) Auswählen

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


and for the quick reply:

Code (find) Auswählen
// 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) Auswählen

// 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 :)
Titel: Re: Disable showing pictures in Quotes
Beitrag von: Greengoat in Januar 08, 2007, 12:43:40 VORMITTAG
Zitat von: Oldiesmann in März 11, 2005, 05:03:05 NACHMITTAGS
Add this to style.css, right after the .quote block:

.quote img
{
  display: none;
}


Worked perfectly.  Thanks.
Titel: Re: Disable showing pictures in Quotes
Beitrag von: Geno15 in Januar 26, 2009, 07:20:58 NACHMITTAGS
Oldiesmann ---- Wow that sure is one hot tip..I was about to ask the same question. Thank you sir!
Titel: Re: Disable showing pictures in Quotes
Beitrag von: FlixyaFriend in Januar 30, 2009, 11:06:30 VORMITTAG
Zitat von: Oldiesmann in März 11, 2005, 05:03:05 NACHMITTAGS
Add this to style.css, right after the .quote block:

.quote img
{
  display: none;
}


Thank for this trick. it's work very well.
Titel: Re: Disable showing pictures in Quotes
Beitrag von: Skoony in Januar 13, 2011, 08:34:45 VORMITTAG
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:
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi54.tinypic.com%2Frhitrr.png&hash=77a0e63de5c2c74bf91e1a00b768361fbfc89e44)

I'm a complete newbie so please don't run over me :P
Titel: Re: Disable showing pictures in Quotes
Beitrag von: Illori in Januar 13, 2011, 01:19:04 NACHMITTAGS
try index.css instead