The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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. |
#2
|
||||
|
||||
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? |
#3
|
|||
|
|||
As a vB user, you can set your avatar. For my forum, I don't need users to have different avatars and prefer to set them en masse via usergroups. Each usergroup will be assigned a different avatar.
Quote:
Quote:
Your point here is not clear. How will additional database calls save manual file edits? 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?) |
#4
|
|||||
|
|||||
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:
Like I said, I'm not sure it's better, just different. But, no manual file edits. |
Благодарность от: | ||
tbworld |
#5
|
|||||
|
|||||
Quote:
Quote:
Tuch? Quote:
Quote:
Quote:
No manual file edits makes your suggestion better for sure. I really appreciate your input & feedback on this. :up: |
#6
|
||||
|
||||
Quote:
Honestly? I thought the availability of the data was what you were looking for. Quote:
That'd be the first road I'd explore. |
#7
|
|||
|
|||
Originally Posted by Dead Eddie
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. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|