We're back at the Factory for our usual BFLF Sunday sessions. We are proud to say that this event is part of the Greater Manchester Fringe festival taking place in July. This party will be a 'Heroes and Villains' themed rave, which is quite fitting for the venue! Sunday 3rd July 2016, 2.00pm-4.30pm.
Dance: DJ David Dunne will be spinning the tunes on the day on the multi-sensory dance floor with glitter cannons, bubbles and giant parachute dance.


text:
Dennis Richardson denies Trump administration ask for voter info after outcry from Democrats
Updated Jan 09, 2019; Posted Jun 30, 2017
By Gordon R. Friedman | The Oregonian/OregonLive
SALEM -- Oregon Secretary of State Dennis Richardson on Friday rebuffed Trump administration efforts to gather private information about Oregon voters in an effort to root out potential voter fraud.
Richardson said a presidential commission can get the full list of Oregon voters' names, addresses and voting history the same way anyone else could: by paying $500.
The request for voter information from a federal commission investigating voter fraud generated outcry from some of the state's top Democrats, who implored Richardson not to turn over the records.
Democrats said the request from Kris Kobach, the former Kansas secretary of state who now heads the Presidential Advisory Commission on Election Integrity, is inappropriate and would result in the disclosure of Oregonians' private information. All of Oregon's Democratic members of Congress, two Democratic state representatives and the Democratic Party of Oregon asked him to refuse to give Kobach information.
At least 20 states have already rebelled against Kobach's request, including California, New York and his home state of Kansas.
It would be illegal for Richardson to refuse to release public information, including voter names, addresses, party affiliation and voting history, regardless of who requests it. But Richardson noted that Social Security numbers, driver's license numbers and some of the other data Kobach asked for is confidential under Oregon law and he is duty-bound to keep it private.
In a letter to Kobach issued Friday evening, Richardson said he does not believe the federal government "should be involved in dictating how states conduct their elections." Richardson also said, "We have very little evidence of voter fraud or registration fraud in Oregon." He extolled Oregon's system, including vote-by-mail and automatic voter registration at the DMV, as a model for other states to emulate.
Richardson also told president Donald Trump in February that there was no voter fraud in Oregon.
"I'm pleased to report that in Oregon we have reviewed the processes and we are confident that voter fraud in last November's election did not occur in Oregon," wrote Richardson, who became Oregon's first Republican secretary of state in 30 years after taking office in January.
Critics have panned the commission Kobach now heads as an effort by Trump to suppress voting rights. Some Republicans -- including Trump -- have said unlawful voting is rampant. But elections experts point to data showing voter fraud is nearly nonexistent.
Kobach himself has been the subject of sharp criticism for his conservative views on ballot access and for being fined by a federal court last week for making "patently misleading representations."
In his June 28 letter, Kobach asked Richardson to send his commission Oregon's publicly available voter roll data. Kobach asked for regularly released information, like voters' full names, addresses, party affiliations and ballot-casting history. Any member of the public can learn that information about an individual voter from the voter's county elections office, and that data is frequently sold in bulk by the state to requesters, usually political parties and candidates for office.
But Kobach's letter also seeks information not normally given up by the state in voter data releases: partial social security numbers, dates of birth, whether a person has been convicted of a felony, military status and overseas residency status.
Requests to interview Richardson were not answered and he did not respond to voicemails seeking comment.
In his letter, Richardson told Kobach "We believe the best way to prevent voter intimidation or disenfranchisement is to follow the Oregon model of trying to get every eligible voter on the registration rolls through automatic voter registration and outreach efforts, and then, sending every registered voter a ballot."
-- Gordon R. Friedman
Gfriedman@Oregonian.com
503-221-8209; @GordonRFriedman

redpajama_set_name: RedPajamaCommonCrawl


text:
#ifndef SIMPLETHREAD_H
#define SIMPLETHREAD_H

#include "mutex.h"

class U_EXPORT SimpleThread
{
  public:
    SimpleThread();
    virtual  ~SimpleThread();
    int32_t   start(void);        // start the thread. Return 0 if successfull.
    void      join();             // A thread must be joined before deleting its SimpleThread.

    virtual void run(void) = 0;   // Override this to provide the code to run
                                  //   in the thread.
  private:
    void *fImplementation;
};

class IntlTest;

// ThreadPool - utililty class to simplify the spawning a group of threads by
//              a multi-threaded test.
//
//   Usage: from within an intltest test function,
//       ThreadPool<TestClass> pool(
//               this,              // The current intltest test object,
//                                  //     of type "TestClass *"
//               numberOfThreads,   // How many threads to spawn.
//               &TestClass::func); // The function to be run by each thread.
//                                  //     It takes one int32_t parameter which
//                                  //     is set to the thread number, 0 to numberOfThreads-1.
//
//       pool.start();              // Start all threads running.
//       pool.join();               // Wait until all threads have terminated.

class ThreadPoolBase {
  public:
    ThreadPoolBase(IntlTest *test, int32_t numThreads);
    virtual ~ThreadPoolBase();

    void start();
    void join();

  protected:
    virtual void callFn(int32_t param) = 0;
    friend class ThreadPoolThread;

    IntlTest  *fIntlTest;
    int32_t  fNumThreads;
    SimpleThread **fThreads;
};

template<class TestClass>
class ThreadPool : public ThreadPoolBase {
  private:
    void (TestClass::*fRunFnPtr)(int32_t);
  public:
    ThreadPool(TestClass *test, int howMany, void (TestClass::*runFnPtr)(int32_t threadNumber)) :
        ThreadPoolBase(test, howMany), fRunFnPtr(runFnPtr) {};
    virtual ~ThreadPool() {};
  private:
    virtual void callFn(int32_t param) {
        TestClass *test = dynamic_cast<TestClass *>(fIntlTest);
        (test->*fRunFnPtr)(param);
    }
};
#endif

redpajama_set_name: RedPajamaGithub


It was a deadly day on the roads here yesterday as two separate accidents in 12 hours left three men dead.
The first happened along the Marina Coastal Expressway before the Central Boulevard exit at around 5.10am.
A 33-year-old motorcyclist was pronounced dead by paramedics at the scene.
The other motorcyclist, a 27-year-old man, sustained injuries and was arrested for causing death by a negligent act.
The two are understood by The Straits Times to be off-duty police officers, who worked together at the Bukit Timah Neighbourhood Police Centre.
A video circulating online showed several vehicles on the left-most lane, along with emergency vehicles and police officers at the scene.
In the video, a police officer can also be seen examining a scrambler motorcycle.
Eyewitnesses told Chinese evening daily Lianhe Wanbao that they saw damaged helmets and blood at the scene.
Later that day, an accident involving a lorry and a black van along Mandai Road near the Seletar Expressway junction left two men dead.
Photos circulating online showed the van, with its front smashed in, behind the lorry on the leftmost lane, which was cordoned off with traffic cones.
The Singapore Civil Defence Force said it was alerted to the accident along Mandai Road, towards Yishun, at 4.40pm.
"Two men in their 20s were pronounced dead by paramedics at the scene," said a spokesman.
Police said the deceased are the van driver, a 29-year-old, and a 25-year-old passenger from the lorry.
Investigations into both accidents are ongoing.
Yesterday morning's accident comes six months after 29-year-old traffic police officer Nadzrie Matin died in a traffic accident along Serangoon Road while patrolling on his motorcycle. The 52-year-old driver of the other vehicle was arrested for a negligent act causing the death of Staff Sergeant Nadzrie.


text:
Fair to increase student involvement
Connor Veasey, Staff Writer
All Francis Marion University (FMU) students interested in becoming involved in activities on and off campus can attend the Student Involvement Fair.
The Student Involvement Fair is hosted annually on FMU's campus. This year's fair will be held from 1-4 p.m. on Aug. 28 in the Smith University Center.
There will be 55-60 slots available for businesses, school clubs and school organizations.Students who decide to attend the fair will receive information from student organizations and clubs as well as local businesses in the surrounding Florence area.
"We want more students to come and attend the fair each year," LaTasha Brand, assistant dean of students, said.
Since Brand decreased three involvement fairs per semester fall semester to one a few years ago, participation has increased.
"In the past we were hosting three different events throughout the fall semester, leading to confusion among students as to which fair they are to attend," Brand said. "We want to increase the foot traffic for the fair each year. Hosting one annual event helps bring more students together than when we hosted the events separately in the previous years."
Brand encourages anyone interested in joining a club or organization to come to the fair. She added that there will be a few new clubs and local business participating this year.
Two faith-based groups, The Fellowship of Christian Athletes and Intravarsity, are interested in becoming recognized organizations and will be attending this year's fair.
"A new freshman focus program, created by the Division of Student Affairs, will also have a booth set up, and freshman students are encouraged to visit it," Daphne Carter-McCants, assistant dean of students, said.
Because the fair will allow students to learn more about Florence and other surrounding areas, Brand explained,it is an opportunity for new students to learn more about the campus and become more acclimated to college life.
"Students are encouraged to attend the fair and are welcome to bring their friends with them," Brand said.
Brand added that the faculty desires to keep the fair consistent and around the same time each year so that it will be easier for the students, as well as themselves, to remember the date and participating organizations.
"The major difference, like the past few years,[is] that the three fairs have been comprised into one large fair in effort to make it easier for students to remember to go to one big fair every year," Brand said.
A fair that familiarizes students with the surrounding areawill let them know where they can go and how they can have fun at those places, Brand explained; and for those who cannot leave the campus, the clubs and organizations will provide them with activities to participate in.
Conversation tables encourage foreign language
Just an opinion, no one shoot me
Students encouraged at Night of Inspiration
Students bond playing ultimate Frisbee
SC Chamber Music Festival: Event unites musicians from around the world
Campus police releases crime report
Hispanic Heritage Celebrated
Welcome Week scheduled to unite incoming and returning students
New SGA President welcomes students


text:
{{vm.log._id ? 'Edit Log' : 'New Log'}}

    <form name="vm.form.logForm" class="form-horizontal" ng-submit="vm.save(vm.form.logForm.$valid)" novalidate>
      <fieldset>

          Name
          <input name="name" type="text" ng-model="vm.log.name" id="name" class="form-control" placeholder="Name" required>

Log name is required.

          <button type="submit" class="btn btn-default">{{vm.log._id ? 'Update' : 'Create'}}</button>

      </fieldset>
    </form>


text:
<?php

/**
 * A protected API call to add a page
 * @uri /page/add
 */
class PageAddResource extends Tonic\Resource {

    /**
     * @method POST
     */
    function add() {

       	// get token
		$token = Utilities::ValidateJWTToken(apache_request_headers());

		// check if token is not null
        if($token != NULL){

			// get a reference to the site, user
			$site = Site::GetBySiteId($token->SiteId);
			$user = User::GetByUserId($token->UserId);

			// creates an access object
			$access = Utilities::SetAccess($user);

            parse_str($this->request->data, $request); // parse request

            // get request paramters
            $pageTypeId = $request['pageTypeId'];
            $name = $request['name'];
            $friendlyId = $request['friendlyId'];
            $description = $request['description'];

			// check permissions
			if(Utilities::CanPerformAction($pageTypeId, $access['CanCreate']) == false){
				return new Tonic\Response(Tonic\Response::BADREQUEST);
			}

            // default layout and stylesheet is content
            $layout = 'content';
            $stylesheet = 'content';

            if($pageTypeId != '-1'){
                $pageType = PageType::GetByPageTypeId($pageTypeId);

                if($pageType != null){
                    $pageTypeId = $pageType['PageTypeId'];
                    $layout = $pageType['Layout'];
                    $stylesheet = $pageType['Stylesheet'];
                }
            }

			// add page
            $page = Page::Add($friendlyId, $name, $description, $layout, $stylesheet, $pageTypeId, $token->SiteId, $token->UserId);

            $fullName = $user['FirstName'].' '.$user['LastName'];
            $row['LastModifiedFullName'] = $fullName;

			// init url
            $url = $page['FriendlyId'];

			// init PT
			$pageType = NULL;

			// get url, permissions
            if($page['PageTypeId']!=-1){
                $pageType = PageType::GetByPageTypeId($page['PageTypeId']);

				if($pageType != NULL){
	                $url = strtolower($pageType['FriendlyId']).'/'.$page['FriendlyId'];

	                // set edit permissions
					if($access['CanEdit']=='All' || strpos($access['CanEdit'], $pageType['PageTypeId']) !== FALSE){
						$canEdit = true;
					}

					// set publish permissions
					if($access['CanPublish']=='All' || strpos($access['CanPublish'], $pageType['PageTypeId']) !== FALSE){
						$canPublish = true;
					}

					// set remove permissions
					if($access['CanRemove']=='All' || strpos($access['CanRemove'], $pageType['PageTypeId']) !== FALSE){
						$canRemove = true;
					}
				}

            }
            else{

                // set edit permissions
				if($access['CanEdit']=='All' || strpos($access['CanEdit'], 'root') !== FALSE){
					$canEdit = true;
				}

				// set publish permissions
				if($access['CanPublish']=='All' || strpos($access['CanPublish'], 'root') !== FALSE){
					$canPublish = true;
				}

				// set remove permissions
				if($access['CanRemove']=='All' || strpos($access['CanRemove'], 'root') !== FALSE){
					$canRemove = true;
				}

            }

            // init
            $imageURL = '';
            $thumbURL = '';

			// get thumb url
			if($page['Image']!=''){

				// set images URL
				if(FILES_ON_S3 == true){
					$bucket = $site['Bucket'];
					$imagesURL = str_replace('{{bucket}}', $bucket, S3_URL);
					$imagesURL = str_replace('{{site}}', $site['FriendlyId'], $imagesURL);
				}
				else{
					$imagesURL = $site['Domain'];
				}

				$thumbURL = $imagesURL.'/files/thumbs/'.$page['Image'];
				$imageURL = $imagesURL.'/files/'.$page['Image'];

            }

            $page['Image'] = $imageURL;
            $page['Thumb'] = $thumbURL;

           	// set permissions
            $page['CanEdit'] = $canEdit;
            $page['CanPublish'] = $canPublish;
            $page['CanRemove'] = $canRemove;

			// set url
            $page['Url'] = $url;

            // no drafts on new page
            $page['HasDraft'] = false;

            // return a json response
            $response = new Tonic\Response(Tonic\Response::OK);
            $response->contentType = 'application/json';
            $response->body = json_encode($page);

            return $response;

        } else{ // unauthorized access

            return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
        }
    }

}

/**
 * A protected API call to add a page
 * @uri /page/edit/tags
 */
class PageEditTagsResource extends Tonic\Resource {

    /**
     * @method POST
     */
    function post() {

        // get token
		$token = Utilities::ValidateJWTToken(apache_request_headers());

		// check if token is not null
        if($token != NULL){

			$user = User::GetByUserId($token->UserId);

			// creates an access object
			$access = Utilities::SetAccess($user);

            parse_str($this->request->data, $request); // parse request
			$pageId = $request['pageId'];
            $tags = $request['tags'];

			// get page
            $page = Page::GetByPageId($pageId);

            // check permissions
			if(Utilities::CanPerformAction($page['PageTypeId'], $access['CanEdit']) == false){
				return new Tonic\Response(Tonic\Response::BADREQUEST);
			}

            $page = Page::EditTags($pageId, $tags, $token->UserId);

            // return a json response
            $response = new Tonic\Response(Tonic\Response::OK);
            $response->contentType = 'application/json';
            $response->body = json_encode($page);

            return $response;

        } else{ // unauthorized access

            return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
        }
    }

}

/**
 * A protected API call to remove a page
 * @uri /page/remove
 */
class PageRemoveResource extends Tonic\Resource {

    /**
     * @method POST
     */
    function post() {

        // get token
		$token = Utilities::ValidateJWTToken(apache_request_headers());

		// check if token is not null
        if($token != NULL){

			$user = User::GetByUserId($token->UserId);
			$site = Site::GetBySiteId($token->SiteId);

			// creates an access object
			$access = Utilities::SetAccess($user);

        	parse_str($this->request->data, $request); // parse request
			$pageId = $request['pageId'];

        	$page = Page::GetByPageId($pageId);

        	// check permissions
			if(Utilities::CanPerformAction($page['PageTypeId'], $access['CanEdit']) == false){
				return new Tonic\Response(Tonic\Response::BADREQUEST);
			}

        	// make sure page is part of the site
        	if($page['SiteId']==$site['SiteId']){

        		// get file location
        		$path = SITES_LOCATION.'/'.$site['FriendlyId'].'/';
        		$static_path = SITES_LOCATION.'/'.$site['FriendlyId'].'/';

        		// default is root
        		$pageTypeId = -1;

        		// set file
				$file = $page['FriendlyId'].'.html';

				// set file
				if($page['PageTypeId'] != -1){

					$pageType = PageType::GetByPageTypeId($page['PageTypeId']);

					if($pageType != NULL){
						$pageTypeId = $pageType['PageTypeId'];

		    			$file = $pageType['FriendlyId'].'.'.$page['FriendlyId'].'.html';
		    			$static_path = $static_file.$pageType['FriendlyId'].'/';
		    		}
				}

		        // check permissions
				if(Utilities::CanPerformAction($pageTypeId, $access['CanRemove']) == false){
					return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
				}

		        // set template
				$template = $path.'templates/page/'.$file;

		        // remove template
		        if(file_exists($template)){
		        	unlink($template);
		        }

		        $static_file = $static_path.$file;

		        // remove static file if it exists
		        if(file_exists($static_file)){
		        	unlink($static_file);
		        }

		        // remove page from the DB
		        Page::Remove($pageId);

		        if($site['UrlMode'] == 'static'){
		        	// update controllers
		        	Publish::InjectControllers($site);
		        }
		        else{
		        	// update states
					Publish::InjectStates($site);
				}

				return new Tonic\Response(Tonic\Response::OK);

	        }
	        else{
		        return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
	        }

        }
        else{
            return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
        }
    }

}

/**
 * A protected API call to publish a page
 * @uri /page/publish
 */
class PagePublishResource extends Tonic\Resource {

    /**
     * @method POST
     */
    function publish() {

        // get token
		$token = Utilities::ValidateJWTToken(apache_request_headers());

		// check if token is not null
        if($token != NULL){

			$user = User::GetByUserId($token->UserId);

			// creates an access object
			$access = Utilities::SetAccess($user);

        	parse_str($this->request->data, $request); // parse request
			$pageId = $request['pageId'];

        	// get page
        	$page = Page::GetByPageId($pageId);

			// make sure the user is part of the site (or is a superadmin)
            if($token->SiteId != $page['SiteId']){
	            return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
            }

			// default is root
    		$pageTypeId = -1;

    		// determine if file is in sub-direcotry
        	if($page['PageTypeId']!=-1){
		        $pageType = PageType::GetByPageTypeId($page['PageTypeId']);

		        // set page type
		        $pageTypeId = $pageType['PageTypeId'];
	        }

	        // check permissions
			if(Utilities::CanPerformAction($pageTypeId, $access['CanPublish']) == false){
				return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
			}

			// set the page to active
            Page::SetIsActive($pageId, 1);

            // publish the page
            Publish::PublishPage($pageId);

            // return a json response
            $response = new Tonic\Response(Tonic\Response::OK);

        } else{ // unauthorized access

            return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
        }
    }

}

/**
 * A protected API call to un-publish a page
 * @uri /page/unpublish
 */
class PageUnPublishResource extends Tonic\Resource {

    /**
     * @method POST
     */
    function unpublish() {

        // get token
		$token = Utilities::ValidateJWTToken(apache_request_headers());

		// check if token is not null
        if($token != NULL){

			$user = User::GetByUserId($token->UserId);

			// creates an access object
			$access = Utilities::SetAccess($user);

        	parse_str($this->request->data, $request); // parse request
			$pageId = $request['pageId'];

			// get page
            $page = Page::GetByPageId($pageId);

            // make sure the user is part of the site (or is a superadmin)
            if($user['SiteId'] != $page['SiteId']){
	            return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
            }

            // delete page
            $site = Site::GetBySiteId($page['SiteId']);
            $filename = '../sites/'.$site['FriendlyId'].'/';

			// default is root
			$pageTypeId = -1;

			// get $pageTypeId
            if($page['PageTypeId']!=-1){
                $pageType = PageType::GetByPageTypeId($page['PageTypeId']);
                $filename .= strtolower($pageType['FriendlyId']).'/';

                $pageTypeId = $pageType['PageTypeId'];
            }

            // check permissions
            if(Utilities::CanPerformAction($pageTypeId, $access['CanPublish']) == false){
				return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
			}

            // set active
            Page::SetIsActive($pageId, 0);

            // remove file
            $filename = $filename.$page['FriendlyId'].'.php';

            if(file_exists($filename)){
                unlink($filename);
            }

            // return a json response
            $response = new Tonic\Response(Tonic\Response::OK);

        } else{ // unauthorized access

            return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
        }
    }

}

/**
 * A protected API call to edit, delete an existing page
 * @uri /page/retrieve
 */
class PageRetrieveResource extends Tonic\Resource {

    /**
     * @method POST
     */
    function post() {

        // get token
		$token = Utilities::ValidateJWTToken(apache_request_headers());

		// check if token is not null
        if($token != NULL){

			$user = User::GetByUserId($token->UserId);

			// creates an access object
			$access = Utilities::SetAccess($user);

			// parse request
			parse_str($this->request->data, $request);

			// get request params
			$pageId = $request['pageId'];

			// get page
            $page = Page::GetByPageId($pageId);

            // make sure the user is part of the site (or is a superadmin)
            if($user['SiteId'] != $page['SiteId']){
	            return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
            }

            // get site
            $site = Site::GetBySiteId($page['SiteId']);

            // url
            $page['Url'] = $page['FriendlyId'];

            // default permissions
			$canEdit = false;
			$canPublish = false;
			$canRemove = false;

			// set file
			$file = $page['FriendlyId'];

			// get the page type
            if($page['PageTypeId']!=-1){
	            $pageType = PageType::GetByPageTypeId($page['PageTypeId']);
	            $page['Url'] = $pageType['FriendlyId'].'/'.$page['FriendlyId'];
	            $file = $pageType['FriendlyId'].'.'.$page['FriendlyId'];

				// get permissions for the page
	            $canEdit = Utilities::CanPerformAction($pageType['PageTypeId'], $access['CanEdit']);
	            $canPublish = Utilities::CanPerformAction($pageType['PageTypeId'], $access['CanPublish']);
	            $canRemove = Utilities::CanPerformAction($pageType['PageTypeId'], $access['CanRemove']);
	        }
            else{
                // get permissions for the page
	            $canEdit = Utilities::CanPerformAction('root', $access['CanEdit']);
	            $canPublish = Utilities::CanPerformAction('root', $access['CanPublish']);
	            $canRemove = Utilities::CanPerformAction('root', $access['CanRemove']);
            }

            $hasDraft = false;

            if($page['Draft'] != NULL){
            	$hasDraft = true;
            }

            $page['HasDraft'] = $hasDraft;

			// set permissions
            $page['CanEdit'] = $canEdit;
            $page['CanPublish'] = $canPublish;
            $page['CanRemove'] = $canRemove;

            // return a json response
            $response = new Tonic\Response(Tonic\Response::OK);
            $response->contentType = 'application/json';
            $response->body = json_encode($page);

            return $response;
        }
        else{
            return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
        }
    }

}

/**
 * A protected API call to get and save content for a page
 * @uri /page/save
 */
class PageSaveResource extends Tonic\Resource {

    /**
     * @method POST
     */
    function update() {

        // get token
		$token = Utilities::ValidateJWTToken(apache_request_headers());

		// check if token is not null
        if($token != NULL){

			$user = User::GetByUserId($token->UserId);
			$site = Site::GetBySiteId($token->SiteId);

			// creates an access object
			$access = Utilities::SetAccess($user);

            parse_str($this->request->data, $request); // parse request

			// get request params
			$pageId = $request['pageId'];
            $name = $request['name'];
            $friendlyId = $request['friendlyId'];
            $description = $request['description'];
            $keywords = $request['keywords'];
            $callout = $request['callout'];
            $layout = $request['layout'];
            $stylesheet = $request['stylesheet'];
            $includeOnly = $request['includeOnly'];
            $beginDate = $request['beginDate'];
            $endDate = $request['endDate'];
            $location = $request['location'];
            $latitude = $request['latitude'];
            $longitude = $request['longitude'];

            // set timezone
            $timeZone = $site['TimeZone'];

            // default is a root element
            $pageTypeId = -1;

            // get a reference to a page
            $page = Page::GetByPageId($pageId);

            // make sure the user is part of the site (or is a superadmin)
            if($token->SiteId != $page['SiteId']){
	            return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
            }

            // get a pagetypeId
            if($page['PageTypeId']!=-1){
	            $pageType = PageType::GetByPageTypeId($page['PageTypeId']);
	            $pageTypeId = $pageType['PageTypeId'];
	        }

            // get permissions (both publishers and editors can save settings)
            $canEdit = Utilities::CanPerformAction($pageTypeId, $access['CanEdit']);
            $canPublish = Utilities::CanPerformAction($pageTypeId, $access['CanPublish']);

            // check permissions
			if($canEdit == false && $canPublish == false){
				return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
			}

			// edits settings
            Page::EditSettings($pageId, $name, $friendlyId, $description, $keywords, $callout,
            	$beginDate, $endDate, $timeZone,
            	$location, $latitude, $longitude,
            	$layout, $stylesheet, $includeOnly, $token->UserId);

            return new Tonic\Response(Tonic\Response::OK);

        } else{ // unauthorized access

            return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
        }

        return new Tonic\Response(Tonic\Response::NOTIMPLEMENTED);
    }

}

/**
 * A protected API call to get and save content for a page
 * @uri /page/content/retrieve
 */
class PageContentRetrieveResource extends Tonic\Resource {

    /**
     * @method POST
     */
    function post() {

        // get token
		$token = Utilities::ValidateJWTToken(apache_request_headers());

		// check if token is not null
        if($token != NULL){

            $site = Site::GetBySiteId($token->SiteId);
			$user = User::GetByUserId($token->UserId);

			// creates an access object
			$access = Utilities::SetAccess($user);

			// parse request
			parse_str($this->request->data, $request);

			// get request params
            $pageId = $request['pageId'];

            // get page
            $page = Page::GetByPageId($pageId);

            // set file
			$file = $page['FriendlyId'].'.html';

			// set file
			if($page['PageTypeId'] != -1){

				$pageType = PageType::GetByPageTypeId($page['PageTypeId']);

				if($pageType != NULL){
	    			$file = $pageType['FriendlyId'].'.'.$page['FriendlyId'].'.html';
	    		}
			}

			// retrieve a draft if available, if not retrieve the content or default content
			$content = '';

			if($page['Draft'] != NULL){
				$content = $page['Draft'];
			}
			else if($page['Content'] != NULL){
				$content = $page['Content'];
			}
			else{
				$content = '<div id="block-1" class="block row"><div class="col col-md-12"><h1>'.strip_tags(html_entity_decode($page['Name'])).'</h1><p>'.strip_tags(html_entity_decode($page['Description'])).'</p></div></div>';
			}

            $response = new Tonic\Response(Tonic\Response::OK);
            $response->contentType = 'text/html';
            $response->body = $content;

            return $response;

        } else{ // unauthorized access

            return new Tonic\Response(Tonic\Response::BADREQUEST);
        }
    }

}

/**
 * A protected API call to get and save content for a page
 * @uri /page/content/save
 */
class PageContentSaveResource extends Tonic\Resource {

    /**
     * @method POST
     */

    function post() {

        // get token
		$token = Utilities::ValidateJWTToken(apache_request_headers());

		// check if token is not null
        if($token != NULL){

            $site = Site::GetBySiteId($token->SiteId);
			$user = User::GetByUserId($token->UserId);

			// creates an access object
			$access = Utilities::SetAccess($user);

            parse_str($this->request->data, $request); // parse request

			$pageId  = $request['pageId'];
            $content = $request['content'];
            $status = $request['status']; // draft or publish
            $image = $request['image'];

			// get page and site
            $page = Page::GetByPageId($pageId);

            // default is root
    		$pageTypeId = -1;
    		$pageType = NULL;

    		// determine if file is in sub-direcotry
        	if($page['PageTypeId']!=-1){
		        $pageType = PageType::GetByPageTypeId($page['PageTypeId']);

		        // set page type
		        $pageTypeId = $pageType['PageTypeId'];
	        }

			// get permissions
            $canEdit = Utilities::CanPerformAction($pageTypeId, $access['CanEdit']);
            $canPublish = Utilities::CanPerformAction($pageTypeId, $access['CanPublish']);

            // check permissions
			if($canEdit == false && $canPublish == false){
				return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
			}

            // save content
            if($status=='publish'){
	            Page::EditContent($pageId, $content, $token->UserId);
            }
            else{ // save draft
	            Page::EditDraft($pageId, $content, $token->UserId);
            }

            $url = '';

			// publish if status is set to publish and the user can publish
            if($status=='publish' && $canPublish == true){

            	// set active
            	Page::SetIsActive($page['PageId'], 1);

            	// publish page
                $url = Publish::PublishPage($page['PageId'], false, true);

                // edit image
                Page::EditImage($page['PageId'], $image, $token->UserId);

                // republish common JS
				Publish::PublishCommonJS($page['SiteId']);

				// if page is include only, republish site
				if($page['IncludeOnly'] == 1){
					Publish::PublishSite($page['SiteId']);
				}

            }

			// return successful response
            $response = new Tonic\Response(Tonic\Response::OK);
            $response->contentType = 'text/html';
            $response->body = $url;

            return $response;

        } else{ // unauthorized access

            return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
        }
    }
}

/**
 * A protected API call to get and save content for a page
 * @uri /page/content/revert
 */
class PageContentRevert extends Tonic\Resource {

    /**
     * @method POST
     */

    function post() {

        // get token
		$token = Utilities::ValidateJWTToken(apache_request_headers());

		// check if token is not null
        if($token != NULL){

            $site = Site::GetBySiteId($token->SiteId);
			$user = User::GetByUserId($token->UserId);

			// creates an access object
			$access = Utilities::SetAccess($user);

            parse_str($this->request->data, $request); // parse request

			// get page id
			$pageId  = $request['pageId'];

			// get page and site
            $page = Page::GetByPageId($pageId);

            // default is root
    		$pageTypeId = $page['PageTypeId'];

    		// get permissions
            $canEdit = Utilities::CanPerformAction($pageTypeId, $access['CanEdit']);
            $canPublish = Utilities::CanPerformAction($pageTypeId, $access['CanPublish']);

            // check permissions
			if($canEdit == false && $canPublish == false){
				return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
			}

			 // removes the draft for the page
            Publish::RemoveDraft($pageId);

			// return successful response
            return new Tonic\Response(Tonic\Response::OK);

        } else{ // unauthorized access

            return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
        }
    }
}

/**
 * A protected API call to generate a preview
 * @uri /page/content/preview
 */
class PageContentPreviewResource extends Tonic\Resource {

