Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Change or create an entry in a theme template file

 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I see in the bottom.htm there is ${usersOnline} where you get the status of the user.
I?m personalizing the template and I need only the number of connected users the ${usersOnline} returns me a sentence.
Where can I change the code to add and entry to do this like ${numberUsersOnline}? Is there documentation or something I can read to understand this model?

TIA
Marco
[originally posted on jforum.net by radar]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Edit the file net/jforum/view/forum/ForumAction.java, method "list". There you will find all code for the forum's home page.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
thanks for the quick answer, I saw there are many useful entries that I can use like "totalOnlineUsers" that could be what I need.


[originally posted on jforum.net by radar]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I see the ${totalOnlineUsers} is valid only for the home page but if I go to login page, for instance, this entry doesn't exist. Is there a way that I make it global?

I see ${forumTitle?default("JForum")} entry in the header.htm, for instance

TIA
Marco

[originally posted on jforum.net by radar]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Was this resolved? I am trying to do the same but getting the same error... any help would be appreciated. thanks.

[originally posted on jforum.net by hsb]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For performance reasons, the "global" template variables are pretty much static lookups from the cached config file. However, if you need some custom globals, it's not too hard to modify the prepareTemplateContext method in the ControllerUtils class to add what you need.
[originally posted on jforum.net by monroe]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. So can i just not add static variable to config file? if not can you help me with modifying prepareTemplateContext method? I am not really Java person.
[originally posted on jforum.net by hsb]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic