MyBB Community Forums

Full Version: Correct phrasing?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This is considered a variable, correct?

${random_example}
No, it should be {$random_example}.
Ah, I see.

And from there, if I wanted to discuss the act of getting the information within that variable displayed on a page that it wasn't showing on by default, what is that action referred to as?
In most cases, you'd have to modify the core/your plugin.
This is where I get confused.. What is it called when I see something like this used? (I'm using random words in this example but I think you'll recognize it)

{$myBB->something->blah->random_example}

I was led to believe elsewhere that this is going in the right direction as far as just grabbing a variable from one page and displaying it on a new page. Is that incorrect? What's the above example here with those extra names and arrows called and what does it do, if not what I'm trying to accomplish?

I'm just trying to figure out the simple way, on the fly in templates, to bring in a piece of info from another page but I know I have the phrasing/terminology wrong so I'm not even sure how to ask the question to the experts here. lol
That's simply an object type variable. Objects can have properties that are accessed using the arrow (->).

What piece of data are you trying to grab and I'll tell you if it's possible without a plugin/core edit?
Oh man lol I have a long list...

The 2 main ones I was curious about were these 2 though:

1) Displaying the ban reason and ban length of time on the user's profile without using a plugin, because I want to choose where to put that piece of data on the actual user profile layout.

2) Displaying the user's last login on the post bit.

Like I said there are others, but I'm trying to not drive you guys crazy and was hoping to come to terms with how to determine this myself. I'm big on trying to learn "how" to answer my own questions rather than just asking them because I know that can be a pain in the rear. lol

PS: If I look more into "hooks" is that somewhat also related to what I'm trying to do? Or are hooks used for something completely different?
1) I'd have to look into that

2) That's not too hard, though the login time will be showed as a unix timestamp (ugly long number). If you want to format it, you'd need to use a plugin.

Re hooks: hooks are used by plugins. They literally let the plugin "Hook" into a section of code in the core and execute functions.