File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JForum and the fly likes Change or create an entry in a theme template file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » JForum
Bookmark "Change or create an entry in a theme template file" Watch "Change or create an entry in a theme template file" New topic
Author

Change or create an entry in a theme template file

Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
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

Joined: Apr 22, 2012
Posts: 17424
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

Joined: Apr 22, 2012
Posts: 17424
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

Joined: Apr 22, 2012
Posts: 17424
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

Joined: Apr 22, 2012
Posts: 17424
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

Joined: Apr 22, 2012
Posts: 17424
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

Joined: Apr 22, 2012
Posts: 17424
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]
 
 
subject: Change or create an entry in a theme template file