Example #1
0
function print_post_box($sid, $cid, $pid, $qid, $subject, $body, $coward)
{
    global $auth_zid;
    writeln('<form method="post">');
    if ($sid != 0) {
        writeln('<input type="hidden" name="sid" value="' . $sid . '"/>');
    }
    if ($cid != 0) {
        writeln('<input type="hidden" name="cid" value="' . $cid . '"/>');
    }
    if ($pid != 0) {
        writeln('<input type="hidden" name="pid" value="' . $pid . '"/>');
    }
    if ($qid != 0) {
        writeln('<input type="hidden" name="qid" value="' . $qid . '"/>');
    }
    writeln('<div class="dialog_title">Post Comment</div>');
    writeln('<div class="dialog_body">');
    writeln('<table class="fill">');
    writeln('	<tr>');
    writeln('		<td style="width: 80px">Subject</td>');
    writeln('		<td colspan="2"><input name="subject" type="text" value="' . $subject . '" required="required"/></td>');
    writeln('	</tr>');
    writeln('	<tr>');
    writeln('		<td style="width: 80px; vertical-align: top; padding-top: 12px">Comment</td>');
    writeln('		<td colspan="2"><textarea name="comment" style="height: 120px" required="required">' . $body . '</textarea></td>');
    writeln('	</tr>');
    writeln('	<tr>');
    if ($auth_zid == "") {
        $question = captcha_challenge();
        writeln('		<td>Captcha</td>');
        writeln('		<td><table><tr><td>' . $question . '</td><td><input name="answer" type="text" style="margin-left: 8px; width: 100px"/></td></tr></table></td>');
    } else {
        writeln('		<td></td>');
        writeln('		<td><label><input name="coward" type="checkbox"' . ($coward ? ' checked="checked"' : '') . '/>Post Anonymously</label></td>');
    }
    writeln('		<td class="right"><input name="post" type="submit" value="Post"/> <input name="preview" type="submit" value="Preview"/></td>');
    writeln('	</tr>');
    writeln('</table>');
    writeln('</div>');
    writeln('</form>');
}
Example #2
0
function print_submit_box($title, $body, $story, $tid, $preview)
{
    global $auth_zid;
    global $auth_user;
    print_header("Submit Story");
    writeln('<table class="fill">');
    writeln('<tr>');
    writeln('<td class="left_col">');
    print_left_bar("main", "pipe");
    writeln('</td>');
    writeln('<td class="fill">');
    if ($preview) {
        $a["zid"] = $auth_zid;
        $topic = db_get_rec("topic", $tid);
        $a["title"] = $title;
        $a["topic"] = $topic["topic"];
        $a["icon"] = $topic["icon"];
        $a["story"] = $story;
        writeln('<h1>Preview</h1>');
        writeln('<p>Check your links before you post!</p>');
        print_article($a);
    }
    writeln('<form method="post">');
    writeln('<div class="dialog_title">Submit Story</div>');
    writeln('<div class="dialog_body">');
    writeln('<table class="fill" style="padding: 0px">');
    writeln('	<tr>');
    writeln('		<td style="width: 80px">Title</td>');
    writeln('		<td colspan="2"><input name="title" type="text" value="' . $title . '" required="required"/></td>');
    writeln('	</tr>');
    writeln('	<tr>');
    writeln('		<td style="width: 80px">Topic</td>');
    writeln('		<td colspan="2">');
    writeln('			<select name="tid">');
    $topics = db_get_list("topic", "topic", array("promoted" => 1));
    $k = array_keys($topics);
    for ($i = 0; $i < count($topics); $i++) {
        $topic = $topics[$k[$i]];
        if ($topic["tid"] == $tid) {
            writeln('				<option value="' . $topic["tid"] . '" selected="selected">' . $topic["topic"] . '</option>');
        } else {
            writeln('				<option value="' . $topic["tid"] . '">' . $topic["topic"] . '</option>');
        }
    }
    writeln('			</select>');
    writeln('		</td>');
    writeln('	</tr>');
    writeln('	<tr>');
    writeln('		<td style="width: 80px; vertical-align: top; padding-top: 12px">Story</td>');
    writeln('		<td colspan="2"><textarea name="story" style="height: 200px" required="required">' . $body . '</textarea></td>');
    writeln('	</tr>');
    writeln('	<tr>');
    $question = captcha_challenge();
    writeln('		<td>Captcha</td>');
    writeln('		<td><table><tr><td>' . $question . '</td><td><input name="answer" type="text" style="margin-left: 8px; width: 100px"/></td></tr></table></td>');
    writeln('		<td class="right"><input type="submit" value="Submit"/> <input name="preview" type="submit" value="Preview"/></td>');
    writeln('	</tr>');
    writeln('</table>');
    writeln('</div>');
    writeln('</form>');
    writeln('</td>');
    writeln('</tr>');
    writeln('</table>');
    print_footer();
}
Example #3
0
					<td><input name="username" type="text" placeholder="Only a-z,0-9" required="required"/></td>
				</tr>
				<tr>
					<td style="text-align: right">Email</td>
					<td><input name="mail_1" type="email" size="40" required="required"/></td>
				</tr>
				<tr>
					<td style="text-align: right">Email (again)</td>
					<td><input name="mail_2" type="email" size="40" required="required"/></td>
				</tr>
			</table>
		</td>
		<td style="vertical-align: top">
			<table>
				<tr>
					<td><h3>Prove yourself:</h3></td>
				</tr>
				<tr>
					<td><table><tr><td><?php 
echo captcha_challenge();
?>
</td><td><input name="answer" type="text"/></td></tr></table></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<input type="submit" value="Create"/>
<?php 
writeln('</form>');
print_footer();