News:

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

Main Menu

Footnotes v1.08 is out!

Started by Nao 尚, April 15, 2009, 04:40:25 AM

Previous topic - Next topic

Nao 尚

Link to Mod

Footnotes v1.08
Developed by Nao/Gilles

Link to Mod | Demo post | Support Topic


What does it do?
This mod adds a "nb" button to your message editor. The new [nb] tag allows you to show footnotes (aka nota bene) in a message, just like in Wikipedia or Spip.

Features

  • It works.
  • You can nest footnotes within each other as well (if you're crazy enough to do that (like those people who enjoy parentheses too much for their own sake (see what I mean?))).
  • If you quote footnotes, they will appear inside the quotes, rather than below your message, in order to avoid confusion about who posted what. (SMF2 only)

License Agreement
Do you like reading annoying legal mumbo-jumbo? Neither do I. So let's cut the crap and skip to the rules.
Footnotes is completely free to use, even on commercial websites. By installing it, however, you agree to the following rules.
Otherwise, you're in breach of the licence and will be exposed to potential damage such as a lawsuit, complete and utter humiliation in public, and not finding your shoes when you're already late for work.

  • You will not distribute a modified version of it,
  • You will not install/use it on a website that encourages and/or endorses violence, hate and/or any kind of bigotry. Be nice to each other!

Compatibility
It should work on any version of SMF 1.1.x and any version of SMF 2.0 (Beta 2 or later). The quoted footnotes feature only works on SMF2, though.
All previous versions of this mod MUST be uninstalled BEFORE installing this version. Also, make sure to backup your database and files first.

Support

  • You may need/want to edit the style.css additions if you want to apply the mod on a custom theme.
  • The nb.gif BBCode icon should be in /Themes/default/images/bbc, if you need it for your custom theme.
  • That's all for now.

Changelog
v1.08
! A last-minute code optimization broke multiple footnotes. Oops.

v1.07
! Fixed quoted footnotes compatibility with SMF2 Public RC3
* Improved compatibility with other mods at install time

v1.06
! Quoting messages with footnotes would break them if user has Wysiwyg enabled by default.

v1.05
! Fixed compatibility with SMF2 Public RC2

v1.03
+ Added support for nested footnotes. You can now have a footnote inside another footnote (and so on). The footnote will be shown immediately below its parent.
+ When quoting a message that has a footnote, the footnote will now appear directly at the bottom of the related quote, rather than below the entire post, which should clear confusion about who wrote which footnote (the poster or the quoted).
! Fixed support for SMF2's Curve theme. 'clear: both' had to go... If you're having layout issues because of this, use 'overflow: auto' on the parent div. If that means anything to you.
* [nb] tag is now case insensitive

v1.02
! If two or more footnotes had the same content in a single message,
  links pointing to the duplicate contents would be broken

v1.01
! The tag would break when switching between Wysiwyg modes in SMF2

v1.0
@ First release
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

Blinker

Wow, interesting mod Nao, thanks!

I think many of my members can make good use of this.

Tested and working fine on 1.1.8 on default and custom theme. Excellent work. :)

Nao 尚

Thanks :)
I figured it would be nice to try and get my first actual mod out (ie not something someone else created in the first place). It's small but it's nice for copywriters.

I'm still not sure about the tag name though. I originally used [ref] then switched to [note] then [nb] (nota bene), it can still be changed to [note], what do you think?
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

mforum


Blinker

Quote from: Nao 尚 on April 15, 2009, 05:12:31 AMThanks :)
I figured it would be nice to try and get my first actual mod out (ie not something someone else created in the first place). It's small but it's nice for copywriters.

It's nice to 'own' something! I also think a small, simple mod like this a good start and the added benefit is no more complicated support and having people get the ******s with you because they think you owe them dedicated support. Between AEVA and SMG you need a break from complex issues.

Quote from: Nao 尚 on April 15, 2009, 05:12:31 AMI'm still not sure about the tag name though. I originally used [ref] then switched to [note] then [nb] (nota bene), it can still be changed to [note], what do you think?

I think [nb] is fine. Everyone knows what it means and it's also what's on the button itself. Leave it. For now at least...

Nao 尚

Quote from: Blinker on April 15, 2009, 05:23:29 AM
It's nice to 'own' something! I also think a small, simple mod like this a good start and the added benefit is no more complicated support and having people get the ******s with you because they think you owe them dedicated support. Between AEVA and SMG you need a break from complex issues.
Lol, did you read into my mind? ;)
Although Aeva is much easier to handle now. I had a flood of bug reports coming when I released v6, which were mostly due to an undocumented (and unreported?) bug on PHP 5.2. Now that everything works nicely, the topic is as quiet as it has ever been :)

QuoteI think [nb] is fine. Everyone knows what it means and it's also what's on the button itself. Leave it. For now at least...
I wasn't sure everyone knew what NB means. I felt like it was more used in French than in English. It has the advantage of taking up less space in a message. [nb]Yay.[/nb]
I'm just saying because I already have these alternative "note.gif" and "ref.gif" buttons if anyone wants them, lol.
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

Blinker

#6
Quote from: Nao 尚 on April 15, 2009, 05:33:21 AMLol, did you read into my mind? ;)

Haha, let's put it this way - sometimes, if I feel like a cheap laugh, I read a few pages of the AEVA & SMG threads, or an SMG thread on the official site....your posts and the shocked replies of the poor hapless users amuse me tremendously. (Not that I enjoy seeing others struggle with their boards, it's just the comedy in the posts).

LOL, sometimes I feel like you're not doing the legendary arrogance of the French any favours, but mostly you're somewhat justified. Either way, I often laugh. :P I am smiling even now as I type. :D

Quote from: Nao 尚 on April 15, 2009, 05:33:21 AM
QuoteI think [nb] is fine. Everyone knows what it means and it's also what's on the button itself. Leave it. For now at least...
I wasn't sure everyone knew what NB means. I felt like it was more used in French than in English.

OK, let me clarify - "Footnote" is the correct term for what the mod is being used for, but actually in English I think the most correct usage of the N.B. or Nota Bene is to tell people "Take Note" or "Pay Attention" or "Important Note" or "Very Important". Keeping that in mind, in the case of this mod NB may not be the most appropriate use of the term. Generally the correct terminology would be footnote, citation, annotation etc etc.....but for your humble piece of coding I think it (NB) will be fine.

/thread hijack and English lesson for today. O:)

Nao 尚

Quote from: Blinker on April 15, 2009, 06:11:58 AM
LOL, sometimes I feel like you're not doing the legendary arrogance of the French any favours, but mostly you're somewhat justified.
Hey that used to be in my sig after all ;)
And I'm not really arrogant -- I simply lack patience in front of people who don't, themselves, have the patience to read through a documentation to find the answer to their questions.

QuoteOK, let me clarify - "Footnote" is the correct term for what the mod is being used for, but actually in English I think the most correct usage of the N.B. or Nota Bene is to tell people "Take Note" or "Pay Attention" or "Important Note" or "Very Important".
"Take note", "Veuillez noter que...", it's pretty much the same as "Footnote" to me ;)

QuoteKeeping that in mind, in the case of this mod NB may not be the most appropriate use of the term. Generally the correct terminology would be footnote, citation, annotation etc etc.....but for your humble piece of coding I think it (NB) will be fine.
And I'm trying to keep the tag name short. 4 letters is the most I can do. That's why I thought of "note", but mforum pointed out that it may be so generic that it gets in conflict with possibly other "note" tags. But I don't recall seeing any "note" tag up till now, so... Let's say if I change the tag, I'll have to change it today, once and for all.
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

Groundhog

Smart little mod Nao 尚.

I'll have fun inventing reasons to use this mod. It's simple to use, thanks.  :)

Özgür

#9
Nice mod Nao.
But have a two small bug (for me :S maybe..)
1 - If the description ended with the non-english character when footnotes not work.
Im try this
尚 => non-english
1 senelik konu ve artık zaten sınırlama yok.[nb]Nao 尚[/nb] Nao
2 - And If i try using [nb] to quick reply and try preview seems like in this attachment

And notice : If i use 1 senelik konu ve artık zaten sınırlama yok.[nb]Nao 尚[/nb] Nao not in nobbc    
It does not look after "Nao " in this site too. Maybe this is smf bug.
So Long

Marcus Forsberg

Good job Nao! Keep it up!

Nao 尚

Thanks guys!

Ozgur, I have no problem with non-English characters. I tried with my nickname here:
http://forum.noisen.com/4964/nao-se-remet-au-boulo/msg230516/#msg230516

It brought me to test the thing with Wysiwyg on, though -- and I realized it doesn't work. Of course -- I'm not using the regular tag handling so I should be implementing everything by hand. I'll look into fixing that. Maybe not right now though -- it'll require some thinking. I'll try to find a solution that isn't the same as in Aeva -- because it might conflict with it.

Edit -- a quick fix:

Open Subs.php

Search for

if (stripos($message, '[nb]') !== false)

Replace with

if (stripos($message, '[nb]') !== false && (!isset($_REQUEST['action']) || $_REQUEST['action'] != 'jseditor'))

It seems to work for me (switching between non-wys/wys), but it might create more issues (SSI functions?). Could you test this? Thanks!

Edit 2 -- I fixed the fix to fix broken previews. C'est un bon chien, Idefix ! (Okay it doesn't translate well...)
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

Özgür

Fix is working. But i guess character problem is my site problem. Because my site have is a problem not solved for character encoding. (here)

Thanks for the nice mod and quick fix. You are awesome Nao. =)
So Long

Nao 尚

Okay I've uploaded v1.01 with the fix. To anyone using SMF 1.1.x: no need to update, it's a SMF2-centric fix ;)
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

damnitmike

QuoteI'm still not sure about the tag name though. I originally used [ref] then switched to [note] then [nb] (nota bene), it can still be changed to [note], what do you think?

Hmmmm....maybe, let the user call it what they want?  Trying to think of a cool example........If someone has a forum about......Ohh I dunno, let's say candy. They could call it a .......  Pez.....no, an M&M........oh I dunno!......lol.....


Anyhow.....A pretty creative mod!!! I'm going to try it!

You do nice work Nao!

Tiribulus

Oh, my wife's gonna love this one buddy, and for free yet :o

Great idea 8)

xrunner

Just added - outstanding! I love it - great mod.

Nao 尚

There's a saying that says, "There's no pleasing some people"... I just found out the opposite also exists :D Or maybe it's just confirmation that "size doesn't matter" eheh. It's the smallest possible mod I could have thought of. Maybe I could convince the SMF staff to include it in the core code? After all it does make sense for long posts... More than the "glowing text" bbcode for instance ;)

@damnitmike> Although it's technically easy to do that, I don't think it's in anyone's interest. I think [nb] is good as it is.
I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.

Aeva Media rocks your life.

damnitmike

Hmmmm....seems we lost some posts here after the server maintenance....

Nao...your fix for me did the trick.....without going back into my cpanel and going by memory, the !important! with the font size 9 worked beautifully in the css.styles.........

It shrunk the nb number and brackets, and also moved them up slightly....

Niiiiice..........It also works superbly in vbgamers Article mod, and I might add it was displaying differently there also, but is fixed now!


DeviDarkL

Great mod Nao. Very useful to me eheh ;)

Here is Portuguese_PT translation:

<file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['noisen_footnote'] = 'Nota de Rodapé';
]]></add>
</operation>
</file>

Advertisement: