QUOTE Tag output information

Started by PlutoDelic, March 04, 2010, 01:37:36 PM

Previous topic - Next topic

PlutoDelic

Hi guys, i recently upgraded to SMF 2 RC2, and by installing some modi's i even came up learning some php.

with the help of the xml files, i can identify where/what the package is modifying, and by comparing the original and modified code i could even solve some modes that made my forum show errors

to get straight to my problem, i recently added the Off-Topic BBC Tag mod, it works fine though it changed the output of the normal QUOTE tag for some reason, have a look:

http://i48.tinypic.com/15mxlxk.jpg

my question does not really point to what the mod did, i am quite interested on what i can change on that output, i never really liked to be linked on the original post, maybe linking is ok but at list something shorter

regards,

pluto

Kays

Hi, that link shouldn't look like that. It's possible that the mod broke it.

Have you posted this question in the support topic for that mod?

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

PlutoDelic

well yea thats what i said, it didnt/shouldnt look like that, and as i said, i know the mod caused it but i was always interested to cut the output information, e.g i want only the author and a small text sayin Link to post rather then the whole date and time...i always wanted to change it thats why im posting here.

Kays

Look in Subs.php where the quote tag is defined. You should be able to edit that there.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

PlutoDelic

what ever i change, the result is an error hehe. I need more specific help about it

i can guess i have to change something here

array(
'tag' => 'quote',
'before' => '<div class="quoteheader"><div class="topslice_quote">' . $txt['quote'] . '</div></div><blockquote>',
'after' => '</blockquote><div class="quotefooter"><div class="botslice_quote"></div></div><br />',
'block_level' => true,
),
array(
'tag' => 'quote',
'parameters' => array(
'author' => array('match' => '(.{1,192}?)'),
),
'before' => '<div class="quoteheader">' . $txt['quote_from'] . ': {author}</div><blockquote>',
'after' => '</blockquote>',
'block_level' => true,
),


what exactly if i may ask?

TheListener

Sorry to intrude here.

When adding an off topic item to a post I just use a gif.

Saves a lot of hassle plus it looks too much like a quote IMO

Kays

There's actually five of them. I think it's the fourth one. Just try commenting it out and see what you get.


/* array(
'tag' => 'quote',
'parameters' => array(
'author' => array('match' => '([^<>]{1,192}?)'),
'link' => array('match' => '(?:board=\d+;)?((?:topic|threadid)=[\dmsg#\./]{1,40}(?:;start=[\dmsg#\./]{1,40})?|action=profile;u=\d+)'),
'date' => array('match' => '(\d+)', 'validate' => 'timeformat'),
),
'before' => '<div class="quoteheader"><div class="topslice_quote"><a href="' . $scripturl . '?{link}">' . $txt['quote_from'] . ': {author} ' . $txt['search_on'] . ' {date}</a></div></div><blockquote>',
'after' => '</blockquote><div class="quotefooter"><div class="botslice_quote"></div></div><br />',
'block_level' => true,
),
*/


@ Brack1 I don't think that's what he's after. But I do like the smiley. :)

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

PlutoDelic

it worked like a charm, i did some CSS edits so it looks a bit smaller now, thanks a lot.

ps, Brack, i usually love those mods that GIF around, i mean text to picture stuff (report to moderator, etc etc), are you saying that something similar can be implemented at this specific point?

TheListener

All you have to do is add the gif to whichever smileys you use in your forum.


Kays


If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

PlutoDelic

#10
Kays, something strange happened, quote seems to be working only when inserting a quote from a topic/reply (quoting someone directly), meaning where [quote author=...] is used, if i insert a quote from WYSIWYG (or of course type it manually), it doesnt show up at all...

http://i47.tinypic.com/332tk3l.jpg