    /**
     * @method POST
     */
    function post() {

        // get token
		$token = Utilities::ValidateJWTToken(apache_request_headers());

		// check if token is not null
        if($token != NULL){

        	// get user
        	$user = User::GetByUserId($token->UserId);
            $site = Site::GetBySiteId($token->SiteId);

			// creates an access object
			$access = Utilities::SetAccess($user);

            parse_str($this->request->data, $request); // parse request

            $pageId = $request['pageId']; // get page type
            $content = $request['content']; // get page type
            $status = 'draft';

			// get page and site
            $page = Page::GetByPageId($pageId);

            // make sure the user is part of the site (or is a superadmin)
            if($user['SiteId'] != $page['SiteId']){
	            return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
            }

            // default is root
    		$pageTypeId = -1;
    		$pageType = NULL;

    		// determine if file is in sub-direcotry
        	if($page['PageTypeId']!=-1){
		        $pageType = PageType::GetByPageTypeId($page['PageTypeId']);

		        // set page type
		        $pageTypeId = $pageType['PageTypeId'];
	        }

            // get permissions
            $canEdit = Utilities::CanPerformAction($pageTypeId, $access['CanEdit']);
            $canPublish = Utilities::CanPerformAction($pageTypeId, $access['CanPublish']);

            // check permissions to save a draft
			if($canEdit == true || $canPublish == true){

				// create a preview
				$url = Publish::PublishPage($page['PageId'], true);

			}

            // strip leading '../' from string
            $url = str_replace('../', '', $url);

            $response = new Tonic\Response(Tonic\Response::OK);
            $response->contentType = 'text/html';
            $response->body = $url;

            return $response;

        } else{ // unauthorized access

            return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
        }
    }
}

/**
 * A protected API call to remove files in the preview folder
 * @uri /page/content/preview/remove
 */
class PagePreviewRemoveResource extends Tonic\Resource {

    /**
     * @method DELETE
     */
    function remove() {

       	// get token
		$token = Utilities::ValidateJWTToken(apache_request_headers());

		// check if token is not null
        if($token != NULL){

        	// only can remove preview files from own site
            $site = Site::GetBySiteId($token->SiteId);

            if($site){
                $dir = SITES_LOCATION.'/'.$site['FriendlyId'].'/preview/*';

                $files = glob($dir); // get all file names

                foreach($files as $file){ // iterate files
                  if(is_file($file))
                    unlink($file); // delete file
                }
            }

            return new Tonic\Response(Tonic\Response::OK);

        } else{ // unauthorized access

            return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
        }
    }
}

/**
 * A protected API call to get and save content for a page
 * @uri /page/image/swap
 */
class PageImageResource extends Tonic\Resource {

    /**
     * @method POST
     */
    function save() {

         // get token
		$token = Utilities::ValidateJWTToken(apache_request_headers());

		// check if token is not null
        if($token != NULL){

            parse_str($this->request->data, $request); // parse request

            $fromUrl = $request['fromUrl']; // get page type
            $toUrl = $request['toUrl']; // draft or publish

            $image_data = file_get_contents($fromUrl);
            file_put_contents($toUrl, $image_data);

            return new Tonic\Response(Tonic\Response::OK);

        }
    }
}

/**
 * A protected API call that shows all pages
 * @uri /page/list/all
 */
class PageListAll extends Tonic\Resource {

    /**
     * @method GET
     */
    function get() {

        // get token
		$token = Utilities::ValidateJWTToken(apache_request_headers());

		// check if token is not null
        if($token != NULL){

            // get pages
            $list = Page::GetPagesForSite($token->SiteId, true);

            // get site
            $site = Site::GetBySiteId($token->SiteId);

            $pages = array();

            foreach ($list as $row){

                $fullName = $row['FirstName'].' '.$row['LastName'];
                $row['LastModifiedFullName'] = $fullName;

                // init
	            $imageURL = '';
	            $thumbURL = '';

				// get thumb url
				if($row['Image']!=''){

					 // set images URL
					if(FILES_ON_S3 == true){
						$bucket = $site['Bucket'];
						$imagesURL = str_replace('{{bucket}}', $bucket, S3_URL);
						$imagesURL = str_replace('{{site}}', $site['FriendlyId'], $imagesURL);
					}
					else{
						$imagesURL = $site['Domain'];
					}

					$thumbURL = $imagesURL.'/files/thumbs/'.$row['Image'];
					$imageURL = $imagesURL.'/files/'.$row['Image'];

	            };

                $row['Image'] = $imageURL;
                $row['Thumb'] = $thumbURL;

                $url = $row['FriendlyId'];

                if($row['PageTypeId']!=-1){
                    $pageType = PageType::GetByPageTypeId($row['PageTypeId']);

                    $url = strtolower($pageType['FriendlyId']).'/'.$row['FriendlyId'];
                }

                $row['Url'] = $url;

                // permissions are not applicable to this API call
	            $row['CanEdit'] = '';
	            $row['CanPublish'] = '';
	            $row['CanRemove'] = '';

                $pages[$row['PageId']] = $row;
            }

            // return a json response
            $response = new Tonic\Response(Tonic\Response::OK);
            $response->contentType = 'application/json';
            $response->body = json_encode($pages);

            return $response;

        }
        else{ // unauthorized access

            return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
        }

    }

}

/**
 * A protected API call that shows all pages
 * @uri /page/list/allowed
 */
class PageListAllowed extends Tonic\Resource {

    /**
     * @method GET
     */
    function get() {

		// get token
		$token = Utilities::ValidateJWTToken(apache_request_headers());

		// check if token is not null
        if($token != NULL){

			// get a reference to the site
			$site = Site::GetBySiteId($token->SiteId);
			$user = User::GetByUserId($token->UserId);

			// creates an access object
			$access = Utilities::SetAccess($user);

            // get pages
            $list = Page::GetPagesForSite($token->SiteId, false);

            $pages = array();

            foreach ($list as $row){

                $fullName = $row['FirstName'].' '.$row['LastName'];
                $row['LastModifiedFullName'] = $fullName;

				// init url
                $url = $row['FriendlyId'];

				// initialize PT
				$pageType = NULL;

				$canEdit = false;
				$canPublish = false;
				$canRemove = false;

				// get url, permissions
                if($row['PageTypeId']!=-1){
                    $pageType = PageType::GetByPageTypeId($row['PageTypeId']);

                    $url = strtolower($pageType['FriendlyId']).'/'.$row['FriendlyId'];

                    // set edit permissions
					if($access['CanEdit']=='All' || strpos($access['CanEdit'], $pageType['PageTypeId']) !== FALSE){
						$canEdit = true;
					}

					// set publish permissions
					if($access['CanPublish']=='All' || strpos($access['CanPublish'], $pageType['PageTypeId']) !== FALSE){
						$canPublish = true;
					}

					// set remove permissions
					if($access['CanRemove']=='All' || strpos($access['CanRemove'], $pageType['PageTypeId']) !== FALSE){
						$canRemove = true;
					}

                }
                else{

	                // set edit permissions
					if($access['CanEdit']=='All' || strpos($access['CanEdit'], 'root') !== FALSE){
						$canEdit = true;
					}

					// set publish permissions
					if($access['CanPublish']=='All' || strpos($access['CanPublish'], 'root') !== FALSE){
						$canPublish = true;
					}

					// set remove permissions
					if($access['CanRemove']=='All' || strpos($access['CanRemove'], 'root') !== FALSE){
						$canRemove = true;
					}

                }

                // init
                $imageURL = '';
                $thumbURL = '';

				// get thumb url
				if($row['Image'] != ''){

					 // set images URL
					if(FILES_ON_S3 == true){
						$bucket = $site['Bucket'];
						$imagesURL = str_replace('{{bucket}}', $bucket, S3_URL);
						$imagesURL = str_replace('{{site}}', $site['FriendlyId'], $imagesURL);
					}
					else{
						$imagesURL = $site['Domain'];
					}

					$thumbURL = $imagesURL.'/files/thumbs/'.$row['Image'];
					$imageURL = $imagesURL.'/files/'.$row['Image'];

	            };

                $row['Image'] = $imageURL;
                $row['Thumb'] = $thumbURL;

               	// set permissions
                $row['CanEdit'] = $canEdit;
                $row['CanPublish'] = $canPublish;
                $row['CanRemove'] = $canRemove;

				// set url
                $row['Url'] = $url;

                $hasDraft = false;

                if($row['Draft'] != NULL){
                	$hasDraft = true;
                }

                $row['HasDraft'] = $hasDraft;

                // push to array
                array_push($pages, $row);
            }

            // return a json response
            $response = new Tonic\Response(Tonic\Response::OK);
            $response->contentType = 'application/json';
            $response->body = json_encode($pages);

            return $response;

        }
        else{ // unauthorized access

            return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
        }

    }

}

/**
 * A protected API call that shows all pages for a given PageType.FriendlyId
 * @uri /page/list/sorted
 */
class PageListSortedResource extends Tonic\Resource {

    /**
     * @method POST
     */
    function post() {

        // get token
		$token = Utilities::ValidateJWTToken(apache_request_headers());

		// check if token is not null
        if($token != NULL){

			// get a reference to the site
			$site = Site::GetBySiteId($token->SiteId);
			$user = User::GetByUserId($token->UserId);

			// creates an access object
			$access = Utilities::SetAccess($user);

        	parse_str($this->request->data, $request); // parse request

            $friendlyId = $request['friendlyId']; // get page type
            $sort = $request['sort'];

			// default
			$orderBy = 'LastModifiedDate DESC';

			// don't pass directly to DB
			if($sort=='date desc'){
				$orderBy = 'LastModifiedDate DESC';
			}

			if($sort=='date asc'){
				$orderBy = 'LastModified ASC';
			}

			if($sort=='name desc'){
				$orderBy = 'Name DESC';
			}

			if($sort=='name asc'){
				$orderBy = 'Name ASC';
			}

            $siteId = $token->SiteId;
            $pageSize = 100;

            $page = 0;

            $pageTypeId = -1;
            $dir = '/';

            if($friendlyId!='root'){ // get pagetype
                $pageType = PageType::GetByFriendlyId($friendlyId, $siteId);
                $pageTypeId = $pageType['PageTypeId'];
                $dir = strtolower($pageType['FriendlyId']).'/';
            }

            // get pages
			$list = Page::GetPages($siteId, $pageTypeId, $pageSize, $page, $orderBy);

            $pages = array();

            foreach ($list as $row){

                $page = Page::GetByPageId($row['PageId']);

                $fullName = $row['FirstName'].' '.$row['LastName'];
                $page['LastModifiedFullName'] = $fullName;

                $thumbUrl = '';

                if($page['Image']!=''){

                	$thumbUrl = '/files/thumbs/'.$page['Image'];

                }

                $page['Thumb'] = $thumbUrl;

                $url = $page['FriendlyId'];

				// default permissions
				$canEdit = false;
				$canPublish = false;
				$canRemove = false;

				// initialize PT
				$pageType = NULL;

                if($page['PageTypeId']!=-1){
                    $pageType = PageType::GetByPageTypeId($page['PageTypeId']);

                    $url = strtolower($pageType['FriendlyId']).'/'.$page['FriendlyId'];

                    // set edit permissions
					if($access['CanEdit']=='All' || strpos($access['CanEdit'], $pageType['PageTypeId']) !== FALSE){
						$canEdit = true;
					}

					// set publish permissions
					if($access['CanPublish']=='All' || strpos($access['CanPublish'], $pageType['PageTypeId']) !== FALSE){
						$canPublish = true;
					}

					// set remove permissions
					if($access['CanRemove']=='All' || strpos($access['CanRemove'], $pageType['PageTypeId']) !== FALSE){
						$canRemove = true;
					}

                }
                else{

	                // set edit permissions
					if($access['CanEdit']=='All' || strpos($access['CanEdit'], 'root') !== FALSE){
						$canEdit = true;
					}

					// set publish permissions
					if($access['CanPublish']=='All' || strpos($access['CanPublish'], 'root') !== FALSE){
						$canPublish = true;
					}

					// set remove permissions
					if($access['CanRemove']=='All' || strpos($access['CanRemove'], 'root') !== FALSE){
						$canRemove = true;
					}

                }

                $page['CanEdit'] = $canEdit;
                $page['CanPublish'] = $canPublish;
                $page['CanRemove'] = $canRemove;

                $page['Url'] = $url;

                $hasDraft = false;

                if($page['Draft'] != NULL){
                	$hasDraft = true;
                }

                $page['HasDraft'] = $hasDraft;

                $pages[$row['PageId']] = $page;
            }

            // return a json response
            $response = new Tonic\Response(Tonic\Response::OK);
            $response->contentType = 'application/json';
            $response->body = json_encode($pages);

            return $response;

        }
        else{ // unauthorized access

            return new Tonic\Response(Tonic\Response::BADREQUEST);
        }

    }

}

/**
 * A protected API call that shows all pages for a given PageType.FriendlyId
 * @uri /page/list/{friendlyId}
 */
class PageListFriendlyResource extends Tonic\Resource {

    /**
     * @method GET
     */
    function get($friendlyId) {

        // get token
		$token = Utilities::ValidateJWTToken(apache_request_headers());

		// check if token is not null
        if($token != NULL){

			// get a reference to the site
			$site = Site::GetBySiteId($token->SiteId);

            $siteId = $token->SiteId;
            $pageSize = 100;
            $orderBy = 'Created DESC';
            $page = 0;

            $pageTypeId = -1;
            $dir = '/';

            if($friendlyId!='root'){ // get pagetype
                $pageType = PageType::GetByFriendlyId($friendlyId, $siteId);
                $pageTypeId = $pageType['PageTypeId'];
                $dir = strtolower($pageType['FriendlyId']).'/';
            }

            // get pages
            $list = Page::GetPages($siteId, $pageTypeId, $pageSize, $page, $orderBy);

            $pages = array();

            foreach ($list as $row){

                $page = Page::GetByPageId($row['PageId']);

                $fullName = $row['FirstName'].' '.$row['LastName'];
                $page['LastModifiedFullName'] = $fullName;

                $thumbUrl = '';

                if($page['Image']!=''){

                	$thumbUrl = '/files/thumbs/'.$page['Image'];

                }

                // set thumb
                $page['Thumb'] = $thumbUrl;

                $url = $page['FriendlyId'];

                if($page['PageTypeId']!=-1){
                    $pageType = PageType::GetByPageTypeId($page['PageTypeId']);

                    $url = strtolower($pageType['FriendlyId']).'/'.$page['FriendlyId'];
                }

				// set url
                $page['Url'] = $url;

                // permissions are not applicable to this API call
	            $page['CanEdit'] = '';
	            $page['CanPublish'] = '';
	            $page['CanRemove'] = '';

                $pages[$row['PageId']] = $page;
            }

            // return a json response
            $response = new Tonic\Response(Tonic\Response::OK);
            $response->contentType = 'application/json';
            $response->body = json_encode($pages);

            return $response;

        }
        else{ // unauthorized access

            return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
        }

    }

}

/**
 * This is a public API call that shows you the list of pages for the specified parameters in a list format
 * @uri /page/published/list
 */
class PageListResource extends Tonic\Resource {

    /**
     * @method POST
     */
    function post() {

        parse_str($this->request->data, $request); // parse request
        $siteId = $request['siteId'];
        $friendlyId = $request['type'];
        $pageSize = $request['pagesize'];
        $orderBy = $request['orderby'];
        $current= $request['current'];

        // get language
        $language = 'en';

		// set order
        if($orderBy=='Created' || $orderBy=='BeginDate'){
            $orderBy = 'Pages.'.$orderBy.' DESC';
        }
        else{
            $orderBy = 'Pages.'.$orderBy.' ASC';
        }

        if($pageSize==''){
            $pageSize = 10;
        }

        $site = Site::GetBySiteId($siteId);
        $pageType = PageType::GetByFriendlyId($friendlyId, $siteId);

	    $list = Page::GetPages($site['SiteId'], $pageType['PageTypeId'], $pageSize, $current, $orderBy, true);

        $pages = array();

        foreach ($list as $row){

            $page = Page::GetByPageId($row['PageId']);

            $name = $row['FirstName'].' '.$row['LastName'];

            // get image url
            $thumbUrl = '';
            $imageUrl = '';
            $hasImage = false;

            if($page['Image']!=''){
                $hasImage = true;
                $thumbUrl = 'files/thumbs/'.$page['Image'];
                $imageUrl = 'files/'.substr($page['Image'], 2);
            }

            // check for callout
            $hasCallout = false;

            if($page['Callout']!=''){
                $hasCallout = true;
            }

			// build URL
            $url = strtolower($pageType['FriendlyId']).'/'.$page['FriendlyId'];

            $beginDate = null;
            $beginReadable = '';

            if($page['BeginDate'] != null){

	            // create a readable begin date
	            $begin = DateTime::createFromFormat('Y-m-d H:i:s', $page['BeginDate']);
	            $local = new DateTimeZone($site['TimeZone']);
				$begin->setTimezone($local);
				$beginReadable = $begin->format('D, M d y h:i a');

				$beginDate = $begin->format('Y-m-d H:i:s');
			}

			$endDate = null;
            $endReadable = '';

			if($page['EndDate'] != null){

				// create a readable end date
				$end = DateTime::createFromFormat('Y-m-d H:i:s', $page['EndDate']);
				$local = new DateTimeZone($site['TimeZone']);
				$end->setTimezone($local);
				$endReadable = $end->format('D, M d y h:i a');

				$endDate = $end->format('Y-m-d H:i:s');

			}

            $item = array(
                    'PageId'  => $page['PageId'],
                    'Name' => $page['Name'],	// get a translation for name, description, and callout
                    'Description' => $page['Description'],
                    'Callout' => $page['Callout'],
                    'Location' => $page['Location'],
                    'LatLong' => $page['LatLong'],
                    'HasCallout' => $hasCallout,
                    'Url' => $url,
                    'Image' => $imageUrl,
                    'Thumb' => $thumbUrl,
                    'HasImage' => $hasImage,
                    'BeginDate' => $beginDate,
                    'BeginDateReadable' => $beginReadable,
                    'EndDate' => $endDate,
                    'EndDateReadable' => $endReadable,
                    'LastModified' => $page['LastModifiedDate'],
                    'Author' => $name,
                    'FirstName' => $row['FirstName'],
                    'LastName' => $row['LastName'],
                    'Photo' => $row['PhotoUrl'],
                    'Tags' => $page['Tags']
                );

            array_push($pages, $item);
        }

        // return a json response
        $response = new Tonic\Response(Tonic\Response::OK);
        $response->contentType = 'applicaton/json';
        $response->body = json_encode($pages);

        return $response;

        return new Tonic\Response(Tonic\Response::CREATED);
    }

}

/**
 * This is a public API call that shows you the list of pages for the specified parameters in a list format
 * @uri /page/published/count
 */
class PagePublishedCountResource extends Tonic\Resource {

    /**
     * @method POST
     */
    function post() {

        parse_str($this->request->data, $request); // parse request
        $siteId = $request['siteId'];
        $friendlyId = $request['type'];

        // get pagetype
        $pageType = PageType::GetByFriendlyId($friendlyId, $siteId);

		// get a count
		$count = Page::GetPagesCount($siteId, $pageType['PageTypeId'], true);

        // return a json response
        $response = new Tonic\Response(Tonic\Response::OK);
        $response->contentType = 'applicaton/json';
        $response->body = '{"count":'.$count.'}';

        return $response;

        return new Tonic\Response(Tonic\Response::CREATED);
    }

}

?>


Phenomenal!!! Kate Moss definitely takes over the September issue of Vogue UK! Who else could fill this spot?! With a mix of rock and roll flair and classic elegance Kate definitely shines through with the Moss Factor!
Yes yes yes Kate Kate Kate. There will never be enough of Kate in the world!


In the workshop, we bring the practicality of understanding the structure of a Yin Yoga session and how it may differ from every individual that is facilitating it. Participants will learn basic- advanced myo-fascial release theory and hands on application, meridians and much more.
Direct application of positional release of meridians, fascial slings and incorporating different types of tools into a session, participants get a first hand glance at how they can deepen their own yoga practice through manipulations of the breath, mind and body.
The workshop has been structured in such a way that participants are able explore the "inner experiences of the mind" at their own levels and further develop a higher awareness/ consciousness, even with just 5 hours!
Background in movement, instructing, meditation & yoga will be beneficial. But we open the course for any wanting to learn more and how to help themselves and others benefit from Yin Yoga.
Of any mental, physical and emotional state of being.
NOTE: No notes/ manuals will be given as this is a practical workshop.


text:
Hercules Crosse Jarvis (18 June 1802 – 8 February 1889) MLC, MLA, was a mayor of Cape Town and a powerful merchant of the Cape Colony.

Childhood
Born in Plymouth, England on 18 June 1802, he was a close relative of John Jervis, 1st Earl of St Vincent, the admiral who fought Napoleon. His father, also named John Jervis, was an army captain from Staffordshire who died young, leaving his wife and six children.
Coming from an intensely military family, the 14-year-old Hercules Crosse was offered a commission in the army by his relative the Admiral of St Vincent, but he had other plans and turned the offer down. He was also of a very gentle and sensitive nature, and the idea of war deeply repelled him.

After briefly visiting the Cape in 1816, he decided to move to the colony permanently, and arrived in Cape Town in 1821 with the intention of settling and making his fortune.

Early life in Cape Town
Soon after moving to Cape Town, he found a job as a clerk in the trading firm Hudson, Donaldson & Dixon and worked his way up to being its manager - a position he held throughout his life until he retired from business in 1864.
He was enormously influential in starting and developing the Cape's wine exports, and founded a distillery for that purpose in the vicinity of Paarl. He came to have a presence in many of the Cape's institutions, including directorship in Mutual Life (1846), the Union Bank (1847), the Harbour Board and even the South African College (1860). He was also a veteran member of the Cape Town Commercial Exchange.

Family
Jarvis married an Afrikaans woman, Elizabeth Maria Vos, joining the local Dutch Reformed Church (where he was later made an Elder) in order to do so. He was aged 19 at the time, and she was only 16. They had five daughters. One of them, Elizabeth Maria, met and married the young John Charles Molteno, who was later to become the Cape's first Prime Minister. Another daughter, Elizabeth Magdalena Christina ("Betty") married the Wynberg Mayor James Bisset and was mother to the Governor and cricketer Sir Murray Bisset. A third daughter, Sophia St Ives married the influential Cape businessman and exporter Percy John Allport. Anne Jarvis married the widower and Indian army officer Major William Bazett Gordon Blenkins C.B. The youngest daughter Emmie never married.

Political career

Hercules Crosse became a prominent fighter for the establishment of a representative Cape parliament, and when it was finally created he took a seat as the first minister to stand for Cape Town. In addition, the city of Cape Town was set up with a Board of Commissioners (later, Municipal Council) in 1840 and Jarvis was immediately elected onto it, soon becoming its chairman. He had particularly good relations with the Cape Malay community of Cape Town, and throughout his political career he derived a good deal of his political support from this important voting bloc.

He went on to become mayor and first citizen of Cape Town from 1848 to 1861, making him the longest serving of any first citizen of Cape Town.
As mayor, Jarvis was responsible for much of the early development of Cape Town's infrastructure. He drew up the plans for the city's first breakwater and harbour, and was a member of the Harbour Board for forty years.

He was an impartial and influential spokesman of the city during the Anti-Convict Movement (1848–1850), holding public meetings and presiding over debates. This local movement had developed in response to an attempt by the British government to turn the Cape Colony into a penal colony. In the end, it was Jarvis' resolutions on the matter that ended up being conveyed to the Governor and the Queen. He subsequently suggested a renaming of a portion of the Heerengracht to "Adderley Street" - now the central street of the Cape Town CBD - after the man who had championed the opinion of the Cape citizens in the House of Commons.

In the 1860s he joined the growing movement for Responsible government that was led by his son-in-law John Molteno.

Later life
The Cape's economy was in a severely depressed state in the 1860s, and Jarvis's vast business interests were one of the many victims of this economic stagnation. Once the leading wine merchant in the country, he eventually declared bankruptcy in 1864 and, already elderly, never completely recovered financially, even in the country's 1870s economic boom. He sold his Somerset Road house and moved in with the extended family of his son-in-law John Molteno, in Claremont.
In later life, he took an avid interest in mining. He unsuccessfully prospected for coal in the Cape Town City Bowl area, before setting up a Manganese mining venture outside Paarl.

He died at the house of his daughter Sophia St Ives Mary Alport, in Claremont, Cape Town, in 1889 and was buried beside his wife at Claremont St. Saviours Church.

References

|-

|-

|-

Mayors of Cape Town
Jarvis
Jarvis
South African businesspeople
1803 births
1889 deaths
19th-century South African people

redpajama_set_name: RedPajamaWikipedia


CAMPBELLSVILLE, Ky. – "My name is not the name my past calls me. The only name I answer to is the one our eternal Father calls me. The enemy has no power," Gabby Pyles, a senior at Lindsey Wilson College, said on the first night of Highway 55 Revival.
The first night of the Highway 55 Revival was held at the Ransdell Chapel in Campbellsville. It was a worship night with a very brief word on identity from Pyles.
She also said, "We are chosen, a bright light in a dark world, healed by His wounds.
"It is possible to wear kindness, but to wear shame at the same time. Knowing something and believing something are completely different.
Sandra Stillwell, a Campbellsville University senior from Elizabethtown, Ky., said about the Highway 55 Revival, "Two rival schools. Two nights. One purpose—Jesus. Revival was incredible.
"There's been a shift in perspective, understanding and worship—not only for myself, but for those involved. Seeing two communities unified solely to praise the Lord, has shook me. It would be an understatement to say my life's been altered.


Context. Ragozzine & Brown presented a list of candidate members of the first collisional family to be found among the trans-Neptunian objects (TNOs), the one associated with (136108) Haumea (2003 EL61).
Aims. We aim to identify which of the candidate members of the Haumea collisional family are true members, by searching for water ice on their surfaces. We also attempt to test the theory that the family members are made of almost pure water ice by using optical light-curves to constrain their densities.
Methods. We use optical and near-infrared photometry to identify water ice, in particular using the colour as a sensitive measure of the absorption feature at . We use the filter of the new Hawk-I instrument at the VLT as a short H-band (HS) for this as it is more sensitive to the water ice feature than the usual H filter.
Results. We report colours for 22 candidate family members, including NIR colours for 15. We confirm that 2003 SQ317 and 2005 CB79 are family members, bringing the total number of confirmed family members to 10. We reject 8 candidates as having no water ice absorption based on our Hawk-I measurements, and 5 more based on their optical colours. The combination of the large proportion of rejected candidates and time lost to weather prevent us from putting strong constraints on the density of the family members based on the light-curves obtained so far; we can still say that none of the family members (except Haumea) require a large density to explain their light-curve.
Based on observations collected at the European Southern Observatory, La Silla & Paranal, Chile – http://archive.eso.org/wdb/wdb/eso/sched_rep_arc/query?progid=81.C-0544 & http://archive.eso.org/wdb/wdb/eso/sched_rep_arc/query?progid=82.C-0306.


text:
ReviewsMovie Reviews
Courtesy of DC Entertainment
Movie Review: Batman v Superman: Dawn of Justice
Derek Spicer
Movie Reviews, Reviews
*Massive Spoilers Below*
The almost three year wait for the release of Batman v Superman is finally over. I'm more relieved about its arrival than anything else, to be honest. With its arrival, the launch of DC's larger cinematic universe has really begun. It's reception? Well, to say this movie is divisive is an understatement. I don't think I've ever seen a movie divide fans and critics as much as Batman v Superman, except maybe its predecessor, Man of Steel, coincidentally. Professional critics are ripping this movie apart with a low 30s rating on Rotten Tomatoes and a mediocre score on Metacritic. General audience goers, on the other hand, have been much kinder with a 74% audience approval score on Rotten Tomatoes and a 7.5 IMBD score. Those aren't universal acclaim numbers, but they are miles apart from the establishment critics. Combined with the really high box office numbers, around $170 million in its opening weekend domestically and $425 million worldwide, I think there will be an interesting story to tell as to why the "experts" differ so vastly in their opinion of this film from the average viewer.
As for the movie itself, there are a few general consensus things about this film that even the most negative reviewers have about this film. For starters, it is a beautifully shot film. The cinematography was phenomenal. I'd say Oscar-worthy. When you go to see this movie, I highly recommend seeing it on the largest screen possible to have the fullest experience. It's that good. On a performance level, there are two characters that stand out: Ben Affleck's Batman and Gal Gadot's Wonder Woman.
A major thing I was worried about when they first announced Ben Affleck as the new Batman all the way up to the release of this film was would I be able to see Ben Affleck as Bruce Wayne/Batman or would I just see only Ben Affleck on screen and all the baggage that comes with him. I'm ecstatic to report my fears were completely unfounded. Affleck knocks his depiction of the Dark Knight out of the park. Personally, I enjoyed him more as Bruce Wayne in this film than I did as Batman, but I thoroughly loved both. Affleck stunned me with how he was able to convey Batman's raw anger, bitterness, and even helplessness as an older, grizzled, and wounded warrior with such poise that I'm really looking forward to a solo Batman film. I hope Affleck gets the opportunity to direct it as well as a fan of his work shooting Argo. The fight scene you see in the trailer, in which you see him completely dominate a room of a dozen armed goons, came disappointingly late in the film, but it was a thing of beauty. I wish they had more moments like that one.
Throughout the movie, Bruce Wayne is plagued by nightmares mostly revolving around the death of his parents, fears of an unchecked Superman, and the helplessness he felt when he saw Zod and Superman tear Metropolis apart with their fight. There's one particular sequence, seen in trailers and in released stills prior to the release, which takes place in the desert in what looks like a post-apocalyptic Gotham or Metropolis with Darkseid's Omega symbol carved into the sand. I'll come back to Darkseid later since he has a very strong, albeit unseen, presence in this film. It's a wonderful scene from a visual standpoint, but it can leave the casual viewer confused as to what's happening. Adding to the confusion is that the dream seems to be a dream within a dream, Inception-style. It is also our first Justice League member cameo appearance in the form of Ezra Miller's Flash. Bruce is woken up from the desert nightmare to what looks like the Flash struggling through a time portal with a cryptic warning to Bruce. The Flash mentions something about, "Lois Lane being the key," and, "you were right about him." Afterwards, the Flash, who utters, "I'm too early," is pulled back by the whirlwind of the portal before he's able to give Bruce the complete warning and Bruce wakes up shaken. It's a very cool sequence to watch, but probably left many, including myself at first, scratching their heads as to what on Earth just happened.
One interesting element to Affleck's Batman that seems to have gotten drowned or at least pushed to the side because of all the hoopla surrounding the film's critical reception is that this new Batman's portrayal, I think, is quite controversial. This Batman is not afraid to kill people and even occasionally uses guns to do it. Dream or nightmare sequences aside, this Batman killed, directly and indirectly, I'd estimate at least a dozen people. All bad guys of course, but, nonetheless, it marks a turning point in the cinematic portrayal of Batman from Nolan's Dark Knight Trilogy. Or a return to form if you want to go all the way back to Burton's Batman. He's not apologetic about it either. A car full of gunmen in his way shooting at him? Blows it up. A henchman pulling the pin from a grenade to toss at Batman? Throw a batarang at it causing the henchman to drop the grenade, killing the group around him. Big boss with a flamethrower pointed at an innocent? Shoot the canister causing it to explode. As was repeatedly emphasized to death in the marketing for this film, this version of Batman was heavily influenced by Frank Miller's "Dark Knight Returns" Batman, and, in this way, it comes across blatantly.
The set up for the showdown between Batman and Superman can get muddled and confusing at times. This is where I recommend going to see the movie a second time because a lot of the elements I found confusing or seemingly random actually made a lot more sense. This is one area where I believe Zack Snyder will need help with when he takes the helm of the Justice League movies that start shooting in a month. He needs either someone to co-direct with him or someone to help him with the editing process. The pieces for a great epic are all there, they just get a little jumbled at times, which is where I think Snyder lost many of the critics. I think with a bit of re-editing in the first act, this movie would've achieved universal acclaim. Unfortunately for Snyder, most people won't go back to see the movie a second time. There's just so much thrown at you, it takes a while to digest it. Once I was able to digest it and go back to see it again, it was very easy to follow and more of the plot points clicked into place.
The lynchpin for the clash of DC titans was Jesse Eisenberg's Lex Luthor. From the get go, it's plain to the viewer Luthor is the one driving Batman and Superman to fight. Luthor's motivations for hating Superman and wanting him to fight Batman are a bit rushed, but otherwise they are solid enough. Motivated in part by fear of another Kryptonian attack, but mostly not wanting an all-powerful being interfering with his megalomaniacal interests, Luthor manipulates geopolitics and the criminal element to tarnish Superman's reputation further and fuel Batman's anger at the Man of Steel. There's another, I believe, hidden motive behind Luthor's actions, but I'll come to that at the end.
As for Eisenberg's performance, it was…interesting. I won't say good or bad because I honestly haven't made up my mind. On the one hand, he can be very menacing. On the other hand, he can be cringingly cartoonish. I've had many friends tell me they either loved or hated Eisenberg's portrayal of Lex Luthor. Coincidentally, among my friends, there seems to be a positive correlation between the opinion of Jesse Eisenberg's interpretation of Luthor and the opinion of the film as a whole. I don't think correlation equals causation in this case, but I wonder if there's something to that connection. My favorite moment for Eisenberg's Luthor occurs when he's not even on the screen. It's the Senate hearing where he leaves a jar in front of Holly Hunter's Senator June Finch, alluding to a conversation those two had earlier where Senator Finch blocked Luthor's path to import Kryptonite to potentially use as a deterrent against Superman. He lets her know she's about to die right before the Senate room explodes killing all, including his assistant Mercy Graves. Well all, except Superman, who gets partially blamed for the attack. Without that sequence, I probably would've leaned more towards the negative, but I don't feel strongly one way or the other. I think his portrayal works just fine in the context of this film.
The actual fight is both amazing and disappointing at the same time. While it was an excellent action sequence with Batman's fabled prep-time coming into play with force, it was relatively brief. I wasn't expecting Revenge of the Sith Obi-Wan and Anakin on Mustafar length fight, but I was hoping for something more than what amounted to a one-side skirmish. I say one-sided because Batman utterly kicked Superman's ass. It wasn't even a competition. That's what Kryptonite will do I guess. At the end, Batman has his armored boot on Superman's neck prepared to finish him off with a Kryptonite spear before Superman manages to break through Batman's judgment-clouding anger with help from a last minute rescue by Lois Lane. It was actually one of the few tear-jerking, touching moments of the film. When Superman utters, "you're letting him kill Martha," it very visibly rattles Batman. Superman explains he was compelled to fight Batman because Luthor has kidnapped his mother, who shares a first name with Batman's mother. I noticed there were a lot of complaints as to why we need to see Bruce Wayne's parents killed on-screen again, but I thought Snyder did a brilliant job of tying it into this moment. In their first act as a team, Batman offers to rescue Martha Kent for Superman, so that Superman can deal with Luthor. The epic Batman fight sequence I alluded to earlier is him rescuing Martha Kent, which he successfully does. Never come between Batman and a mother named Martha it seems.
Leave it to Luthor to have one more ace up his sleeve or I guess a doomsday plan in this case. Yes, the giant, hulking creature from the third trailer is Doomsday. Using the body of General Zod, the genesis chamber in the crashed Kryptonian ship quarantined since the events of Man of Steel, and his own blood, Luthor is able to unleash Doomsday just as Superman and Batman believe they have the upper hand on him. Superman tries to save Metropolis by pushing Doomsday into space until the military launches a nuke at both of them, which only temporarily disables Superman and Doomsday. Batman lures Doomsday back to the abandoned port of Gotham, where he fought Superman, in order to retrieve the Kryptonite spear in the hopes it can kill the Kryptonian-based Doomsday. Unfortunately for Batman, Doomsday knocks his Batwing out of the sky and is prepared to blast him to dust, which is where you see the line from the trailer of Batman uttering, "Ah shit!" However, in what was my absolute favorite moment from the film, Wonder Woman leaps in front of the blast to deflect it with her bracelets. When the camera panned out on Gal Gadot in her complete Wonder Woman attire with her heart-pumping theme playing in the background, the audience at the theater I was in cheered loudly. Her arrival at that moment was a culmination of events that I believe was executed flawlessly by Snyder.
Throughout the film, Gal Gadot's Wonder Woman, as her alter-ego Diana Prince, has her own shadowy agenda that has her crossing paths with both Bruce Wayne and Clark Kent. Gadot and Affleck, in particular, have great on-screen chemistry. She is trying to get back a photograph of her that proves she isn't a normal person, but rather a seemingly-immortal meta-human. Diana is very much the doorway to the Justice League set-up. Bruce Wayne discovers the photo in LexCorp's archives along with a set of files on three other meta-humans: Flash, Aquaman, and Cyborg. He sends those files to Diana. In the files are captured footage of the three future Justice League members in some form. The Flash uses his speed out of costume to stop an armed robbery; Aquaman, fierce glowing eyes and all, destroys an underwater surveillance drone with his trident; and Doctor Silas Stone, using what appears to be a Mother Box, Darkseid technology, repairs his son's body turning his son, Victor, into Cyborg. See what I mean about Darkseid looming over this film? Finally, as Diana is about to leave Metropolis she sees Doomsday's arrival on the news. She decides she can't let innocents die just to keep knowledge of her existence from coming out. She easily could've walked away from man's world again, which is what she apparently did 100 years ago, but she chooses to stay and fight. Let me tell you, she can fight.
The Doomsday fight with Batman, Wonder Woman, and a yellow-sun rejuvenated Superman was a spectacle to behold. It was quite amusing to watch Batman just try to dodge all of Doomsday's attacks while Wonder Woman was getting solid cuts in with her sword. Between all the visuals, sound effects, and energy blasts, the fight reminded me of something I might see in a live-action Dragonball Z fight. It even included Frieza-esque mid-battle evolutions by Doomsday, who, despite all the vicious Superman punches and Wonder Woman cuts, kept getting more powerful and spikier as the fight progressed. The fight concluded when Superman impaled Doomsday with the Kryptonite spear while Wonder Woman used her lasso to hold Doomsday down after Batman weakened him with a Kryptonite gas grenade. However, Doomsday used his spiked limb, originally a hand cut off by Wonder Woman before it regenerated into a deadly weapon, to impale Superman, killing him. Yes, similar to the "Death of Superman" issue that marked Doomsday's first arrival in comics, Doomsday and Superman end up killing each other. It's a very ballsy move on Warner Bros. part to kill one of the DC trinity right before a Justice League movie. Clark Kent and Superman get dueling funerals in a beautiful sequence. The nation mourns an empty casket in Washington while family and friends, Martha Kent, Lois Lane, Bruce Wayne, and Diana Prince primarily, have a private memorial in Smallville. After the service, Bruce tells Diana that he won't fail Superman in death as he did in life. He asks her help to track down the other meta-humans because, as Bruce says, he'll need their help to stop an upcoming threat. That threat, as mentioned earlier, is strongly hinted at being Darkseid. This is further solidified in a conversation between Batman and a recently imprisoned and head-shaven Lex Luthor. Lex rambles, "he's coming," and that the, "bell can't be unrung." The implication that Darkseid is on his way to Earth. Most likely, he learned about Darkseid from the Kryptonian genesis chamber along with the knowledge to create Doomsday. Why? We'll just have to wait and see.
Who is this Darkseid? He is the ruler of the planet Apokolips, a harsh, fiery world in the DC universe. Darkseid is bent on controlling the nature of life itself and is probably the most dangerous of all of Superman's and the Justice League's villains. He's highly intelligent, ruthless, merciless, incredibly strong, commands a powerful army of Parademons, the winged creatures from the "Knightmare" desert dream sequence, and has this ability called Omega beams, which are similar to Superman's laser beams except Darkseid's are much more powerful and will continue to seek a target until they hit it making them almost inescapable. Darkseid was the inspiration behind the creation of Marvel's Thanos. Marvel had a tendency to copy many elements of DC characters, this being one of them. He also has the ability to influence and corrupt those around him, which might explain the "Knightmare" Bruce Wayne has depicting an army of Superman cultists and Parademons led by a vengeful, murderous Man of Steel. Perhaps, what Bruce Wayne is seeing is not a dream, but rather a vision or maybe even a memory of an alternative universe. The Flash appearance could've been a warning from the future in order to change the past to prevent that reality from happening. Needless to say, in order to fight Darkseid, Batman and Wonder Woman are going to need all the help they can get to defeat him, especially with Superman dead. Well, maybe not. The final shot of the film is a big cliffhanger that leaves in question whether or not Superman is really dead. I guess we'll see in the Justice League film next year. My guess is they might be going with elements of Injustice: Gods Among Us or Flashpoint, particularly with that Flash cameo near the beginning, but the stage is set for a superhero team-up no matter what direction they decide to go in. It's an interesting coincidence that Superman decides to make the ultimate sacrifice for humanity most-likely leading to his resurrection in a film released Easter weekend.
Despite fears that there would be too many characters weighing down the plot, particularly the Justice League introductions, the supporting cast held up. Lois Lane injected much-needed humanity into Superman when she and Superman had some heart-to-heart moments. I really felt her grief at Superman's death in that final shot of her crying over Superman's body while Batman and Wonder Woman sullenly look on. Perry White was pretty much non-stop sarcasm and wit. If you had a comic relief element to the film it was Lawrence Fishburne's Perry White. Diane Lane's Martha Kent had some strong moments too, including a nice humorous moment between her and Batman. I'm certainly interested in seeing this R-rated three-hour ultimate cut. I wonder if some of the pacing issues happened because it's written as a three-hour movie that couldn't cleanly be cut down to two and a half hours for cinematic and ticket sales purposes.
Batman v Superman has made fans excited, at the very least, for Wonder Woman, a hopefully soon-to-be-announced solo Batman flick, as well as the upcoming Suicide Squad movie this August. Warner Bros. and DC have built a beautiful, serious, and engaging cinematic world. I hope they don't get skittish and overreact to these negative reviews. They aren't series-crushing by any stretch, but I do think there are a few elements they can learn and alter to make them more broadly appealing. I just hope they don't destroy the core of what makes them good in the process. Chances are this film will still make $1 billion at the worldwide box office, assuming audience reviews remain consistently above average as they are, so there's no need to panic on Warner Bros. part. It's the story critics hated not the characters, so tell an even better story with these great characters. The raw materials are there. Overall, I'd say most of the problems of this film occurred in the post-production phase, which I'm confident Warner Bros. will make sure they have someone looking over Snyder's shoulder so as to have a much smoother ride for the Justice League films. Despite that, the film was still very enjoyable, and I plan on seeing a third time but in IMAX. I loved it that much.
A bold ending with a solid Justice League set-up
Superb new Batman and Wonder Woman; a humanized and heroic Superman with great on-screen chemistry among the whole cast
Well choreographed fight scenes including Batman/Superman and Doomsday
Post-production editing
Over-reliance on dream sequences
Can be confusing to non-DC Comics fans at times
9Overall Score
Batman v SupermanBatman v Superman: Dawn of JusticeDCDC EntertainmentWarner Bros.Zack Snyder
Derek works as the Development Administrator for Young Americans for Liberty Foundation. He is a huge fan of nerd culture, whose interests include but are not limited to Star Wars, DC Comics, Game of Thrones, Marvel's Cinematic Universe, The Arrow, The Flash, and the upcoming DC Cinematic Universe. He currently resides in Alexandria, Virginia.
Mark Hamill Unearths Lost Batman '89 Storyboard Introducing Robin
JB Augustine
John Carpenter and Anthony Burch Are Teaming Up to Write Joker One-Shot


Sorry, we cant ship to your state, but we do have distributors there. Please contact us to place an order.
Sorry, we cant ship to your state. Please contact us for more information.
NZ delighted critics and admirers alike when we premiered our Sav Blancs to the world and set an international benchmark. In fact, if you have had only one wine from New Zealand, it probably was a Sav Blanc! But now it's time to discover our other whites: Chardonnay, Pinot Gris, Gewurztraminer… all burst out of the glass, ready to tempt your tastebuds and lead you to your next discovery.
JOIN CRUX, and save 10% off your first order!
Join our exclusive wine fellowship and you'll receive an immediate 10% off your initial online order. Plus a wide range of Crux-only exclusives, special offers and surprises.
Our Master Sommelier has made a few special selections for Crux members only, available in limited supply at 15% off.
Introducing Crux, your personal source for our very best wines.
NZ Wine Navigator Crux members enjoy "first in line" access to our most important wines, as well as special offers and savings, exclusive content and advice from Master Sommelier Cameron Douglas, and additional "members only" privileges. Plus, 10% off your first order.
By submitting your email and joining Crux, you agree to receive NZ Wine Navigator emails.
Already a Crux member? Log in now.
Not a Crux member? Sign up now.


Is the T-REX Badge Included?
What brand are T-Rex Lights?
T-Rex Torch Grille light info. Size of light, amps, watts, lumens.
RMAs (Return Material Authorization), how do I go about returning something?
My T-Rex Torch grille has more than one light. Do I need a separate harness for each light?
Is my T-Rex product under warranty? How do I start the warranty process?
How do I look up part numbers on the T-Rex website?
Does T-Rex build custom grilles?
Does T-REX Grilles allow for will call pickup?
Q: Is the T-REX Badge Included?
Dodge re-branded their truck division in 2009 from Dodge Ram to RAM. Grilles for application of 2009 and later are listed under the brand name RAM. Reset the Year, Make, Model, search and use the brand RAM to locate applicable products.
LED Light Diagnostics All testing should be performed with a multimeter. A test light will not tell you voltage, it will only tell you if power is present or not. Initial Diagnostics Before you get into more in-depth testing ensure the following 1.	Heavy Red wire is attached to battery positive terminal. 2.	Battery is fully charged and has charge of 12 volts 3.	Heavy Black wire is attached to battery negative terminal. 4.	Check fuse to ensure it is not blown. Switch Diagnostics; 1. Center wire wire should have 12 volts at all times. 2. One of the outside wires should have 12 volts when switch is in the on position. 3. The other outside wire goes to ground and runs through the harness and attaches to Terminal 85 on the relay. Relay Diagnostics; •	Terminal 30 – This is the main power wire coming from the battery and should have 12 volts at all times. •	Terminal 85 – This terminal goes to ground thru the heavy black wire attached to the battery negative terminal. •	Terminal 86 – This will have 12 volts when the switch is in the ON position. If no power here when the switch is on, then the switch is bad. •	Terminal 87 – This is the power out to the light and will have 12 volts when the switch is in the ON position. If Terminal 86 has 12 volts when the switch is on, but no voltage is read on this terminal, then the relay is bad. •	Terminal 87A – Not Used •	If the relay chatters when activated, then it is receiving low voltage (under 10.5 volts). Recheck voltage reading on Terminal 30 and 86 and make necessary corrections to restore 12 volts to these terminals.
Q: What brand are T-Rex Lights?
T-Rex LED Lights are a private label ZROADZ brand that we have made to our specifications. We use the highest quality CREE chips, an extruded aluminum housing and a poly-carbonate lens with precision optics. The light pattern and distance is equivalent and sometimes better when compared to other leading brands of LED lights and light bars.
Q: T-Rex Torch Grille light info. Size of light, amps, watts, lumens.
We use a variety of light sizes in our Torch grilles. Please contact our customer service department at 800-287-5900 for details of the lights included in the grille you are interested in.
Q: RMAs (Return Material Authorization), how do I go about returning something?
Contact the company from which the item was purchased and ask for an RMA (Return Material Authorization). Click Here for more product return information.
Q: My T-Rex Torch grille has more than one light. Do I need a separate harness for each light?
Our wiring harnesses are designed to accommodate a 15 amp draw. If the lights have a combined amp draw of less than 15 amps you can use the harness as is and simply wire the lights in series. If the combined amperage draw is above 15 amps, the fuse will need to be upgraded to the appropriate rating. We suggest using a fuse rated 5 amps higher then the the anticipate amperage draw. The relay in our harness is rated at 30 amps and will accommodate any combination of light bars we currently offer. The downside to using a single harness on multiple lights is they are either all on or all off. Sometimes this is not desirable in which case separate harnesses are required.
Q: Is my T-Rex product under warranty? How do I start the warranty process?
T-REX grilles are covered by a limited lifetime structural warranty and a three-year warranty on the finish. If you experience a problem with your T-REX grille email details to . Please note all returns are taken care of via email.
In the unlikely event that your T-REX grille must be returned for warranty consideration, please follow the instructions below. Ensure the following information is available when contacting our customer service department.
1.Copy of original purchase receipt.
2.Description of the problem or issue.
3.Images of the product defect. The more clearly the images identify the issue, the faster your claim can be processed.
4.Shipping address the replacement item is to be sent to.
Please choose one of the following options for warranty processing and indicate your choice on your initial return request.
1. I would like to receive a replacement part before I send my part back – This option will resolve the issue the quickest but will require us to have a current credit card on file. Our customer service department will send you a credit card authorization form and keep it on file until the warranty process is complete. Credit card information will be destroyed once the procedure is done. The return label will be provided in the replacement box.
2. I would like to send my item back to T-REX for warranty consideration before a replacement is sent. You will not be required to submit credit card information using this method. Once you provide all the information being requested T-Rex will provide you with a return label.
T-REX will cover the cost of outbound shipping on ground service only. Upgraded shipping (next day, 2nd day etc) costs will not be paid for by T-REX. Ensuring proper internal packing is your responsibility. Damage resulting from improper/inadequate internal packing is not covered under warranty. Damage claims for products shipped to T-REX must be initiated and managed by the shipper. T-REX will hold damaged products for a period of 30 days after receipt or until the claim is completed whichever occurs first, after which the product will be returned to the customer at their expense or scrapped. A product that has been determined to have been modified or abused is not eligible for warranty relief. You will be contacted by T-REX to determine disposition of the product in question.
Email our customer service department at customerservice@trexbillet.com with the above information. Once this information is received and the issue evaluated, we will be contacting you with further instructions, so please make sure the email address and/or phone number you provide are your primary email and/or phone number. Please note, open warranty claims must be completed within 45 days of RMA issuance.
T-REX wiring harness part number 639HAR1 is the best way to ensure your Torch grille operates properly. This harness simplifies wiring and ensures proper ground and power are applied to your Torch grille. In the event you choose to wire your Torch grille yourself we have found the most common occurrence of non operation of our Torch LED lights can be linked to inadequate grounding or low voltage. All ground wires need to be affixed to a non painted metal surface or directly to the negative terminal on the battery. T-REX Torch LED lights are reverse polarity protected and require a minimum of 10 volts to operate. Please call our technical department at: 800.287.5900 if you need further assistance.
Q: How do I look up part numbers on the T-Rex website?
If you know the part number, simply enter it into the search box and choose search. Your part number and any variations will be displayed. If you would like to see all grilles and associated parts for your vehicle, simply enter the year make and model into the vehicle look up and all parts will be displayed.
Q: Does T-Rex offer sponsorships?
For information and eligibility requirements, visit the T-Rex Grilles Support & Sponsorship page.
Q: Does T-Rex build custom grilles?
At this time, T-Rex does not make custom grilles.
T-REX grilles are finest in the industry but do require normal care. Wash regularly as you would when caring for your vehicles. Never use dish soap.
T-REX polished grilles should be waxed at the same time that you wax the vehicle and can be cleaned with soap and water. A polished finish can be cared for in the same fashion that would care for your vehicles factory chrome. Be sure to dry carefully with a soft micro fiber towel and never leave wet water spots as that may leave a blemish.
Paint warranty applies to defects in material and / or workmanship, it does not cover the matte finish surface appearance. To enjoy the matte appearance for many years to come, please follow these owner care and maintenance tips. Get a no-shine matte car wash soap that uses no fillers, no silicone, and won't strip your matte paint of its layer of protection.
Do not use wax, detail spray, armorall®, or any products made for normal paint. Use only products specifically developed for matte finish paint. Do not use products that are even mildly abrasive, such as polishes, glazes, or rubbing compounds. do not use mechanical cleaners or polishers. Do not use terrycloth, cloth, or paper towels. Do not rub the finish vigorously, this will burnish the paint finish, causing a permanent shiny spot. Shiny spots cannot be removed.
Do not use commercial car wash facilities or their shine enhancement products. Most car wash brushes, large mechanized "towels," and shine enhancement products can damage matte paint.
Remove foreign substances such as insect remains, tar, and road debris using a soft applicator and a mild solvent; saturate and soak area before cleaning—rub lightly.
Hand-wash with a soft wash mitt and mild cleaning product safe for matte paint. Use microfiber cleaning cloths with alcohol-based window cleaner for basic surface clean-up.
T-Rex Grilles with Gloss Black Powder Coated Finish may be washed regularly as you would when caring for your vehicles finish using soap and water. T-REX grilles should be waxed at the same time that you wax the vehicle. As a general rule, anything you use to clean your vehicles painted surfaces can be used to clean and maintain your T-REX grille. A Gloss powder Coated Finish can be cared for in the same fashion that you would care for your vehicles factory paint job. Never leave wet water spots as that may leave a blemish.
Q: Does T-REX Grilles allow for will call pickup?
Yes. You may arrange for pickup with customer service. Just leave a memo note at the time of purchase.