Hi Neo,
From what I know, Blogger.com stores everything in a database (including
images)... but how to do this without breaking up the text from a single
blog entry into multiple pieces? Clearly, the server needs to know how to
"insert" an image into the correct place, and the only way I can currently
come up with is to have the text broken up (the breaks where an image is
supposed to go), and a "meta-field" db category that spells out the
sorting order of the text blocks and the images
(text-image-text-image-image-text, etc.) for each blog entry.
Well, storing images in a database is expensive in terms of memory and
processing involved, but you can store them however you wish. In any case,
you will still need to upload them via the browser user interface.
As to the server "inserting" an image into a page, again, that's all done
via HTML text. How it's done, I can't tell you. You're writing the app.
There are any number of ways to do it. But they all involve writing HTML and
CSS into an HTML document. Positioning images in an HTML document is not
exactly a piece of cake, especially when it comes to wrapping text around
them. But again, however you want to describe the back end, and however it
interfaces with the front end, ultimately you're writing an HTML editor.
A web-based HTML editor is a daunting task to design, especially when it
comes to mixing text and images. You may want to have a look at some of the
free code that's out there, and modify it to suit your needs. Here are a few
links if you're interested:
http://www.411asp.net/home/webapps/htmlcode
http://directory.google.com/Top/Computers/Software/Freeware/Editors/HTML/
http://www.geniisoft.com/showcase.nsf/WebEditors
http://www.cmsreview.com/WYSIWYG/OpenSource/directory.html
http://www.netmag.co.uk/downloads/default.asp?subsectionid=489&subsubsectionid=118
Belief in Intelligent Design ...
No, I am not interested in debate. It's a waste of my time. But I will leave
you with this thought: It takes just as much faith to DISbelieve in
something that cannot be proven as it does to believe in something that
cannot be proven. Disbelief is, after all, belief in the opposite of
something believed. True skepticism is not any form of belief.
Let's keep this post on-topic.
I will if you will! ;-)
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.
Kevin said:
A blog is an HTML document on the client. As such, it has no images in it.
It is pure text. It has image tags in it, which contain references to the
location of the image. The browser downloads the image from the server and
formats it in the browser, according to the HTML and CSS in the page.
A blog... as an HTML document on the client? Well, all "web content"
ends up as this eventually... I guess. The point is, I have seen blog
entries (blogger.com comes to mind) where the blogger had "interleaved"
text and images in their blog entry. This is something I haven't seen
before, and I have never seen a code example that shows how to do this.
I also do not have access to a blog account on blogger.com, so I haven't
seen their interface or how they might allow a user to do this.
Therefore, if one wants to incorporate an image into a blog entry, it
either has to be on the server, be on another server (with an absolute URL
pointing to it), or be uploaded to the server. Since when one is entering
an entry into a blog, it is going to be displayed as HTML in an HTML
document, how this is accomplished depends largely upon the interface used
to create the blog entry.
From what I know, Blogger.com stores everything in a database
(including images)... but how to do this without breaking up the text
from a single blog entry into multiple pieces? Clearly, the server needs
to know how to "insert" an image into the correct place, and the only
way I can currently come up with is to have the text broken up (the
breaks where an image is supposed to go), and a "meta-field" db category
that spells out the sorting order of the text blocks and the images
(text-image-text-image-image-text, etc.) for each blog entry.
Of course, I have no idea what sort of interface you're designing. I would
suspect that it will be an ASP.Net form. If your interface has a textarea
in it into which you type the content, it must be processed in some way in
order to be rendered correctly in an HTML document. This means that line
breaks must be translated into <br> tags, and a few other things,
depending upon your requirements.
You may decide to allow inline HTML to be entered into the text, so as to
be able to render it in the HTML document. If this is the case, and you
are referencing an image that is already on *a* web server, you could
simply type in the HTML for the image tag. On the other hand, if you want
to upload the image to the server, you would need to include an input
type="file" element in the form, and handle the upload to the server.
I intend to have *everything* handled by my SQL server. That way, I
don't have to worry about stray uploaded images clogging up the file
system, or file name conflicts, or any number of other headaches that
crop up when images are *not* stored in a database. Since this is going
to be a small, personal site, I just won't have many of the issues that
sites that use images-extracted-from-databases have, so I'm not
concerned about them.
Of course, you would also have to position the image in the text
afterwards. How you do this is up to you again, as you are developing your
own interface. It could be as simple as I described earlier, or as complex
as allowing the user to drag and drop the image in the page, using DHTML
to position it dynamically.
The bottom line to all this is that, regardless of what it looks like in a
browser, things aren't always what they seem; a blog entry is an HTML
document, and when you create an app for creating blog entries, you are
creating an HTML editor. If you aren't very familiar with HTML at this
point, it would behoove you to become familiar with it. or just forget
about including any images or formatting.
I have over 10 years of direct web experience, as I use XHTML 1.1 and
CSS 2.1 to create web sites that are 100% accessible. I have been using
SQL Server, ASP and ASP.NET for the last several years, and am leaping
at the opportunity to use ASP.NET 2.0 (for its XHTML 1.1 compliance).
The problem is, I have never been able to examine code (and its
accompanying database structure) that could take text and images (both
of which are stored in the database) and interleave them.
The only logical method that I have been able to think of is the one in
my first paragraph above, where the text is broken up before it is even
put into the database, so that the images can be "interleaved" with it
more effectively. This, however, requires a "tracking" table, which
tracks the order of text and images so that it can be properly assembled
in the post. That way, you can upload text and images to create the
following post: text-image-text-image-image-text-image, but the problem
with this method is that it is very inelegant. It is a *very* messy way
of doing it, and is the design equivalent to building a car-sized Rube
Goldberg contraption whose entire purpose is just to pick your nose in a
certain way.
BTW, I believe in Intelligent Design. So, you might not want to believe
anything I say, since I am as ignorant and ill-educated as someone who
believes the world is flat, that the Sun circles the Earth or that there
really is a tooth fairy.
Belief in Intelligent Design is not a breakdown of intelligence. It is,
however, a direct result of a severe lack of decent scientific
education, as well as an inability to critically examine the world in a
logical, rational way (the Scientific Method) and see things for how
they really are. Simply put, Intelligent Design fails all three basic
requirements of Science: to be testable, to make testable predictions,
and to provide clear guidelines and examples on how it can be proven
wrong (that is, to be able to be disproven). Therefore, I.D. simply
isn't Science. It is Religious Mythology, and nothing more.
Let's keep this post on-topic; e-mail me if you want a debate.
Yes, but what would you rather see me do: cross-post, or multi-post? Me,
I'd rather do the lesser of two evils, and cross-post.
....Geshel
--
***********************************************************************
* My reply-to is an automatically monitored spam honeypot. Do not use *
* it unless you want to be blacklisted by SpamCop. Please reply to my *
* first name at my last name dot org. *
***********************************************************************
"Anyone who believes in Intelligent Design ("creationism") is just as
ignorant and ill-educated as someone who believes that the world is
flat, that the Sun circles the Earth or that there really is a tooth
fairy. Darwinism has an overwhelming foundation of evidence that can be
tested and reproduced. Intelligent Design, on the other hand, has no
evidence at all; not one single shred of testable proof. As such,
Intelligent Design is Religious Mythology, and has no right whatsoever
to be in our Science classrooms." - 99.99+% of Scientists
***********************************************************************
Mignon McLaughlin once said that "A nymphomaniac is a woman [who is] as
obsessed with sex as the average man." Unfortunately, since true
nymphomaniacs are so rare, this means that it takes an extraordinary
woman to keep up with an ordinary man.
***********************************************************************