MyBB Community Forums

Full Version: New var for Template
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys

I want to develop a new variable for the following template: forumdisplay_thread.

1. I want to get the "lastpost"-id from the table mybb_threads,
2. then I want to get the "subject" of this "lastpost"-ID from mybb_posts.

I want to save this subject in a variable and then output it in the template forumdisplay_thread (e.g. as {$myVar} ) For each "thread" the subject should be displayed for new answers. (please look attached)

 Which hooks should I use? Does anyone have a " start help " for me? 

In postbit_posturl I can use this:


{$post['subject_title']}  
but it is not possible for the template forumdisplay_thread. I want to display the current subject per thread. Maybe you can help me. :-) Anybody got a way for me?

 JAY

does anyone have a hint for me? What exactly do I have to do so that {$post['subject_title']} can also be used for "forumdisplay"-template?
Hi.

You are free to check my following plugin:
https://community.mybb.com/mods.php?acti...w&pid=1219

It loads the first post full message in the very same template you want to load the last post subject.

You can get "inpiration" by reading or even copying (if your code license is compatible) and adapting the code to your needs.

If my style of achieving my needs is not appealing to you, you can try to understand how to use the forumdisplay_get_threads and the 'forumdisplay_thread' work, as these are the only two hooks you need to ahieve what you are seeking.

https://github.com/Sama34/OUGC-Display-M...um-Display