<commit_before><?php
// Version: 2.0 RC4; Index

$linguaggio = $settings['theme_dir'].'/languages/iPhone.language.' . $context['user']['language'] . '.php';
if (file_exists($linguaggio))
  require($settings['theme_dir'].'/languages/iPhone.language.' . $context['user']['language'] . '.php');
else
  require($settings['theme_dir'].'/languages/iPhone.language.english.php');


global $txt;

function template_init()
{
  global $context, $settings, $options, $txt;

  $settings['theme_version'] = '1.1';
  
  // Portal disabling mafia
  // SimplePortal
  $settings['disable_sp'] = true;

  // TinyPortal
  if (function_exists('tp_hidebars'))
    tp_hidebars();

  // PortaMX
  $_SESSION['pmx_paneloff'] = array('head', 'top', 'left', 'right', 'bottom', 'foot', 'front', 'pages' => 'Pages');
}

function template_html_above()
{
  global $context, $settings, $options, $scripturl, $txt, $modSettings;

  echo

'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>', $context['page_title_html_safe'], '</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" />
<link rel="stylesheet" media="screen" href="', $settings['theme_url'] ,'/style.css" type="text/css" />
<script type="application/x-javascript">

', (isset($_COOKIE['disablequoting'])) ? 'var aquoting = 1;

' : 'var aquoting = 0;

', 

'
var showchildboards = "', $txt['iShow'] ,' ', $txt['parent_boards'], '";
var hidechildboards = "', $txt['iHide'] ,' ', $txt['parent_boards'], '";
var quotingoff = "', $txt['iQuoting'],' ',$txt['iOff'], '";
var loading = "', $txt['iLoading'],'...";

</script>

<script type="application/x-javascript" src="'. $settings['theme_url'] .'/jquery-1.10.2.min.js"></script>
<script type="application/x-javascript" src="'. $settings['theme_url'] .'/jquery.autosize.min.js"></script>
<script type="application/x-javascript" src="'. $settings['theme_url'] .'/jquery.hammer.min.js"></script>
<script type="application/x-javascript" src="'. $settings['theme_url'] .'/touchy.js"></script>
<script type="application/x-javascript" src="'. $settings['theme_url'] .'/iphone.js"></script>',
((!empty($_GET['topic'])) && ($_GET['topic'])) ? '
<script type="application/x-javascript" src="'. $settings['theme_url'] .'/quote.js"></script>' : '';

  if ($context['user']['is_guest'])
  {
    $options['collapse_header'] = !empty($_COOKIE['upshrink']);
    $options['collapse_header_ic'] = !empty($_COOKIE['upshrinkIC']);
  }

  echo '
</head>
<body><div id="wrapper">';
}

function iPhoneTitle(){

  global $context;

  $title = str_replace($context['forum_name_html_safe'].' - ','',$context['page_title_html_safe']);
  
  if($title=='Index')
    $title=$context['forum_name_html_safe'];
  
  $title = str_replace('View the profile of ','',$title);
  
  $title = str_replace('Set Search Parameters','Search',$title);
  
    return $title;
  
  }

function template_body_above()
{

global $txt, $_GET, $context, $modSettings, $settings, $user_info, $scripturl;

echo '

<div id="topbar">';
if((!empty($_GET['action'])) && (($_GET['action']=='login') || ($_GET['action']=='register'))) {
  $loginregister=' style="display:none;"';
  }
else
  $loginregister='';
  echo'

  <h1 id="pageTitle">';
  
  if((!empty($_GET['action']))&&($_GET['action']=='login'||$_GET['action']=='register'||$_GET['action']=='login2'||$_GET['action']=='register2'))
    echo'
    <div id="titleSwitcher">';
  else
    echo'
    <div id="theTitle">', iPhoneTitle(), '</div>';  
  
  echo'</h1>
   
  <a href="#" id="showhidesearch" onclick="if(document.getElementById(\'searchbar\').style.display==\'block\'){document.getElementById(\'searchbar\').style.display=\'none\';}else{document.getElementById(\'searchbar\').style.display=\'block\';document.searchform.search.focus();}" id="tabsearch"', $issearch ,'></a>    

  </div>';

	echo '

  <div id="searchbar" class="inputContainer">

  <form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" name="searchform" id="searchform">

  <input type="text" name="search"', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', !empty($context['search_string_limit']) ? ' maxlength="' . $context['search_string_limit'] . '"' : '', ' tabindex="', $context['tabindex']++, '" />
  <input type="submit" id="searchbutton" class="button inputbutton" value="'. $txt['search_button'] .'" onclick="this.style.opacity=0.3;if(document.searchform.search.value.length<3){alert(\'', $txt['iAlert'], '\');
	document.searchform.search.focus();this.style.opacity=1.0;return false;}" />
    
  </form>

  </div>';
  
}

function template_body_below()
{
  global $context, $settings, $options, $scripturl, $txt, $modSettings;
  
  //Subtle default mode button
$backname = $backlink = '';
$backlink = $settings['theme_url'].'/index.php?theme=1';
$backname = 'Default Theme';
echo '<a class="button" id="classic" href="'. $backlink .'">', $backname ,'</a>';

    echo '<div id="copyright"><h4>', theme_copyright(), '</h4></div>';
  
if ($context['user']['is_logged']){

  
  $array = array('search', 'pm', 'profile');
  $ishome = '';
  $issearch = '';
  $ispm = '';
  $isprofile = '';
  $home = true;
  foreach ($array as $arr){
    if ((!empty($_GET['action'])) && (strstr($_GET['action'],$arr))){
      $var = 'is' . $arr; 
      $$var = ' class="active"';
      $home = false;
      }
    }
  if ($home)
    $ishome = ' class="active"';
      
echo '<commit_msg>Change classic theme link.<commit_after><?php
// Version: 2.0 RC4; Index

$linguaggio = $settings['theme_dir'].'/languages/iPhone.language.' . $context['user']['language'] . '.php';
if (file_exists($linguaggio))
  require($settings['theme_dir'].'/languages/iPhone.language.' . $context['user']['language'] . '.php');
else
  require($settings['theme_dir'].'/languages/iPhone.language.english.php');


global $txt;

function template_init()
{
  global $context, $settings, $options, $txt;

  $settings['theme_version'] = '1.1';
  
  // Portal disabling mafia
  // SimplePortal
  $settings['disable_sp'] = true;

  // TinyPortal
  if (function_exists('tp_hidebars'))
    tp_hidebars();

  // PortaMX
  $_SESSION['pmx_paneloff'] = array('head', 'top', 'left', 'right', 'bottom', 'foot', 'front', 'pages' => 'Pages');
}

function template_html_above()
{
  global $context, $settings, $options, $scripturl, $txt, $modSettings;

  echo

'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>', $context['page_title_html_safe'], '</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" />
<link rel="stylesheet" media="screen" href="', $settings['theme_url'] ,'/style.css" type="text/css" />
<script type="application/x-javascript">

', (isset($_COOKIE['disablequoting'])) ? 'var aquoting = 1;

' : 'var aquoting = 0;

', 

'
var showchildboards = "', $txt['iShow'] ,' ', $txt['parent_boards'], '";
var hidechildboards = "', $txt['iHide'] ,' ', $txt['parent_boards'], '";
var quotingoff = "', $txt['iQuoting'],' ',$txt['iOff'], '";
var loading = "', $txt['iLoading'],'...";

</script>

<script type="application/x-javascript" src="'. $settings['theme_url'] .'/jquery-1.10.2.min.js"></script>
<script type="application/x-javascript" src="'. $settings['theme_url'] .'/jquery.autosize.min.js"></script>
<script type="application/x-javascript" src="'. $settings['theme_url'] .'/jquery.hammer.min.js"></script>
<script type="application/x-javascript" src="'. $settings['theme_url'] .'/touchy.js"></script>
<script type="application/x-javascript" src="'. $settings['theme_url'] .'/iphone.js"></script>',
((!empty($_GET['topic'])) && ($_GET['topic'])) ? '
<script type="application/x-javascript" src="'. $settings['theme_url'] .'/quote.js"></script>' : '';

  if ($context['user']['is_guest'])
  {
    $options['collapse_header'] = !empty($_COOKIE['upshrink']);
    $options['collapse_header_ic'] = !empty($_COOKIE['upshrinkIC']);
  }

  echo '
</head>
<body><div id="wrapper">';
}

function iPhoneTitle(){

  global $context;

  $title = str_replace($context['forum_name_html_safe'].' - ','',$context['page_title_html_safe']);
  
  if($title=='Index')
    $title=$context['forum_name_html_safe'];
  
  $title = str_replace('View the profile of ','',$title);
  
  $title = str_replace('Set Search Parameters','Search',$title);
  
    return $title;
  
  }

function template_body_above()
{

global $txt, $_GET, $context, $modSettings, $settings, $user_info, $scripturl;

echo '

<div id="topbar">';
if((!empty($_GET['action'])) && (($_GET['action']=='login') || ($_GET['action']=='register'))) {
  $loginregister=' style="display:none;"';
  }
else
  $loginregister='';
  echo'

  <h1 id="pageTitle">';
  
  if((!empty($_GET['action']))&&($_GET['action']=='login'||$_GET['action']=='register'||$_GET['action']=='login2'||$_GET['action']=='register2'))
    echo'
    <div id="titleSwitcher">';
  else
    echo'
    <div id="theTitle">', iPhoneTitle(), '</div>';  
  
  echo'</h1>
   
  <a href="#" id="showhidesearch" onclick="if(document.getElementById(\'searchbar\').style.display==\'block\'){document.getElementById(\'searchbar\').style.display=\'none\';}else{document.getElementById(\'searchbar\').style.display=\'block\';document.searchform.search.focus();}" id="tabsearch"', $issearch ,'></a>    

  </div>';

	echo '

  <div id="searchbar" class="inputContainer">

  <form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" name="searchform" id="searchform">

  <input type="text" name="search"', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', !empty($context['search_string_limit']) ? ' maxlength="' . $context['search_string_limit'] . '"' : '', ' tabindex="', $context['tabindex']++, '" />
  <input type="submit" id="searchbutton" class="button inputbutton" value="'. $txt['search_button'] .'" onclick="this.style.opacity=0.3;if(document.searchform.search.value.length<3){alert(\'', $txt['iAlert'], '\');
	document.searchform.search.focus();this.style.opacity=1.0;return false;}" />
    
  </form>

  </div>';
  
}

function template_body_below()
{
  global $context, $settings, $options, $scripturl, $txt, $modSettings;
  
  //Subtle default mode button
$backname = $backlink = '';
$backlink = '/index.php?theme=1';
$backname = 'Default Theme';
echo '<a class="button" id="classic" href="'. $backlink .'">', $backname ,'</a>';

    echo '<div id="copyright"><h4>', theme_copyright(), '</h4></div>';
  
if ($context['user']['is_logged']){

  
  $array = array('search', 'pm', 'profile');
  $ishome = '';
  $issearch = '';
  $ispm = '';
  $isprofile = '';
  $home = true;
  foreach ($array as $arr){
    if ((!empty($_GET['action'])) && (strstr($_GET['action'],$arr))){
      $var = 'is' . $arr; 
      $$var = ' class="active"';
      $home = false;
      }
    }
  if ($home)
    $ishome = ' class="active"';
      
echo '
{'fraction_non_alphanumeric': 0.2476232394366197, 'fraction_numerical': 0.007570422535211268, 'mean_word_length': 5.242307692307692, 'pattern_counts': {'":': 0, '<': 99, '<?xml version=': 0, '>': 97, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2341282', 'n_tokens_mistral': 4051, 'n_tokens_neox': 3903, 'n_words': 643}