'; exit; } else if( is_dir($game ) && $game != "images" && $game != "trailers" && $game != "_template" ) { echo ' Instructions
'; // Todo: These steps will fail if safemode is turned on if( !is_dir($game.'/images') ) { mkdir($game.'/images'); } if( !is_dir($game.'/trailers') ) { mkdir($game.'/trailers'); } if( !file_exists($game.'/_data.xml') ) { copy('_template/_data.xml',$game.'/_data.xml'); } exit; } else { header("Location: index.php"); exit; } } $press_request = TRUE; $monetize = 0; $xml = simplexml_load_file($game."/data.xml"); foreach( $xml->children() as $child ) { switch( $child->getName() ) { case("title"): define("GAME_TITLE", $child); break; case("release-date"): define("GAME_DATE", $child); break; case("website"): define("GAME_WEBSITE", $child); break; case("platforms"): $platforms = array(); $i = 0; foreach( $child->children() as $subchild ) { $platforms[$i][$subchild->getName()] = $subchild; $i++; } break; case("prices"): $prices = array(); $i = 0; foreach( $child->children() as $subchild ) { $prices[$i][$subchild->getName()] = $subchild; $i++; } break; case("description"): define("GAME_DESCRIPTION", $child); break; case("history"): define("GAME_HISTORY", $child); break; case("histories"): $histories = array(); $i = 0; foreach( $child->children() as $subchild ) { $histories[$i][$subchild->getName()] = $subchild; $i++; } break; case("features"): $features = array(); $i = 0; foreach( $child->children() as $subchild ) { $features[$i] = $subchild; $i++; } break; case("trailers"): $trailers = array(); $i = 0; foreach( $child->children() as $subchild ) { $trailers[$i][$subchild->getName()] = $subchild; $i++; } break; case("awards"): $awards = array(); $i = 0; foreach( $child->children() as $subchild ) { $awards[$i][$subchild->getName()] = $subchild; $i++; } break; case("quotes"): $quotes = array(); $i = 0; foreach( $child->children() as $subchild ) { $quotes[$i][$subchild->getName()] = $subchild; $i++; } break; case("press-can-request-copy"): if( strtolower($child) == "false" ) $press_request = FALSE; else $press_request = TRUE; break; case("monetization-permission"): if( strtolower($child) == "false" ) $monetize = 1; else if( strtolower($child) == "ask") $monetize = 2; else if( strtolower($child) == "non-commercial") $monetize = 3; else if( strtolower($child) == "monetize") $monetize = 4; break; case("additionals"): $additionals = array(); $i = 0; foreach( $child->children() as $subchild ) { $additionals[$i][$subchild->getName()] = $subchild; $i++; } break; case("credits"): $credits = array(); $i = 0; foreach( $child->children() as $subchild ) { $credits[$i][$subchild->getName()] = $subchild; $i++; } break; case("promoter"): $promoterawards = array(); $promoterquotes = array(); $promotercode = ($child->children()); $promotercode = $promotercode->product; $promoterxml = simplexml_load_file('http://promoterapp.com/dopresskit/'.$promotercode); foreach( $promoterxml->children() as $promoterchild ) { switch( $promoterchild->children()->getName() ) { case("review"): $i = 0; foreach( $promoterchild->children() as $promotersubchild ) { $promoterquotes[$i][$promotersubchild->getName()] = $promotersubchild; $i++; } break; case("award"): $i = 0; foreach( $promoterchild->children() as $promotersubchild ) { $promoterawards[$i][$promotersubchild->getName()] = $promotersubchild; $i++; } break; } } break; } } $xml = simplexml_load_file("data.xml"); foreach( $xml->children() as $child ) { switch( $child->getName() ) { case("title"): define("COMPANY_TITLE", $child); break; case("based-in"): define("COMPANY_BASED", $child); break; case("description"): define("COMPANY_DESCRIPTION", $child); break; case("analytics"): define("ANALYTICS", $child); break; case("contacts"): $contacts = array(); $i = 0; foreach( $child->children() as $subchild ) { $contacts[$i][$subchild->getName()] = $subchild; $i++; } break; } } function parseLink($uri) { $parsed = trim($uri); if( strpos($parsed, "http://") === 0 ) $parsed = substr($parsed, 7); if (strpos($parsed, "https://") === 0 ) $parsed = substr($parsed, 8); if( strpos($parsed, "www.") === 0 ) $parsed = substr($parsed, 4); if( strrpos($parsed, "/") == strlen($parsed) - 1) $parsed = substr($parsed, 0, strlen($parsed) - 1); if( substr($parsed,-1,1) == "/" ) $parsed = substr($parsed, 0, strlen($parsed) - 1); return $parsed; } echo ' '. COMPANY_TITLE .'
'; if( file_exists($game."/images/header.png") ) { echo ''; } echo '

Factsheet

Developer:
'. COMPANY_TITLE .'
Based in '. COMPANY_BASED .'

Release date:
'. GAME_DATE .'

Platforms:
'; for( $i = 0; $i < count($platforms); $i++ ) { $name = $link = ""; foreach( $platforms[$i]['platform']->children() as $child ) { if( $child->getName() == "name" ) { $name = $child; } else if( $child->getName() == "link" ) { $link = $child; } } echo ''.$name.'
'; } echo '

Website:
'. parseLink(GAME_WEBSITE) .'

Regular Price:
'; if( count($prices) == 0 ) { echo '-'; } else { echo ''; for( $i = 0; $i < count($prices); $i++ ) { $currency = $value = ""; foreach( $prices[$i]['price']->children() as $child ) { if( $child->getName() == "currency" ) { $currency = $child; } else if( $child->getName() == "value" ) { $value = $child; } } echo ''; } echo'
'.$currency.''.$value.'
'; } echo'

Description

'. GAME_DESCRIPTION .'

History

'; for( $i = 0; $i < count($histories); $i++ ) { $header = $text =""; foreach( $histories[$i]['history']->children() as $child ) { if( $child->getName() == "header" ) $header = $child; else if( $child->getName() == "text" ) $text = $child; } echo ''.$header.'

'.$text.'

'; } if( defined("GAME_HISTORY") ) { echo '

'. GAME_HISTORY .'

'; } for( $i = 0; $i < count($histories); $i++ ) { $header = $text =""; foreach( $histories[$i]['history']->children() as $child ) { if( $child->getName() == "header" ) { $header = $child; } else if( $child->getName() == "text" ) { $text = $child; } } echo ''.$header.'

'.$text.'

'; } echo '

Features

    '; for( $i = 0; $i < count($features); $i++ ) { echo '
  • '.$features[$i].'
  • '; } echo '

Videos

'; if( count($trailers) == 0 ) { echo '

There are currently no trailers available for '.GAME_TITLE.'. Check back later for more or contact us for specific requests!

'; } else { for( $i = 0; $i < count($trailers); $i++ ) { $name = $youtube = $vimeo = $mov = $mp4 = ""; $ytfirst = -1; foreach( $trailers[$i]['trailer']->children() as $child ) { if( $child->getName() == "name" ) { $name = $child; } else if( $child->getName() == "youtube" ) { $youtube = $child; if( $ytfirst == -1 ) { $ytfirst = 1; } } else if( $child->getName() == "vimeo" ) { $vimeo = $child; if( $ytfirst == -1 ) { $ytfirst = 0; } } else if( $child->getName() == "mov" ) { $mov = $child; } else if( $child->getName() == "mp4" ) { $mp4 = $child; } } if( strlen($youtube) + strlen($vimeo) > 0 ) { echo '

'.$name.' '; $result = ""; if( strlen( $youtube ) > 0 ) { $result .= 'YouTube, '; } if( strlen( $vimeo ) > 0 ) { $result .= 'Vimeo, '; } if( strlen( $mov ) > 0 ) { $result .= '.mov, '; } if( strlen( $mp4 ) > 0 ) { $result .= '.mp4, '; } echo substr($result, 0, -2); if( $ytfirst == 1 ) { echo '

'; } elseif ( $ytfirst == 0 ) { echo '
'; } echo '

'; } } } echo '

Images

'; if( file_exists($game."/images/images.zip") ) { $filesize = filesize($game."/images/images.zip"); if( $filesize > 1024 && $filesize < 1048576 ) { $filesize = (int)( $filesize / 1024 ).'KB'; } if( $filesize > 1048576 ) { $filesize = (int)(( $filesize / 1024 ) / 1024 ).'MB'; } echo '
download all screenshots & photos as .zip ('. $filesize .')
'; } echo '
'; if ($handle = opendir($game.'/images')) { $found = 0; /* This is the correct way to loop over the directory. */ while (false !== ($entry = readdir($handle))) { if( substr($entry,-4) == ".png" ) { if( substr($entry,0,4) != "logo" && substr($entry,0,4) != "icon" && substr($entry,0,6) != "header" ) { echo '
'.$entry.'
'; $found++; } } } } echo '
'; closedir($handle); if ($found == 0) { echo '

There are currently no screenshots available for '.GAME_TITLE.'. Check back later for more or contact us for specific requests!

'; } echo '
'; if( file_exists($game."/images/logo.zip") ) { $filesize = filesize($game."/images/logo.zip"); if( $filesize > 1024 && $filesize < 1048576 ) { $filesize = (int)( $filesize / 1024 ).'KB'; } if( $filesize > 1048576 ) { $filesize = (int)(( $filesize / 1024 ) / 1024 ).'MB'; } echo '
download logo files as .zip ('. $filesize .')
'; } echo '
'; if( file_exists($game.'/images/logo.png') ) { echo '
logo
'; } if( file_exists($game.'/images/icon.png') ) { echo '
logo
'; } echo '
'; if( !file_exists($game.'/images/logo.png') && !file_exists($game.'/images/icon.png')) { echo '

There are currently no logos or icons available for '.GAME_TITLE.'. Check back later for more or contact us for specific requests!

'; } echo '
'; if( count( $promoterawards ) + count( $awards ) > 0 ) { echo('

Awards & Recognition

'); echo('
    '); if( count($promoterawards) >= 0 ) { for( $i = 0; $i < count($promoterawards); $i++ ) { $description = $info = ""; foreach( $promoterawards[$i]['award']->children() as $child ) { if( $child->getName() == "title" ) { $description = $child; } else if( $child->getName() == "location" ) { $info = $child; } else if( $child->getName() == "url" ) { $url = $child; } else if( $child->getName() == "year" ) { $year = $child; } } echo '
  • "'.$description.'" '.$info.'
  • '; } } if( count($awards) > 0 ) { for( $i = 0; $i < count($awards); $i++ ) { $description = $info = ""; foreach( $awards[$i]['award']->children() as $child ) { if( $child->getName() == "description" ) { $description = $child; } else if( $child->getName() == "info" ) { $info = $child; } } echo '
  • "'.$description.'" '.$info.'
  • '; } } echo '
'; echo '
'; } if( count($promoterquotes) + count($quotes) > 0 ) { echo '

Selected Articles

    '; if( count($promoterquotes) >= 0 ) { for( $i = 0; $i < count($promoterquotes); $i++ ) { $name = $description = $website = $link = ""; foreach( $promoterquotes[$i]['review']->children() as $child ) { if( $child->getName() == "quote" ) { $description = $child; } else if( $child->getName() == "reviewer-name" ) { $name = $child; } else if( $child->getName() == "publication-name" ) { $website = $child; } else if( $child->getName() == "url" ) { $link = $child; } } echo '
  • "'.$description.'"
    - '.$name.', '.$website.'
  • '; } } if( count($quotes) > 0 ) { for( $i = 0; $i < count($quotes); $i++ ) { $name = $description = $website = $link = ""; foreach( $quotes[$i]['quote']->children() as $child ) { if( $child->getName() == "description" ) { $description = $child; } else if( $child->getName() == "name" ) { $name = $child; } else if( $child->getName() == "website" ) { $website = $child; } else if( $child->getName() == "link" ) { $link = $child; } } echo '
  • "'.$description.'"
    - '.$name.', '.$website.'
  • '; } } echo '
