MyBB Community Forums

Full Version: $gid/$usertitle missing in latest threads plugins
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello all,

I've tried several different latest/new threads plugins. All of them, for some reason, do not display the usergroup title. I would like to have the usergroup title (Administrator, Moderator, User, etc)  display under the poster's name. Been fiddling around, going through the forums for answers, tried the solutions, to no avail.

Currently installed is this plugin: https://community.mybb.com/mods.php?acti...w&pid=1143

I made changes to the hooks_functions.php file by adding the usergroups table that contains $usertitle, I made changes to templates. The changes are highlighted in yellow. But nothing happens. See attached images. Am I missing something?

Much appreciation in advance for any help.

[attachment=46761][attachment=46762][attachment=46763]

EDIT: Found the problem. I forgot to query the usertitle:

$query = $db->query("
        SELECT t.*, tt.usertitle, .....

For those who seek this mod. Here is the solution. The changes are in nt_hooks_functions.php highlighted in yellow.

[attachment=46765]  [attachment=46766]
Usually plugins show username with format and when you set different color and style for each usergroups , then your users can detect user group of writer based on style that have like my free plugin in here
(2024-03-12, 11:55 PM)Mostafa.Shiraali Wrote: [ -> ]Usually plugins show username with format and when you set different color and style for each usergroups , then your users can detect user group of writer based on style that have like my free plugin in here

Thanks for your reply. It's an Astrology website website. The users won't understand the color codes, especially guests. It would be more effective if they can see the word "Astrologer" under the poster's name.

I edited my OP to include more details with images of my attempt o fix this.


EDIT. I found the problem. It's fixed. See OP.

P.S. Nice plugin! Will check it out.
(2024-03-12, 11:46 PM)webless Wrote: [ -> ]Hello all,
I've tried several different latest/new threads plugins. All of them, for some reason, do not display the usergroup title. I would like to have the usergroup title (Administrator, Moderator, User, etc)  display under the poster's name. Been fiddling around, going through the forums for answers, tried the solutions, to no avail.
Currently installed is this plugin: https://community.mybb.com/mods.php?acti...w&pid=1143
I made changes to the hooks_functions.php file by adding the usergroups table that contains $usertitle, I made changes to templates. The changes are highlighted in yellow. But nothing happens. See attached images. Am I missing something?
Much appreciation in advance for any help.
EDIT: Found the problem. I forgot to query the usertitle:
$query = $db->query("
        SELECT t.*, tt.usertitle, .....
For those who seek this mod. Here is the solution. The changes are in nt_hooks_functions.php highlighted in yellow.
 



Hello all,
am reviving this thread.

Instead of posting all forum posts, I would like to display only posts from groups that were also given a specific group category  in the mysql "users" table under the column "additionalgroups" - how would I do that without making major changes?


Is it possible to simply do something like
SELECT * FROM table WHERE column1 = 'var1' AND column2 = 'var2';

in the hooks.php here? I'm not a coder so my fiddling hasn't been successful. Much thanks in advance for your help.
[attachment=46810]
(2024-03-25, 02:54 PM)webless Wrote: [ -> ]
(2024-03-12, 11:46 PM)webless Wrote: [ -> ]Hello all,
I've tried several different latest/new threads plugins. All of them, for some reason, do not display the usergroup title. I would like to have the usergroup title (Administrator, Moderator, User, etc)  display under the poster's name. Been fiddling around, going through the forums for answers, tried the solutions, to no avail.
Currently installed is this plugin: https://community.mybb.com/mods.php?acti...w&pid=1143
I made changes to the hooks_functions.php file by adding the usergroups table that contains $usertitle, I made changes to templates. The changes are highlighted in yellow. But nothing happens. See attached images. Am I missing something?
Much appreciation in advance for any help.
EDIT: Found the problem. I forgot to query the usertitle:
$query = $db->query("
        SELECT t.*, tt.usertitle, .....
For those who seek this mod. Here is the solution. The changes are in nt_hooks_functions.php highlighted in yellow.
 



Hello all,
am reviving this thread.

Instead of posting all forum posts, I would like to display only posts from groups that were also given a specific group category  in the mysql "users" table under the column "additionalgroups" - how would I do that without making major changes?


Is it possible to simply do something like
SELECT * FROM table WHERE column1 = 'var1' AND column2 = 'var2';

in the hooks.php here? I'm not a coder so my fiddling hasn't been successful. Much thanks in advance for your help.

Problem solved. Solution was simple. But when you have no background in html, java, php, sql....it took a week of fiddling around. After successfully writing/creating my own page,, I realized I could get the plugin to do what I wanted with a simple insert.

change this :

WHERE 1=1 $where AND t.visible >    

to this:

WHERE 1=1  $where AND t.visible IN ('1') AND u.additionalgroups IN ('14')


Now this whole thing was to avoid needing to figure out how to integrate MYBB with Wordpress.

This plugin allows  a blogger or many bloggers to write their articles (in my case - astrologers and numerologists) and have it featured on the landing page of the forum.

THANK YOU, MYBB.
LONG LIVE, MYBB!!

[attachment=46816]