Import of recovered 0.7a
This commit is contained in:
commit
5d5f103a26
26 changed files with 1516 additions and 0 deletions
38
CHANGES
Normal file
38
CHANGES
Normal file
|
@ -0,0 +1,38 @@
|
|||
0.7
|
||||
- Changed the RSS export routines slightly so only the first
|
||||
paragraph of an entry is included in the channel since
|
||||
userland.com's parser was choking on some entries.
|
||||
+ I now think this is caused by something else. I'll
|
||||
look into it. I think this behavior will become an option,
|
||||
in case you only want to export teasers for your content -
|
||||
not the entirity of your content.
|
||||
|
||||
- Graceful degradation happens in the sidebar now. If no
|
||||
sidebar/rdfsources or sidebar/links files are in place, things
|
||||
carry on silently.
|
||||
|
||||
- New attribute for the <weblog> entity in dong.conf - "public".
|
||||
If set as "true", the RSS dump of the current page definition will
|
||||
be included in the sidebar of all pages defined by the current
|
||||
configuration file. They will appear under the heading "Section
|
||||
Index". If no entities contain it, the section heading will not
|
||||
appear.
|
||||
|
||||
- Basic navigation controls for historical entries.
|
||||
|
||||
0.6
|
||||
- minclude/rdf-import.inc and minclude/rdf-export.inc have been
|
||||
renamed as rss-(im|ex)port.inc because they really are not
|
||||
RDF-related. There's an awful lot of interchange of those terms
|
||||
out there, but I don't think it's correct, somehow.
|
||||
|
||||
- Permalinks enabled via ¶ characters under the datestamp.
|
||||
|
||||
- RSS export now includes <link> elements pointing to an article's
|
||||
permalink URL.
|
||||
|
||||
- A couple more bits of code moved into minclude/misc.inc to clear
|
||||
up some code duplication.
|
||||
|
||||
0.1 to 0.5
|
||||
- A lot happened.
|
340
COPYING
Normal file
340
COPYING
Normal file
|
@ -0,0 +1,340 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
43
INSTALL
Normal file
43
INSTALL
Normal file
|
@ -0,0 +1,43 @@
|
|||
Unpack the archive so that index.php3 is in a directory that your web
|
||||
server can see, and you preserve the directory structure of the archive.
|
||||
Rename dong.conf.default to dong.conf. How's that? Oh, I'm assuming you've
|
||||
got PHP working (version 3 is fine, should work with 4) first.
|
||||
|
||||
Edit the files in mindong/content - these are the blog entries. Read the
|
||||
ones that are there first, they form the majority of the documentation right
|
||||
now.
|
||||
|
||||
Edit mindong/sidebar/links - These are the links down the right-hand side
|
||||
of the page. Just look at the file. It should be obvious.
|
||||
|
||||
Now turn your attention to dong.conf - the fields there should be pretty
|
||||
obvious. Make your changes.
|
||||
|
||||
One non-obvious part of dong.conf may be the fields of the <weblog> tag.
|
||||
I'm going to have to write a full DTD one day, but for now ...
|
||||
|
||||
<weblog name="froglog" main="true">
|
||||
|
||||
"name" and "main" are the only supported fields right now.
|
||||
|
||||
"name" is a short name for your blog content. This is used as the name of the
|
||||
directory to look in for your content. In this case, 'blog entries will be
|
||||
searched for in froglog/content, sidebar stuff in froglog/sidebar.
|
||||
|
||||
"main" indicates that this entry is the default. If you only have one
|
||||
<weblog> section, you can safely omit it. If you have multiple <weblog>
|
||||
sections, one of them should be nominated as default. If no entries are
|
||||
default, the first entry in the file will be used when no specific content
|
||||
is requested via the URL.
|
||||
|
||||
To specify a particular set of content, use the "name" field from the
|
||||
<weblog> section in the request URL like so;
|
||||
|
||||
http://www.grouse.net.au/~mike/index.php3?page=personal
|
||||
|
||||
The above URL will look for a weblog definition with the name "personal"
|
||||
and content directories as subdirectories of a "personal" directory.
|
||||
|
||||
That's really badly described, isn't it? Play around with it. I don't
|
||||
think I've been TOO obscure.
|
||||
|
22
README
Normal file
22
README
Normal file
|
@ -0,0 +1,22 @@
|
|||
So what is this thing? This "Minimalist Dong" you find yourself rummaging
|
||||
through?
|
||||
|
||||
It's weblog management software. Very basic - hence the "Minimalist". The
|
||||
interface is all text, although you could easily put graphics into it. As
|
||||
it ships, it passes HTML 4.01-Strict validation, but you can easily mangle
|
||||
that too. Try not to, OK? :)
|
||||
|
||||
It can import and export content in RSS 0.91 formatted XML files, the
|
||||
Netscape channel format, allowing you to easily syndicate content from
|
||||
other sites, and have your own content syndicated by others.
|
||||
|
||||
It'll do more things when we get to version 1.0 - and then I'm going to
|
||||
think about "Maximus" - but that's for later. Maximus will have the
|
||||
functions of Minimalist Dong as a baseline, but many more funky things
|
||||
besides. It will require much more in the way of resources than
|
||||
Minimalist.
|
||||
|
||||
Minimalist Dong should require nothing more than a fairly standard build
|
||||
of PHP and a web server.
|
||||
|
||||
|
72
README.md
Normal file
72
README.md
Normal file
|
@ -0,0 +1,72 @@
|
|||
# Minimalist Dong
|
||||
|
||||
In the year 2001, I wrote a blog called Minimalist Dong. This involved not just writing the content for it but also the software to make it go, as was the style at the time. This is that software. The README and INSTALL files are exactly as I've found them, and this thing you're reading now is the only new thing.
|
||||
|
||||
This has been uploaded from a working/test copy that I left unpacked in an old home directory that made it into my backups somehow, and is not the exact contents of the minimalistdong-0.7a.tar.gz release file. All the actual release archives appear to have been lost to time. I've put a couple of files back, deleted some things, and left some stuff like an alternate style sheet that was hanging around.
|
||||
|
||||
## Don't use this
|
||||
|
||||
The file extension is .php3 for god's sake, that alone should be a red flag. Will it even run in ... whatever we're up to now? I hope not. There's no separation of code and content, the HTML is right there in the body and includes things like this:
|
||||
```
|
||||
<h1><?php print "<a href=\"$config[URL]\">$config[SITETITLE]</a>"; ?></h1>
|
||||
```
|
||||
|
||||
There are some enlightening things in the mindong/content folder, which are the blog entries for the software itself. I was very, very keen on XML in the year 2001, and it shows. There's a second blog section in the faq folder that you can take a look at as well.
|
||||
|
||||
The default contents of the links and rdfsources files have been modified, as almost all the links were invalid now, and ... well the RDF stuff won't be there either but I left a couple of examples in there for what it looked like.
|
||||
|
||||
## What's its deal?
|
||||
|
||||
The point of this was to be able to write my blog entries in a text editor in a terminal. The files were plain text, and ordered by the file creation timestamp on the filesystem. Could backups and copying have messed up your entire blog sequence? Oh yes. I planned to add a simple header format at some point with date and meta information, in much the same way static generators do things today!
|
||||
|
||||
The FAQ included this entry on the design philosopy:
|
||||
> Design Philosophy
|
||||
>
|
||||
> Minimalist Dong has only two firm critera for its development.
|
||||
>
|
||||
> Firstly, all a user requires to run a Minimalist Dong site is a web server
|
||||
> that supports PHP version 3 with some fairly standard configuration
|
||||
> options. No databases, no administrative rights on the server and no
|
||||
> specific platform. A user with the correct environment should be able to
|
||||
> unpack it and start running things almost immediately.
|
||||
>
|
||||
> Secondly, the interface will be text. No graphic elements will ever be
|
||||
> required in the default configuration. You're free to add them, of course,
|
||||
> but you'll never require them.
|
||||
>
|
||||
> It is because of this philosophy that the software gains the term
|
||||
> "Minimalist". Any feature that can be implemented without breaking these
|
||||
> rules will be considered.
|
||||
|
||||
## Why "Minimalist Dong"?
|
||||
|
||||
From the included FAQ:
|
||||
|
||||
> Something [Nikolai](https://dobbs.town/@Nikolai_Kingsley) wrote ...
|
||||
>
|
||||
> Shitsu-Tonka. We of maked MINIMALIST DONG, maked a lot of, more than of
|
||||
> digital watch that buy of American magazine TIME to give away to lucky
|
||||
> reader.
|
||||
>
|
||||
> MINIMALIST DONG is wary, always, even in raining.
|
||||
>
|
||||
> MINIMALIST DONG make stong men weep, make weepy men stong, but what she do
|
||||
> to stong weepy women we can not say about. Just to say weepy no more, but
|
||||
> knuckles closer to ground! Always tell correct time!
|
||||
>
|
||||
> MINIMALIST DONG soft on inside, stong and not crack on outside, inside
|
||||
> too. Press button on end and can hear TRUCK DRIVER DIVORCE loud and soft
|
||||
> too. and soon many more soon to choose from, ZOOT ALLURES soon. MONTANA,
|
||||
> soon. BABY SNAKES too, soon, but not copyrighted yet, here.
|
||||
>
|
||||
> MINIMALIST DONG batteries INCLUDED!
|
||||
>
|
||||
> MINIMALIST DONG smoke but not inhale.
|
||||
>
|
||||
> MINIMALIST DONG not banned by Geneva Convention.
|
||||
>
|
||||
> MINIMALIST DONG. You will be assimilated. Resistance is irrelevant.
|
||||
|
||||
## More information
|
||||
|
||||
If you're interested in what the hell was going through my mind, my later plans, and associated Hubris, you might enjoy reading [my blog post about Feedtube](https://bremensaki.com/2025/02/09/its-feeds-but-in-a-tube/).
|
25
TODO
Normal file
25
TODO
Normal file
|
@ -0,0 +1,25 @@
|
|||
REAL SOON NOW
|
||||
|
||||
- Generic include system with "zones" to replace rdfsources/links
|
||||
|
||||
- "Official" datestamps on entries, instead of last updated stamps
|
||||
|
||||
BEFORE 1.0 RELEASE
|
||||
|
||||
- Include a couple of extra style sheets
|
||||
|
||||
- Random taglines
|
||||
|
||||
- Better install documentation
|
||||
|
||||
- DTD for dong.conf XML format
|
||||
|
||||
FUTURE
|
||||
|
||||
- Web-based form for entry composition
|
||||
|
||||
ONGOING
|
||||
|
||||
- Clean up code duplication. This has started, with the creation of the
|
||||
"misc" include file, but much more can be done.
|
||||
|
48
dong.conf.default
Normal file
48
dong.conf.default
Normal file
|
@ -0,0 +1,48 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!-- This is the CONFIGURATION FILE version, and has nothing to do with
|
||||
the Minimalist Dong version -->
|
||||
|
||||
<dong version="0.01">
|
||||
|
||||
<weblog name="mindong" main="true" public="true">
|
||||
<sitetitle>Minimalist Dong</sitetitle>
|
||||
<url>http://www.grouse.net.au/~mike/work/minimalistdong/index.php3</url>
|
||||
<email>mike@grouse.net.au</email>
|
||||
<description>Minimalist Dong is a fine piece of blogging software</description>
|
||||
<articlelimit>5</articlelimit>
|
||||
<rdfarticlelimit>10</rdfarticlelimit>
|
||||
</weblog>
|
||||
|
||||
<!-- This defines an FAQ section for a site. Note the "public" attribute
|
||||
is "true", so it will be included as a sidebar option on any page of the
|
||||
site. The article limit is set to 0, so every entry is always shown on the
|
||||
front page. This is not very suitable for a page with frequently added
|
||||
content, but good for an FAQ. -->
|
||||
|
||||
<weblog name="faq" public="true">
|
||||
<sitetitle>Frequently Asked Questions</sitetitle>
|
||||
<url>http://www.grouse.net.au/~mike/work/minimalistdong/index.php3?page=faq</url>
|
||||
<email>mike@grouse.net.au</email>
|
||||
<description>Minimalist Dong explained!</description>
|
||||
<articlelimit>0</articlelimit>
|
||||
<rdfarticlelimit>5</rdfarticlelimit>
|
||||
</weblog>
|
||||
|
||||
|
||||
|
||||
<!-- A second blog could be configured by uncommenting the block below
|
||||
and adding a content directory called 'anotherdong' -->
|
||||
|
||||
<!--
|
||||
<weblog name="anotherdong">
|
||||
<sitetitle>Another Dong</sitetitle>
|
||||
<url>http://www.grouse.net.au/~mike/index.php3?page=anotherdong</url>
|
||||
<email>mike@grouse.net.au</email>
|
||||
<description>Another Dong-based 'blog!</description>
|
||||
<articlelimit>10</articlelimit>
|
||||
<rdfarticlelimit>10</rdfarticlelimit>
|
||||
</weblog>
|
||||
-->
|
||||
|
||||
</dong>
|
113
dong.css
Normal file
113
dong.css
Normal file
|
@ -0,0 +1,113 @@
|
|||
BODY {
|
||||
color: #000000;
|
||||
background: #FFFFFF;
|
||||
font-family: "trebuchet ms", helvetica, arial, san-serif;
|
||||
}
|
||||
|
||||
H1 { /* Used for masthead (site title, eg Minimalist Dong) */
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
H2 { /* Reserved for article headlines, not used on base blog page */
|
||||
font-size: 1.4em;
|
||||
}
|
||||
|
||||
H3 { /* Used for blog entry headings and article subheadings */
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 0.1em;
|
||||
}
|
||||
|
||||
H4 { /* Used for blog entry subheadings and article subsubheadings */
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
P.tagline { /* Used for taglines that appear next to the masthead */
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
P.entrydate { /* Used for time and date stamps on blog entries */
|
||||
font-size: 0.7em;
|
||||
margin-top: -0.2em;
|
||||
}
|
||||
|
||||
P.entrytext { /* Used for blog entries, will normally be default */
|
||||
margin-top: 0em;
|
||||
margin-bottom: 20em;
|
||||
}
|
||||
|
||||
P.menuhead {
|
||||
font-weight: bold;
|
||||
margin-top: 0.8em;
|
||||
margin-bottom: 0.3em;
|
||||
}
|
||||
|
||||
P.menusubhead {
|
||||
font-weight: bold;
|
||||
font-size: 0.9em;
|
||||
margin-top: 0.6em;
|
||||
margin-bottom: 0.2em;
|
||||
}
|
||||
|
||||
P.menuoption { /* Sidebar menu options */
|
||||
font-size: 0.9em;
|
||||
margin-left: 0.5em;
|
||||
margin-top: -0.3em;
|
||||
margin-bottom: 0.2em;
|
||||
}
|
||||
|
||||
A {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
A:link {
|
||||
color: green;
|
||||
}
|
||||
|
||||
A:visited {
|
||||
color: dimgray;
|
||||
}
|
||||
|
||||
A:hover {
|
||||
color: green;
|
||||
background-color: greenyellow;
|
||||
}
|
||||
|
||||
TD.sidebar A {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
TD.sidebar A:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
TABLE.layout {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.blog {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
|
||||
TD.entryhead {
|
||||
vertical-align: top;
|
||||
text-align: right;
|
||||
border-top: thin solid lightgrey;
|
||||
padding: 5px 5px 5px 5px;
|
||||
}
|
||||
|
||||
TD.entrytext {
|
||||
vertical-align: top;
|
||||
text-align: left;
|
||||
border-top: thin solid lightgrey;
|
||||
padding: 5px 5px 5px 5px;
|
||||
}
|
||||
|
||||
TD.sidebar {
|
||||
vertical-align: top;
|
||||
text-align: left;
|
||||
font-size: 0.9em;
|
||||
padding: 5px 5px 5px 5px;
|
||||
background-color: cornsilk;
|
||||
}
|
||||
|
26
faq/content/2001040700
Normal file
26
faq/content/2001040700
Normal file
|
@ -0,0 +1,26 @@
|
|||
Why "Minimalist Dong"?
|
||||
|
||||
Something ##nikolai#http://www.very.net/~nikolai## wrote ...
|
||||
|
||||
Shitsu-Tonka. We of maked MINIMALIST DONG, maked a lot of, more than of
|
||||
digital watch that buy of American magazine TIME to give away to lucky
|
||||
reader.
|
||||
|
||||
MINIMALIST DONG is wary, always, even in raining.
|
||||
|
||||
MINIMALIST DONG make stong men weep, make weepy men stong, but what she do
|
||||
to stong weepy women we can not say about. Just to say weepy no more, but
|
||||
knuckles closer to ground! Always tell correct time!
|
||||
|
||||
MINIMALIST DONG soft on inside, stong and not crack on outside, inside
|
||||
too. Press button on end and can hear TRUCK DRIVER DIVORCE loud and soft
|
||||
too. and soon many more soon to choose from, ZOOT ALLURES soon. MONTANA,
|
||||
soon. BABY SNAKES too, soon, but not copyrighted yet, here.
|
||||
|
||||
MINIMALIST DONG batteries INCLUDED!
|
||||
|
||||
MINIMALIST DONG smoke but not inhale.
|
||||
|
||||
MINIMALIST DONG not banned by Geneva Convention.
|
||||
|
||||
MINIMALIST DONG. You will be assimilated. Resistance is irrelevant.
|
17
faq/content/2001040701
Normal file
17
faq/content/2001040701
Normal file
|
@ -0,0 +1,17 @@
|
|||
Design Philosophy
|
||||
|
||||
Minimalist Dong has only two firm critera for its development.
|
||||
|
||||
Firstly, all a user requires to run a Minimalist Dong site is a web server
|
||||
that supports PHP version 3 with some fairly standard configuration
|
||||
options. No databases, no administrative rights on the server and no
|
||||
specific platform. A user with the correct environment should be able to
|
||||
unpack it and start running things almost immediately.
|
||||
|
||||
Secondly, the interface will be text. No graphic elements will ever be
|
||||
required in the default configuration. You're free to add them, of course,
|
||||
but you'll never require them.
|
||||
|
||||
It is because of this philosophy that the software gains the term
|
||||
"Minimalist". Any feature that can be implemented without breaking these
|
||||
rules will be considered.
|
124
grouse.css
Normal file
124
grouse.css
Normal file
|
@ -0,0 +1,124 @@
|
|||
/* A style sheet for Minimalist Dong sort of based on Grouse! */
|
||||
|
||||
BODY {
|
||||
color: #000000;
|
||||
background: #FFFFFF;
|
||||
font-family: "trebuchet ms", helvetica, arial, san-serif;
|
||||
}
|
||||
|
||||
H1 { /* Used for masthead (site title, eg Minimalist Dong) */
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
H2 { /* Reserved for article headlines, not used on base blog page */
|
||||
font-size: 1.4em;
|
||||
}
|
||||
|
||||
H3 { /* Used for blog entry headings and article subheadings */
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 0.1em;
|
||||
}
|
||||
|
||||
H4 { /* Used for blog entry subheadings and article subsubheadings */
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
P.tagline { /* Used for taglines that appear next to the masthead */
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
P.entrydate { /* Used for time and date stamps on blog entries */
|
||||
font-size: 0.7em;
|
||||
margin-top: -0.2em;
|
||||
}
|
||||
|
||||
P.entrytext { /* Used for blog entries, will normally be default */
|
||||
margin-top: 0em;
|
||||
margin-bottom: 20em;
|
||||
}
|
||||
|
||||
P.menuhead {
|
||||
font-weight: bold;
|
||||
margin-top: 0.8em;
|
||||
margin-bottom: 0.3em;
|
||||
color: white;
|
||||
}
|
||||
|
||||
P.menusubhead {
|
||||
font-weight: bold;
|
||||
font-size: 0.9em;
|
||||
margin-top: 0.6em;
|
||||
margin-bottom: 0.2em;
|
||||
}
|
||||
|
||||
P.menuoption { /* Sidebar menu options */
|
||||
font-size: 0.9em;
|
||||
margin-left: 0.5em;
|
||||
margin-top: -0.3em;
|
||||
margin-bottom: 0.2em;
|
||||
}
|
||||
|
||||
A {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
A:link {
|
||||
color: #0000FF;
|
||||
}
|
||||
|
||||
A:visited {
|
||||
color: #9932CC;
|
||||
}
|
||||
|
||||
A:hover {
|
||||
color: #FF6347;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
TD.sidebar A {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
TD.sidebar A:link {
|
||||
color: #EEA000;
|
||||
}
|
||||
|
||||
TD.sidebar A:visited {
|
||||
color: #FFBB00;
|
||||
}
|
||||
|
||||
TD.sidebar A:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
TABLE.layout {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.blog {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
|
||||
TD.entryhead {
|
||||
vertical-align: top;
|
||||
text-align: right;
|
||||
border-top: thin solid lightgrey;
|
||||
padding: 5px 5px 5px 5px;
|
||||
}
|
||||
|
||||
TD.entrytext {
|
||||
vertical-align: top;
|
||||
text-align: left;
|
||||
border-top: thin solid lightgrey;
|
||||
padding: 5px 5px 5px 5px;
|
||||
}
|
||||
|
||||
TD.sidebar {
|
||||
vertical-align: top;
|
||||
text-align: left;
|
||||
font-size: 0.9em;
|
||||
padding: 5px 5px 5px 5px;
|
||||
background-color: #5B69A6;
|
||||
}
|
||||
|
184
index.php3
Normal file
184
index.php3
Normal file
|
@ -0,0 +1,184 @@
|
|||
<?php
|
||||
require "minclude/config.inc";
|
||||
require "minclude/misc.inc";
|
||||
|
||||
// If $page is undefined, will use the 'default' entry from config
|
||||
get_config($page);
|
||||
|
||||
// This sets the directory that all the content and include files are
|
||||
// stored under - usually just changing $blogdir will be enough, but
|
||||
// the others can be forced to specific values if you need finer control.
|
||||
//$blogdir="blog";
|
||||
$articledir="$config[NAME]/content";
|
||||
$imagedir="$config[NAME]/images";
|
||||
$sidebardir="$config[NAME]/sidebar";
|
||||
|
||||
// If we need to refer back to this page and pass parameters, we need to
|
||||
// know if the URL itself has any parameters (like "page=xxxx") so we can
|
||||
// add new ones without disturbing anything.
|
||||
|
||||
// I'm assuming there's only one possible reason for a "?" to appear in a
|
||||
// URL. I think I'm right, but must check the specs one day ...
|
||||
if (preg_match("/\?/",$config[URL])) {
|
||||
$switchchar="&";
|
||||
}
|
||||
else {
|
||||
$switchchar="?";
|
||||
}
|
||||
|
||||
|
||||
// Includes
|
||||
// Some of these can be removed in some cases, but they shouldn't do any
|
||||
// harm even if you're not using the features.
|
||||
|
||||
// Stuff to handle RDF headline imports
|
||||
require "minclude/rss-import.inc";
|
||||
// Code for RDF exports
|
||||
require "minclude/rss-export.inc";
|
||||
|
||||
// This handles any special display modes - only XML right now, but a
|
||||
// handler for table-free or low/high graphic usage could go here.
|
||||
switch ($mode) {
|
||||
case rdf:
|
||||
case rss:
|
||||
rssexport();
|
||||
exit();
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// The start of the actual HTML is just after this ...
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE><?php print $config[SITETITLE]; ?></TITLE>
|
||||
<link rel="stylesheet" href="dong.css" type="text/css">
|
||||
</HEAD>
|
||||
|
||||
<BODY>
|
||||
|
||||
<h1><?php print "<a href=\"$config[URL]\">$config[SITETITLE]</a>"; ?></h1>
|
||||
<p class="tagline"><?php print "$config[DESCRIPTION]"; ?></p>
|
||||
<!-- Main body table start -->
|
||||
<TABLE class="layout">
|
||||
|
||||
<TR> <!-- Row 1 Start -->
|
||||
<TD class="blog"> <!-- Main body cell -->
|
||||
|
||||
<?php
|
||||
if (!$offset) {
|
||||
$offset=0;
|
||||
}
|
||||
|
||||
$size=sizeof($articlelist=get_articlelist($offset, $config[ARTICLELIMIT]));
|
||||
|
||||
$nextoffset=$offset+$config[ARTICLELIMIT];
|
||||
$prevoffset=$offset-$config[ARTICLELIMIT];
|
||||
$nexturl = append_to_url($config[URL],"offset=$nextoffset");
|
||||
$prevurl = append_to_url($config[URL],"offset=$prevoffset");
|
||||
|
||||
$navbar="<p class=\"navbar\">";
|
||||
|
||||
if ($prevoffset >= 0) {
|
||||
$navbar = $navbar." <a href=\"$prevurl\">Next $config[ARTICLELIMIT] Items</a> \n";
|
||||
}
|
||||
|
||||
if ($totalarticles > $nextoffset) {
|
||||
$navbar = $navbar." <a href=\"$nexturl\">Previous $config[ARTICLELIMIT] Items</a> \n";
|
||||
}
|
||||
|
||||
print "$navbar";
|
||||
?>
|
||||
<table class="blog"> <!-- Open the table for the main blog entries -->
|
||||
<?php
|
||||
// Main content loop starts here
|
||||
for ($index=0;$index<$size;$index++) {
|
||||
|
||||
$workfile="$articledir/$articlelist[$index]";
|
||||
$articlefile=fopen ($workfile, "r");
|
||||
$articlestamp=date("g:i a, l, d F Y", filectime($workfile));
|
||||
$permalink=$config[URL].$switchchar."showentry=".$articlelist[$index];
|
||||
|
||||
$oneline = fgets($articlefile, 300);
|
||||
print"<tr>\n<td class=\"entryhead\"><h3>$oneline</h3>";
|
||||
print"<p class=\"entrydate\">$articlestamp</p>\n";
|
||||
print"<p class=\"permalink\">
|
||||
<a href=\"$permalink\" title=\"permalink URL\">¶</a>
|
||||
</p>\n</td>";
|
||||
|
||||
print"<td class=\"entrytext\">";
|
||||
while (!feof ($articlefile)) {
|
||||
$oneline = fgets($articlefile, 300);
|
||||
if ($oneline == "\n") {
|
||||
$oneline="<p>";
|
||||
}
|
||||
elseif (preg_match("|^%%|", $oneline)) {
|
||||
$oneline = preg_replace("|%%(.*)%%|U", "<img
|
||||
src=\"$imagedir/\\1\">", $oneline);
|
||||
}
|
||||
else {
|
||||
$oneline = preg_replace("|##(.*)#(.*)##|U", "<a href=\"\\2\">\\1</a>", $oneline);
|
||||
}
|
||||
print"$oneline\n";
|
||||
}
|
||||
fclose ($articlefile);
|
||||
print "</td></tr>\n";
|
||||
|
||||
} // Main content loop ends
|
||||
?>
|
||||
</table> <!-- Close the table for the main blog entries -->
|
||||
<?php print "$navbar"; ?>
|
||||
|
||||
</TD> <!-- End Main body cell -->
|
||||
|
||||
|
||||
<TD class="sidebar"> <!-- Sidebar cell -->
|
||||
<?php
|
||||
if(sizeof($public)) {
|
||||
print"<p class=\"menuhead\">Section Index</p>\n";
|
||||
while (list($key, $value) = each($public)) {
|
||||
grab_headlines($value);
|
||||
}
|
||||
}
|
||||
|
||||
if($rdffile=@fopen ("$sidebardir/rdfsources", "r")) {
|
||||
print"<p class=\"menuhead\">Other Pages</p>";
|
||||
while (!feof ($rdffile)) {
|
||||
$rdfurl = chop(fgets($rdffile, 100));
|
||||
if ($rdfurl == "") {
|
||||
break;
|
||||
}
|
||||
grab_headlines($rdfurl);
|
||||
}
|
||||
fclose ($rdffile);
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// Here's where the sidebar links are processed
|
||||
if($linkfile=@fopen ("$sidebardir/links", "r")) {
|
||||
print "<p class=\"menuhead\">Links</p>";
|
||||
while (!feof ($linkfile)) {
|
||||
$linkname = chop(fgets($linkfile, 100));
|
||||
if ($linkname == "") {
|
||||
break;
|
||||
}
|
||||
$linkurl = chop(fgets($linkfile, 100));
|
||||
print"<p class=\"menuoption\"><A HREF=\"$linkurl\">$linkname</A></p>\n";
|
||||
}
|
||||
fclose ($linkfile);
|
||||
}
|
||||
?>
|
||||
|
||||
</TD> <!-- End Sidebar cell -->
|
||||
</TR> <!-- Row 1 Ends -->
|
||||
</TABLE> <!-- Main Body table ends -->
|
||||
<p>This <a href="http://www.grouse.net.au/~mike/index.php3?page=minimalist">
|
||||
Minimalist Dong</a> weblog is run by
|
||||
<?php print "<a href=\"$config[EMAIL]\">$config[EMAIL]</a>"; ?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
110
minclude/config.inc
Normal file
110
minclude/config.inc
Normal file
|
@ -0,0 +1,110 @@
|
|||
<?php
|
||||
// This stuff all relates to reading and parsing the configuration files.
|
||||
// A lot of the code is HIDEOUS - but it does work. It needs a cleanup.
|
||||
|
||||
function get_config($page) {
|
||||
|
||||
$xml_parser = make_xml_parser("ConfigcharacterData", "ConfigstartElement",
|
||||
"ConfigendElement");
|
||||
|
||||
if (!($fp = fopen("dong.conf", 'r'))) {
|
||||
die("Could not open config file for parsing!\n");
|
||||
}
|
||||
|
||||
// loop through the file and parse baby!
|
||||
while ($data = fread($fp, 4096)) {
|
||||
if (!($data = utf8_encode($data))) {
|
||||
echo 'ERROR'."\n";
|
||||
}
|
||||
|
||||
if (!xml_parse($xml_parser, $data, feof($fp))) {
|
||||
die(sprintf( "XML error: %s at line %d\n\n",
|
||||
xml_error_string(xml_get_error_code($xml_parser)),
|
||||
xml_get_current_line_number($xml_parser)));
|
||||
}
|
||||
}
|
||||
|
||||
xml_parser_free($xml_parser);
|
||||
|
||||
}
|
||||
|
||||
function ConfigstartElement($parser, $name, $attrs=''){
|
||||
|
||||
global $config_open_tags, $current_tag, $isfirst, $gotnamed, $isdefault,
|
||||
$page, $isnamed, $config, $storeflag, $public, $publicflag;
|
||||
|
||||
$current_tag = $name;
|
||||
|
||||
switch($name){
|
||||
case 'WEBLOG':
|
||||
if ($attrs[PUBLIC]) {
|
||||
$publicflag=1;
|
||||
$public[TEMPNAME]=$attrs[NAME];
|
||||
}
|
||||
|
||||
if (!$isfirst && !$gotnamed) {
|
||||
$config[NAME]=$attrs[NAME];
|
||||
$storeflag=1;
|
||||
$isfirst=1;
|
||||
}
|
||||
|
||||
if ($attrs[MAIN]=="true" && !$gotnamed) {
|
||||
$config[NAME]=$attrs[NAME];
|
||||
$storeflag=1;
|
||||
}
|
||||
|
||||
if ($attrs[NAME] == $page) {
|
||||
$isnamed=1;
|
||||
$storeflag=1;
|
||||
$config[NAME]=$attrs[NAME];
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function ConfigendElement($parser, $name, $attrs=''){
|
||||
|
||||
global $confg_close_tags, $isdefault, $gotnamed, $isnamed, $storeflag, $publicflag;
|
||||
|
||||
switch($name){
|
||||
case 'WEBLOG':
|
||||
$isdefault = 0;
|
||||
if($isnamed == 1) {
|
||||
$isnamed = 0;
|
||||
$gotnamed = 1;
|
||||
}
|
||||
$storeflag=0;
|
||||
$publicflag=0;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function ConfigcharacterData($parser, $data) {
|
||||
|
||||
global $current_tag, $storeflag, $config, $public, $publicflag;
|
||||
|
||||
$data=chop($data);
|
||||
|
||||
if ($storeflag && $data) {
|
||||
$config[$current_tag]=$data;
|
||||
}
|
||||
|
||||
if ($publicflag && ($current_tag == "URL") && $data) {
|
||||
if (preg_match("/\?/",$data)) {
|
||||
$switchchar="&";
|
||||
}
|
||||
else {
|
||||
$switchchar="?";
|
||||
}
|
||||
|
||||
$public[$public[TEMPNAME]]=$data.$switchchar."mode=rss";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
105
minclude/misc.inc
Normal file
105
minclude/misc.inc
Normal file
|
@ -0,0 +1,105 @@
|
|||
<?php
|
||||
// Code for parsing the config XML file
|
||||
|
||||
|
||||
// Some global and non-user-servicable variables that really don't need to
|
||||
// clutter up the index file.
|
||||
|
||||
$config_open_tags = array(
|
||||
'WEBLOG' => '<WEBLOG>',
|
||||
'SITETITLE' => '<SITETITLE>',
|
||||
'DESCRIPTION' => '<DESCRIPTION>',
|
||||
'ARTICLELIMIT' => '<ARTICLELIMIT>',
|
||||
'RDFARTICLELIMIT' => '<RDFARTICLELIMIT>',
|
||||
'URL' => '<URL>',
|
||||
'EMAIL' => '<EMAIL>');
|
||||
|
||||
$config_close_tags = array(
|
||||
'WEBLOG' => '</WEBLOG>',
|
||||
'SITETITLE' => '</SITETITLE>',
|
||||
'DESCRIPTION' => '</DESCRIPTION>',
|
||||
'ARTICLELIMIT' => '</ARTICLELIMIT>',
|
||||
'RDFARTICLELIMIT' => '</RDFARTICLELIMIT>',
|
||||
'URL' => '</URL>',
|
||||
'EMAIL' => '</EMAIL>');
|
||||
|
||||
$open_tags = array(
|
||||
'CHANNEL' => '<CHANNEL>',
|
||||
'ITEM' => '<ITEM>',
|
||||
'TITLE' => '<TITLE>',
|
||||
'LINK' => '<LINK>');
|
||||
|
||||
$close_tags = array(
|
||||
'CHANNEL' => '</CHANNEL>',
|
||||
'ITEM' => '</ITEM>',
|
||||
'TITLE' => '</TITLE>',
|
||||
'LINK' => '</LINK>');
|
||||
|
||||
|
||||
function make_xml_parser($character, $startelement, $endelement) {
|
||||
|
||||
$xml_parser = xml_parser_create("UTF-8");
|
||||
xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, true);
|
||||
xml_parser_set_option($xml_parser, XML_OPTION_TARGET_ENCODING, 'UTF-8');
|
||||
xml_set_character_data_handler($xml_parser, $character);
|
||||
xml_set_element_handler($xml_parser, $startelement, $endelement);
|
||||
|
||||
return $xml_parser;
|
||||
}
|
||||
|
||||
|
||||
function get_articlelist($offset, $limit) {
|
||||
// Get list of all available articles
|
||||
global $articledir, $showentry, $totalarticles;
|
||||
|
||||
$handle=opendir("$articledir");
|
||||
|
||||
// Skip reading the directory if we're displaying a permalink
|
||||
if ($showentry) {
|
||||
$articlelist[0]=$showentry;
|
||||
return $articlelist;
|
||||
}
|
||||
|
||||
// Stock $articlelist with every available article
|
||||
$index=0;
|
||||
while ($file = readdir($handle)) {
|
||||
if ($file != "." && $file != "..") {
|
||||
$articlelist[$index] = "$file";
|
||||
$index++;
|
||||
}
|
||||
}
|
||||
|
||||
// Set the total now
|
||||
$totalarticles = sizeof($articlelist);
|
||||
|
||||
// Sort the article list to highest number (most recent) first
|
||||
rsort ($articlelist);
|
||||
|
||||
|
||||
// Avoid overflows if we don't have a lot of articles, or make sure
|
||||
// every article is displayed if the limit is 0
|
||||
|
||||
if ((sizeof($articlelist) < $limit) || ($limit == 0)) {
|
||||
$limit = sizeof($articlelist) - $offset;
|
||||
}
|
||||
|
||||
for ($count=0;$count<$limit;$count++) {
|
||||
$newlist[$count]=$articlelist[$count+$offset];
|
||||
}
|
||||
return $newlist;
|
||||
|
||||
}
|
||||
|
||||
function append_to_url($url, $option) {
|
||||
if (preg_match("/\?/",$url)) {
|
||||
$switchchar="&";
|
||||
}
|
||||
else {
|
||||
$switchchar="?";
|
||||
}
|
||||
|
||||
$url = $url.$switchchar.$option;
|
||||
|
||||
return $url;
|
||||
}
|
||||
?>
|
61
minclude/rss-export.inc
Normal file
61
minclude/rss-export.inc
Normal file
|
@ -0,0 +1,61 @@
|
|||
<?php
|
||||
function rssexport() {
|
||||
global $articledir, $config, $switchchar;
|
||||
print"<?"; ?>xml version="1.0"?>
|
||||
|
||||
<rss version="0.92">
|
||||
|
||||
<channel>
|
||||
|
||||
<?php
|
||||
echo"
|
||||
<title>$config[SITETITLE]</title>
|
||||
<link>$config[URL]</link>
|
||||
<description>$config[DESCRIPTION]</description>
|
||||
<language>$config[LANGUAGE]</language>
|
||||
<webmaster>$config[EMAIL]</webmaster>
|
||||
";
|
||||
|
||||
$articlelist=get_articlelist(0, $config[RDFARTICLELIMIT]);
|
||||
|
||||
// Avoid overflows if we don't have a lot of articles
|
||||
if (sizeof($articlelist) < $config[RDFARTICLELIMIT]) {
|
||||
$config[RDFARTICLELIMIT] = sizeof($articlelist);
|
||||
}
|
||||
|
||||
// Main content loop starts here
|
||||
for ($index=0;$index < $config[RDFARTICLELIMIT];$index++) {
|
||||
|
||||
$bodytext="";
|
||||
$workfile="$articledir/$articlelist[$index]";
|
||||
$articlefile=fopen ($workfile, "r");
|
||||
|
||||
$headline = chop(fgets($articlefile, 300));
|
||||
// Throw away the first blank line ...
|
||||
$toss = chop(fgets($articlefile, 300));
|
||||
|
||||
while (!feof ($articlefile)) {
|
||||
$oneline = chop(fgets($articlefile, 300));
|
||||
$oneline = preg_replace("|##(.*)#(.*)##|U", "\\1", $oneline);
|
||||
if (preg_match("|^%%|", $oneline)) {
|
||||
$oneline = preg_replace("|%%(.*)%%|U", "<image: \\1>", $oneline);
|
||||
}
|
||||
if (!$oneline) { // Only export the first paragraph
|
||||
break;
|
||||
}
|
||||
$oneline = $oneline." ";
|
||||
$bodytext = $bodytext.$oneline;
|
||||
$bodytext = strip_tags("$bodytext");
|
||||
$link=$config[URL].$switchchar."showentry=".$articlelist[$index];
|
||||
}
|
||||
print "\t<item>\n";
|
||||
print "\t\t<title>$headline</title>\n";
|
||||
print "\t\t<description>$bodytext</description>\n";
|
||||
print "\t\t<link><![CDATA[$link]]></link>\n";
|
||||
print "\t</item>\n\n";
|
||||
|
||||
fclose ($articlefile);
|
||||
} // Main content loop ends
|
||||
print "</channel>\n</rss>";
|
||||
}
|
||||
?>
|
111
minclude/rss-import.inc
Normal file
111
minclude/rss-import.inc
Normal file
|
@ -0,0 +1,111 @@
|
|||
<?php
|
||||
// Stuff for RDF parsing - based on code originally from
|
||||
// http://www.phpbuilder.com/columns/joe20000907.php3
|
||||
|
||||
function startElement($parser, $name, $attrs=''){
|
||||
|
||||
global $open_tags, $current_tag, $initem, $index;
|
||||
$current_tag = $name;
|
||||
|
||||
switch($name){
|
||||
case 'ITEM':
|
||||
$initem=1;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function endElement($parser, $name, $attrs=''){
|
||||
|
||||
global $close_tags, $current_tag, $initem, $index;
|
||||
|
||||
switch($name){
|
||||
case 'ITEM':
|
||||
$index++;
|
||||
$initem = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function characterData($parser, $data) {
|
||||
|
||||
global $current_tag, $initem, $links, $titles, $channelurl, $channeltitle, $index;
|
||||
switch($current_tag){
|
||||
case 'TITLE':
|
||||
if (!$initem && chop($data) != "") {
|
||||
$channeltitle = $data;
|
||||
}
|
||||
else {
|
||||
$titles[$index] = $data;
|
||||
}
|
||||
$current_tag = '';
|
||||
break;
|
||||
|
||||
case 'LINK':
|
||||
if ($initem) {
|
||||
$links[$index] = $data;
|
||||
}
|
||||
else {
|
||||
$channelurl = $data;
|
||||
}
|
||||
$current_tag = '';
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function grab_headlines($xml_file) {
|
||||
global $index, $channeltitle, $channelurl, $links, $titles;
|
||||
|
||||
$index=0;
|
||||
|
||||
$xml_parser = make_xml_parser("characterData", "startElement","endElement");
|
||||
|
||||
//$xml_parser = xml_parser_create("UTF-8");
|
||||
//xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, true);
|
||||
//xml_parser_set_option($xml_parser, XML_OPTION_TARGET_ENCODING, 'UTF-8');
|
||||
//if (!xml_set_element_handler($xml_parser, 'startElement','endElement')){
|
||||
// die("Failed to set element handler!\n");
|
||||
// }
|
||||
//xml_set_character_data_handler($xml_parser, 'characterData');
|
||||
|
||||
|
||||
if (!($fp = fopen($xml_file, 'r'))) {
|
||||
die("Could not open $xml_file for parsing!\n");
|
||||
}
|
||||
|
||||
|
||||
// loop through the file and parse baby!
|
||||
while ($data = fread($fp, 4096)) {
|
||||
if (!($data = utf8_encode($data))) {
|
||||
echo 'ERROR'."\n";
|
||||
}
|
||||
|
||||
if (!xml_parse($xml_parser, $data, feof($fp))) {
|
||||
die(sprintf( "XML error: %s at line %d\n\n",
|
||||
xml_error_string(xml_get_error_code($xml_parser)),
|
||||
xml_get_current_line_number($xml_parser)));
|
||||
}
|
||||
}
|
||||
//if (sizeof($titles) > $limit
|
||||
//Output the title of the Channel ($channelname, $channelurl)
|
||||
print"<p class=\"menusubhead\"><a href=\"$channelurl\">$channeltitle</a></p>\n";
|
||||
//Output the links ($links[x], $titles[x])
|
||||
|
||||
for ($count=0;$count<$index;$count++) {
|
||||
if ($links[$count] == "" || $links[$count] == "\n") {
|
||||
$links[$count] = $channelurl;
|
||||
}
|
||||
print"<p class=\"menuoption\"><a href=\"$links[$count]\" class=\"linkurl\">$titles[$count]</a>\n";
|
||||
}
|
||||
xml_parser_free($xml_parser);
|
||||
}
|
||||
|
||||
?>
|
10
mindong/content/2001032600.txt
Normal file
10
mindong/content/2001032600.txt
Normal file
|
@ -0,0 +1,10 @@
|
|||
Generic Entry
|
||||
|
||||
You just write stuff in files like this, you know? I keep them named after
|
||||
dates (might make it easier to build archives later). Highest numbers are
|
||||
at the top of the page.
|
||||
|
||||
Here's a ##stupid link#http://www.grouse.net.au/~mike/allyourbase.swf## to
|
||||
click on, which demonstrates the link shorthand. Of course, there's
|
||||
nothing stopping you from doing it <a href="http://www.very.net">the
|
||||
usual way</a>.
|
8
mindong/content/2001032601.txt
Normal file
8
mindong/content/2001032601.txt
Normal file
|
@ -0,0 +1,8 @@
|
|||
Some Limitations
|
||||
|
||||
A single line shouldn't be more than 300 characters. If you're using URL
|
||||
shorthand, keep each link together on one line. Multiple shorthand links
|
||||
on one line are just fine though.
|
||||
|
||||
There are undoubtably bugs. ##mail me#mailto:mike@grouse.net.au## about
|
||||
them.
|
8
mindong/content/2001032700.txt
Normal file
8
mindong/content/2001032700.txt
Normal file
|
@ -0,0 +1,8 @@
|
|||
Oh Yeah
|
||||
|
||||
One other thing ... the "navbar" file does nothing yet. The links on the
|
||||
top navbar are hard-coded in index.php3, so if you want the top links to
|
||||
work, edit it.
|
||||
|
||||
The "sidebar" directory has only one relevant file in it right now, and
|
||||
that's "links". Read it. It's obvious. Other stuff may go in there later.
|
6
mindong/content/2001032701.txt
Normal file
6
mindong/content/2001032701.txt
Normal file
|
@ -0,0 +1,6 @@
|
|||
RDF Headlines
|
||||
|
||||
I'm having some productive lunchbreaks.
|
||||
|
||||
Hacked in some code to support RDF headline imports in the sidebar. Hooray
|
||||
for Other People's Content!
|
7
mindong/content/2001032702.txt
Normal file
7
mindong/content/2001032702.txt
Normal file
|
@ -0,0 +1,7 @@
|
|||
Tidier
|
||||
|
||||
OK, I've tidied things up a bit. Styles are now all in dong.css, the
|
||||
sidebar headlines now pull the site name from the channel definition and
|
||||
the navbar gets content from blog/navbar like it's supposed to.
|
||||
|
||||
Have a dig around. Go on.
|
19
mindong/content/2001032900.txt
Normal file
19
mindong/content/2001032900.txt
Normal file
|
@ -0,0 +1,19 @@
|
|||
RDF Fun
|
||||
|
||||
OK, Minimalist Dong can now do RDF Channel exports. How's that for a quick
|
||||
hack? To get the XML dump of a Dong, just add ?mode=rdf to the url. For
|
||||
example: ##http://www.grouse.net.au/~mike/index.php3?mode=rdf#http://www.grouse.net.au/~mike/index.php3?mode=rdf##
|
||||
will get you the RDF dump of the Minimalist Dong home page.
|
||||
|
||||
Something kind of neat that occured to me last night is that with this
|
||||
feature, you could 'nest' multiple Dongs. One could become an index page,
|
||||
with links in the sidebar to a sub-page, created by just adding the sub
|
||||
page's RDF channel.
|
||||
|
||||
I'm probably explaining it badly. But I think it's a neat thing, and I'll
|
||||
try and get it straight in my head later.
|
||||
|
||||
Proper documentation of Minimalist Dong is getting important. I'll forget
|
||||
how to do things soon. But there's one major feature to work in, which
|
||||
will change a lot of the config files around. That first, <em>then</em>
|
||||
the documentation.
|
5
mindong/content/2001040200.txt
Normal file
5
mindong/content/2001040200.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
Configuration
|
||||
|
||||
Wow. XML config file. Multiple content sets from one codebase. Nifty.
|
||||
|
||||
Documentation real soon now. I promise. :)
|
10
mindong/content/2001040800.txt
Normal file
10
mindong/content/2001040800.txt
Normal file
|
@ -0,0 +1,10 @@
|
|||
Almost There
|
||||
|
||||
Minimalist Dong, as of 0.7, is almost feature-complete.
|
||||
|
||||
Now that navigation through historical entries is possible, all that needs
|
||||
to be done is tweaks of the mechanics of the system, and some tidying up
|
||||
of the includes system.
|
||||
|
||||
Not to mention tidying up of some of the code ... don't go looking into
|
||||
config.inc if you've just had breakfast.
|
2
mindong/sidebar/links
Normal file
2
mindong/sidebar/links
Normal file
|
@ -0,0 +1,2 @@
|
|||
Grouse!
|
||||
http://www.grouse.net.au/
|
2
mindong/sidebar/rdfsources
Normal file
2
mindong/sidebar/rdfsources
Normal file
|
@ -0,0 +1,2 @@
|
|||
http://www.grouse.net.au/rdf.php3
|
||||
http://www.brunching.com/brunching.rdf
|
Loading…
Add table
Add a link
Reference in a new issue