'; echo '
'; } if( $press_request == TRUE ) { echo '

Request Press Copy

Please fill in your e-mail address below and we\'ll get back to you as soon as a press copy is available for you.

, writing for would like to

Alternatively, you can always request a press copy by sending us a quick email.

'; echo '
'; } if( $monetize >= 1 ) { echo '

Monetization Permission

'; if( $monetize == 1 ) echo('

'.COMPANY_TITLE.' does currently not allow for the contents of '.GAME_TITLE.' to be published through video broadcasting services.

'); if( $monetize == 2 ) echo('

'.COMPANY_TITLE.' does allow the contents of this game to be published through video broadcasting services only with direct written permission from '.COMPANY_TITLE.'. Check at the bottom of this page for contact information.

'); if( $monetize == 3 ) echo('

'.COMPANY_TITLE.' allows for the contents of '.GAME_TITLE.' to be published through video broadcasting services for non-commercial purposes only. Monetization of any video created containing assets from '.GAME_TITLE.' is not allowed.

'); if( $monetize == 4 ) echo('

'.COMPANY_TITLE.' allows for the contents of '.GAME_TITLE.' to be published through video broadcasting services for any commercial or non-commercial purposes. Monetization of videos created containing assets from '.GAME_TITLE.' is legally & explicitly allowed by '.COMPANY_TITLE.'. This permission can be found in writing at http://'. $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'].'.

'); echo '
'; } echo ' '; for( $i = 0; $i < count($additionals); $i++ ) { $title = $description = $link = ""; foreach( $additionals[$i]['additional']->children() as $child ) { if( $child->getName() == "title" ) { $title = $child; } else if( $child->getName() == "description" ) { $description = $child; } else if( $child->getName() == "link" ) { $link = $child; } } if( strpos(parseLink($link),'/') !== 0 ) { $linkTitle = substr(parseLink($link),0,strpos(parseLink($link),'/')); } else { $linkTitle = $link; } echo '

'.$title.'
'.$description.' '.$linkTitle.'.

'; } echo '

About '. COMPANY_TITLE .'

Boilerplate
'. COMPANY_DESCRIPTION .'

More information
More information on '. COMPANY_TITLE .', our logo & relevant media are available here.


'. GAME_TITLE .' Credits

'; for( $i = 0; $i < count($credits); $i++ ) { $previous = $website = $person = $role = ""; foreach( $credits[$i]['credit']->children() as $child ) { if( $child->getName() == "person" ) { $person = $child; } else if( $child->getName() == "previous" ) { $previous = $child; } else if( $child->getName() == "website" ) { $website = $child; } else if( $child->getName() == "role" ) { $role = $child; } } echo '

'; if( strlen($website) == 0 ) { echo ''.$person.'
'.$role; } else { echo ''.$person.'
'.$role.''; } echo '

'; } echo '

Contact

'; for( $i = 0; $i < count($contacts); $i++ ) { $link = $mail = $name = ""; foreach( $contacts[$i]['contact']->children() as $child ) { if( $child->getName() == "name" ) { $name = $child; } else if( $child->getName() == "link" ) { $link = $child; } else if( $child->getName() == "mail" ) { $mail = $child; } } echo '

'; if( strlen($link) == 0 && strlen($mail) > 0 ) { echo ''.$name.'
'.$mail.''; } if( strlen($link) > 0 && strlen($mail) == 0 ) { echo ''.$name.'
'.parseLink($link).''; } echo '

'; } echo '

presskit() by Rami Ismail (Vlambeer) - also thanks to these fine folks

'; if ( defined("ANALYTICS") && strlen(ANALYTICS) > 10 ) { echo ''; } echo' '; ?>