Author Topic: Thanks and some feedback  (Read 2567 times)

0 Members and 1 Guest are viewing this topic.

Offline djr33

  • New
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Thanks and some feedback
« on: 24 Jan 2010 11:37:27 PM »
I added AChat (actually a slightly older verison, still called 'tpvchat') to my SMF board, and I think it's great. It is simple and there are some features that could be added, but I wanted to let you know that I think it's useful, regardless of that-- at the SMF site too many people are complaining at it, when, despite some issues, it is a great addition.

I'm developing a complex site involving SMF as a base but expanding and extracting components. For example, the registration system is now entirely external from the board (just borrowing some code on the back end).

Because of this I have customized AChat as well:
--I extracted it from SMF (while keeping it attached on the back end), with basically a complex system of includes.
--I disabled guest access (since for my purposes that's better)-- they must be logged into smf to use it.
--I made it language independent-- along with the rest of my site, the interface and status messages (of course not user posts) are translated into any supported language (that is, if there is a set of phrases for it stored).


I'm not sure what your status is on developing this further, but I wanted to let you know what I'm doing with it and if you would like to see what I've done just let me know. I'd be more than happy to contribute my methods to future releases as you desire (some, all, none, whatever). You could use my code also, but it is somewhat messy and also dependent on the framework of my website (for example, translation engine), so it would have some serious problems without it. It would not be difficult to duplicate the effect, though, using it as an example.


I am also now trying to add one last feature: users currently online. I saw this was also probably the most requested feature on the SMF discussion.

This mainly came from wanting the "X user has left the chat" to be more accurate (if, for example, their internet connection dies).

I think I know how to do this and will try to add it today.
Basic plans:
-Create a new table for statuses, using time and membername.
-Upon sending the "X user entered chat" message, add entry to table.
-Upon sending "X user left chat" message, delete entry.
-With every request to get posts, update time in entry
-If any entry has a time older than one minute(?), delete it
-->and also insert "X user has left chat".

I'm also thinking about how to generate the actual "online" table. That seems difficult. I'll figure something out, though.

And again, if you'd like to add this as a feature to a future version, let me know.


Thanks,
Daniel

Offline Deano

  • Admin
  • Level 5
  • *****
  • Posts: 122
  • Karma: +6/-0
  • Gibbed
    • View Profile
    • resplace
Re: Thanks and some feedback
« Reply #1 on: 25 Jan 2010 12:53:12 AM »
Hey, theres allot to talk about from your post, but most interesting right now was your comments about expanding the chat to show users online, we too had your same idea, almost.

Our idea was to just to write to the DB the current time each time the user posts something, for 5 minutes or configurable(?) the user would be shown as "active" in the chat and after the period they would be removed. Unfortunately free time has got a little rare since due to work and the girlfriend so I havnt had the time to sit down and implement it.

Firstly I am going to need to add a page to the admin panel, with little experience with SMF add-ons I would have to research how to do this and then follow a guide to teach me which would mean spending a good day on implementing the idea. I'm hoping to do this and if any help can be offered getting this into the mod I would be more than greatful, I dont mind sharing credit and going joint on this project so long as it fits everyones needs :)

As for sharing your changes so far, it would be great if you could. It would help me to expand the system further by possibly working from your changes, for instance you just gave me the idea to add language changeable, which would be quite easy and very useful to everyone!

I think my main concerns are getting an admin options interface, and cleaning up my code/fixing a bug or two so that every-things ready for moving on to other improvements!

Oh and BTW, I'm very glad you are using and have found my modification useful! It's nice to see my efforts help others!
Regards, Dean Williams

freelance-coders.net is a freelance service, making it easy, fast and secure to freelance on the internet.

resplace.net community forums

Re: Thanks and some feedback
« Reply #1 on: 25 Jan 2010 12:53:12 AM »

Offline Deano

  • Admin
  • Level 5
  • *****
  • Posts: 122
  • Karma: +6/-0
  • Gibbed
    • View Profile
    • resplace
Re: Thanks and some feedback
« Reply #2 on: 25 Jan 2010 12:54:59 AM »
And btw we could float the online list, or just put it on the left/right of the chat. Or place it below the chat and use the same AJAX to refresh it.
Regards, Dean Williams

freelance-coders.net is a freelance service, making it easy, fast and secure to freelance on the internet.

Offline djr33

  • New
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Thanks and some feedback
« Reply #3 on: 25 Jan 2010 02:53:05 AM »
Glad to hear back.

I have spent the afternoon coding more, and now I have completed a solid version of the chat with online user lists.

Features:
1. There is an external function that can be called anywhere:
getchatusers($mode)
$mode=0-> number of users; $mode=1-> array of active usernames

2. The same ajax call is used (we think alike, it appears), and one div on top of the other is used to display the active users then the chat itself. This required a bit of modification in the styles of the divs, but seems to work now.
It would be a good idea, perhaps, to move it to a side div in the future. That might look nicer, but it works for now.

3. When a user enters the chat, they are logged in.

4. Messages are only displayed if sent after initial login time.

5. When a user does the "get" action, their activity is updated.

6. When any user does the "get" action, inactive users are pruned (time()-60).



Regarding languages, I'm not sure how this would best be implemented in a "simple" way. SMF uses a very opaque system of translation: each phrase is given a number (sometimes an abbreviation?), but not in any clear way. I suppose you could try to integrate with their system, but I find it annoying to work with. My system works outside of that (for everything on the site except the board, though integrated with its language setting), and is a little more straightforward to use, I think.
The way they handle translation is to have a user who knows SMF well translate the entire board using some sort of (hidden) language admin system at the SMF site.

For my purposes, I need something more direct.

To explain my purpose, my website is going to be an all-encompassing language learning website. It will be designed to be "flat" in the sense that users can access anything at any time, rather than having incremental "courses" where most learners don't need at least half of the material. (For example, some can skip grammar, some can skip vocab, some can skip to halfway through the material, and some need everything from the start). It'll have a forum, chat, user system (extracted from smf), and then another half of the site that has resources, tools, vocab lists, etc.
Because of this, having full language support is crucial (so users of any language can access the site in their language, or to practice using websites in a target language).
Anyway, enough about that--

I am happy now with the chat, though the code is quite messy (yours + my haphazard additions/changes), and it would be smoother to extract all the styling into CSS if possible.


I agree with you about working with SMF's admin system. That seems difficult. Really, though, I don't think many more "admin" features are needed. Clearing the chat and deleting individual messages is plenty. The only other thing that people may want to have control over is whether guests can view/participate in the chat.
I just disabled it entirely (and it would be somewhat difficult to get that code back in there).


If you'd like to talk by IM it might be a bit faster, but for now go ahead and take a look at the site here:
http://lingkit.com/chat
You will need to register an account to get access to the chat.
To look at*:
--/chat, obviously
--note the links in the top bar-- chat(#) displays the current number of users in the chat. I'm not sure I'll keep this, but it's available and easy to place anywhere by just calling the function.
--Change the language by dropping down the "English US" menu to something else. I don't have any translations up right now, so I'll put together a rough Italian translation and you can see that. Note that the actual messages are translated for the user viewing the chat AFTER they are retrieved from the database-- they are stored in the DB as "untranslated" with variable strings in them.

(*if you go to other links on the site, many will be broken. The framework for everything is there, but many things are not up.)



Moving forward:
1. I'll gladly send you my code, though as I said it's messy.
2. I'd be happy to help you expand, some, but I want to limit my time because this site is taking up all the time I have right now. If you have trouble reading my code, though, of course I'll explain it. I can comment it also.
3. My purpose with this was direct: get it working in a single environment (my site), so I hope that's a good starting point. It may take a good bit of work to expand this to a "portable" and "plugable" system for everyone.
4. Regardless of anything, though, this proves the code is a good base.
5. I haven't changed the Javascript at all and I think that's solid-- that's why I like this chat (the no flicker thing, its general reliability, etc).
6. An eventual goal with this should be to clean up all the code and make a few things customizable (ex. guests). And then get all of the styling out and into a .css file. Making an extra .css file fit into the smf system might be difficult.


As for credit, etc., sure, if you'd like, but I'm more than happy to just share what I've done to help you improve the chat-- return the favor for sharing your work in the first place.


Note: my approach to using SMF is to disable code I don't want and find a way to get some minimal other things working. I wouldn't consider myself an expert on integration/expansion of the board, just that I know where most stuff is / what it does, and where to start if I have to fix something.
« Last Edit: 25 Jan 2010 02:56:42 AM by djr33 »

Offline djr33

  • New
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Thanks and some feedback
« Reply #4 on: 26 Jan 2010 03:37:50 AM »
Update:
Today, I extracted all styling to an external .css file. This is probably the last update for a while.

The only problems I've noticed to consider addressing in the future:
1. The php code is messy.
2. The chat is a little slow to refresh (not sure if there's much that can be done about this)

And of course making this usable by everyone with perhaps customizable options.

Let me know when you have some time and I'll be happy to explain, etc. If you're busy right now, though, no problem. I have some days with time to work and other days (frequently several in a row) with none, due to classes/assignments.

Offline Deano

  • Admin
  • Level 5
  • *****
  • Posts: 122
  • Karma: +6/-0
  • Gibbed
    • View Profile
    • resplace
Re: Thanks and some feedback
« Reply #5 on: 28 Jan 2010 06:55:35 PM »
I've learned allot since we originally created Achat, including methods for optimization and etc. I'm pretty sure I could make Achat far more efficient than it currently is, firstly like you by making CSS external so were not reloading style info because we dont need to.

It's something I'm keen to work on now you've driven me back to it! I would appreciate it if you could send me some of your source code so far just for reference/reflection.

Thank you so much!
Regards, Dean Williams

freelance-coders.net is a freelance service, making it easy, fast and secure to freelance on the internet.

Offline Deano

  • Admin
  • Level 5
  • *****
  • Posts: 122
  • Karma: +6/-0
  • Gibbed
    • View Profile
    • resplace
Re: Thanks and some feedback
« Reply #6 on: 28 Jan 2010 11:47:49 PM »
BTW I dont suppose you want to try out my Emoticon Library mod for SMF do you? I've been having some trouble getting it popular and it would be great to start getting that ball rolling on your site!

http://software.resplace.net/SimpleMachines/LiveEmoticonLibrary.php

It basically makes a hook to this website and offers all the emoticons from our newly available library in your SMF forums, theres an ever growing API too so you can go ahead and implement it into anything else you feel fit!

http://fun.resplace.net/Emoticons/
Regards, Dean Williams

freelance-coders.net is a freelance service, making it easy, fast and secure to freelance on the internet.

Offline djr33

  • New
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Thanks and some feedback
« Reply #7 on: 01 Feb 2010 03:00:53 AM »
Emoticons: Not at the moment. It looks like a good package, but for now my goal is to keep the forum as simple as possible while I modify/extract components and finish integrating with the whole site. A consequence of this is that extra features become difficult to implement. Maybe at some point once things are running on the site, though.


Ok, sure, I can get you my source. What would be the best way to do that? Send me an email (I believe you can find it, as admin of the site, right?), or let me know a better way. Probably too much text to post here.


EDIT: I've added you on msn. Email me if I'm not on, but otherwise we can talk there and figure it out.
« Last Edit: 01 Feb 2010 03:02:05 AM by djr33 »