How to use already existing plugin variables in other templates?
Vonnabeee Offline
Junior Member
**
Posts: 2
Joined: Jan 2023
Post: #1
How to use already existing plugin variables in other templates?
Alright so, bare with me here. I want to start off by saying I have very little to almost no knowledge when it comes to PHP, so I am not entirely sure if it can be done, and I doubt someone will lend me a hand and walk me through the process, but it's worth a try.

As the title implied, I would like to know a (rather easy?) way of being able to use plugin variables across templates other than the ones they are installed into by default.

As an example I will take the Newpoints Plugin. By default, the two main variables (aka {$newpoints_profile} and {$post['newpoints_postbit']}) can only be used in member_profile and postbit_classic accordingly.

How would I be able to, for example, use or get the values of these two variables in member_profile_customfields and postbit_author_user.

Another example would be for the plugin Latest Posts on sidebar. The variable {$sidebar} that contains all of the latest posts can only be used in the index template. How would I go about using it in the footer template?

I tried so far to call in the template that uses the variables (via template conditionals), however to no avail. Maybe Zinga or someone else that are far more experienced with PHP and conditionals could help out with this struggle.

[QUICK UPDATE]
I have managed to get the {$sidebar} to work in the footer template. The last thing I am struggling with is getting {$post['newpoints_postbit']} to work in postbit_author_user and {$newpoints_profile} to work in member_profile_customfields.

[QUICK UPDATE #2]
Most probably my question was wrongly put. TL;DR: How can I show the value of NewPoints Currency on other templates? (The value that also auto-updates with posts without the need of recounting)
(This post was last modified: 01-30-2023 08:46 AM by Vonnabeee.)
01-26-2023 03:54 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
How to use already existing plugin variables in other templates? - Vonnabeee - 01-26-2023 03:54 AM

 Standard Tools
Forum Jump: