Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » how to install blog?

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 2027 Views
  • boymaker
    Avatar
    Community Member
    2 Posts

    how to install blog? Link to this post

    how to install blog? i put folder blog in silverstripe and run db. but db error.
    ------------------------------------------
    Building Database

    Creating database tables
    # Newsletter
    # Newsletter_SentRecipient
    # Newsletter_Recipient
    # NewsletterType
    # PageComment
    # Email_BounceRecord
    # Email_BlackList
    # PageView
    # SiteTree
    # Field SiteTree.ClassName: changed to enum('SiteTree','GhostPage','Page','BlogEntry','BlogHolder','UserDefinedForm','ErrorPage','RedirectorPage','VirtualPage','SubscribeForm') character set utf8 collate utf8_general_ci default 'SiteTree' (from enum('SiteTree','GhostPage','Page','UserDefinedForm','ErrorPage','RedirectorPage','VirtualPage','SubscribeForm') character set utf8 collate utf8_general_ci default 'SiteTree')
    # Field SiteTree_Live.ClassName: changed to enum('SiteTree','GhostPage','Page','BlogEntry','BlogHolder','UserDefinedForm','ErrorPage','RedirectorPage','VirtualPage','SubscribeForm') character set utf8 collate utf8_general_ci default 'SiteTree' (from enum('SiteTree','GhostPage','Page','UserDefinedForm','ErrorPage','RedirectorPage','VirtualPage','SubscribeForm') character set utf8 collate utf8_general_ci default 'SiteTree')
    # Field SiteTree_versions.ClassName: changed to enum('SiteTree','GhostPage','Page','BlogEntry','BlogHolder','UserDefinedForm','ErrorPage','RedirectorPage','VirtualPage','SubscribeForm') character set utf8 collate utf8_general_ci default 'SiteTree' (from enum('SiteTree','GhostPage','Page','UserDefinedForm','ErrorPage','RedirectorPage','VirtualPage','SubscribeForm') character set utf8 collate utf8_general_ci default 'SiteTree')
    # QueuedEmail
    # File
    # EditableCheckboxOption
    # EditableDropdownOption
    # EditableFormField
    # EditableRadioOption
    # SubmittedForm
    # SubmittedFormField
    # Group
    # Member
    # Member_UnsubscribeRecord
    # Permission
    # Widget
    # Field Widget.ClassName: changed to enum('Widget','ArchiveWidget','BlogManagementWidget','RSSWidget','TagCloudWidget') character set utf8 collate utf8_general_ci default 'Widget' (from enum('Widget') character set utf8 collate utf8_general_ci default 'Widget')
    # WidgetArea
    # GhostPage
    # Page
    # BlogEntry
    "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" . "
    ".$codeparser->useable_tagsHTML()."
    ")); $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()); } } } ?>
    Warning: Cannot modify header information - headers already sent by (output started at D:\wamp\www\silverstripe\blog\code\BlogEntry.php:68) in D:\wamp\www\silverstripe\sapphire\core\Debug.php on line 151
    Error

    The website server has not been able to respond to your request.

  • deejayh
    Avatar
    Community Member
    10 Posts

    Re: how to install blog? Link to this post

    I get the same as you boymaker!

    Installed correctly, ensured “Default BlackCandy” template was selected, did a .../db/build?flush=1, listed all the db details, THEN found that the frontend is working OK, but cannot get access to the backend - just get:

    "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" . "
    ".$codeparser->useable_tagsHTML()."
    ")); $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()); } } } ?>
    Error
    The website server has not been able to respond to your request.

    I will have to remove the installation and see if I can get back in!

    Anyone have any ideas on this?

  • deejayh
    Avatar
    Community Member
    10 Posts

    Re: how to install blog? Link to this post

    just an update.

    I found another message on this forum, with the same issues.

    The suggestion was to open a file (php) in blog/code/ and ensure that the opening <? was changed to <?php.

    I found a couple of php files with <? changed them and voila! All works now.

    Regards,
    Dave

    2027 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.