:(

Kays

That's strange I can't reproduce it. It should use the first quote tag in Subs.php. Did you alter it?

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

PlutoDelic

i've changed all of this:
         array(
            'tag' => 'quote',
            'before' => '<div class="quoteheader"><div class="topslice_quote">' . $txt['quote'] . '</div></div><blockquote>',
            'after' => '</blockquote><div class="quotefooter"><div class="botslice_quote"></div></div><br />',
            'block_level' => true,
         ),
         array(
            'tag' => 'quote',
            'parameters' => array(
               'author' => array('match' => '(.{1,192}?)'),
            ),
            'before' => '<div class="quoteheader">' . $txt['quote_from'] . ': {author}</div><blockquote>',
            'after' => '</blockquote>',
            'block_level' => true,
         ),


in to this (what you said to):

/*         array(
            'tag' => 'quote',
            'parameters' => array(
               'author' => array('match' => '([^<>]{1,192}?)'),
               'link' => array('match' => '(?:board=\d+;)?((?:topic|threadid)=[\dmsg#\./]{1,40}(?:;start=[\dmsg#\./]{1,40})?|action=profile;u=\d+)'),
               'date' => array('match' => '(\d+)', 'validate' => 'timeformat'),
            ),
            'before' => '<div class="quoteheader"><div class="topslice_quote"><a href="' . $scripturl . '?{link}">' . $txt['quote_from'] . ': {author} ' . $txt['search_on'] . ' {date}</a></div></div><blockquote>',
            'after' => '</blockquote><div class="quotefooter"><div class="botslice_quote"></div></div><br />',
            'block_level' => true,
         ),
*/


and this topic is the only backup that i have :S

Kays

No, replace the fourth one with what I had posted. This is what you should have.


array(
'tag' => 'quote',
'before' => '<div class="quoteheader"><div class="topslice_quote">' . $txt['quote'] . '</div></div><blockquote>',
'after' => '</blockquote><div class="quotefooter"><div class="botslice_quote"></div></div><br />',
'block_level' => true,
),
array(
'tag' => 'quote',
'parameters' => array(
'author' => array('match' => '(.{1,192}?)', 'quoted' => true),
),
'before' => '<div class="quoteheader"><div class="topslice_quote">' . $txt['quote_from'] . ': {author}</div></div><blockquote>',
'after' => '</blockquote><div class="quotefooter"><div class="botslice_quote"></div></div><br />',
'block_level' => true,
),
array(
'tag' => 'quote',
'type' => 'parsed_equals',
'before' => '<div class="quoteheader"><div class="topslice_quote">' . $txt['quote_from'] . ': $1</div></div><blockquote>',
'after' => '</blockquote><div class="quotefooter"><div class="botslice_quote"></div></div><br />',
'quoted' => 'optional',
// Don't allow everything to be embedded with the author name.
'parsed_tags_allowed' => array('url', 'iurl', 'ftp'),
'block_level' => true,
),
/* array(
'tag' => 'quote',
'parameters' => array(
'author' => array('match' => '([^<>]{1,192}?)'),
'link' => array('match' => '(?:board=\d+;)?((?:topic|threadid)=[\dmsg#\./]{1,40}(?:;start=[\dmsg#\./]{1,40})?|action=profile;u=\d+)'),
'date' => array('match' => '(\d+)', 'validate' => 'timeformat'),
),
'before' => '<div class="quoteheader"><div class="topslice_quote"><a href="' . $scripturl . '?{link}">' . $txt['quote_from'] . ': {author} ' . $txt['search_on'] . ' {date}</a></div></div><blockquote>',
'after' => '</blockquote><div class="quotefooter"><div class="botslice_quote"></div></div><br />',
'block_level' => true,
),
*/
array(
'tag' => 'quote',
'parameters' => array(
'author' => array('match' => '(.{1,192}?)'),
),
'before' => '<div class="quoteheader"><div class="topslice_quote">' . $txt['quote_from'] . ': {author}</div></div><blockquote>',
'after' => '</blockquote><div class="quotefooter"><div class="botslice_quote"></div></div><br />',
'block_level' => true,
),

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

PlutoDelic

unfortunately there's no change at all, and yes i apologise, i was so sure that i've read to change the first tag (which had effect on the output). one more reason to check the optician

Kays


If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

PlutoDelic

Kays, thanks for asking and sorry for delaying, i've managed to copy paste all the information from the original subs.php and now it's back to normal (and obivously, the Off Topic BBC Tag modified something on the quote parameters)

from your tips that what i need to modify, the 4th quote tag on subs.php, i LEARNED that what i need to modify exactly is this

array('match' => '(\d+)', 'validate' => 'timeformat'),

this is the default state, and it outputs the quotes post with a date and time, that's something that i hate cause it's too much information and cosmetically overloads the whole page. it's useful i can understand that, but it would be so nice to cut the output for example, from  "Quote from: USER on Month XX, HH:MM:SS AM/PM" to "Quote from: USER" where as hovering over it would show the other information.

regards, and thanks a lot Kays, you really helped :).

Pluto

Kays

Look a bit further down also. If you can you might be able to add  title="" for the hoverover.


'before' => '<div class="quoteheader"><a href="' . $scripturl . '?{link}">' . $txt['smf239'] . ': {author} ' . $txt[176] . ' {date}</a></div><div class="quote">',

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

PlutoDelic

nice, im learning quite a lot from you.

i did some try outs and i came to this conclusion

'before' => '<div class="quoteheader"><a href="' . $scripturl . '?{link}">' . $txt['smf239'] . ' {author} -' . ' {date}</a></div>

the open div in ur code did some anomalies, it was a pure guess to change it though

also if you dont mind, can you please explain to me what $txt['smf239'] and $txt[176] are (all the $txt in general actually), and i've noticed the {data}, if this can be modified it would be great, for me there's no need to show the seconds of a quoted post

i am also trying to give the same LOOK for the normal quote tag (see image below), but i just cant find the right place for it, and i can imagine it's not on subs.php, yet subs.php shows some style classes which i cant find them anywhere (topslice_quote, botslice_quote)

http://i48.tinypic.com/mi1d3n.jpg

and yea, sorry for the big list, just tryin to kill two (few) birds with one stone

Kays

The $txt variables are the language strings. $txt['smf239'] is for "Quote by:" while $txt[176] is for "on"

In looking at it closer try using this:


'before' => '<div class="quoteheader"><a href="' . $scripturl . '?{link}" title="' . $txt['smf239'] . ': {author} ' . $txt[176] . ' {date}>' . $txt['smf240'] . '</a></div><div class="quote">',


If you want to change the formatting look in style.css of the theme you are using.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

PlutoDelic

#20
Quote from: Kays on March 08, 2010, 11:13:12 PM
The $txt variables are the language strings. $txt['smf239'] is for "Quote by:" while $txt[176] is for "on"

In looking at it closer try using this:


'before' => '<div class="quoteheader"><a href="' . $scripturl . '?{link}" title="' . $txt['smf239'] . ': {author} ' . $txt[176] . ' {date}>' . $txt['smf240'] . '</a></div><div class="quote">',


nope, it messed it up, i removed the last open div again and it made the whole quote linked, no sign of the quote square at all and hovering over it after some seconds showed who posted and when, i like the idea but the quoted text looks really unfriendly. (and the $txt[176] on notepad2 keeps showing on red??)

and where exactly can i find those $txt's?

Quote from: Kays on March 08, 2010, 11:13:12 PM
If you want to change the formatting look in style.css of the theme you are using.

hmmm, you say "style.css", in the SMF/Themes/Theme_Used/css i can only find a file called "index.css", no clue of style.css on the theme that i am using, but the default theme has a "style.css" on the main dir of the default theme (not css folder), now i am getting confused!

EDIT: i forgot to mention that i really dont understand why are plain ugly text and is styled in bold, it's so annoying

Kays

The $txt strings can be found in Themes/Default/Languages/index.{language}.php


Sorry, style.css is for 1.1. For 2.0 it's index.css in the css folder. The formatting is there

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Advertisement: