commit bbd2815316a37c5e51afe891ab2d80f6f07021eb Author: Andrew O'Neil Date: Thu Sep 6 22:33:58 2007 +0000 Move blog to open source path diff --git a/_config.php b/_config.php new file mode 100644 index 0000000..f2abe24 --- /dev/null +++ b/_config.php @@ -0,0 +1,8 @@ + diff --git a/code/ArchiveWidget.php b/code/ArchiveWidget.php new file mode 100644 index 0000000..bcee029 --- /dev/null +++ b/code/ArchiveWidget.php @@ -0,0 +1,78 @@ + "Varchar" + ); + + static $defaults = array( + "DisplayMode" => "month" + ); + + static $title = "Archive"; + static $cmsTitle = "Blog Archive"; + static $description = "Show a list of months or years in which there are blog posts, and provide links to them."; + + function getBlogHolder() { + $page = Director::currentPage(); + + if($page->is_a("BlogHolder")) { + return $page; + } else if($page->is_a("BlogEntry") && $page->getParent()->is_a("BlogHolder")) { + return $page->getParent(); + } else { + return DataObject::get_one("BlogHolder"); + } + } + + function getCMSFields() { + return new FieldSet( + new OptionsetField("DisplayMode","Display by",array("month"=>"month","year"=>"year")) + ); + } + + function Dates() { + Requirements::css("blog/css/archivewidget.css"); + $results = new DataObjectSet(); + $blogHolder = $this->getBlogHolder(); + $id = $blogHolder->ID; + + if($this->DisplayMode == "month"){ + $sqlResults = DB::query("SELECT DISTINCT MONTH(`Date`) AS `Month`, YEAR(`Date`) AS `Year` FROM `SiteTree` NATURAL JOIN `BlogEntry` WHERE `ParentID` = $id ORDER BY `Date` DESC"); + }else{ + $sqlResults = DB::query("SELECT DISTINCT YEAR(`Date`) AS `Year` FROM `SiteTree` NATURAL JOIN `BlogEntry` WHERE `ParentID` = $id ORDER BY `Date` DESC"); + } + + + + foreach($sqlResults as $sqlResult) { + $date = new Date("Date"); + + + + $month = ($this->DisplayMode == "month") ? (int)$sqlResult['Month'] : 1; + + $date->setValue(array( + "Day" => 1, + "Month" => $month, + "Year" => (int)$sqlResult['Year'] + )); + + if($this->DisplayMode == "month"){ + $link = $blogHolder->Link() . $sqlResult['Year']. '/' . sprintf("%'02d", $sqlResult['Month']); + } + else{ + $link = $blogHolder->Link() . $sqlResult['Year']; + } + + $results->push(new ArrayData(array( + "Date" => $date, + "Link" => $link + ))); + } + + return $results; + } +} + +?> \ No newline at end of file diff --git a/code/BlogEntry.php b/code/BlogEntry.php new file mode 100644 index 0000000..35449cf --- /dev/null +++ b/code/BlogEntry.php @@ -0,0 +1,132 @@ + "Datetime", + "Author" => "Text", + "Tags" => "Text" + ); + + static $casting = array( + "Date" => "Date" + ); + + static $defaults = array( + "ProvideComments" => true + ); + + static $allowed_children = "none"; + + /** + * overload so that the default date is today. + */ + public function populateDefaults(){ + parent::populateDefaults(); + $this->Date = date("d/m/Y H:i:s",time()); + } + + /** + * Ensures the most recent article edited on the same day is shown first. + */ + public function setDate($val){ + $datepart = date("Y-m-d",strtotime($val)); + $minutepart = date("H:i:s",time()); + $date = $datepart . " " . $minutepart; + return $this->setField("Date",$date); + } + + function getCMSFields() { + Requirements::javascript('blog/javascript/bbcodehelp.js'); + Requirements::css('blog/css/bbcodehelp.css'); + $firstName = Member::CurrentMember() ? Member::currentMember()->FirstName : ''; + $codeparser = new BBCodeParser(); + + $fields = parent::getCMSFields(); + $fields->removeFieldFromTab("Root.Content.Main","Content"); + $fields->addFieldToTab("Root.Content.Main", new TextareaField("Content", "Content", 20)); + $fields->addFieldToTab("Root.Content.Main", new CalendarDateField("Date", "Date"),"Content"); + $fields->addFieldToTab("Root.Content.Main", new TextField("Author", "Author", $firstName),"Content"); + + $fields->addFieldToTab("Root.Content.Main", new LiteralField("BBCodeHelper", "
" . + "BBCode help" . + "
")); + + $fields->addFieldToTab("Root.Content.Main", new TextField("Tags", "Tags (comma sep.)"),"Content"); + return $fields; + } + + function Tags() { + $theseTags = split(" *, *", trim($this->Tags)); + + $output = new DataObjectSet(); + foreach($theseTags as $tag) { + $output->push(new ArrayData(array( + "Tag" => $tag, + "Link" => $this->getParent()->Link() . '?tag=' . urlencode($tag) + ))); + } + if($this->Tags){ + return $output; + } + } + + + function SideBar() { + return $this->getParent()->SideBar(); + } + + function ParagraphSummary(){ + $content = new Text('Content'); + $content->value = Convert::raw2xml($this->Content); + $parser = new BBCodeParser($content->FirstParagraph()); + return $parser->parse(); + } + + function ParsedContent() { + $parser = new BBCodeParser($this->Content); + $content = new Text('Content'); + $content->value =$parser->parse(); + return $content; + } + + function EditURL(){ + return $this->getParent()->Link('post')."/".$this->ID."/"; + } + +} + +class BlogEntry_Controller extends Page_Controller { + function init() { + parent::init(); + Requirements::themedCSS("blog"); + } + + function unpublishPost(){ + if(!Permission::check('ADMIN')){ + Security::permissionFailure($this, + "Unpublishing blogs is an administrator task. Please log in."); + } + else{ + $SQL_id = Convert::raw2sql($this->ID); + + $page = DataObject::get_by_id("SiteTree", $SQL_id); + $page->deleteFromStage('Live'); + $page->flushCache(); + + $page = DataObject::get_by_id("SiteTree", $SQL_id); + $page->Status = "Unpublished"; + + Director::redirect($this->getParent()->Link()); + } + } + +} + +?> \ No newline at end of file diff --git a/code/BlogHolder.php b/code/BlogHolder.php new file mode 100644 index 0000000..c8f94db --- /dev/null +++ b/code/BlogHolder.php @@ -0,0 +1,231 @@ + "WidgetArea" + ); + + static $allowed_children = array( + 'BlogEntry' + ); + + function getCMSFields() { + $fields = parent::getCMSFields(); + $fields->removeFieldFromTab("Root.Content.Main","Content"); + $fields->addFieldToTab("Root.Content.Widgets", new WidgetAreaEditor("SideBar")); + + return $fields; + } + + public function BlogEntries($limit = 10) { + $start = isset($_GET['start']) ? (int)$_GET['start'] : 0; + $tagCheck = ''; + $dateCheck = ""; + + if(isset($_GET['tag'])) { + $tag = addslashes($_GET['tag']); + $tag = str_replace(array("\\",'_','%',"'"), array("\\\\","\\_","\\%","\\'"), $tag); + $tagCheck = "AND `BlogEntry`.Tags LIKE '%$tag%'"; + } + + + if(Director::urlParams()){ + + $year = Director::urlParam('Action'); + $month = Director::urlParam('ID'); + + if(is_numeric($month) && is_numeric($month)){ + $dateCheck = "AND Date BETWEEN '$year-$month-1' AND '$year-$month-31'"; + } + else if(isset($year)){ + $dateCheck = "AND Date BETWEEN '$year-1-1' AND '$year-12-31'"; + } + } + + return DataObject::get("Page","`ParentID` = $this->ID AND ShowInMenus = 1 $tagCheck $dateCheck","`BlogEntry`.Date DESC",'',"$start, $limit"); + } + + function Tag() { + return isset($_GET['tag']) ? $_GET['tag'] : false; + } + + function BlogEntryForm(){ + Requirements::javascript('jsparty/behaviour.js'); + Requirements::javascript('jsparty/prototype.js'); + Requirements::javascript('jsparty/scriptaculous/effects.js'); + Requirements::javascript('cms/javascript/PageCommentInterface.js'); + Requirements::javascript('blog/javascript/bbcodehelp.js'); + + $id = 0; + if(Director::urlParam('ID')){ + $id = Director::urlParam('ID'); + } + + $codeparser = new BBCodeParser(); + $membername = Member::currentMember() ? Member::currentMember()->getName() : ""; + + $fields = new FieldSet( + new HiddenField("ParentID", "ParentID", $this->ID), + new HiddenField("ID","ID"), + new HiddenField("Date","Date"), + new TextField("Title","Subject"), + new TextField("Author","Author",$membername), + new CompositeField( + new LiteralField("BBCodeHelper","BBCode help
" ), + new TextareaField("Content", "Content",20), + new LiteralField("BBCodeTags","") + ), + new TextField("Tags","Tags"), + new LiteralField("Tagsnote"," ") + ); + + $submitAction = new FormAction('postblog', 'Post blog entry'); + $actions = new FieldSet($submitAction); + $validator = new RequiredFields('Title','Content'); + + $form = new BlogEntry_Form($this, 'BlogEntryForm',$fields, $actions,$validator); + + if($id != 0){ + $form->loadNonBlankDataFrom(DataObject::get_by_id('BlogEntry',$id)); + }else{ + $form->loadNonBlankDataFrom(array("Author" => Cookie::get("BlogHolder_Name"))); + } + + return $form; + } + + function isPost(){ + return Director::urlParam('Action') == 'post'; + } + + function postURL(){ + return $this->Link('post'); + } + + function requireDefaultRecords() { + parent::requireDefaultRecords(); + + if(!DataObject::get_one('BlogHolder')) { + $blogholder = new BlogHolder(); + $blogholder->Title = "Blog"; + $blogholder->URLSegment = "blog"; + $blogholder->Status = "Published"; + + $widgetarea = new WidgetArea(); + $widgetarea->write(); + + $blogholder->SideBarID = $widgetarea->ID; + $blogholder->write(); + $blogholder->publish("Stage", "Live"); + + $managementwidget = new BlogManagementWidget(); + $managementwidget->ParentID = $widgetarea->ID; + $managementwidget->write(); + + $tagcloudwidget = new TagCloudWidget(); + $tagcloudwidget->ParentID = $widgetarea->ID; + $tagcloudwidget->write(); + + $archivewidget = new ArchiveWidget(); + $archivewidget->ParentID = $widgetarea->ID; + $archivewidget->write(); + + $widgetarea->write(); + + $blog = new BlogEntry(); + $blog->Title = "SilverStripe blog module successfully installed"; + $blog->URLSegment = 'sample-blog-entry'; + $blog->setDate(date("Y-m-d H:i:s",time())); + $blog->Tags = "silverstripe, blog"; + $blog->Content = "Congratulations, the SilverStripe blog module has been successfully installed. This blog entry can be safely deleted. You can configure aspects of your blog (such as the widgets displayed in the sidebar) in [url=admin]the CMS[/url]."; + $blog->Status = "Published"; + $blog->ParentID = $blogholder->ID; + $blog->write(); + $blog->publish("Stage", "Live"); + + Database::alteration_message("Blog page created","created"); + } + } +} + +class BlogHolder_Controller extends Page_Controller { + function init() { + parent::init(); + + // This will create a tag point to the RSS feed + RSSFeed::linkToFeed($this->Link() . "rss", "RSS feed of this blog"); + Requirements::themedCSS("blog"); + Requirements::themedCSS("bbcodehelp"); + + } + + function showarchive() { + $month = addslashes($this->urlParams['ID']); + return array( + "Children" => DataObject::get('SiteTree', "ParentID = $this->ID AND DATE_FORMAT(`BlogEntry`.`Date`, '%Y-%M') = '$month'"), + ); + } + + function ArchiveMonths() { + $months = DB::query("SELECT DISTINCT DATE_FORMAT(`BlogEntry`.`Date`, '%M') AS `Month`, DATE_FORMAT(`BlogEntry`.`Date`, '%Y') AS `Year` FROM `BlogEntry` ORDER BY `BlogEntry`.`Date` DESC"); + $output = new DataObjectSet(); + foreach($months as $month) { + $month['Link'] = $this->Link() . "showarchive/$month[Year]-$month[Month]"; + $output->push(new ArrayData($month)); + } + return $output; + } + + function rss() { + global $project; + $rss = new RSSFeed($this->Children(), $this->Link(), $project . " blog", "", "Title", "ParsedContent"); + $rss->outputToBrowser(); + } + + function BBTags() { + return BBCodeParser::usable_tags(); + } + + function post(){ + if(!Permission::check('ADMIN')){ + Security::permissionFailure($this, + "Posting blogs is an administrator task. Please log in."); + } + return array(); + } + +} + + +class BlogEntry_Form extends Form { + function postblog($data) { + Cookie::set("BlogHolder_Name", $data['Author']); + $blogentry = new BlogEntry(); + $this->saveInto($blogentry); + + if($data['ID'] != 0){ //new post + $blogentry = DataObject::get_by_id("BlogEntry",$data['ID']); + $this->saveInto($blogentry); + $blogentry->setDate($data['Date']); + }else{ + $blogentry->setDate(date("Y-m-d H:i:s",time())); + $blogentry->URLSegment = $data['Title']; + } + + $blogentry->Status = "Published"; + $blogentry->writeToStage("Stage"); + $blogentry->publish("Stage", "Live"); + + Director::redirect(Director::currentURLSegment()); + + } +} + +?> \ No newline at end of file diff --git a/code/BlogManagementWidget.php b/code/BlogManagementWidget.php new file mode 100644 index 0000000..a680699 --- /dev/null +++ b/code/BlogManagementWidget.php @@ -0,0 +1,56 @@ +value(); + if($unmoderatedcount == 1) { + return "You have 1 unmoderated comment"; + } else if($unmoderatedcount > 1) { + return "You have $unmoderatedcount unmoderated comments"; + } else { + return "Comment administration"; + } + } + + function CommentLink() { + $unmoderatedcount = DB::query("SELECT COUNT(*) FROM PageComment WHERE NeedsModeration=1")->value(); + + if($unmoderatedcount > 0) { + return "admin/comments/unmoderated"; + } else { + return "admin/comments"; + } + } + + function WidgetHolder() { + if(Permission::check("ADMIN")) { + return $this->renderWith("WidgetHolder"); + } + } + + function PostLink() { + $blogholder = $this->getBlogHolder(); + + return $blogholder->Link('post'); + } + + function getBlogHolder() { + $page = Director::currentPage(); + + if($page->is_a("BlogHolder")) { + return $page; + } else if($page->is_a("BlogEntry") && $page->getParent()->is_a("BlogHolder")) { + return $page->getParent(); + } else { + return DataObject::get_one("BlogHolder"); + } + } +} + +?> \ No newline at end of file diff --git a/code/RSSWidget.php b/code/RSSWidget.php new file mode 100644 index 0000000..c81f150 --- /dev/null +++ b/code/RSSWidget.php @@ -0,0 +1,44 @@ + "Text", + "RssUrl" => "Text", + "NumberToShow" => "Int", + ); + + static $defaults = array( + "NumberToShow" => 10 + ); + + static $title = "RSS Feed"; + static $cmsTitle = "RSS Feed"; + static $description = "Shows the latest entries of a RSS feed."; + + function getCMSFields() { + return new FieldSet( + new TextField("CustomTitle","Custom title for the feed"), + new TextField("RssUrl", "URL of RSS Feed"), + new NumericField("NumberToShow", "Number of Items to show") + ); + } + + function Title() { + $this->feed = new SimplePie($this->RssUrl); + $this->feed->init(); + return ($this->CustomTitle) ? $this->CustomTitle : $this->feed->get_feed_title(); + } + + function FeedItems() { + $output = new DataObjectSet(); + foreach($this->feed->get_items(0, $this->NumberToShow) as $item) { + $output->push(new ArrayData(array( + "Title" => $item->get_title(), + "Link" => $item->get_link() + ))); + } + return $output; + } +} + +?> \ No newline at end of file diff --git a/code/TagCloudWidget.php b/code/TagCloudWidget.php new file mode 100644 index 0000000..05e9a19 --- /dev/null +++ b/code/TagCloudWidget.php @@ -0,0 +1,150 @@ + "Int", + "Sortby" => "Varchar" + ); + + static $defaults = array( + "Limit" => "0", + "Sortby" => "alphabet" + ); + + static $title = "Tags"; + static $cmsTitle = "Tag Cloud"; + static $description = "Shows a tag cloud of tags on your blog."; + + function getBlogHolder() { + $page = Director::currentPage(); + + if($page->is_a("BlogHolder")) { + return $page; + } else if($page->is_a("BlogEntry") && $page->getParent()->is_a("BlogHolder")) { + return $page->getParent(); + } else { + return DataObject::get_one("BlogHolder"); + } + } + + + function getCMSFields() { + return new FieldSet( + new TextField("Limit", "Limit number of tags"), + new OptionsetField("Sortby","Sort by",array("alphabet"=>"alphabet","frequency"=>"frequency")) + ); + } + + function Tags() { + Requirements::css("blog/css/tagcloud.css"); + + $allTags = array(); + $max = 0; + $blogHolder = $this->getBlogHolder(); + + $entries = $blogHolder->Children(); + + if($entries) { + foreach($entries as $entry) { + $theseTags = split(" *, *", trim($entry->Tags)); + foreach($theseTags as $tag) { + $allTags[$tag] = isset($allTags[$tag]) ? $allTags[$tag] + 1 : 1; //getting the count into key => value map + $max = ($allTags[$tag] > $max) ? $allTags[$tag] : $max; + } + } + + if($allTags) { + + //TODO: move some or all of the sorts to the database for more efficiency + + if($this->Limit > 0){ + uasort($allTags, "column_sort_by_popularity"); //sort by popularity + $allTags = array_slice($allTags, 0, $this->Limit); + } + if($this->Sortby == "alphabet"){ + natksort($allTags); + } + + $sizes = array(); + foreach($allTags as $tag => $count){ + $sizes[$count] = true; + } + $numsizes = count($sizes)-1; //Work out the number of different sizes + if($numsizes > 5){$numsizes = 5;} + + foreach($allTags as $tag => $count) { + $popularity = floor($count / $max * $numsizes); + + switch($popularity) { + case 0: + $class = "not-popular"; + break; + case 1: + $class = "not-very-popular"; + break; + case 2: + $class = "somewhat-popular"; + break; + case 3: + $class = "popular"; + break; + case 4: + $class = "very-popular"; + break; + case 5: + $class = "ultra-popular"; + break; + default: + $class = "broken"; + break; + } + + $allTags[$tag] = array( + "Tag" => $tag, + "Count" => $count, + "Class" => $class, + "Link" => $blogHolder->Link() . '?tag=' . urlencode($tag) + ); + + } + + } + + $output = new DataObjectSet(); + foreach($allTags as $tag => $fields) { + $output->push(new ArrayData($fields)); + } + return $output; + } + + return; + } +} + +function column_sort_by_popularity($a, $b){ + + if($a == $b) { + $result = 0; + } + else { + $result = $b - $a; + } + + return $result; +} + +function natksort(&$aToBeSorted) + { + $aResult = array(); + $aKeys = array_keys($aToBeSorted); + natcasesort($aKeys); + foreach ($aKeys as $sKey) + { + $aResult[$sKey] = $aToBeSorted[$sKey]; + } + $aToBeSorted = $aResult; + + return true; + } + +?> \ No newline at end of file diff --git a/code/import/TypoImport.php b/code/import/TypoImport.php new file mode 100644 index 0000000..11e264d --- /dev/null +++ b/code/import/TypoImport.php @@ -0,0 +1,152 @@ +Title = "imported blog"; + + // write it! + $bholder->write(); + $bholder->publish("Stage", "Live"); + + // get the typo articles + $result = pg_query($dbconn, "SELECT * FROM contents WHERE type='Article'"); + + while ($row = pg_fetch_row($result)) { + + // title [1] + // author [2] + // body [3] + // body_html [4] (type rendered and cached the html here. This is the preferred blog entry content for migration) + // keywords (space separated) [7] (tags table is just a list of the unique variants of these keywords) + // created_at [8] + // permalink [12] (this is like the url in sitetree, prolly not needed) + // email [18] (address of the commenter) + // url [19] (url of the commenter) + + $title = $row[1]; + $author = $row[2]; + $blog_entry = $row[4]; + $keywords = $row[7]; + $created_at = $row[8]; + + // sometimes it's empty. If it is, grab the body + if ($blog_entry == ""){ + // use "body" + $blog_entry = $row[3]; + } + echo "blog_entry: $blog_entry"; + echo "
\n"; + + // put the typo blog entry in the SS database + $newEntry = new BlogEntry(); + $newEntry->Title = $title; + $newEntry->Author = $author; + $newEntry->Content = $blog_entry; + $newEntry->Tags = $keywords; + $newEntry->Date = $created_at; + + // tie each blog entry back to the blogholder we created initially + $newEntry->ParentID = $bholder->ID; + + // write it! + $newEntry->write(); + $newEntry->publish("Stage", "Live"); + + // grab the id so we can get the comments + $old_article_id = $row[0]; + + // get the comments + $result2 = pg_query($dbconn, "SELECT * FROM contents WHERE type = 'Comment' AND article_id = $old_article_id"); + + while ($row2 = pg_fetch_row($result2)) { + // grab the body_html + $comment = $row2[4]; + + // sometimes it's empty. If it is, grab the body + if ($comment == ""){ + // use "body" + $comment = $row2[3]; + } + + + + + $Cauthor = $row2[2]; + $Ccreated_at = $row2[8]; + + // put the typo blog comment in the SS database + $newCEntry = new PageComment(); + $newCEntry->Name = $Cauthor; + $newCEntry->Comment = $comment; + $newCEntry->Created = $created_at; + + // need to grab the newly inserted blog entry's id + $newCEntry->ParentID = $newEntry->ID; + + // write it! + $newCEntry->write(); + + echo "comment: $comment"; + echo "
\n"; + } + + $newEntry->flushCache(); + + // fix up the specialchars + pg_query($dbconn, "UPDATE SiteTree SET Content = REPLACE(Content, \"×\", \"x\")"); + pg_query($dbconn, "UPDATE SiteTree SET Content = REPLACE(Content, \"’\", \"’\")"); + pg_query($dbconn, "UPDATE SiteTree SET Content = REPLACE(Content, \"‘\", \"‘\")"); + pg_query($dbconn, "UPDATE SiteTree SET Content = REPLACE(Content, \"—\", \"—\")"); + pg_query($dbconn, "UPDATE SiteTree SET Content = REPLACE(Content, \"“\", \"“\")"); + pg_query($dbconn, "UPDATE SiteTree SET Content = REPLACE(Content, \"”\", \"”\")"); + pg_query($dbconn, "UPDATE SiteTree SET Content = REPLACE(Content, \"–\", \"–\")"); + pg_query($dbconn, "UPDATE SiteTree SET Content = REPLACE(Content, \"—\", \"—\")"); + pg_query($dbconn, "UPDATE SiteTree SET Content = REPLACE(Content, \"…\", \"…\")"); + pg_query($dbconn, "UPDATE SiteTree SET Content = REPLACE(Content, \"™\", \"™\")"); + pg_query($dbconn, "UPDATE SiteTree SET Content = REPLACE(Content, \"&\", \"&\")"); + + pg_query($dbconn, "UPDATE PageComment SET Comment = REPLACE(Comment, \"×\", \"x\")"); + pg_query($dbconn, "UPDATE PageComment SET Comment = REPLACE(Comment, \"’\", \"’\")"); + pg_query($dbconn, "UPDATE PageComment SET Comment = REPLACE(Comment, \"‘\", \"‘\")"); + pg_query($dbconn, "UPDATE PageComment SET Comment = REPLACE(Comment, \"—\", \"—\")"); + pg_query($dbconn, "UPDATE PageComment SET Comment = REPLACE(Comment, \"“\", \"“\")"); + pg_query($dbconn, "UPDATE PageComment SET Comment = REPLACE(Comment, \"”\", \"”\")"); + pg_query($dbconn, "UPDATE PageComment SET Comment = REPLACE(Comment, \"–\", \"–\")"); + pg_query($dbconn, "UPDATE PageComment SET Comment = REPLACE(Comment, \"—\", \"—\")"); + pg_query($dbconn, "UPDATE PageComment SET Comment = REPLACE(Comment, \"…\", \"…\")"); + pg_query($dbconn, "UPDATE PageComment SET Comment = REPLACE(Comment, \"™\", \"™\")"); + pg_query($dbconn, "UPDATE PageComment SET Comment = REPLACE(Comment, \"&\", \"&\")"); + + + } + + pg_close($dbconn); + + } // end function + +} // end class +?> diff --git a/css/archivewidget.css b/css/archivewidget.css new file mode 100644 index 0000000..0018f54 --- /dev/null +++ b/css/archivewidget.css @@ -0,0 +1,9 @@ +.archiveMonths{ + +} + +ul.archiveYears li{ + display: inline; + font-size: 1.2em !important; + margin:0 !important; +} \ No newline at end of file diff --git a/css/bbcodehelp.css b/css/bbcodehelp.css new file mode 100644 index 0000000..05db9a7 --- /dev/null +++ b/css/bbcodehelp.css @@ -0,0 +1,32 @@ +/* + Foundational BBHelper formatting +*/ + +ul.bbcodeExamples li { + list-style-type:none; + font-size: 1em; +} +ul.bbcodeExamples li.last { + border: none; +} + +ul.bbcodeExamples li span.example { + +} + +#BBTagsHolder{ + color: #777; + padding: 5px; + width: 270px; + background-color: #fff; + font-size:0.8em; +} + +.bbcodeExamples{ + margin: 0 !important; + padding: 0; +} + +#BBCodeHint{ + cursor: pointer; +} \ No newline at end of file diff --git a/css/blog.css b/css/blog.css new file mode 100644 index 0000000..691205f --- /dev/null +++ b/css/blog.css @@ -0,0 +1,11 @@ +.BlogError { + text-align: center; +} + +.BlogError p { + color: #fff; + display: inline; + background-color: #f77; + padding: 7px; + font-weight:bold; +} \ No newline at end of file diff --git a/css/flickrwidget.css b/css/flickrwidget.css new file mode 100644 index 0000000..ef16f0a --- /dev/null +++ b/css/flickrwidget.css @@ -0,0 +1,3 @@ +div.flickrwidget { + text-align: center; +} \ No newline at end of file diff --git a/css/tagcloud.css b/css/tagcloud.css new file mode 100644 index 0000000..464952f --- /dev/null +++ b/css/tagcloud.css @@ -0,0 +1,6 @@ +.tagcloud .not-popular { font-size: 1em; } +.tagcloud .not-very-popular { font-size: 1.3em; } +.tagcloud .somewhat-popular { font-size: 1.6em; } +.tagcloud .popular { font-size: 1.9em; } +.tagcloud .very-popular { font-size: 2.2em; } +.tagcloud .ultra-popular { font-size: 2.5em; } \ No newline at end of file diff --git a/images/blogholder-file.gif b/images/blogholder-file.gif new file mode 100644 index 0000000..4b5b00f Binary files /dev/null and b/images/blogholder-file.gif differ diff --git a/images/blogpage-file.gif b/images/blogpage-file.gif new file mode 100644 index 0000000..73cc55b Binary files /dev/null and b/images/blogpage-file.gif differ diff --git a/javascript/bbcodehelp.js b/javascript/bbcodehelp.js new file mode 100644 index 0000000..a035b0f --- /dev/null +++ b/javascript/bbcodehelp.js @@ -0,0 +1,12 @@ +Behaviour.register({ + '#BBCodeHint': { + onclick: function() { + if($('BBTagsHolder').style.display == "none") { + Effect.BlindDown('BBTagsHolder'); + } else{ + Effect.BlindUp('BBTagsHolder'); + } + return false; + } + } +}); diff --git a/templates/ArchiveWidget.ss b/templates/ArchiveWidget.ss new file mode 100644 index 0000000..198fc53 --- /dev/null +++ b/templates/ArchiveWidget.ss @@ -0,0 +1,21 @@ +<% if DisplayMode == month %> + +<% else %> + +<% end_if %> \ No newline at end of file diff --git a/templates/BlogManagementWidget.ss b/templates/BlogManagementWidget.ss new file mode 100644 index 0000000..fdd8682 --- /dev/null +++ b/templates/BlogManagementWidget.ss @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/templates/Includes/BlogPagination.ss b/templates/Includes/BlogPagination.ss new file mode 100644 index 0000000..3322029 --- /dev/null +++ b/templates/Includes/BlogPagination.ss @@ -0,0 +1,21 @@ +<% if BlogEntries.MoreThanOnePage %> +
+ <% if BlogEntries.NotLastPage %> + + <% end_if %> + + <% if BlogEntries.NotFirstPage %> + + <% end_if %> + + + <% control BlogEntries.Pages %> + <% if CurrentBool %> + $PageNum + <% else %> + $PageNum + <% end_if %> + <% end_control %> + +
+<% end_if %> \ No newline at end of file diff --git a/templates/Includes/BlogSideBar.ss b/templates/Includes/BlogSideBar.ss new file mode 100644 index 0000000..ebd57aa --- /dev/null +++ b/templates/Includes/BlogSideBar.ss @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/templates/Includes/BlogSummary.ss b/templates/Includes/BlogSummary.ss new file mode 100644 index 0000000..98c7b16 --- /dev/null +++ b/templates/Includes/BlogSummary.ss @@ -0,0 +1,14 @@ +
+

$MenuTitle

+

Posted by $Author.XML on $Date.Long | $Comments.Count Comments

+ <% if Tags %> +

+ Tags: + <% control Tags %> + $Tag<% if Last %><% else %>,<% end_if %> + <% end_control %> +

+ <% end_if %> +

$ParagraphSummary

+

$Comments.Count comments | Read the full post

+
\ No newline at end of file diff --git a/templates/Layout/BlogEntry.ss b/templates/Layout/BlogEntry.ss new file mode 100644 index 0000000..84a384e --- /dev/null +++ b/templates/Layout/BlogEntry.ss @@ -0,0 +1,23 @@ +<% include BlogSideBar %> +
+ <% include BreadCrumbs %> + +
+

$Title

+

Posted by $Author.XML on $Date.Long | $Comments.Count Comments

+ <% if Tags %> +

+ Tags: + <% control Tags %> + $Tag<% if Last %><% else %>,<% end_if %> + <% end_control %> +

+ <% end_if %> +

$Content.Parse(BBCodeParser)

+
+
+ <% if CurrentMember %>

Edit this post | Unpublish this post

<% end_if %> + + $PageComments + +
\ No newline at end of file diff --git a/templates/Layout/BlogHolder.ss b/templates/Layout/BlogHolder.ss new file mode 100644 index 0000000..36720a3 --- /dev/null +++ b/templates/Layout/BlogHolder.ss @@ -0,0 +1,23 @@ +<% include BlogSideBar %> + +
+ + <% include BreadCrumbs %> + + $Content + + <% if Tag %> +

Viewing entries tagged with '$Tag'

+ <% end_if %> + + <% if BlogEntries %> + <% control BlogEntries %> + <% include BlogSummary %> + <% end_control %> + <% else %> +

There are no blog entries

+ <% end_if %> + + <% include BlogPagination %> + +
\ No newline at end of file diff --git a/templates/Layout/BlogHolder_post.ss b/templates/Layout/BlogHolder_post.ss new file mode 100644 index 0000000..f901d62 --- /dev/null +++ b/templates/Layout/BlogHolder_post.ss @@ -0,0 +1,12 @@ +<% include BlogSideBar %> + +
+ + <% include BreadCrumbs %> + + <% if isPost %> + + $BlogEntryForm + + <% end_if %> +
\ No newline at end of file diff --git a/templates/RSSWidget.ss b/templates/RSSWidget.ss new file mode 100644 index 0000000..1cf1089 --- /dev/null +++ b/templates/RSSWidget.ss @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/templates/TagCloudWidget.ss b/templates/TagCloudWidget.ss new file mode 100644 index 0000000..14939d6 --- /dev/null +++ b/templates/TagCloudWidget.ss @@ -0,0 +1,5 @@ +

+ <% control Tags %> + $Tag + <% end_control %> +

\ No newline at end of file