A Variables Question

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
GTI
Registered User
Posts: 300
Joined: Mon Aug 24, 2020 4:59 pm
Location: West Sussex
Name: Laura

A Variables Question

Post by GTI »

Hiyaa

So a while ago I requested a new template event for Prosilver so I know there is a process in place for that.

But is there a similar system to request a new variable or maybe an extension to a variable that already exists?


To elaborate, If you have unapproved posts or topics in your forum, a little blue question mark shows up on the forum list on the index page.

This is in the forumlist_body.html template and the variables are:
<!-- IF forumrow.U_UNAPPROVED_TOPICS -->
<!-- ELSEIF forumrow.U_UNAPPROVED_POSTS -->

On the topic list, if you have reported posts they have a little red exclamation icon by them and the variable for that is:
<!-- IF topicrow.S_TOPIC_REPORTED -->

I would like to add an icon for this on the forum list in the same way as the unapproved icon.

The variable or variables would be either:
<!-- IF forumrow.U_TOPIC_REPORTED -->
or
<!-- IF forumrow.U_REPORTED_TOPICS -->
<!-- IF forumrow.U_REPORTED_POSTS -->


Obviously I could open a topic in the ideas section to suggest adding the icon on the forum list but just requesting a variable would mean that people could add an icon themselves if they wanted to rather than forcing it on everyone.

Thx
L
Most of us will enjoy Christmas in the comfort of our own homes this year, however, sadly, that can't be said for people in the Ukraine who are suffering day after day, due to the Russian invasion.

If you would like to make a small donation to help Ukrainians in their time of need, you can donate to help all Ukrainians via BritishRedCross or you can donate to help the Ukrainian children via Unicef. 🇺🇦 Thank You 🇺🇦
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: A Variables Question

Post by david63 »

It isn't quite that simple. A variable has to be generated by some PHP code in one of the .php files and then passed to the template so just adding one would not work.

What you would need is either a core code change or an extension.
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
User avatar
GTI
Registered User
Posts: 300
Joined: Mon Aug 24, 2020 4:59 pm
Location: West Sussex
Name: Laura

Re: A Variables Question

Post by GTI »

Thanks David, I didn't think it would be possible to add these variables by an extension only.

From all of your extension developing experience, would you say it's possible to add 10 variables safely using one extension? without having to modify any core code?

9 of them already exist and work in some templates and the 10th 'if topic is hot' would be new.
Most of us will enjoy Christmas in the comfort of our own homes this year, however, sadly, that can't be said for people in the Ukraine who are suffering day after day, due to the Russian invasion.

If you would like to make a small donation to help Ukrainians in their time of need, you can donate to help all Ukrainians via BritishRedCross or you can donate to help the Ukrainian children via Unicef. 🇺🇦 Thank You 🇺🇦
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: A Variables Question

Post by david63 »

GTI wrote: Sun Aug 29, 2021 1:16 am would you say it's possible to add 10 variables safely using one extension?
Without knowing the precise details I cannot see any reason why you would not be able to add 10, or more, variables from one extension - but you will need the background code to produce those variables.
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
Post Reply

Return to “Extension Writers Discussion”