View Full Version : Is it possible to programmatically add a column to forumdisplay (via hooks/plugin)
jwocky
11-17-2012, 01:07 AM
I wanted to add a column to the forumdisplay without actually changing the templates but rather have it added in via a plugin/hook. The data would be populated with data from a custom field in the thread table.
Is this possible? Has anyone done this with any example code? Any direction on which hook location and what variables I should tackle?
Thanks!!
Lynne
11-17-2012, 02:08 AM
I *think* it is. I am pretty sure I did it that way on my site, but my site is so modified that I really can't post the plugins. These are the hooks I used (and some may be related onto to the mod I wrote and not just making the column):
forumdisplay_complete
forumdisplay_announcement
search_results_prebits
search_process_fetch
search_results_threadbit
tags_list_threads
threadbit_process
threadbit_display
threadbit_display
If you search through the code for those hooks, then you may be able to figure out what was done. If I recall, there is a variable that sets the number of columns and so I had to add 1 to that variable in order to add the column (in multiple places).
jwocky
11-17-2012, 02:57 AM
I *think* it is. I am pretty sure I did it that way on my site, but my site is so modified that I really can't post the plugins. These are the hooks I used (and some may be related onto to the mod I wrote and not just making the column):
forumdisplay_complete
forumdisplay_announcement
search_results_prebits
search_process_fetch
search_results_threadbit
tags_list_threads
threadbit_process
threadbit_display
threadbit_display
If you search through the code for those hooks, then you may be able to figure out what was done. If I recall, there is a variable that sets the number of columns and so I had to add 1 to that variable in order to add the column (in multiple places).
Lynne, I was just checking out your site, is it the 'First Post' column that you are referring to? Thats exactly what I want to do ! Yours can even sort by that column which is also what I want to do. Thanks for the tips, I will start looking at those hooks.
I understand you cant post your code, but do you remember which variables actually are the ones to play with? Im pretty sure I have to work on the
threadbit_process
threadbit_display
threadbit_display
hooks, but Im confused as to which variables contain the actual column data
Thanks!!
Lynne
11-17-2012, 05:32 PM
I believe the variable is colspan:
$colspan++;
(I have no idea why I listed that one hook twice. :/ )
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.