[ABD] Acronym Mod by CMX v0.9.5

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Locked
CodeMonkeyX
Registered User
Posts: 261
Joined: Thu Feb 14, 2002 3:16 am
Location: So. California
Contact:

[ABD] Acronym Mod by CMX v0.9.5

Post by CodeMonkeyX » Sat Apr 12, 2003 10:49 pm

8/2/2003 - Version 0.9.5 bug fix release.

7/31/2003 - Version 0.9.4 is pretty much a complete rewrite. I saw that after adding all the checks for existing tags, and urls etc the previous method was more trouble than it was worth. So I changed it.
As of V0.9.4 acronyms are now parsed and added when the message is viewed.

This has two main:
* It makes newly added acronyms appear in old posts.
* It is much simpler to insure acronym tags are not inserted into the wrong place.

The only dis advantage is that it adds some more processing time to viewtopic.php.

7/8/2003 - Just finished doing some update work on this mod. I addressed some of the problems people have been having with the mod. And added a acronym listing page, which you can link to if you wish. See the install file for more information.

Today I started a new project, the Acronym Mod. This may have been done before, but I wanted to learn how to do it anyway. Basically this mod has two functions:
  1. To add a BBCode for acronyms.
  2. To add functionallity that will automatically add descriptions to acronyms in posts.
I though this project would be a breeze, but it took me a little longer than I though to get it working. I had to learn a lot about preg_replace in php.

It seems to be working pretty well right now. Give it a try

Features:
* Allows users to define thier own acronyms by using the acronym BBCode.
* Automatically scans posts and adds descriptions to matched acronyms.
* Admin Control Panel to easily add/edit/remove acronyms.
Last edited by CodeMonkeyX on Sun Aug 03, 2003 9:48 am, edited 7 times in total.
CodeMonkeyX
codemonkeyx.net
"Codito Ergo Sum" - Descartes (kinda)

CodeMonkeyX
Registered User
Posts: 261
Joined: Thu Feb 14, 2002 3:16 am
Location: So. California
Contact:

Post by CodeMonkeyX » Sun Apr 13, 2003 5:15 am

I just uploaded v0.9.1, it has a greatly impoved searching function. I addressed all the things I thought might cause the mod problems, so I think it is pretty much ready for release.

I will just wait to see if you guys have any problems first.
CodeMonkeyX
codemonkeyx.net
"Codito Ergo Sum" - Descartes (kinda)

Syntroll
Registered User
Posts: 12
Joined: Thu Jan 09, 2003 8:30 pm
Location: Rouen // France
Contact:

Post by Syntroll » Sun Apr 13, 2003 8:17 am

Hi ,
I've installed your acronym mod .. and I want to ask you one questions :
* first : whow users can see the acronym description ?

you made a very good install ... I'm going to add a bbcode button for more facility

THX for this mods .. and if you want some help .. :wink:
I'm french and not accustomed with English !
My website : Commun-0-Troll

CodeMonkeyX
Registered User
Posts: 261
Joined: Thu Feb 14, 2002 3:16 am
Location: So. California
Contact:

Post by CodeMonkeyX » Sun Apr 13, 2003 8:32 am

Well the acronyms should have a dotted line under them, then when the user holds the mouse over them a description should pop up, like a tool-tip.

I do not think I need any help, the mod is pretty simple. If you send me the code for the bbcode button I will add that to the mod.

Tell me if you have any problems with it.
CodeMonkeyX
codemonkeyx.net
"Codito Ergo Sum" - Descartes (kinda)

Mighty_Y
Registered User
Posts: 36
Joined: Thu Dec 05, 2002 5:38 pm

Post by Mighty_Y » Sun Apr 13, 2003 9:07 am

I like it, I hope you don't mind that I'm going to port it for PHP-Nuke??
(Me and Anor did the same thing with your News)
If it's ready you can download it on http://www.portedmods.com

Syntroll
Registered User
Posts: 12
Joined: Thu Jan 09, 2003 8:30 pm
Location: Rouen // France
Contact:

Post by Syntroll » Sun Apr 13, 2003 10:09 am

Oki THX CodeMonkeyX ... this mod woks perfectly ...
CodeMonkeyX wrote: If you send me the code for the bbcode button I will add that to the mod

I search it and I'll give you !

THX again
I'm french and not accustomed with English !
My website : Commun-0-Troll

Mighty_Y
Registered User
Posts: 36
Joined: Thu Dec 05, 2002 5:38 pm

Post by Mighty_Y » Sun Apr 13, 2003 11:37 am

I installed it on Nuke and it also works perfect, only 1 thing if you give in LOL in your admin panel and the descrition laughing out loud then it only parses LOL and not lol if you understand me. Could you make it that it parses that too??

PS I made an addonpage where everyone can see what acronyms are specified in the adminpanel. Now it's only for nuke but I can make it for normal phpBB too if you like it. Nuke view here http://www.portedmods.com/modules.php?n ... le=acronym

[edit]Because I don't have the time to wait for your reply I packaged this addon so you can download it.
Download here http://users.skynet.be/fa091229/acronym_page.zip
[/edit]
Last edited by Mighty_Y on Mon Apr 14, 2003 8:33 am, edited 1 time in total.

Syntroll
Registered User
Posts: 12
Joined: Thu Jan 09, 2003 8:30 pm
Location: Rouen // France
Contact:

Post by Syntroll » Sun Apr 13, 2003 12:02 pm

For add a bbcode button :

Code: Select all

------find------- 

b_help = "{L_BBCODE_B_HELP}"; 
i_help = "{L_BBCODE_I_HELP}"; 
u_help = "{L_BBCODE_U_HELP}"; 
q_help = "{L_BBCODE_Q_HELP}"; 
c_help = "{L_BBCODE_C_HELP}"; 
l_help = "{L_BBCODE_L_HELP}"; 
o_help = "{L_BBCODE_O_HELP}"; 
p_help = "{L_BBCODE_P_HELP}"; 
w_help = "{L_BBCODE_W_HELP}"; 
a_help = "{L_BBCODE_A_HELP}"; 
s_help = "{L_BBCODE_S_HELP}"; 
f_help = "{L_BBCODE_F_HELP}"; 


------add after------- 


t_help = "test: [test]message[/test] (alt+t) "; 

---find----------- 


('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','
','
  • ','
','
  • ','
','[img]','[/img]','','');



-----add after '[/url]' -------


,'[test]','[/test]'


-----find------------------


<td><span class="genmed">
<input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" />
</span></td>



------add after------------------



<td><span class="genmed">
<input type="button" class="button" accesskey="t" name="addbbcode18" value="test" style="width: 40px" onClick="bbstyle(18)" onMouseOver="helpline('t')" />
</span></td> [/code]

this work was made by LikiD
I'm french and not accustomed with English !
My website : Commun-0-Troll

User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Post by drathbun » Sun Apr 13, 2003 1:24 pm

Very nice. Just had a look at your demo topic, looks like something that I will definitely be interested in trying out.

Dave
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image

netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic » Sun Apr 13, 2003 4:18 pm

Excellent. I've been meaning to get around to something like this. I was planning on a smart tags kind of thing which would automatically link to external sites, e.g. 'phpbb' in a post would link to phpbb. I'm sure this could be modified to do that.
Defend the game:
Image

Mighty_Y
Registered User
Posts: 36
Joined: Thu Dec 05, 2002 5:38 pm

Post by Mighty_Y » Sun Apr 13, 2003 4:52 pm

Has someone tested my addon??

CodeMonkeyX
Registered User
Posts: 261
Joined: Thu Feb 14, 2002 3:16 am
Location: So. California
Contact:

Post by CodeMonkeyX » Sun Apr 13, 2003 6:25 pm

Mighty_Y wrote: I installed it on Nuke and it also works perfect, only 1 thing if you give in LOL in your admin panel and the descrition laughing out loud then it only parses LOL and not lol if you understand me. Could you make it that it parses that too??


Well actually that is a feature, not a bug!! (as Micosoft so often like to say) ;) This way it helps prevent to many mis-matches. But if you really want to try it I think you have to do this.

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php

#
#-----[ FIND ]------------------------------------------
#
$orig_word[] = '#\b(' . str_replace('\*', '\w*?', phpbb_preg_quote( $row['acronym'], '#')) . ')\b#';

#
#-----[ REPLACE, WITH ]------------------------------------------
#
$orig_word[] = '#\b(' . str_replace('\*', '\w*?', phpbb_preg_quote( $row['acronym'], '#')) . ')\b#i';
I think that is right, but I am working of the top of my head so it might now work either. ;)
CodeMonkeyX
codemonkeyx.net
"Codito Ergo Sum" - Descartes (kinda)

CodeMonkeyX
Registered User
Posts: 261
Joined: Thu Feb 14, 2002 3:16 am
Location: So. California
Contact:

Post by CodeMonkeyX » Sun Apr 13, 2003 6:26 pm

netclectic wrote: Excellent. I've been meaning to get around to something like this. I was planning on a smart tags kind of thing which would automatically link to external sites, e.g. 'phpbb' in a post would link to phpbb. I'm sure this could be modified to do that.


Yeah that is a good idea, when I get this one through the database I will write the URL mod. (I will wait to make sure nothing is wrong with this one ;) )
CodeMonkeyX
codemonkeyx.net
"Codito Ergo Sum" - Descartes (kinda)

Mighty_Y
Registered User
Posts: 36
Joined: Thu Dec 05, 2002 5:38 pm

Post by Mighty_Y » Sun Apr 13, 2003 6:44 pm

Oh ok, I think I'm stupid, I even can't see the differance between a bug and a feature :D.

And still no-one has tested my addon :cry:

Automechanic
Registered User
Posts: 39
Joined: Fri Dec 06, 2002 7:33 am
Location: East Anglia UK
Contact:

Post by Automechanic » Sun Apr 13, 2003 7:32 pm

Thanks for another great mod Codemonkey, I have a post with over 180 acronyms in it and it works fine Click Here
It also works well with your news mod also the printable topics mod.

Mighty_Y
The code for phpbb is

Code: Select all

$phpbb_root_path = './';
And your addon is also working Here

Locked

Return to “[2.0.x] MODs in Development”