News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

[offtopic]BOX[/offtopic]

Started by Ar3k, November 06, 2004, 09:39:48 AM

Previous topic - Next topic

Ar3k

Hello.
Sorry but my english is not so good. But i will try it. ;)

I will make an other painted box when i enter [offtopic] [/offtopic]
like [ code ] [ /code ]

Thx 4 help

[Unknown]

http://www.simplemachines.org/community/index.php?topic=12138.0

'~\[offtopic\](.+?)\[/offtopic\]~i' => '<div style="margin: 1px; padding: 1px; background-color: #eeeeee; color: black; border: 1px solid black;">$1</div>',

-[Unknown]

diplomat.

reading that, i get confused a little. i was trying to add a spoiler tag but without the javascript...like a code or quote box, but the text is the same color as the bg of the spoiler box. how would i do that?
avidSOUND.com: Where Aspiring Musicians Can Be HEARD!

[Unknown]

The same way I posted with the offtopic box.

-[Unknown]

diplomat.

where exactly do i add that part?
avidSOUND.com: Where Aspiring Musicians Can Be HEARD!

[Unknown]

Read my first post in the topic I linked to.

-[Unknown]

diplomat.

yeah thats where i get confused. u have to add two things from the other thread im assuming...but on this
'~\[spoiler\](.+?)\[/spoiler\]~i' => '<div style="margin: 1px; padding: 1px; background-color: #eeeeee; color: black; border: 1px solid black;">$1</div>',

i dunno where i would insert that part by looking at the other thread. (keep in mind that im a nooby)
avidSOUND.com: Where Aspiring Musicians Can Be HEARD!

[Unknown]

Quote from: [Unknown] on June 07, 2004, 09:35:45 AM
In the next version, you'll find this in the same file:
// [me=Comment]does something[/me]
'~\[me=((?:&quot;)?)(.{1,80}?)\\1\](.+?)\[/me\](?:<br />)?~i' => '<div class="meaction">* $2 $3</div>',


And add after it:
'~\[you( />)?\]~i' => $context['user']['name'],

-[Unknown]

-[Unknown]

codenaught

Yeah just add

'~\[spoiler\](.+?)\[/spoiler\]~i' => '<div style="margin: 1px; padding: 1px; background-color: #eeeeee; color: black; border: 1px solid black;">$1</div>',


after

'~\[me=((?:&quot;)?)(.{1,80}?)\\1\](.+?)\[/me\](?:<br />)?~i' => '<div class="meaction">* $2 $3</div>',

in the Sources/Subs.php file
like Unknown suggested. If you have the Faster Parsecode mod installed you will have to do something different though as that mod edits the subs.php file a lot.

Actually you have beta 5 on your forum don't you? So maybe that is why you can't find it.
Dev Consultant
Former SMF Doc Coordinator

Ar3k

It works ! Thx 4 Help !

Greez Arek

Anguz

#10
Quote from: akabugeyes on November 07, 2004, 09:17:51 PM
If you have the Faster Parsecode mod installed you will have to do something different though


if(isset($add['[offtopic]'])){
$arr1 = '~\[offtopic\](.+?)\[/offtopic\]~i';
$arr2 = isset($disabled['offtopic']) ? '$1' : '<div style="margin: 1px; padding: 1px; background-color: #eeeeee; color: black; border: 1px solid black;">$1</div>';
}


;)

Quote from: akabugeyes
as that mod edits the subs.php file a lot.

Not really, only the parsecode function, the rest of the file is untouched.
Cristián Lávaque http://cristianlavaque.com

Anguz

Now you can also add tags that don't use parameters using this mod
http://mods.simplemachines.org/index.php?mod=48 :)

The format for the offtopic one would be


offtopic <div style="margin: 1px; padding: 1px; background-color: #eeeeee; color: black; border: 1px solid black;">$1</div>


You could also just add a new class to your style.css file like this


div.offtopic
{
margin: 1px;
padding: 1px;
background-color: #eeeeee;
color: black;
border: 1px solid black;
}


and make the tag


offtopic <div class="offtopic">$1</div>
Cristián Lávaque http://cristianlavaque.com

Jaanz

How about if i want to see that offtopic text, i mean that i want to replace that Code: text with Offtopic: text. I tried to figure that out almost 1 hour and then i had to go for a smoke. (regular cigarette)


Anguz

Well, the code tag gets a different parsing than the rest of the tags. What do you mean by making it like it?
Cristián Lávaque http://cristianlavaque.com

Jaanz

#14
Ok, i try to explain it again, but different way and example.

Quote
As you see, above this box has bolded Quote text wich tells you what this box mean is.

And i would like that Quote text to be replaced with Offtopic or Spoiler texts.

I know it's a easy to make that, but... not for me. Only experience i had with coding is from the year when commodore 64 was "the machine". :D

Anguz

I see, well, it's pretty much what I posted in my other reply with the code. For the header, just add it at the beginning, like this:

offtopic <div class="quoteheader">Offtopic:</div><div class="offtopic">$1</div>

Ideally, you wouldn't hardcode the text, instead you'll add this in the file Modifications.english.php

$txt['offtopic'] = 'Offtopic';

and then make the tag like this:

offtopic <div class="quoteheader">' . $txt['offtopic'] . ':</div><div class="offtopic">$1</div>

If you want to have a different styling for the offtopic header than the quote one, then in style.css create a new class named offtopicheader with the styles you want and change the class in the tag like this

offtopic <div class="offtopicheader">' . $txt['offtopic'] . ':</div><div class="offtopic">$1</div>
Cristián Lávaque http://cristianlavaque.com

Jaanz

#16
Quote from: Anguz on December 31, 2004, 03:59:10 AM

and then make the tag like this:

offtopic <div class="quoteheader">' . $txt['offtopic'] . ':</div><div class="offtopic">$1</div>


I don't understand where i supposed to put that code line? To the subs.php? I Tried that, but forum gave me few errors. (Sorry about asking stupid questions.)

[Unknown]

I believe you enter that in the settings for his mod.

-[Unknown]

Anguz

Quote from: Jaanz on January 01, 2005, 08:39:36 AM
I don't understand where i supposed to put that code line? To the subs.php? I Tried that, but forum gave me few errors. (Sorry about asking stupid questions.)

http://www.simplemachines.org/community/index.php?topic=19452.msg159718#msg159718
Cristián Lávaque http://cristianlavaque.com

VaNcHeR

Excuse me, can you explain me, what should I do to install this feature to SMF 1.1? I can't find right place in the Subs.php =( There is no such lines there =(

Advertisement: