if ($fields['filelocal'] == "1") { $tempurl = $settings['url'] . "/pod/" . $fields['audio_file']; } else { $tempurl = $settings['url'] . "/pod/" . $tempurl; } } if (!isset($_GET['post']) or $_GET['post'] == "1") { //start building the item echo "\n\n<item>\n"; //some important general stuff echo " <pubDate>" . date("r", strtotime($fields['posted'])) . "</pubDate>\n"; echo " <title>" . html_to_xml($fields['title']) . "</title>\n"; echo " <link>" . $settings['url'] . "/index.php?id=" . $fields['id'] . "</link>\n"; echo " <guid>" . $settings['url'] . "/index.php?id=" . $fields['id'] . "</guid>\n"; //author $postauthor = html_to_xml(getfullname($fields['author_id'])); if (veryempty($postauthor)) { $postauthor = html_to_xml(getnickname($fields['author_id'])); } echo " <dc:creator>" . $postauthor . "</dc:creator>\n"; echo " <itunes:author>" . $postauthor . "</itunes:author>\n"; //explicit or not? if ($settings['itunes_explicit'] == "1") { $setexpl = "yes"; } else { $setexpl = "no"; } echo " <itunes:explicit>" . $setexpl . "</itunes:explicit>\n"; //comments if ($fields['comment_on'] == "1") { echo " <comments>" . $settings['url'] . "/index.php?id=" . $fields['id'] . "#comments</comments>\n";
//start building the item echo "<item>\n"; //globally unique identifier echo " <guid>" . $settings['url'] . "/index.php?id=" . $fields['id'] . "</guid>\n"; //title echo " <title>" . chars($fields['title']) . "</title>\n"; //link echo " <link>" . $settings['url'] . "/index.php?id=" . $fields['id'] . "</link>\n"; //comments if ($fields['comment_on'] == "1") { echo " <comments>" . $settings['url'] . "/index.php?id=" . $fields['id'] . "#comments</comments>\n"; } //show categories showcats($fields); //author $postauthor = chars(getfullname($fields['author_id'])); echo " <dc:creator>" . $postauthor . "</dc:creator>\n"; echo " <itunes:author>" . $postauthor . "</itunes:author>\n"; //description and summary $desc = chars($fields['message_html']); echo " <description>\n" . $desc . "\n </description>\n"; echo " <itunes:summary>\n" . $desc . "\n </itunes:summary>\n"; //bodytext echo " <content:encoded>\n" . chars($fields['message_html']); //hyperlinks //resetting variable $linkrows = ""; //getting data from links-table $dosql = "SELECT * FROM {$GLOBALS['prefix']}lb_links "; $dosql .= "WHERE posting_id='{$fields['id']}' "; $dosql .= "ORDER BY linkorder ASC;";
function authorfullname() { //returns the full name of the author of a posting (works within postings-loop) global $postings; global $currentid; return getfullname($postings[$currentid]['author_id']); }
/** * send an email when receiving a fresh comment * * @param unknown_type $posting * @param unknown_type $name * @param unknown_type $mail * @param unknown_type $web * @param unknown_type $message */ function notify($posting, $name, $mail, $web, $message) { global $settings; if (empty($mail)) { $mail = "no mail address"; } if (empty($web)) { $web = "no web address"; } $authorid = $posting['author_id']; $to = getfullname($authorid) . " <" . getmail($authorid) . ">"; $subject = "New comment on '" . $settings['sitename'] . "'"; $name = entities_to_chars($name); $mail = entities_to_chars($mail); $web = entities_to_chars($web); $body = $name . " has left a comment for '" . $posting['title'] . "'\n"; $body .= $settings['url'] . "/index.php?id=" . $posting['id'] . "\n\n"; $body .= entities_to_chars(strip_tags($message)) . "\n\n"; $body .= "Name: " . $name; if (!empty($mail)) { $body .= " / eMail: " . $mail; $showmail = $mail; } else { $showmail = getmail($authorid); } if ($web != "http://") { $body .= " / Web: " . $web; } //killing komma and semikolon $name = str_replace(",", " ", $name); $name = str_replace(";", " ", $name); $headers = "From: " . $name . " <" . $showmail . ">\r\n"; mail($to, $subject, $body, $headers); }
if ($fields['category2_id'] != "0") { $tempcats .= urldecode(getcategory($fields['category2_id'])) . ", "; } if ($fields['category3_id'] != "0") { $tempcats .= urldecode(getcategory($fields['category3_id'])) . ", "; } if ($fields['category4_id'] != "0") { $tempcats .= urldecode(getcategory($fields['category4_id'])) . ", "; } //trim the string $tempcats = trim(htmlentities(substr($tempcats, 0, strrpos($tempcats, ",")), ENT_QUOTES, "UTF-8")); if ($tempcats != "") { echo " <dc:subject>{$tempcats}</dc:subject>\n"; } //author echo " <dc:creator>\n" . getfullname($fields['author_id']) . "\n</dc:creator>\n"; //description echo " <description>\n"; echo html_entity_decode(trim(strip_tags($fields['message_html'])), ENT_QUOTES); echo "\n </description>\n"; //bodytext echo " <content:encoded>\n" . trim(htmlspecialchars($fields['message_html'], ENT_QUOTES)); //hyperlinks //getting data from links-table $dosql = "SELECT * FROM {$GLOBALS['prefix']}lb_links "; $dosql .= "WHERE posting_id='{$fields['id']}' "; $dosql .= "ORDER BY linkorder ASC;"; $result = mysql_query($dosql) or die(mysql_error()); $j = 0; while ($linkrows[$j] = mysql_fetch_assoc($result)) { $j += 1;
if ($fields['category2_id'] != "0") { $tempcats .= urldecode(getcategory($fields['category2_id'])) . ", "; } if ($fields['category3_id'] != "0") { $tempcats .= urldecode(getcategory($fields['category3_id'])) . ", "; } if ($fields['category4_id'] != "0") { $tempcats .= urldecode(getcategory($fields['category4_id'])) . ", "; } //trim the string $tempcats = trim(substr($tempcats, 0, strrpos($tempcats, ","))); if ($tempcats != "") { echo " <dc:subject>" . str_replace("&", "&", $tempcats) . "</dc:subject>\n"; } //author echo " <dc:creator>\n" . str_replace("&", "&", getfullname($fields['author_id'])) . "\n</dc:creator>\n"; //description echo " <description>\n"; echo str_replace("&", "&", trim(strip_tags($fields['message_html']))); echo "\n </description>\n"; //bodytext echo " <content:encoded>\n" . trim(htmlspecialchars($fields['message_html'], ENT_QUOTES)); //hyperlinks //getting data from links-table $dosql = "SELECT * FROM {$GLOBALS['prefix']}lb_links "; $dosql .= "WHERE posting_id='{$fields['id']}' "; $dosql .= "ORDER BY linkorder ASC;"; $result = mysql_query($dosql) or die(mysql_error()); $j = 0; while ($linkrows[$j] = mysql_fetch_assoc($result)) { $j += 1;