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 { $writer->write('<link>' . '<url>' . htmlspecialchars(Utils_Unicode::correct($link->url)) . '</url>' . '<title>' . htmlspecialchars(Utils_Unicode::correct($link->title)) . '</title>' . '<feed>' . htmlspecialchars(Utils_Unicode::correct($link->feed)) . '</feed>' . '<registered>' . $link->registered . '</registered>' . '<xfn>' . htmlspecialchars($link->xfn) . '</xfn>' . '</link>'); $writer->write(CRLF); } while ($link->shift()); $link->close(); } $log = new RefererLog(); if ($log->open()) { $writer->write('<logs>'); $writer->write(CRLF); do {