Mini Chat

A place for general not CMSimple related discussions
Post Reply
scriptshow
Posts: 13
Joined: Tue Jan 03, 2012 8:06 pm
Location: Spain
Contact:

Mini Chat

Post by scriptshow » Wed Feb 01, 2012 12:06 pm

Almost ten years ago that arose such as bar Chat, and now are in vogue because of the social networks... At that time, had little interest.

Over here I have one of my simple development:
http://www.scriptshow.murcia-region.com/chat/

The Script would be perfectly adaptable to templates developed by Gert:
http://www.ge-webdesign.de/cmsimple/

I have included a script to see who's online.
Thanks to http://www.cmsimpleforum.com/viewtopic.php?f=29&t=3959 for sharing such useful and simple scripts. Perfect!.

Thank you all for the valuable and interesting contribution.

Pedro
Last edited by scriptshow on Sat Feb 04, 2012 11:09 am, edited 2 times in total.
"Simplicity carried to the extreme becomes elegance" [ Jon Franklin ]

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Mini Chat

Post by cmb » Wed Feb 01, 2012 4:32 pm

Hi scriptshow,

that's a nice idea. :)

I guess it's based on ChatSimple. Unfortunately ChatSimple is vulnerable to XSS injection. You should at least escape potentially dangerous characters by calling htmlspecialchars() when writing the $post or when reading the file.

And it would be nice, if new chat posts would be displayed automatically. Currently the user has to press F5 to see, if someone responded.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

scriptshow
Posts: 13
Joined: Tue Jan 03, 2012 8:06 pm
Location: Spain
Contact:

Re: Mini Chat

Post by scriptshow » Thu Feb 02, 2012 11:29 am

Hi Cristoph,

you're right, your perceptions are accurate. I posted the basic script (less than 1kb.). The complete development in both Perl and PHP has a size of 3 to 4 kb. I have been guided by the philosophy of CMSimple, which began with about 60 Kb, and now in 1.5 Mb When you look to others, and will not be Simple ...

No need to restart the page to see the messages, just click on Submit with fields blank.

Thank you very much for your helpful advice.

Pedro
Last edited by scriptshow on Fri Feb 03, 2012 12:49 am, edited 1 time in total.
"Simplicity carried to the extreme becomes elegance" [ Jon Franklin ]

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Mini Chat

Post by cmb » Thu Feb 02, 2012 12:21 pm

Hi Pedro,
scriptshow wrote:No need to restart the page to see the messages, just click on Submit with fields blank.
If I submit a post, I can see it directly. But that is not so for other "chaters". I've tried with 2 different browsers. After submitting in one browser, I was not able to see it in the other until I've pressed F5.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Mini Chat

Post by cmb » Fri Feb 03, 2012 9:47 pm

Hi Pedro,
scriptshow wrote:I have been guided by the philosophy of CMSimple, which began with about 60 Kb, and now in 1.5 Mb When you look to others, and will not be Simple ...
I'm still not quite sure, if I understand you correctly. Do you mean that CMSimple(_XH) nowadays is not simple anymore, or that other CMSs are not simple?

Well, IMO it's important to distinguish for whom a CMS is simple: for the developers, the ones who want to customize it, or for the end-user. The overall simplicity is always a compromise IMO -- and a good compromise is often hard to achieve.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

scriptshow
Posts: 13
Joined: Tue Jan 03, 2012 8:06 pm
Location: Spain
Contact:

Re: Mini Chat

Post by scriptshow » Sat Feb 04, 2012 12:18 am

Hi all,

I apologize for expressing myself in a language they do not handle properly.
I am an unconditional defender of any development simple, useful, flexible, compatible ... without increasing excessively the size. We know very good CMS larger than 5Mb. that make "everything". Also applications "1 click", claiming the creativity of the user. We bet on developments that free, open, understandable and CMSimple.
I do not know if I explained correctly.

short: I believe in the individual imagination and originality.
A great examples:
http://www.dhteumeuleu.com
http://www.scriptiny.com
After visiting millions of websites, I have been lucky enough to find some experts who can create effects with mathematical precision. Not used: JQue..., Moot ..., Flash, Frameworks, and other useless huge library of 100, 200, 300 kb.
"Simplicity carried to the extreme becomes elegance" [ Jon Franklin ]

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Mini Chat

Post by cmb » Sun Feb 05, 2012 12:20 am

Hi Pedro,
scriptshow wrote:I apologize for expressing myself in a language they do not handle properly.
There's no need to apologize -- on the contrary! IMO it's better to express oneself in a foreign language, even if that might cause some misunderstandings at first, than to stay out of discussions.
scriptshow wrote:I am an unconditional defender of any development simple, useful, flexible, compatible
I like to keep it simple too (BTW: that's the reason I've built my website with CMSimple_XH, and not Joomla, Typo3 or Wordpress). But sometimes complex developments seem to be useful -- even necessary. Consider e.g. modern browsers which consist of several MB compiled (!) code, to be able to process complex CSS, JS and even malformed (X)HTML and to display this in a graphical environment. Compare that to early browsers such as lynx. This was a "simple" development, but does anybody use it today?

Even 1-click applications might have a place IMO. Consider a user wants to convert a video he has filmed with his camera. Often this is an *.avi. But he wants to show it on his website, so *.avi might not be the best choice. As those users often have no special demands on video quality, a simple 1-click solution to convert *.avi files to *.flv (or another web conforming format) might be the best. And well, I wouldn't call such a solution "not simple".
A great examples:
http://www.dhteumeuleu.com
Wow! I'm really impressed by this! :) I wasn't aware how powerful modern computers are to allow those animations to be done by JS. So I really do hope, that users of IE will update to IE10 ASAP (or switch to another browser, which might be better anyway).
scriptshow wrote:Not used: JQue..., Moot ..., Flash, Frameworks, and other useless huge library of 100, 200, 300 kb.
I wouldn't call jQuery and several other JS frameworks useless. Particularly jQuery (I'm not accustomed to other JS frameworks -- and I don't like Flash) is primarily meant to hide browser dependencies (besides giving the code some convenience). Of course those frameworks are not always necessary and should be avoided in those cases. But to avoid them at all cost might sometimes result in reinventing (= rebuilding) the wheel. And often the self made wheel won't be as "round" as the one available through, say, jQuery. Consider e.g. selecting DOM elements by class. Many modern browsers implement document.getElementsByClassName(). But some widespread browser don't. Of course it's not hard to implement getElementsByClassName() -- but this will very slow compared to a native implementation. So code using jQuery might often be more efficient than code doing the same thing in pure JS.

IOW:
Albert Einstein wrote:Everything should be made as simple as possible, but no simpler.
So I've made a variant of the chat, which is IMO simple to use for the visitor, and simple to use for the administrator of a CMSimple_XH website (configuration, l10n, styling and embedding). The size of the ZIP is 36kB, which could be seen as excessive, but I don't feel the need to use it on my Commodore 64. ;)

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Mini Chat

Post by cmb » Wed Apr 25, 2012 7:08 pm

A simple introduction to JS is available on http://www.w3schools.com/js/default.asp.
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply