News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

View filter?

Started by jindroush, May 26, 2004, 10:41:06 AM

Previous topic - Next topic

jindroush

Hi,

I would like to do something like filter-on-view on the posts.

The idea is that user writes something like %REPLACE_ME% and this is inserted to the database (on edit, there would still be %REPLACE_ME%). But on viewing, it'd be replaced with some other info, picture, hyperlink, whatever...

Is it possible to do it without any changes in code? Using some mod or whatever?

Please let me know if this is the wrong forum to ask.

Christian Land

Try using the censoring function for this...

jindroush

That's not enough for me.

I need parametrized replace, more inteligent than just a string for string.

[Unknown]

Why can't you just censor %REPLACE ME% with BLAH?

-[Unknown]

jindroush

Because I want for example:

%REPLACE1(something) be replaced as <a href="prefix/something/index.htm>db_query(something)</a>

or

%REPLACE2(something) as <img src="prefix/pictures/something.jpg>

etc.

[Unknown]

You will need to do this manually in Subs-Post.php's preparsecode() or in Subs.php's doUBBC().

-[Unknown]

jindroush

If (that's a big IF) I develop some kind of plugin for this functionality, is there any chance for it to be included in main tree? I really don't want to be running on modified versions of software  :)

Is it possible to do some kind of mod with this functionality (is there a documentation for making mods anyway)?

[Unknown]

It's still being written.  If you want to donate a few thousand dollars we could hire some people to make the work go faster but otherwise it's just gonna take time.

I'm not sure if this is wanted as a distribution feature, but as a package/mod I think it would do well.  In fact, I had plans myself to do something similar - that would be:

[ board = News and Updates ] or [ board = 9 ]

Would automatically change to a link to that board, for convienience.  But, again, this is as a mod.

Packages, however, are fairly easy to develop and apply.  As long as it's set up in a package, and you test things before hand, it wouldn't cause many problems.

-[Unknown]

Advertisement: