vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Is it possible to programmatically add a column to forumdisplay (via hooks/plugin) (https://vborg.vbsupport.ru/showthread.php?t=290860)

jwocky 11-17-2012 01:07 AM

Is it possible to programmatically add a column to forumdisplay (via hooks/plugin)
 
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

Quote:

Originally Posted by Lynne (Post 2381776)
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. :/ )


All times are GMT. The time now is 03:51 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01019 seconds
  • Memory Usage 1,718KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete