News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Spoiler Tag

Started by Anguz, November 13, 2004, 06:56:09 PM

Previous topic - Next topic

Anguz

I apologize for the lack of update to my mods, they're specified for SMF 1.0.2 still. I'll do a few for 1.0.3 now and later probably the rest. BTW, 3fifty, Streaming 3 may give you an error when trying to install FasterParsecode, since they both modify the same function, so you will need to do some manual editing most probably. VCRulez, thx for letting me know.
Cristián Lávaque http://cristianlavaque.com

3fifty

Quote from: Anguz on April 19, 2005, 08:17:45 PM
BTW, 3fifty, Streaming 3 may give you an error when trying to install FasterParsecode, since they both modify the same function, so you will need to do some manual editing most probably. VCRulez, thx for letting me know.

Sorry didnt mean to rush you, Im in no hurry.  I just though maybe I was doing something wrong. :) Thanks for the tip on that!

Anguz

1.03


  • Updated for SMF 1.0.3.
Cristián Lávaque http://cristianlavaque.com

3fifty

#43
I installed.  Said it installed with success now I get this when I goto my forums



Parse error: parse error, unexpected T_IF, expecting ')' in /home/content/n/c/t/nctuners/html/forum/Sources/Subs.php on line 891



I removed this and the forums came back up.

// Spoiler tag.
if(isset($add['[spoiler]'])){
static $id_spoiler = 0;
$arr1[] = '~\[spoiler\](.+?)\[/spoiler\](?:<br />)?~ie';
$arr2[] = '\'<span class="spoilerheader"><a href="javascript:spoiler(\\\'spoiler\' . $id_spoiler . \'\\\');">\' . $txt[\'spoilerheader\'] . \'</a></span><div id="spoiler\' . $id_spoiler++ . \'" class="spoiler" style="display: none;">$1</div>\'';
}
if(isset($add['[spoiler='])){
static $id_spoiler = 0;
$arr1[] = '~\[spoiler=(.+?)\](.+?)\[/spoiler\](?:<br />)?~ie';
$arr2[] = '\'<span class="spoilerheader"><a href="javascript:spoiler(\\\'spoiler\' . $id_spoiler . \'\\\');">\' . $txt[\'spoilerheader\'] . \': $1</a></span><div id="spoiler\' . $id_spoiler++ . \'" class="spoiler" style="display: none;">$2</div>\'';
}



Anguz

Did you install FasterParsecode first?
Cristián Lávaque http://cristianlavaque.com

thunderbolt

Parse error: parse error, unexpected T_IF, expecting ')' in yadda, yadda/Sources/Subs.php on line 891

I get the same error because I was in such a hurry and DIDN'T install the faster Parse code first.  How do I manually reverve this installation so I can get into the board and install the faster parser code.

me = dumb-as*


thunderbolt

I got it.  Thanks..  I deleted the Subs.php file and renamed the Subs.php~ to Subs.php.

Anguz

Glad you were able to fix it. :)
Cristián Lávaque http://cristianlavaque.com

azuregenesis

how do you get it to work with other themes?

Anguz

Look at the .mod file in the package and look for the modification done to index.template.php, iirc, and do that to your other theme too. Also copy the JavaScript file to your theme's dir as well.
Cristián Lávaque http://cristianlavaque.com

azuregenesis

so, just the index.template and copy the js file?

easy now (hopefully) thanks :)

dadann

#51
Quote from: Anguz on April 26, 2005, 02:26:16 PM
Look at the .mod file in the package and look for the modification done to index.template.php, iirc, and do that to your other theme too. Also copy the JavaScript file to your theme's dir as well.
Sorry, but your mod doesn't modify index.template.php, does it ? ;)

Great mod, BTW

Anguz

Ah, you're right. Well, if your theme doesn't have a script.js file, it'll use the default one I think. And then you'd need to add the styles to your styles.css file. Sorry about the mistake and glad you like the mod.
Cristián Lávaque http://cristianlavaque.com

azuregenesis

checked the mod and it seems it does nothing to the index.template file

it does changes to style.css, script.js, modifications.english, and subs.php

Kilocron

You'll have to forgive me sinc eI'm not THAT good at this stuff.

I installed it on my forum and it works great and installed fine. There is a problem. It seems that all my users that are running off of Firefox can't get it to work. Whereas if you are running on Internet Explorer, there is no problems... any idea what might be causing this? Some kind of setting in Firefox maybe?


One of my users said he got this error...
<bravejaf> Error: spoiler is not definedSource File: javascript:spoiler('spoiler0');Line: 1


Anguz

Hmm... I hadn't seen that error before, it always worked fine in FF for me. So I went and tried it in a 1.0.3 install again and it actually gave me that error. After some search, I went to the FF Tools/Options.../Web Features. There's a pref to "Enable JavaScript" there with an Advanced button. I had all exept the last option there disabled, so I enabled them to see if it had something to do with the error, and after saving the settings and refreshing the page, the spoiler worked. Then I went back to the JS options and set them as they were before, saved and refreshed and spoiler still works. I don't know what the problem could be, but you can try telling your users having that problem, to try that.
Cristián Lávaque http://cristianlavaque.com

Kilocron

Thanks for your help. I'll let the guys know what you said and see if that takes care of it. I'm still in the stoneage of IE. ^ ^;  If they continue having problems, I'll let you know. Otherwise, great mod. Something my forum needed badly.

Anguz

Cristián Lávaque http://cristianlavaque.com

Emilie

I have just installed th emod so I could get "Spoiler Tags" for my forum, but here's the problem.

How can I get a button above the textfield,, so the members can just click there to get the code. Because I don't think people will remember the code, and I don't think all members even will realize that there's is such a function.
So I would like a button that creates the code, just like codes and such :)

And when I use the spoilertag - [*spoiler=LinkText]My Spoilerinfo[/spoiler]
the link is shown up as ": LinkText". Is there anyway I can replace the ":" with "Spoiler: "

I hope I made any sense, I'm swedish so my english isn't much to brag about.

Anguz

You're right. I just haven't bothered adding the buttons for any of my bbcode tag mods so far. In Post.template.php you look for the function template_postbox and it'll be pretty plain to see where you add the button. Don't forget to have an image ready for it. ;)
Cristián Lávaque http://cristianlavaque.com

Advertisement: