2000-07-13 13:30:44 +00:00
< ?
2000-05-18 19:52:00 +00:00
2000-06-16 13:45:57 +00:00
function submit_enter () {
2001-01-21 19:41:11 +00:00
global $anonymous , $allowed_html , $theme , $user ;
2000-06-16 13:45:57 +00:00
2000-12-30 11:58:14 +00:00
// Guidlines:
2000-12-29 11:00:56 +00:00
$output .= " <P>Got some news or some thoughts you would like to share? Fill out this form and they will automatically get whisked away to our submission queue where our moderators will frown at it, poke at it and hopefully post it. Every registered user is automatically a moderator and can vote whether or not your sumbission should be carried to the front page for discussion.</P> \n " ;
$output .= " <P>Note that we do not revamp or extend your submission so it is up to you to make sure your submission is well-written: if you don't care enough to be clear and complete, your submission is likely to be moderated down by our army of moderators. Try to be complete, aim for clarity, organize and structure your text, and try to carry out your statements with examples. It is also encouraged to extend your submission with arguments that flow from your unique intellectual capability and experience: offer some insight or explanation as to why you think your submission is interesting. Make sure your submission has some meat on it!</P> \n " ;
$output .= " <P>However, if you have bugs to report, complaints, personal questions or anything besides a public submission, we would prefer you to mail us instead, or your message is likely to get lost.</P><BR> \n " ;
2000-06-20 07:33:17 +00:00
2000-12-30 11:58:14 +00:00
// Submission form:
2000-06-16 13:45:57 +00:00
$output .= " <FORM ACTION= \" submit.php \" METHOD= \" post \" > \n " ;
2000-05-18 19:52:00 +00:00
2000-06-16 13:45:57 +00:00
$output .= " <P> \n <B>Your name:</B><BR> \n " ;
2000-10-24 07:24:24 +00:00
$output .= format_username ( $user -> userid );
2000-06-16 13:45:57 +00:00
$output .= " </P> \n " ;
$output .= " <P> \n " ;
$output .= " <B>Subject:</B><BR> \n " ;
Over the last 2 days I redid and reorganized an afwul lot of code and
made quite a lot of additions. The most remarkable addition is the
diary server, which I slapped together in less then 40 minutes. Most
of the other changes are however `unvisible' for the user but add much
value to a better maintainability from a developer's objective. Like
always, I fixed quite a number of small bugs that creeped into the code
so we should have a bigger, better and more stable drop.org.
Unfortunatly, some theme update _are_ required:
REQUIRED THEME UPDATES:
=======================
* use format_username() where usernames are used
* use format_date() where timestamps/dates are used
* use format_email() where e-mail addresses are displayed
* use format_url() where url are displayed
* replace 'formatTimestamp' with format_date
* replace 'morelink_*' with 'display_morelink'
[most of these functions are in function.inc or template.inc]
___PLEASE___ (<- this should get your attention ;) update your themes
as soon as possible - it only takes 30 min. to get in sync with the
other themes. Don't start whining about the fact you don't know what
to change ... either eat the source cookie, or ask me to elaborate on
a few changes. Just let me know what's puzzling you and I'll try to
help you out!
TODO LIST FOR NEXT WEEK
=======================
* Add checks for max. text length in textarea's? Is there an HMTL
attribute for this or ...?
* Comment moderation + mojo
* Edit/admin user accounts: block, delete, change permissions, ...
* E-mail password, change password, change e-mail address -> extra
checks and routines to validate such `special' changes.
* Input checking - input filter: bad words, html tags, ...
2000-09-11 07:45:22 +00:00
$output .= " <INPUT TYPE= \" text \" NAME= \" subject \" SIZE= \" 50 \" MAXLENGTH= \" 60 \" ><BR> \n " ;
2000-06-16 13:45:57 +00:00
$output .= " <SMALL><I>Bad subjects are 'Check this out!' or 'An article'. Be descriptive, clear and simple!</I></SMALL> \n " ;
$output .= " </P> \n " ;
2001-01-21 19:41:11 +00:00
$output .= " <P><B>Section:</B><BR> \n " ;
$output .= " <SELECT NAME= \" section \" > \n " ;
foreach ( $sections = section_get () as $value ) $output .= " <OPTION VALUE= \" $value\ " > $value </ OPTION > \n " ;
2000-06-16 13:45:57 +00:00
$output .= " </SELECT> \n " ;
$output .= " </P> \n " ;
$output .= " <P> \n " ;
$output .= " <B>Abstract:</B><BR> \n " ;
Over the last 2 days I redid and reorganized an afwul lot of code and
made quite a lot of additions. The most remarkable addition is the
diary server, which I slapped together in less then 40 minutes. Most
of the other changes are however `unvisible' for the user but add much
value to a better maintainability from a developer's objective. Like
always, I fixed quite a number of small bugs that creeped into the code
so we should have a bigger, better and more stable drop.org.
Unfortunatly, some theme update _are_ required:
REQUIRED THEME UPDATES:
=======================
* use format_username() where usernames are used
* use format_date() where timestamps/dates are used
* use format_email() where e-mail addresses are displayed
* use format_url() where url are displayed
* replace 'formatTimestamp' with format_date
* replace 'morelink_*' with 'display_morelink'
[most of these functions are in function.inc or template.inc]
___PLEASE___ (<- this should get your attention ;) update your themes
as soon as possible - it only takes 30 min. to get in sync with the
other themes. Don't start whining about the fact you don't know what
to change ... either eat the source cookie, or ask me to elaborate on
a few changes. Just let me know what's puzzling you and I'll try to
help you out!
TODO LIST FOR NEXT WEEK
=======================
* Add checks for max. text length in textarea's? Is there an HMTL
attribute for this or ...?
* Comment moderation + mojo
* Edit/admin user accounts: block, delete, change permissions, ...
* E-mail password, change password, change e-mail address -> extra
checks and routines to validate such `special' changes.
* Input checking - input filter: bad words, html tags, ...
2000-09-11 07:45:22 +00:00
$output .= " <TEXTAREA WRAP= \" virtual \" COLS= \" 50 \" ROWS= \" 10 \" NAME= \" abstract \" MAXLENGTH= \" 20 \" ></TEXTAREA><BR> \n " ;
2000-10-02 07:32:17 +00:00
$output .= " <SMALL><I>Allowed HTML tags: " . htmlspecialchars ( $allowed_html ) . " .</I></SMALL> \n " ;
2000-06-16 13:45:57 +00:00
$output .= " </P> \n " ;
$output .= " <P> \n " ;
$output .= " <B>Extended story:</B><BR> \n " ;
2000-09-04 16:14:46 +00:00
$output .= " <TEXTAREA WRAP= \" virtual \" COLS= \" 50 \" ROWS= \" 15 \" NAME= \" article \" ></TEXTAREA><BR> \n " ;
2000-10-02 07:32:17 +00:00
$output .= " <SMALL><I>Allowed HTML tags: " . htmlspecialchars ( $allowed_html ) . " .</I></SMALL> \n " ;
2000-06-16 13:45:57 +00:00
$output .= " </P> \n " ;
2000-05-18 19:52:00 +00:00
2000-06-16 13:45:57 +00:00
$output .= " <P> \n " ;
2001-01-13 09:41:44 +00:00
$output .= " <SMALL><I>You must preview at least once before you can submit:</I></SMALL><BR> \n " ;
Over the last 2 days I redid and reorganized an afwul lot of code and
made quite a lot of additions. The most remarkable addition is the
diary server, which I slapped together in less then 40 minutes. Most
of the other changes are however `unvisible' for the user but add much
value to a better maintainability from a developer's objective. Like
always, I fixed quite a number of small bugs that creeped into the code
so we should have a bigger, better and more stable drop.org.
Unfortunatly, some theme update _are_ required:
REQUIRED THEME UPDATES:
=======================
* use format_username() where usernames are used
* use format_date() where timestamps/dates are used
* use format_email() where e-mail addresses are displayed
* use format_url() where url are displayed
* replace 'formatTimestamp' with format_date
* replace 'morelink_*' with 'display_morelink'
[most of these functions are in function.inc or template.inc]
___PLEASE___ (<- this should get your attention ;) update your themes
as soon as possible - it only takes 30 min. to get in sync with the
other themes. Don't start whining about the fact you don't know what
to change ... either eat the source cookie, or ask me to elaborate on
a few changes. Just let me know what's puzzling you and I'll try to
help you out!
TODO LIST FOR NEXT WEEK
=======================
* Add checks for max. text length in textarea's? Is there an HMTL
attribute for this or ...?
* Comment moderation + mojo
* Edit/admin user accounts: block, delete, change permissions, ...
* E-mail password, change password, change e-mail address -> extra
checks and routines to validate such `special' changes.
* Input checking - input filter: bad words, html tags, ...
2000-09-11 07:45:22 +00:00
$output .= " <INPUT TYPE= \" submit \" NAME= \" op \" VALUE= \" Preview submission \" > \n " ;
2000-06-16 13:45:57 +00:00
$output .= " </P> \n " ;
2000-05-18 19:52:00 +00:00
2000-06-16 13:45:57 +00:00
$output .= " </FORM> \n " ;
$theme -> header ();
$theme -> box ( " Submit a story " , $output );
$theme -> footer ();
2000-05-18 19:52:00 +00:00
}
2001-01-21 19:41:11 +00:00
function submit_preview ( $subject , $abstract , $article , $section ) {
global $allowed_html , $theme , $user ;
2000-06-05 15:59:06 +00:00
2000-11-02 09:23:07 +00:00
include " includes/story.inc " ;
2000-06-16 13:45:57 +00:00
$output .= " <FORM ACTION= \" submit.php \" METHOD= \" post \" > \n " ;
$output .= " <P> \n " ;
$output .= " <B>Your name:</B><BR> \n " ;
2000-10-24 07:24:24 +00:00
$output .= format_username ( $user -> userid );
2000-06-16 13:45:57 +00:00
$output .= " </P> \n " ;
$output .= " <P> \n " ;
$output .= " <B>Subject:</B><BR> \n " ;
2001-01-13 08:29:50 +00:00
$output .= " <INPUT TYPE= \" text \" NAME= \" subject \" SIZE= \" 50 \" MAXLENGTH= \" 60 \" VALUE= \" " . check_output ( check_textfield ( $subject )) . " \" ><BR> \n " ;
2000-06-16 13:45:57 +00:00
$output .= " <SMALL><I>Bad subjects are 'Check this out!' or 'An article'. Be descriptive, clear and simple!</I></SMALL> \n " ;
$output .= " </P> \n " ;
2001-01-21 19:41:11 +00:00
$output .= " <P><B>Section:</B><BR> \n " ;
$output .= " <SELECT NAME= \" section \" > \n " ;
foreach ( $sections = section_get () as $value ) $output .= " <OPTION VALUE= \" $value\ " " . ( $section == $value ? " SELECTED " : " " ) . " > $value </ OPTION > \n " ;
2000-06-16 13:45:57 +00:00
$output .= " </SELECT> \n " ;
$output .= " </P> \n " ;
$output .= " <P> \n " ;
$output .= " <B>Abstract:</B><BR> \n " ;
2001-01-13 08:29:50 +00:00
$output .= " <TEXTAREA WRAP= \" virtual \" COLS= \" 50 \" ROWS= \" 10 \" NAME= \" abstract \" > " . check_textarea ( $abstract ) . " </TEXTAREA><BR> \n " ;
2000-10-02 07:32:17 +00:00
$output .= " <SMALL><I>Allowed HTML tags: " . htmlspecialchars ( $allowed_html ) . " .</I></SMALL> \n " ;
2000-06-16 13:45:57 +00:00
$output .= " </P> \n " ;
$output .= " <P> \n " ;
$output .= " <B>Extended story:</B><BR> \n " ;
2001-01-13 08:29:50 +00:00
$output .= " <TEXTAREA WRAP= \" virtual \" COLS= \" 50 \" ROWS= \" 15 \" NAME= \" article \" > " . check_textarea ( $article ) . " </TEXTAREA><BR> \n " ;
2000-10-02 07:32:17 +00:00
$output .= " <SMALL><I>Allowed HTML tags: " . htmlspecialchars ( $allowed_html ) . " .</I></SMALL> \n " ;
2000-06-16 13:45:57 +00:00
$output .= " </P> \n " ;
IMPORANT - IMPORTANT - :)
=========================
Wulp. I did a major upgrade by (a) breaking a lot of stuff and (b) by
re-doing those things in a much better way. I redesigned the stories
and submissions SQL tables, the way they work and the way they co-
operate together.
In addition, I changed the way parameters are passed to
$theme->abstract() and $theme->article(). Instead of passing a
sh!tload of parameters that only cluttered the code and required too
much pre-processing on the engine-side, we now pass a singly object
$story. $story has more variables then the paramaters we used to pass,
so it allows for better theming (if you feel like it).
I'm not finished yet but I decided to upload my changes so you can
start patching and updating your themes: PLEASE update your themes
ASAP! I don't plan making heavy changes like this again, so don't
get intimiated. ;) You mainly have to update article() and abstract()
as well as a minor update of footer():
article(), abstract():
----------------------
- use the $story object - see my theme!
- the morelink can now be themed. Currently you can use the function
morelink_bytes() in function.inc to `render' the old morelink. The
idea is to make a morelink_words() or morelink_lines() sooner or
later because "188 bytes in body" is not half as clear as "52 words
in body". Clearly, "52 words" is much more informative. ;-)
footer():
---------
- in the article-part, you need to update the displayRelatedLinks():
instead of passing it $sid, you need to pass it $story (after you
globaled $story).
Everything should display correct on the following pages:
- main page
- article page (follow a `read more | xxx bytes in bdoy | x comments' link)
- submission queue
Check if they work with your theme: they should as they work fine for
me (theme `Dries') ... If you got stuck, just look at my theme or ask
for a hand on the list!
Hopefully you can update your themes asap. Thanks in advance.
2000-06-21 15:41:20 +00:00
if ( empty ( $subject )) {
$output .= " <P> \n " ;
$output .= " <FONT COLOR= \" red \" ><B>Warning:</B></FONT> you did not supply a <U>subject</U>. \n " ;
$outout .= " </P> \n " ;
$output .= " <P> \n " ;
$output .= " <INPUT TYPE= \" submit \" NAME= \" op \" VALUE= \" Preview submission \" > \n " ;
$output .= " </P> \n " ;
}
else if ( empty ( $abstract )) {
$output .= " <P> \n " ;
$output .= " <FONT COLOR= \" red \" ><B>Warning:</B></FONT> you did not supply an <U>abstract</U>. \n " ;
$outout .= " </P> \n " ;
$output .= " <P> \n " ;
$output .= " <INPUT TYPE= \" submit \" NAME= \" op \" VALUE= \" Preview submission \" > \n " ;
$output .= " </P> \n " ;
}
2001-01-21 19:41:11 +00:00
else {
IMPORANT - IMPORTANT - :)
=========================
Wulp. I did a major upgrade by (a) breaking a lot of stuff and (b) by
re-doing those things in a much better way. I redesigned the stories
and submissions SQL tables, the way they work and the way they co-
operate together.
In addition, I changed the way parameters are passed to
$theme->abstract() and $theme->article(). Instead of passing a
sh!tload of parameters that only cluttered the code and required too
much pre-processing on the engine-side, we now pass a singly object
$story. $story has more variables then the paramaters we used to pass,
so it allows for better theming (if you feel like it).
I'm not finished yet but I decided to upload my changes so you can
start patching and updating your themes: PLEASE update your themes
ASAP! I don't plan making heavy changes like this again, so don't
get intimiated. ;) You mainly have to update article() and abstract()
as well as a minor update of footer():
article(), abstract():
----------------------
- use the $story object - see my theme!
- the morelink can now be themed. Currently you can use the function
morelink_bytes() in function.inc to `render' the old morelink. The
idea is to make a morelink_words() or morelink_lines() sooner or
later because "188 bytes in body" is not half as clear as "52 words
in body". Clearly, "52 words" is much more informative. ;-)
footer():
---------
- in the article-part, you need to update the displayRelatedLinks():
instead of passing it $sid, you need to pass it $story (after you
globaled $story).
Everything should display correct on the following pages:
- main page
- article page (follow a `read more | xxx bytes in bdoy | x comments' link)
- submission queue
Check if they work with your theme: they should as they work fine for
me (theme `Dries') ... If you got stuck, just look at my theme or ask
for a hand on the list!
Hopefully you can update your themes asap. Thanks in advance.
2000-06-21 15:41:20 +00:00
$output .= " <P> \n " ;
2000-11-13 08:17:45 +00:00
$output .= " <INPUT TYPE= \" submit \" NAME= \" op \" VALUE= \" Preview submission \" > \n " ;
$output .= " <INPUT TYPE= \" submit \" NAME= \" op \" VALUE= \" Submit submission \" > \n " ;
IMPORANT - IMPORTANT - :)
=========================
Wulp. I did a major upgrade by (a) breaking a lot of stuff and (b) by
re-doing those things in a much better way. I redesigned the stories
and submissions SQL tables, the way they work and the way they co-
operate together.
In addition, I changed the way parameters are passed to
$theme->abstract() and $theme->article(). Instead of passing a
sh!tload of parameters that only cluttered the code and required too
much pre-processing on the engine-side, we now pass a singly object
$story. $story has more variables then the paramaters we used to pass,
so it allows for better theming (if you feel like it).
I'm not finished yet but I decided to upload my changes so you can
start patching and updating your themes: PLEASE update your themes
ASAP! I don't plan making heavy changes like this again, so don't
get intimiated. ;) You mainly have to update article() and abstract()
as well as a minor update of footer():
article(), abstract():
----------------------
- use the $story object - see my theme!
- the morelink can now be themed. Currently you can use the function
morelink_bytes() in function.inc to `render' the old morelink. The
idea is to make a morelink_words() or morelink_lines() sooner or
later because "188 bytes in body" is not half as clear as "52 words
in body". Clearly, "52 words" is much more informative. ;-)
footer():
---------
- in the article-part, you need to update the displayRelatedLinks():
instead of passing it $sid, you need to pass it $story (after you
globaled $story).
Everything should display correct on the following pages:
- main page
- article page (follow a `read more | xxx bytes in bdoy | x comments' link)
- submission queue
Check if they work with your theme: they should as they work fine for
me (theme `Dries') ... If you got stuck, just look at my theme or ask
for a hand on the list!
Hopefully you can update your themes asap. Thanks in advance.
2000-06-21 15:41:20 +00:00
$output .= " </P> \n " ;
}
2000-06-16 13:45:57 +00:00
$output .= " </FORM> \n " ;
$theme -> header ();
2001-01-21 19:41:11 +00:00
$theme -> article ( new Story ( $user -> userid , $subject , $abstract , $article , $section , time ()));
2000-06-16 13:45:57 +00:00
$theme -> box ( " Submit a story " , $output );
$theme -> footer ();
2000-05-18 19:52:00 +00:00
}
2001-01-21 19:41:11 +00:00
function submit_submit ( $subject , $abstract , $article , $section ) {
2000-07-12 07:15:09 +00:00
global $user , $theme ;
2000-05-18 19:52:00 +00:00
2000-12-30 11:58:14 +00:00
// Add log entry:
2001-01-07 19:21:28 +00:00
watchdog ( " story " , " story: added ' $subject ' " );
2000-11-13 08:17:45 +00:00
2000-12-30 11:58:14 +00:00
// Add submission to SQL table:
2001-01-21 19:41:11 +00:00
db_query ( " INSERT INTO stories (author, subject, abstract, article, section, timestamp) VALUES (' $user->id ', ' " . check_input ( $subject ) . " ', ' " . check_input ( $abstract ) . " ', ' " . check_input ( $article ) . " ', ' " . check_input ( $section ) . " ', ' " . time () . " ') " );
IMPORANT - IMPORTANT - :)
=========================
Wulp. I did a major upgrade by (a) breaking a lot of stuff and (b) by
re-doing those things in a much better way. I redesigned the stories
and submissions SQL tables, the way they work and the way they co-
operate together.
In addition, I changed the way parameters are passed to
$theme->abstract() and $theme->article(). Instead of passing a
sh!tload of parameters that only cluttered the code and required too
much pre-processing on the engine-side, we now pass a singly object
$story. $story has more variables then the paramaters we used to pass,
so it allows for better theming (if you feel like it).
I'm not finished yet but I decided to upload my changes so you can
start patching and updating your themes: PLEASE update your themes
ASAP! I don't plan making heavy changes like this again, so don't
get intimiated. ;) You mainly have to update article() and abstract()
as well as a minor update of footer():
article(), abstract():
----------------------
- use the $story object - see my theme!
- the morelink can now be themed. Currently you can use the function
morelink_bytes() in function.inc to `render' the old morelink. The
idea is to make a morelink_words() or morelink_lines() sooner or
later because "188 bytes in body" is not half as clear as "52 words
in body". Clearly, "52 words" is much more informative. ;-)
footer():
---------
- in the article-part, you need to update the displayRelatedLinks():
instead of passing it $sid, you need to pass it $story (after you
globaled $story).
Everything should display correct on the following pages:
- main page
- article page (follow a `read more | xxx bytes in bdoy | x comments' link)
- submission queue
Check if they work with your theme: they should as they work fine for
me (theme `Dries') ... If you got stuck, just look at my theme or ask
for a hand on the list!
Hopefully you can update your themes asap. Thanks in advance.
2000-06-21 15:41:20 +00:00
2000-12-30 11:58:14 +00:00
// Display confirmation message:
2000-05-18 19:52:00 +00:00
$theme -> header ();
2000-12-29 11:00:56 +00:00
$theme -> box ( " Thank you for your submission. " , " Thank you for your submission. Your submission has been whisked away to our submission queue where our registered users will frown at it, poke at it and hopefully carry it to the front page for discussion. " );
2000-05-18 19:52:00 +00:00
$theme -> footer ();
}
2000-12-23 23:25:28 +00:00
include " includes/common.inc " ;
2000-07-12 07:15:09 +00:00
2000-05-18 19:52:00 +00:00
switch ( $op ) {
2000-06-16 13:45:57 +00:00
case " Preview submission " :
2001-01-21 19:41:11 +00:00
submit_preview ( $subject , $abstract , $article , $section );
2000-05-18 19:52:00 +00:00
break ;
2000-06-16 13:45:57 +00:00
case " Submit submission " :
2001-01-21 19:41:11 +00:00
submit_submit ( $subject , $abstract , $article , $section );
2000-05-18 19:52:00 +00:00
break ;
default :
2000-06-16 13:45:57 +00:00
submit_enter ();
2000-05-18 19:52:00 +00:00
break ;
}
2000-11-03 07:57:28 +00:00
?>