![]() |
Using {vb:raw conversation.groupid}
As a vBulletin n00b, I've scoured these (and the vb.com's) forums for the past couple of weeks looking for a solution to this. Since I couldn't find one, I'm having to hack the core files - which I'd rather not do.
I'm hoping someone can tell me a more graceful way to handle this php file modification so that I don't have to hack the core files every time I update to a new release. Here's what I needed and how I did it: For those that don't already know, $conversation['groupid'] is not made available for template modifications in the codebase as of 5.1.2 Patch Level 2. The database's node table has a field for this information, but if you take a look - that field only contains NULL values by default. (vb_node -> groupid). I need to assign avatars to my forum users based on the primary group id. This was easier to do in vB4, but the feature was used very little and so, as the devs have explained, the feature was not included in vB5. With that, I set out to create a group avatar manager myself. By modifying /core/vb/library/content/text.php, you are now able to pull this information (although another hack is required to fill the database with the groupid of the post author - which I'll update here as soon as I figure that out). Original @ Line 519 PHP Code:
PHP Code:
Edit: Here's the hack that enables the groupid to be set when someone creates a new forum node (channel/topic/post): Original File: /core/vb/library/content.php @ Line 199 PHP Code:
PHP Code:
Edit: There is still one more file to edit that controls Private Message node creation. Will update this post when I find it. |
I don't fully understand the use case, but remember that you can pull any bit of data you want into a template by making direct API calls in vbulletin 5. You don't need to have the data ready before you start rendering the template.
For something like this, it'd probably require an additional query per post (not sure if that's a deal breaker or not). It'd also save manual file edits. I'm also curious why the user group needs to be attached to the node. Do you want it to stay static in case the user's user group changes? |
Quote:
Quote:
Quote:
Quote:
Quote:
Obviously somebody at vBulletin Solutions thought this was a good idea at one point, otherwise why would the database field exist in the node table? I hope that clarifies what i'm trying to do, why I need to do it, and how I'm attempting to accomplish it. If there's a better way to accomplish what I'm trying to do, I'm all ears! (I still haven't found the file that controls Private Message node creation. Any ideas?) |
Quote:
Quote:
Quote:
Quote:
But, this seems to be the way the new system was designed. Build an API to pull the data, grab the data for the template via an API call, and display. The tags within the template for calling the API are the <vb:data> tags, if you want to look at them. Quote:
Quote:
|
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
|
Quote:
Quote:
Quote:
That'd be the first road I'd explore. :) |
Originally Posted by Dead Eddie https://vborg.vbsupport.ru/images/cs...s/viewpost.gif
But, this seems to be the way the new system was designed. Build an API to pull the data, grab the data for the template via an API call, and display.Elegantly said. :) |
All times are GMT. The time now is 10:27 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|