Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » /db/build/ blog problem

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: 1221 Views
  • sirobscure
    Avatar
    Community Member
    2 Posts

    /db/build/ blog problem Link to this post

    Hello, first of all sry for my english i couldn't write/speak it an i know that... i give my best

    I've got a problem with the blod module. It dosn't works... i saw the video and maked exactly the same things with the db/build?flush=1 (i don't know how i should write).

    thanks for your help and sorry for my english

    the error is:

    "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\thewebartist\blog\code\BlogEntry.php:68) in D:\wamp\www\thewebartist\sapphire\core\Debug.php on line 151
    Error

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

    and my ordnerstruktur:

    http://img518.imageshack.us/img518/2247/ordnerstrukturvv7.jpg

  • simon_w
    Avatar
    Forum Moderator
    471 Posts

    Re: /db/build/ blog problem Link to this post

    Open blog/code/BlogEntry.php and change the <? to <?php. There maybe other files in blog/code that need this fix as well.

  • sirobscure
    Avatar
    Community Member
    2 Posts

    Re: /db/build/ blog problem Link to this post

    thx i'll try it

  • deejayh
    Avatar
    Community Member
    10 Posts

    Re: /db/build/ blog problem Link to this post

    Hi,

    I tried your suggestion, but it did not work.

    So I checked the other PHP file in that folder and a couple had just the <?
    So I changed them to <?php- ?flush=1 into admin - worked.

    Thanks,
    Dave

  • Nivanka
    Avatar
    Community Member
    395 Posts

    Re: /db/build/ blog problem Link to this post

    it is good that I found this post, I had the same problem.

    1221 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.