Warning: The author of this contribution does not provide support for it anymore.

Quick Title Edition

Frequently Asked Questions

[Part 3] How to adapt this MOD to another one ?

For this third part of this tutorial, we are going to use Board3 Portal as example. That MOD has the features that we need here :).

As you will see in the code, the template variable is not TOPIC_TITLE, but TITLE or FULL_TITLE.
Why is there two template variables ? The first one is truncated, not the second one, which is probably used for tooltips.

Open the portal/blocks/recent.php file.
Look at the database query on line 51.
You will see the topics table is not fully loaded here too.
So we must add our three columns inside.

As I said you, I like technical, and I am going to give a tip without modify the query.
I draw one's inspiration from an old MOD for phpBB2 : Rank Color System, by reddog.

Search :

Code: Select all

$result $db->sql_query_limit($sql$portal_config['portal_max_topics']);    

And add before :

Code: Select all

//-- mod : quick title edition -------------------------------------------------
//-- add
$sql str_replace('topic_id''topic_id, topic_attr_id, topic_attr_user, topic_attr_time'$sql);
//-- fin mod : quick title edition ---------------------------------------------    

How does it ? Before being executed, the query is contained in the $sql variable and is no more or less than a string. That code allows to replace elements in that string. Here are the details of the str_replace() function.

I think you are now able to do the rest of the modifications.
There is again one part to describe you, and I think you will be ready to make your own add-ons yourselves :).