Archive for myfreeforum.org Before posting please check the "stickies" in the support forums.
Please ask questions in real English and not "txt". You will get a better response.
Please do not ask support questions via PMs.
 


       myfreeforum.org Forum Index -> Web page/template Editing
Hashim

Help With Advanced Template Editing

Hi there, I'm fairly new to the MFF forum, and I'm looking for a bit of advanced help with template editing. I already know how to edit my own template, which I've done quite a bit of. What I'm looking to find out, however, is how, if it's even possible, to edit the variables that are in templates.

For a better understanding of what I mean by "variables" please see here:


Click to see full size image

As you can see there are parts which i've highlighted, parts in the code which aren't really HTML (as far as I can tell, anyway) - they're just keywords which hold certain values. For example, using the overallfooter.tpl file as an example file, the {SITENAME} keyword/variable (not sure the exact name for these, can anyone enlighten me? ) holds the name of my site as set in the Admin Panel under General Configuration. This is one keyword that CAN be edited, but as you can see, there are plenty more keywords in that file alone, and there is no visible way to edit any of these.

I AM aware that you can remove the keyword completely, replacing it with what you want there. So I COULD just replace {SITENAME}, which currently holds the value of The Coder Hub, with My Coder Hub, and my sitename would change. But there MUST be a way to edit the actual variables and what is stored in them. I've seen these variables all across my forum code and there is so much scope as to what can be done with them, in terms of customizing a forum and giving it your own personal touch. Instead of simply editing where a variable is mentioned, you could edit the variable itself and every part of your code which mentions that variable would change to how you want it.

So, IS there any way I can edit these variables/keywords in my code, and if so, how? I really am dying to know. Thanks in advance.
editor

Some variables are from the admin panel
sitename is in admin configure.

But most are not editable.
Hashim

editor wrote:
Some variables are from the admin panel
sitename is in admin configure.

But most are not editable.


Why though? :/

Let me show you an example of what it could be used for. In my indexbody.tpl file I have a variable called {LAST_VISIT_DATE}, which has the value of "You last visited on 24 Dec 2011 09:36 pm". This is rather bland and not very inviting at all, tbh. So say I wanted to change it to "Welcome back (username here)! You last visited this forum on the (date and time of last visit here)."

That's just one example of what it could be used for and how it could help to make a forum appear professional, inviting, reliable, etc. My point is, not being able to edit these variables REALLY limits how much you can edit your forum, and tbh, in my opinion it's a serious flaw in editing. Is there no way to make it so that, for those who are comfortable with doing so, variables (or certain variables at least) can be edited? :/
myff admin

You will find we have actually dramatically increased the number of what you might call low level less formated macros to give a lot more of that kind of flexibility.

LAST_VISIT_DATE does not currently have such a macro though as it has never been asked for.

If you have a list of things you think are missing we can consider adding them. As I say a lot have been added.
Hashim

myff admin wrote:
You will find we have actually dramatically increased the number of what you might call low level less formated macros to give a lot more of that kind of flexibility.

LAST_VISIT_DATE does not currently have such a macro though as it has never been asked for.

If you have a list of things you think are missing we can consider adding them. As I say a lot have been added.


Hi there. And how do you mean? Firstly, could you please explain to me what you mean by "low-level less-formatted macros"? Thanks.
myff admin

Well macros are inherently a variable, they can either be detailed (example is false)

{USERS_ONLINE} There are 25 users online

or low level

{S_USERS_ONLINE) 25
Hashim

myff admin wrote:
Well macros are inherently a variable, they can either be detailed (example is false)

{USERS_ONLINE} There are 25 users online

or low level

{S_USERS_ONLINE) 25


Ah, I now understand. So basically, you're trying to create less-detailed macros, macros with just the data needed in them, like number of users, current time, etc.? If so, that's good to hear, means at least I'll be able to customize my forum a bit more and will make it generally easier.

So, if I wanted a certain part of my template turned into a low-level less-detailed macro, for example, the current time macro, what would I need to do?

However, this is kind of only half the problem. Is there not a way to actually edit what is within a Macro? For example, on my overallheader.tpl page I have a macro called {NAV_LINKS}. This consists of all the navigation links. But what if I didn't want to include all of the navigation links at the top of my forum? What if I had no need of the Usergroups link, for example, or I just wanted to link to it elsewhere? As far as I can see, there is no visible way to do this except by editing the macro {NAV_LINKS}, and because this cannot be done, this is what I meant originally by it can severely limit what one can do with a forum.
editor

Ask,  as a list and with detail.
Hashim

editor wrote:
Ask,  as a list and with detail.


Please read the last part of my last post which I've just edited. And is ok for me to ask in this thread?
Hashim

Bumpung this up as I really need this answering and no-one seems to have noticed it in the post above:

However, this is kind of only half the problem. Is there not a way to actually edit what is within a Macro? For example, on my overallheader.tpl page I have a macro called {NAV_LINKS}. This consists of all the navigation links. But what if I didn't want to include all of the navigation links at the top of my forum? What if I had no need of the Usergroups link, for example, or I just wanted to link to it elsewhere? As far as I can see, there is no visible way to do this except by editing the macro {NAV_LINKS}, and because this cannot be done, this is what I meant originally by it can severely limit what one can do with a forum.
Hashim

