Topic: Forum navigation back arrow
kaputtnik |
Posted at: 2015-06-06, 16:19
You have pointed here out one problem of the website code: This function is never used and it is currently absolute useless. It allways returns the variable "qs" which is the first parameter of the function. The complete website code has lots of those unused functions and most functions aren't documented well and are therefore difficult to read. So many time get's lost by trying to understand a function (which name sounds very interesting) and in the end you have to consider, that this function is useless
May i got another way to get the last_login timestamp: The user model has a field "last_login" but the value for that is unfortunally updated to "now" if a user loggs in. See django last_login. It should be possible to store the value of "last_login" to a session cookie before this value is updated to "now". After doing so, we have the latest login time stored. But of course this timestamp is vague, because it covers only the begin of the last session and the user has read some posts between login and log out.
You could try yourself for doing this Top Quote |
DragonAtma |
Posted at: 2015-06-06, 19:07
Hmm...
Top Quote |
wl-zocker |
Posted at: 2015-06-06, 19:26
Just a question: What happens if I do not log out, but simply close all widelands tabs? When I come back to the website (even after switching off my computer), I do not (have to) log in anew. I am not sure if a button "Session finished" would be better than what we currently have. Everyone would have to remember to push it before leaving. Would it be possible to get the time period a user in accessing the website by the timestamps of when he clicks somewhere (links to threads etc.)? Or could you do something with page loading (whenever a new page is loaded this time is the last access)? "Only few people know how much one has to know in order to know how little one knows." - Werner Heisenberg Top Quote |
GunChleoc |
Posted at: 2015-06-07, 11:04
I agree with wl-zocker's concerns. Both proposed solutions are not viable. Whenever the user clicks on something, a new page is requested. When the request is processed, there must also be a check somewhere if the user is logged in, and then the unread threads/forums are already being marked by the software. This is the point to hook into to set a timestamp in the userdata in the database. Again, I am wondering how the forum software does this now - how does it know which forums and threads I have read? How does it update the info when I am reading a thread, because the "new" marker does disappear then? The forum might already have some of the knowledge needed for this. phpBB has 2 database fields / cookies to keep track for unread posts:
For logged in users, this is done via the database, and for guests this is done via a cookie. Busy indexing nil values Top Quote |
kaputtnik |
Posted at: 2015-06-07, 12:06
You could find the relevant code in:
There is also a app called "tracking" which stores some user information: https://pypi.python.org/pypi/django-tracking/0.4.1 You should have to know that our website uses currently django version 1.3.7 which is deprecated (current official version of django is 1.8). Thats why i do currently not want to make heavy changes to the website... i fear that the more is changed, the difficult would be an update to a later version of django. There are plans to update the django version, but because of different reasons, it hasn't be done and i believe that it will take some more time... Top Quote |
einstein13 |
Posted at: 2015-06-08, 15:45
At my work we use django 1.6 and there are major problems to update that. Most of them are about related packages Some about syntax, but not so much einstein13 |