Is there a way to make long text in a div smaller instead of expanding it?

OMG! Stack Overflow was so rude when I asked this there, I know that this will be a lot better. Anyway, I’m trying to make live chat for my website. In short it all works but when someone posts a long post, it breaks everything, the text goes onto another line, everything gets moved around and in the wrong spot. I tried lots to fix this INCLUDING ADDING A WORD WRAP! Yah, thats so important to say because on my Stack Overflow post I said that I tried to use word wrap and LIKE TEN MINUTES AFTER I POSTED IT SOMEONE REPLIED AND SAID TO ADD WORD WRAP! WOW! Alright, I also tried you know moving around margins and things. I’m not exactly the best at HTML and CSS so sorry if theres an easy fix to this that I can’t find anywhere on the internet. Here is a link to the code and CSS file in it
HIDDEN BY MOD - YOUR PASSWORD IS VISIBLE !!!!! Please help!

first you need to change your password

than correct your code
for example:

closed </div> but never open
you opened the chat <form but never closed !
you closed it with </forum> :open_mouth:

it is possible that you get such a result because of all these mistakes

P.S. I quickly went through your code so there are probably more errors


as far as I understand your chat is not a live chat judging by this yours statement

Also please know that this is not real live chat cuz I can’t figure out how to do that without anoying the s*** out of the you so please refresh now and then!

For your information “live chat” you want is forbidden TOS 10.

4 Likes

So I tried changing the forum to form, hey idk either why I put that there. Also, I don’t think that there was a div that was not closed/opened, I couldn’t find that anywhere. Anyway, I changed the form thing and put in word-wrap and it still messes it up. Oh yah, I changed my password and removed it from the page, I just copied the page! Anyway http://www.commandercraft.com/Codething.txt is back up without my password this time, and I still need to figure out how to not let my website layout to break!

I assume OxyDac already gave yoy the final answer:

1 Like

Oh, I think that means that I can’t have live chat that IS live. If it does mean that I have to make it actually live then I will but I think its just for chat that is live.

Chat scripts aren’t allowed. Regardless of is it live or not.

2 Likes

Oh ok. But is that for chat scripts like posting or chat scripts like in viewing that chat posts?

All chat scripts aren’t allowed on free hosting.

2 Likes

Alright, time to start working out things for when my website is done then!

Umm could I just you know, have a fix to my error, Ill sort this live chat thing out later. I got lot’s of work to do on my website so I think a solution would be good for the future.

Create an IRC chat room and just share the info to reach the IRC server and room. Then users can access your chat from any IRC client.

Umm no. First off, Im good paying to use my own not so live chat. Second, I don’t know if I can connect that to my sql database without users having to have 2 accounts. Also, this isnt a post about live chat it is about long texts in my divs breaking my page!

There are scripts and methods also which can connect your webpage based interface with either an IRC or xmmp/jabber chat server.
I only recommended the IRC method above because they said chat scripts are not allowed.
I’m not sure if that means all chat scripts or just ones that use serverside processing. But I’m sure there are quite a few options. I’m looking at them myself at the moment.
The author of ph7cms also lists an alternative to the default chat included with ph7cms.
Personally I would think as long as the user verification is done by your site and database that running everythingelse clientside would be better for your site and the server resource usage.

Here is something I’m looking at today.

https://m.inverse.chat/docs/html/quickstart.html#let-your-xmpp-server-serve-converse-for-you

Ok, I don’t see how using some program for live chat would make a div with long text be normal and not break my website layout though?

@commander321

What you currently have is fine for me as far as TOS is concerned
because it’s more like a guestbook than a chat ! (you just use the wrong name)

it would be different if you used realtime chat who then
nonstop asks DB if there are any new posts, constantly doing refresh, ping all users to see if they are online or gone, etc.
which then consumes a lot of server resources.

another reason why chat is problematic is because of the possibility of XSS (there you should work on your version too)


There are a “few” problems why your…hm… I will call it “chat” is going crazy

the way you display content is grouped into two separate divs (plus tons of unnecessary styles that defy each other)

one where the usernames is
and the other where the content is

then when you don’t have enough space (because of the long text)
the entire div with content goes below the div containing users

besides, the whole thing is complicated by these <br> elements in content

you should have this actually [user name] + [user text] = one section

Record in DB eg \n whenever you want to break something (split automatically if it exceeds a certain number of char through the base or parse it elsewhere)

or some other format like <pre>

you should totally redesign everything :slightly_smiling_face:
from how you save to a database to how you show it


The problem with debugging is that you make three calls for Forum.css

2 times as external and once as inline CSS source

in addition - one external then becomes CC.css - what a mess :crazy_face:


can you do me a favour and delete my email as well as text with “1111” from DB
Thx :slight_smile:

3 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.