Advertisement:

Author Topic: [offtopic]BOX[/offtopic]  (Read 39354 times)

Offline Ar3k

  • Semi-Newbie
  • *
  • Posts: 62
  • *stolzdraufeinfreakzusein*
    • X-treme Modding
[offtopic]BOX[/offtopic]
« on: November 06, 2004, 09:39:48 AM »
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

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: [offtopic]BOX[/offtopic]
« Reply #1 on: November 06, 2004, 06:00:33 PM »
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]

Offline diplomat.

  • SMF Friend
  • Full Member
  • *
  • Posts: 545
  • Gender: Male
  • avidSOUND
    • avidSOUND
Re: [offtopic]BOX[/offtopic]
« Reply #2 on: November 07, 2004, 01:39:51 PM »
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!

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: [offtopic]BOX[/offtopic]
« Reply #3 on: November 07, 2004, 06:26:58 PM »
The same way I posted with the offtopic box.

-[Unknown]

Offline diplomat.

  • SMF Friend
  • Full Member
  • *
  • Posts: 545
  • Gender: Male
  • avidSOUND
    • avidSOUND
Re: [offtopic]BOX[/offtopic]
« Reply #4 on: November 07, 2004, 07:24:05 PM »
where exactly do i add that part?
avidSOUND.com: Where Aspiring Musicians Can Be HEARD!

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: [offtopic]BOX[/offtopic]
« Reply #5 on: November 07, 2004, 07:26:04 PM »
Read my first post in the topic I linked to.

-[Unknown]

Offline diplomat.

  • SMF Friend
  • Full Member
  • *
  • Posts: 545
  • Gender: Male
  • avidSOUND
    • avidSOUND
Re: [offtopic]BOX[/offtopic]
« Reply #6 on: November 07, 2004, 08:17:43 PM »
yeah thats where i get confused. u have to add two things from the other thread im assuming...but on this
Code: [Select]
'~\[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!

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: [offtopic]BOX[/offtopic]
« Reply #7 on: November 07, 2004, 08:19:51 PM »
In the next version, you'll find this in the same file:
Code: [Select]
// [me=Comment]does something[/me]
'~\[me=((?:&quot;)?)(.{1,80}?)\\1\](.+?)\[/me\](?:<br />)?~i' => '<div class="meaction">* $2 $3</div>',

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

-[Unknown]

Offline codenaught

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 14,653
  • Gender: Male
  • Formerly Known As akabugeyes
Re: [offtopic]BOX[/offtopic]
« Reply #8 on: November 07, 2004, 09:17:51 PM »
Yeah just add
Code: [Select]
'~\[spoiler\](.+?)\[/spoiler\]~i' => '<div style="margin: 1px; padding: 1px; background-color: #eeeeee; color: black; border: 1px solid black;">$1</div>',
after

Code: [Select]
'~\[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

Offline Ar3k

  • Semi-Newbie
  • *
  • Posts: 62
  • *stolzdraufeinfreakzusein*
    • X-treme Modding
Re: [offtopic]BOX[/offtopic]
« Reply #9 on: November 08, 2004, 01:09:16 AM »
It works ! Thx 4 Help !

Greez Arek

Offline Anguz

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,430
  • Gender: Male
    • cristianlavaque.com
Re: [offtopic]BOX[/offtopic]
« Reply #10 on: November 08, 2004, 07:39:40 PM »
If you have the Faster Parsecode mod installed you will have to do something different though

Code: [Select]
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.
« Last Edit: November 13, 2004, 07:41:29 PM by Anguz »
Cristián Lávaque http://cristianlavaque.com

Offline Anguz

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,430
  • Gender: Male
    • cristianlavaque.com
Re: [offtopic]BOX[/offtopic]
« Reply #11 on: November 12, 2004, 04:08:54 PM »
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

Code: [Select]
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

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

and make the tag

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

Offline Jaanz

  • Semi-Newbie
  • *
  • Posts: 20
  • Gender: Male
Re: [offtopic]BOX[/offtopic]
« Reply #12 on: December 30, 2004, 02:57:48 PM »
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)
Code: [Select]

Offline Anguz

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,430
  • Gender: Male
    • cristianlavaque.com
Re: [offtopic]BOX[/offtopic]
« Reply #13 on: December 30, 2004, 05:43:39 PM »
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

Offline Jaanz

  • Semi-Newbie
  • *
  • Posts: 20
  • Gender: Male
Re: [offtopic]BOX[/offtopic]
« Reply #14 on: December 31, 2004, 03:19:39 AM »
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
« Last Edit: December 31, 2004, 03:24:30 AM by Jaanz »

Offline Anguz

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,430
  • Gender: Male
    • cristianlavaque.com
Re: [offtopic]BOX[/offtopic]
« Reply #15 on: December 31, 2004, 03:59:10 AM »
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:

Code: [Select]
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

Code: [Select]
$txt['offtopic'] = 'Offtopic';
and then make the tag like this:

Code: [Select]
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

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

Offline Jaanz

  • Semi-Newbie
  • *
  • Posts: 20
  • Gender: Male
Re: [offtopic]BOX[/offtopic]
« Reply #16 on: January 01, 2005, 08:39:36 AM »

and then make the tag like this:

Code: [Select]
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.)
« Last Edit: January 01, 2005, 10:55:31 AM by Jaanz »

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: [offtopic]BOX[/offtopic]
« Reply #17 on: January 01, 2005, 04:03:17 PM »
I believe you enter that in the settings for his mod.

-[Unknown]

Offline Anguz

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,430
  • Gender: Male
    • cristianlavaque.com
Re: [offtopic]BOX[/offtopic]
« Reply #18 on: January 01, 2005, 04:18:59 PM »
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

Offline VaNcHeR

  • Newbie
  • *
  • Posts: 1
Re: [offtopic]BOX[/offtopic]
« Reply #19 on: December 28, 2006, 10:26:22 AM »
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 =(