Customizing SMF > SMF Coding Discussion

Automatically link certain words?

<< < (5/8) > >>

MrMike:
Your regex is better, consider it switched. :) I should have been breaking along word boundaries as you did, it's a cleaner, more sensible way to do it.

So, how does one make a mod out of this...is there an online guide or a step-by step tutorial?

Arantor:
Well, if you take a look at the 'Important Customization Information' sticky topic in this board, you'll find a bunch of links discussing various aspects of building a mod.

Essentially, though, you could just do what I did: look at existing mods and see how they work, for the very most part it's just a case of find/replace operations.

MrMike:

--- Quote from: Arantor on May 29, 2012, 10:03:26 PM ---Essentially, though, you could just do what I did: look at existing mods and see how they work, for the very most part it's just a case of find/replace operations.
--- End quote ---

I think the part I'm most uncertain about is how to create the configuration screens with the options for SMF. I'll look over those topics and see what I can learn.

Arantor:
Ah, yes, that's not really that well documented.

There's essentially two parts to it, adding an item to the menu and then doing something when you call that. Take a look around at some mods that do the same (preferably later ones that describe themselves as using hooks, because that solves a *lot* of headaches for 2.0)

MrMike:

--- Quote from: Arantor on May 30, 2012, 10:05:27 AM ---Ah, yes, that's not really that well documented.
--- End quote ---

Yep, I noticed, lol.

Here's the thing...I've got what seems to be some stable, working code. I could probably figure out all the packaging stuff and configuration screens eventually, but if people want this as a mod package before the turn of the century then someone who's familiar with mods might want to contact me to get the code and package it up...otherwise it may be a looooooooong time before I manage to get into a proper, usable mod package.

I did add some code to eliminate unnecessary queries. The first time the mod is used it does a single query to get the target words, which are then placed in a session var. After that initial query it shouldn't need to hit the database again (as long as the user's session is still alive), it 'll just pull a fresh target list out of the session for each post.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version