No-one?
Ask Mr. Religion

Hashim wrote:
No-one?
See

http://forum.myfreeforum.org/about20971.html

AMR
Hashim

Thank you AMR, I'm glad you agree with those changes. But really, it is only half the solution. I was hoping for a better solution to be added, like making all, or at least the majority of, macros available to be edited by advanced forum-owners. As mentioned above, this will give more flexibility for advanced forum-owners with their forums. However, that said, judging from the fact that I have had no more replies from the admins, they obviously aren't interested.
Ask Mr. Religion

Hashim wrote:
Thank you AMR, I'm glad you agree with those changes. But really, it is only half the solution. I was hoping for a better solution to be added, like making all, or at least the majority of, macros available to be edited by advanced forum-owners. As mentioned above, this will give more flexibility for advanced forum-owners with their forums. However, that said, judging from the fact that I have had no more replies from the admins, they obviously aren't interested.
I would not make the leap that there is no interest. These guys are awfully busy, so there is that to keep in mind.

Frankly, I don't know how they could make the macros editable without creating some sort of panel that then does all the work under the hood since they are not going to give direct access to php code running on the servers. There is also the scope of the macros; so these edited ones your are suggesting would have to have some local scope to each forum, else your changes would propagate to my forum, and others. Sounds like quite a chore to sort out and plan carefully.

AMR
Nick(NR)

Hashim wrote:
Thank you AMR, I'm glad you agree with those changes. But really, it is only half the solution. I was hoping for a better solution to be added, like making all, or at least the majority of, macros available to be edited by advanced forum-owners. As mentioned above, this will give more flexibility for advanced forum-owners with their forums. However, that said, judging from the fact that I have had no more replies from the admins, they obviously aren't interested.


It's not through lack of interest, both version of phpbb have had a raft of mods and custom additions, that you simply wont find on any mod site and while you feel advanced forum owners should be able to have these macros available to them to edit, it is something that I very much doubt would be allowed, as this would require php file access and for security and forum protection(from broken edits that may occur) as not all macros are retrieved from a functions file.

However, I personally like the idea of duplicating most of the useful macros and tweaking the name slightly and removing the generic text leaving only the returned data, allowing for more custom text, surrounding the data, but this is something that admin will have to look in to, when time is available to him.
Hashim

Nick(NR) wrote:
Hashim wrote:
Thank you AMR, I'm glad you agree with those changes. But really, it is only half the solution. I was hoping for a better solution to be added, like making all, or at least the majority of, macros available to be edited by advanced forum-owners. As mentioned above, this will give more flexibility for advanced forum-owners with their forums. However, that said, judging from the fact that I have had no more replies from the admins, they obviously aren't interested.


It's not through lack of interest, both version of phpbb have had a raft of mods and custom additions, that you simply wont find on any mod site and while you feel advanced forum owners should be able to have these macros available to them to edit, it is something that I very much doubt would be allowed, as this would require php file access and for security and forum protection(from broken edits that may occur) as not all macros are retrieved from a functions file.

However, I personally like the idea of duplicating most of the useful macros and tweaking the name slightly and removing the generic text leaving only the returned data, allowing for more custom text, surrounding the data, but this is something that admin will have to look in to, when time is available to him.


Ah right, well, that's all I really wanted, confirmation of whether it could be done or not. But is there no way of making it so, as I think AMR suggested, it is available to edit outside of the PHP file? Like an extra panel solely for editing macros and nothing else? I understand that it would be a lot of work for the admin/s, but it would be work that would pay off dividends in the end, wouldn't it, with the amount of flexiblity and convenience it provides for forum-owners? But as you say, it is all up to the main admin and whether he decides it's possible.
Nick(NR)

Hashim wrote:
Ah right, well, that's all I really wanted, confirmation of whether it could be done or not. But is there no way of making it so, as I think AMR suggested, it is available to edit outside of the PHP file? Like an extra panel solely for editing macros and nothing else? I understand that it would be a lot of work for the admin/s, but it would be work that would pay off dividends in the end, wouldn't it, with the amount of flexiblity and convenience it provides for forum-owners? But as you say, it is all up to the main admin and whether he decides it's possible.


My second paragraphs hints at that and the idea of an advanced section in the acp would be where these modified duplicates would go, but and I must point out, the macro would need to be edited in the template to use the alternate version should the forum owner want to use it, one key reason for that is, it would force template changes and not everyone would want the advanced macros

Nick(NR) wrote:
However, I personally like the idea of duplicating most of the useful macros and tweaking the name slightly and removing the generic text leaving only the returned data, allowing for more custom text, surrounding the data, but this is something that admin will have to look in to, when time is available to him.

       myfreeforum.org Forum Index -> Web page/template Editing
Page 1 of 1
Create your own free forum | Buy a domain to use with your forum