The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Comments |
#1082
|
||||
|
||||
Quote:
|
#1083
|
|||
|
|||
I inspired by Cloud Warrior, I decided it was time to get the latest blog entries on the rest of my site. After an hour of playing around, I have some working code. This code is NOT COMPLETE! You need to manually put in the RDF header information in the code. Please don't try to use it if you aren't comfortable playing with PHP code. If someone wants to fix it up and repost it with an explanation that a noobie could follow, by all means go ahead. My brain is about to quit for the day so I'm not quite up to it.
Added the following section of code to the journal.php file causes journal.php?do=rss will pull the latest entries in RDF format. Code:
// RSS SUPPORT if($_REQUEST['do']=='rss') { $vbulletin->input->clean_array_gpc('r', array( 'type' => TYPE_STR, )); // ATTN Compatibility Code $type =& $vbulletin->GPC['type']; // ATTN Compatibility Code require_once(DIR . '/includes/functions_file.php'); // $journalinfo= $db->query_first("SELECT journalist,journalist_id,journalname,journaldesc FROM " . TABLE_PREFIX . "journals"); $getentries= $db->query("SELECT " . TABLE_PREFIX . "journal_entries.entrytitle, " . TABLE_PREFIX . "journal_entries.entrytext, " . TABLE_PREFIX . "journal_entries.entrydate, " . TABLE_PREFIX . "journal_entries.private, " . TABLE_PREFIX . "journal_entries.entry_id, " . TABLE_PREFIX . "journal_entries.allowedusers, " . TABLE_PREFIX . "journals.journalist FROM " . TABLE_PREFIX . "journal_entries, " . TABLE_PREFIX . "journals WHERE " . TABLE_PREFIX . "journal_entries.entry_active=1 AND " . TABLE_PREFIX . "journal_entries.journal_id = " . TABLE_PREFIX . "journals.journal_id ORDER BY entrydate DESC"); require_once('./includes/class_bbcode.php'); $rss1_header .= "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\r\n\r\n"; $rss1_header .= "<rdf:RDF\r\n"; $rss1_header .= " xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\r\n"; $rss1_header .= " xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\r\n"; $rss1_header .= " xmlns:content=\"http://purl.org/rss/1.0/modules/content/\"\r\n"; $rss1_header .= " xmlns=\"http://purl.org/rss/1.0/\"\r\n"; $rss1_header .= ">\r\n\r\n"; $rss1_header .= "<channel rdf:about=\"".$vbulletin->options['bburl']."/journal.php?do=downloadjournal&j=".$j."&type=rss1\">\r\n"; if ($journalinfo['journalname'] == "") { $journalinfo['journalname'] = $journalinfo['journalist'] . "'s Blog"; } $rss1_header .= "<title>Diabetes Daily Member Blogs: Recently Updated</title>\r\n"; $rss1_header .= "<link>".$vbulletin->options['bburl']."/journal.php?do=showjournal&j=".$j."</link>\r\n"; if (empty($journalinfo['journaldesc'])) { $journalinfo['journaldesc'] = $journalinfo['journalist']."'s Blog at ".$vbulletin->options['bbtitle']; } $rss1_header .= "<description>".htmlspecialchars($journalinfo['journaldesc'])."</description>\r\n\r\n"; $rss1_header .= "<items>\r\n"; $rss1_header .= "\t<rdf:Seq>\r\n"; $totalentries = 0; $previousentry = 0; while($entry= $db->fetch_array($getentries)) { if($entry['private']!=1 AND $previousentry != $entry['entry_id']) { $totalentries++; $parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list()); $entry['entrytext'] = $parser->do_parse($entry['entrytext']); $entry['entrytext']= unhtmlspecialchars(stripslashes($entry['entrytext'])); $entry['entrytext']= ereg_replace("{smilies}", $vbulletin->options['bburl']."/images/smilies", $entry['entrytext']); $entry_short= substr ( $entry['entrytext'], 0, 200); $entry['entrytitle']= stripslashes($entry['entrytitle']); $rss1_header .= "\t\t<rdf:li rdf:resource=\"".$vbulletin->options['bburl']."/journal.php?do=showentry&e=".$entry['entry_id']."\" />\r\n"; $rss1_body .= "\t<item rdf:about=\"".$vbulletin->options['bburl']."/journal.php?do=showentry&e=".$entry['entry_id']."\">\r\n"; $rss1_body .= "\t\t<author>".htmlspecialchars($entry['journalist'])."</author>\r\n"; $rss1_body .= "\t\t<title>".htmlspecialchars($entry['entrytitle'])."</title>\r\n"; $W3CDTFdate = preg_replace("/(\+|\-)([0-9]{2})([0-9]{2})/","$1$2:$3", date("O",$entry['entrydate'])); $rss1_body .= "\t\t<dc:date>".date("Y-m-d",$entry['entrydate'])."T".date("H:i:s",$entry['entrydate']).$W3CDTFdate."</dc:date>\r\n"; $rss1_body .= "\t\t<link>".$vbulletin->options['bburl']."/journal.php?do=showentry&e=".$entry['entry_id']."</link>\r\n"; $rss1_body .= "\t\t<content:encoded><![CDATA[".$entry_short."]]></content:encoded>\r\n"; $rss1_body .= "\t\t<description>".htmlspecialchars(strip_tags($entry_short))."</description>\r\n"; $rss1_body .= "\t</item>\r\n\r\n"; } $previousentry = $entry['entry_id']; if($totalentries=="15") { break; } } $rss1_header .= "\t</rdf:Seq>\r\n"; $rss1_header .= "</items>\r\n\r\n"; $rss1_header .= "</channel>\r\n\r\n"; $rss1_body .= "</rdf:RDF>"; $filestring = utf8_encode($rss1_header.$rss1_body); $filename = "$journalinfo[journalist]_blog_".vbdate($vbulletin->options['dateformat'], TIMENOW).'.rdf'; header("Content-Type: application/rdf+xml; charset=utf-8"); header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Content-Disposition: attachment; filename="' . $filename . '"'); header('Content-Length: ' . strlen($filestring)); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); echo $filestring; // RSS 1.0 Ends } |
#1084
|
|||
|
|||
I think It is time to realease an update for this mode. due the popular and more bugs free! What do your think?
|
#1085
|
||||
|
||||
i am working on 1.5 of this hack on the 3.0.x platform, once its complete i will port it over to 3.5.x.
|
#1086
|
|||
|
|||
thank I am very glad to hear this good news
|
#1087
|
||||
|
||||
how can I make the navbar link viewable to guest ?
|
#1088
|
|||
|
|||
any way to fix BB Code in threads when posting in vbjournal? I'm using php 4.4.2 / mysql 4.1.18 / apache 2.0 .. on xp pro .. with vb3.5.4 ..
everything else seems to work but that. |
#1089
|
||||
|
||||
Any chance of updating this to 3.5.x and any current screen shots?
|
#1090
|
|||
|
|||
Is there anyway to allow users to feed their LiveJournal into vbJournal (via RSS?)? I notice AN-Net had mention of it sometime in 2005 but it seems to have faded away and can't determine whether this version has this option?
Thanks |
#1091
|
||||
|
||||
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|