started planning on commentboxb
started planning on commentboxb
The plan is easier to view on this page....
http://testing.isaacg.net/commentboxb/
...because it allows dragging the image around in case the image is too big for your monitor.
I figured it could be posted now, since the rest of the planning is admin and database related.
The idea is the admin that installs the comment box simply pastes in an iframe with a src="cb.cgi" source, which pulls in javascript that replaces the iframe, if javascript works. If javascript does not work, the comment box depends on the iframe, via <form method="post">.
The admin side authorizes the comment box and moderates all authorized comment boxes.
http://testing.isaacg.net/commentboxb/
...because it allows dragging the image around in case the image is too big for your monitor.
I figured it could be posted now, since the rest of the planning is admin and database related.
The idea is the admin that installs the comment box simply pastes in an iframe with a src="cb.cgi" source, which pulls in javascript that replaces the iframe, if javascript works. If javascript does not work, the comment box depends on the iframe, via <form method="post">.
The admin side authorizes the comment box and moderates all authorized comment boxes.
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
Re: started planning on commentboxb
Hmmm, looks like a nice plan. Some thoughts:
1. What about if you want different comment lists for different pages? (Hint: Relational databases are good at this sort of thing.)
2. IP address/OS is generally insufficient for authentication. If you want to let people edit/delete stuff, the most common way is to have people sign up for accounts.
3. Anything to deal with spambots?
1. What about if you want different comment lists for different pages? (Hint: Relational databases are good at this sort of thing.)
2. IP address/OS is generally insufficient for authentication. If you want to let people edit/delete stuff, the most common way is to have people sign up for accounts.
3. Anything to deal with spambots?
Re: started planning on commentboxb
Oh yes! I was thinking of that. the comment management system should be able to link or segregate comment boxes. So you could have the same comment box on different pages, for whatever reason, or have different comment boxes for the same, or different, pages.Jeff250 wrote:1. What about if you want different comment lists for different pages? (Hint: Relational databases are good at this sort of thing.)
For Pickle, I could use embedded dictionaries for keeping track of all comments in one file. However, I think this is a short term solution. MySQL might be more long-term and better for people who might want to write their own comment management system, in a language other than python.
I completely agree. I think this should be an option. I can also imagine the "ip" address method working if, and only if, there's a time limit for a comment to be edited. The comment's time would expire and would become permanent, unless removed by an admin.Jeff250 wrote:2. IP address/OS is generally insufficient for authentication. If you want to let people edit/delete stuff, the most common way is to have people sign up for accounts.
I'm not completely sure how long a time limit should be, for editing. A day, is my guess.
I hate that capachya stuff, but I might have to allow that as an option. I don't want it to be set by default.Jeff250 wrote:3. Anything to deal with spambots?
The comment management tools might be good enough for the admin to keep control across all boxes. there also could be a "delete by ip", "delete by phrase", or "delete by country" admin tool.
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
Re: started planning on commentboxb
you can do this without an iframe.
you could also set a cookie that expires to use for short term authentication.
you could also set a cookie that expires to use for short term authentication.
Re: started planning on commentboxb
Yeah, this is probably the best of both worlds. Isaac, also keep in mind that more than one person can have the same IP address simultaneously.fliptw wrote:you could also set a cookie that expires to use for short term authentication.
I think even calling it a solution is a stretch. There are huge faults in using pickling here. Performance-wise, every time you want to read any comment, you have to read every comment. Any time you want to insert/edit/delete a comment, you have to both read and write every comment. Correctness-wise, simultaneous modifications can get lost. Imagine if person A and person B both click "Add Comment" at the same time. Then this could happen:Isaac wrote:For Pickle, I could use embedded dictionaries for keeping track of all comments in one file. However, I think this is a short term solution.
Code: Select all
Person A's script Person B's script Time
----------------- -----------------
comments = read()
comments = read() ||
comments.add(c_a) ||
comments.add(c_b) ||
write(comments) vv
write(comments)
Re: started planning on commentboxb
Hmm... Though it's unlikely to happen with 2 or 3 people (I've tested this),with 50000 users at once these errors would be common.
So cookies and MySQL database... two things I should know how to do, but don't.
I guess I know what I'm working on next.
Thanks!
So cookies and MySQL database... two things I should know how to do, but don't.
I guess I know what I'm working on next.
Thanks!
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
Re: started planning on commentboxb
You want to start with SQL, then move onto parametrized queries.
Re: started planning on commentboxb
Oh ok. ever heard of sqlite3 or redis or couchdb?
The sqlite page says:
Right now I'm open to anything, but my admin won't let me install new software, except for some scripts that I can make executable. Actually, I bet I could get python to install something, since it appears to have more rights than I do, but I'm not sure if that's allowed.
The sqlite page says:
edit edit:SQLite Is Serverless
Most SQL database engines are implemented as a separate server process. Programs that want to access the database communicate with the server using some kind of interprocess communication (typically TCP/IP) to send requests to the server and to receive back results. SQLite does not work this way. With SQLite, the process that wants to access the database reads and writes directly from the database files on disk. There is no intermediary server process.
There are advantages and disadvantages to being serverless. The main advantage is that there is no separate server process to install, setup, configure, initialize, manage, and troubleshoot. This is one reason why SQLite is a "zero-configuration" database engine. Programs that use SQLite require no administrative support for setting up the database engine before they are run. Any program that is able to access the disk is able to use an SQLite database.
Right now I'm open to anything, but my admin won't let me install new software, except for some scripts that I can make executable. Actually, I bet I could get python to install something, since it appears to have more rights than I do, but I'm not sure if that's allowed.
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
- Krom
- DBB Database Master
- Posts: 16138
- Joined: Sun Nov 29, 1998 3:01 am
- Location: Camping the energy center. BTW, did you know you can have up to 100 characters in this location box?
- Contact:
Re: started planning on commentboxb
Your host may already have a full blown MySQL service available (most web hosts have it as a standard feature), check for that first.
Re: started planning on commentboxb
It does. Should I just use that? It sounds like sqlite3 installs like a javascript or python file, meaning it might be an alternative.
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
Re: started planning on commentboxb
Most of the point of SQLite is to get around having to have an out-of-process database server running. If you already have one running like MySQL, you might as well just use that. And chances are your host already has the MySQL python bindings installed too.
Re: started planning on commentboxb
sqlite would be good for a website that doesn't exceed 100K hits, but if you have mysql, then use it. with the right abstraction layer switching between engines would be just changing one line.
firefox uses sqlite to handle it storage needs.
firefox uses sqlite to handle it storage needs.
Re: started planning on commentboxb
update:
Got a cool little bar going.
This one bar first asks you your name, unless you have a user ID, then it becomes your message box!
Later I'll be connecting it to my mysql database.
Link to the box:
http://testing.isaacg.net/commentboxb/commentboxb.html
Basic concept (special thanks to jeff for the ajax sleep/delay idea):
http://testing.isaacg.net/commentboxb/commentboxb.png
Got a cool little bar going.
This one bar first asks you your name, unless you have a user ID, then it becomes your message box!
Later I'll be connecting it to my mysql database.
Link to the box:
http://testing.isaacg.net/commentboxb/commentboxb.html
Basic concept (special thanks to jeff for the ajax sleep/delay idea):
http://testing.isaacg.net/commentboxb/commentboxb.png
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
Re: started planning on commentboxb
So is this supposed to do something yet?
Re: started planning on commentboxb
There's no posting yet. That will come later. Right now I just have been trying to make the one text area behave differently when asking you your name then accepting regular comments. Once in comment mode the box becomes longer, with that optional login button gone. It also tells you to press enter after you've typed something, within the textbox itself, which vanishes to get out of the way. The box also clears after hitting enter.
Basic stuff, but it took me a while to get it that far.
update: added posting, but no saving.
Basic stuff, but it took me a while to get it that far.
update: added posting, but no saving.
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