"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()); } } } ?> "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()); } } ?>removeFieldFromTab("Root.Content.Main","Content"); return $fields; } public function News($limit = 10) { $start = isset($_GET['start']) ? (int)$_GET['start'] : 0; $dateCheck = ""; 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 $dateCheck","`NewsPage`.Date DESC",'',"$start, $limit"); } } class NewsHolder_Controller extends Page_Controller { } ?> 'Date', "Author" => "Text" ); static $casting = array( "Date" => "Date" ); static $has_one = array( ); /** * 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() { $fields = parent::getCMSFields(); $fields->removeFieldFromTab("Root.Content.Main","Content"); $fields->addFieldToTab("Root.Content.Main", new HTMLEditorField("Content", "Content", 20)); $fields->addFieldToTab("Root.Content.Main", new CalendarDateField("Date", "Date"),"Content"); $fields->addFieldToTab('Root.Content.Main', new TextField('Author'), 'Content'); return $fields; } function ParagraphSummary(){ $content = new Text('Content'); $content->value = Convert::html2raw($this->Content); return $content->FirstParagraph(); } } class NewsPage_Controller extends GeneralPage_Controller { } ?> doc-de_galerie_02 | Digicrafts Flash Components for Carousel Menu, Cover Flow Gallery, Slideshow, FLV Player, Banner Rotator

Reference for Galerie 02

Method

Description

nextItem()Move to next item.
prevItem()Move to previous item.
load()Load xml source.
start()Start the menu.
stop()Stop the menu.
slideshowStart()Start the slideshow.
slideshowStop()Stop the slideshow.

Code Example :

<!-- Insert this javascript in your HTML -->
<script language="JavaScript">
function getFlashMovie(movieName) {
var isIE = navigator.appName.indexOf("Microsoft") != -1;
return (isIE) ? window[movieName] : document[movieName];
}
</script>

<!-- When you create the link to control the Galerie, insert the following script you need
Note that the "getFlashMovie" function should input the ID of your Galerie object -->
<a href="#" onclick = "getFlashMovie('galerie01').prevItem();">prev</a>
<a href="#" onclick = "getFlashMovie('galerie01').load('imagesxxx/photos.xml');">load</a>
<a href="#" onclick = "getFlashMovie('galerie01').nextItem();">next</a>
<a href="#" onclick = "getFlashMovie('galerie01').start();">start</a>
<a href="#" onclick = "getFlashMovie('galerie01').stop();">stop</a>
<a href="#" onclick = "getFlashMovie('galerie01').slideshowStart();">slideshowStart</a>
<a href="#" onclick = "getFlashMovie('galerie01').slideshowStop();">slideshowStop</a>

The Insert Class Interface

Choose Galerie 02 from the Insertbar and this interface will display.

 

1.ID - For the ID and Name tag for the Galerie. The default is galerie04 if leave it in blank.
2.Photo Source - For the source of photo stream in xml which can be generated by Photoshop.

 

Inspector Interface

Select the object and the properties inspector will appear.

1.ID - For the ID and Name tag for the Galerie. The default value is galerie04.
2.Width - Width of the Galerie in pixels.
3.Height - Height of the Galerie in pixels.
4.Photo Source - For the source of photo stream in xml which can be generated by Photoshop.
5.Background Color - To specify the background color of the Galerie. If you like to set the background to transparent, leave it in blank.
6.Sub Menu - The button to open sub-menu for advanced setting of the Galerie.

 

Appearance Interface

Click the "Appearance" button in the Inspector Interface to open this menu.

1. Position - The distance of the loader from the top.
2. Border - Thickness of the border of the loader.
3. Shadow - Shadow amount of the loader.
4. Height - Specify the height of the loader
5. Border Color - Color of border of the loader
6. Item Count - Number of items for each side of the menu.
7. Photo Item Dimension - All photos will keep their aspect ratio in the menu. This parameter specify the maximum width and height for each photo.
8. Center Item Scale - The magnification ratio of the center item.
9. Center Item Distance - The distance between center photo and the side photos.
10. Menu Over Color - Color of photo when rollover the menu
11. Menu Curvature - Specify the curature of the menu.
12. Menu Position - The distance of the menu from the bottom.
13. Side Item Scale - The scale ratio of each side item.
14. Side Item Distance - The distance between each side item.
15. Side Item Alpha - Side item alpha multiply ratio. For example: The value is set to 0.9. The alpha of the item photo near the center item will be 0.9. The alpha of the second itme will be 0.9 x 0.9 = 0.81. And so on.
16. Shadow - Shadow amount of the menu.
17. Caption Color - Color of the caption.
18. Show button - Enable to display rewind, forward and play button.
19. Caption Position - Position of caption count from bottom.
20. Button Position - The rewind, forward and play button position count from top.

 

Slideshow Interface

Click the "Slideshow" button in the Inspector Interface to open this menu.

1.Slideshow Enable - Tick to enable slideshow when start.
2.Slideshow Delay - Delay for each slide.
3.Slideshow Direction - Specify the slideshow start from Left or Right side.

 

Others Interface

Click the "Others" button in the Inspector Interface to open this menu.

1. Loader Fade Out Time - Specify the time for photo fade out in the loader.
2. Loader Transition Time - Specify the time for the loader resize.
3. Loader Transition Type - Specify the motion curve of the loader resize movement.
4. Menu Transition Time - Specify the time for photo shifting in the menu.
5. Rollover Item Motion - The movement of photo when mouse over.
6. Touchscroll Enable - Tick to enable the drag moving function.
7. Keyboard Enable - Tick to enable keyboard left/right control.
8. Mouse Scroll Enable - Tick to enable the mouse scroll wheel control.
9. Click to URL - Tick to enable open new URL function when click on photo. The URL should be defined in the photo source xml file.

 

Registration Interface

Click the "Registration" button in the Inspector Interface to open this menu.

If you did not enter the information, a warning banner will be appeared in the Galerie. Please login to Digicrafts - The Ultimate UI for web design to register your product and get your registration code. Each license only for 1 domain.

1.Username - The username for registration.
2.Registration Code - The registration code generated by Digicrafts.