Example #1
0
        $writer->write('</notice>');
        $writer->write(CRLF);
    } while ($notice->shift());
    $notice->close();
}
$keyword = new Keyword();
if ($keyword->open()) {
    do {
        $writer->write('<keyword' . $newlineStyle . '>' . '<id>' . $keyword->id . '</id>' . '<visibility>' . $keyword->visibility . '</visibility>' . '<starred>' . $keyword->starred . '</starred>' . '<name>' . htmlspecialchars(Utils_Unicode::correct($keyword->name)) . '</name>' . '<description editor="' . htmlspecialchars($keyword->descriptionEditor) . '" formatter="' . htmlspecialchars($keyword->descriptionFormatter) . '">' . htmlspecialchars(Utils_Unicode::correct($keyword->description)) . '</description>' . '<published>' . $keyword->published . '</published>' . '<created>' . $keyword->created . '</created>' . '<modified>' . $keyword->modified . '</modified>');
        $writer->write(CRLF);
        if ($attachment = $keyword->getAttachments()) {
            do {
                $writer->write('<attachment' . ' mime="' . htmlspecialchars($attachment->mime) . '"' . ' size="' . $attachment->size . '"' . ' width="' . $attachment->width . '"' . ' height="' . $attachment->height . '"' . '>' . '<name>' . htmlspecialchars($attachment->name) . '</name>' . '<label>' . htmlspecialchars($attachment->label) . '</label>' . '<enclosure>' . ($attachment->enclosure ? 1 : 0) . '</enclosure>' . '<attached>' . $attachment->attached . '</attached>' . '<downloads>' . $attachment->downloads . '</downloads>');
                if ($includeFileContents && file_exists(__TEXTCUBE_ATTACH_DIR__ . "/{$blogid}/{$attachment->name}")) {
                    $writer->write('<content>');
                    Base64Stream::encode(__TEXTCUBE_ATTACH_DIR__ . "/{$blogid}/{$attachment->name}", $writer);
                    $writer->write('</content>');
                }
                $writer->write('</attachment>');
                $writer->write(CRLF);
            } while ($attachment->shift());
            $attachment->close();
        }
        $writer->write('</keyword>');
        $writer->write(CRLF);
    } while ($keyword->shift());
    $keyword->close();
}
$link = new Link();
if ($link->open()) {
    do {