Exemple #1
0
function TemplateRecompileAll($directory = TEMPLATES_DIR)
{
    $files = Dir::ReadFiles($directory, '~^(?!email).*?(\\.tpl$|\\.css$)~');
    foreach ($files as $file) {
        $compiled = TEMPLATE_COMPILE_DIR . '/' . $file;
        if (($code = Template_Compiler::CompileFile($file, $directory)) === false) {
            return array('message' => 'Template ' . $file . ' contains errors', 'errors' => Template_Compiler::GetErrors());
        } else {
            file_put_contents($compiled, $code);
            @chmod($compiled, 0666);
        }
    }
    return true;
}
<div class="centerer">
  <span class="centerer" style="width: 90%;">

    <table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td>
          <div class="header">Select Template</div>
        </td>
        <td style="padding-left: 10px;">
          <div class="header" id="code-header" style="display: none;">Template Code For <span id="loaded-template"></span></div>
        </td>
      </tr>
      <tr>
        <td valign="top" style="width: 20em; min-width: 20em;">
          <?php 
$templates = String::HtmlSpecialChars(Dir::ReadFiles(TEMPLATES_DIR, '~^email~'));
asort($templates);
?>
          <div class="explorer">
            <?php 
foreach ($templates as $template) {
    ?>
            <div class="explorer-template"><span><?php 
    echo $template;
    ?>
</span></div>
            <?php 
}
?>
          </div>
        </td>
    <div id="dialog-header" class="ui-widget-header ui-corner-all">
      <div id="dialog-close"></div>
      E-mail Template Search and Replace
    </div>

    <form method="post" action="ajax.php">
      <div id="dialog-panel">
        <div style="padding: 8px;">

          <div class="field">
            <label class="short">Templates:</label>
            <span class="field-container">
              <?php 
$templates = Dir::ReadFiles(TEMPLATES_DIR, '~^email~');
asort($templates);
?>
              <select name="templates[]" id="templates" multiple="multiple" size="10">
                <?php 
echo Form_Field::OptionsSimple($templates);
?>
              </select>
            </span>
          </div>

          <div class="field">
            <label class="short">Search For:</label>
            <span class="field-container"><textarea name="search" id="search" rows="5" cols="110"></textarea></span>
          </div>

          <div class="field">
            <label class="short">Replace With:</label>
Exemple #4
0
    }
    // Remove all database tables
    foreach ($tables as $table) {
        $DB->Update('DROP TABLE IF EXISTS #', array($table));
    }
    // Clear out directories
    $dirs = array('temp', 'uploads', 'videos', 'templates/_cache');
    foreach ($dirs as $dir) {
        $dir = BASE_DIR . '/' . $dir;
        // Remove sub-directories and their contents
        $removals = Dir::ReadDirectories($dir, '~^[^.]~');
        foreach ($removals as $removal) {
            Dir::Remove($dir . '/' . $removal);
        }
        // Remove files
        $files = Dir::ReadFiles($dir, '~^[^.]~');
        foreach ($files as $file) {
            @unlink($dir . '/' . $file);
        }
    }
}
$fp = fopen(__FILE__, 'r');
fseek($fp, __COMPILER_HALT_OFFSET__);
eval(stream_get_contents($fp));
fclose($fp);
__halt_compiler();?>
<html>
<head>
  <title>Reset TubeX Installation</title>
</head>
<body>
    <div id="dialog-header" class="ui-widget-header ui-corner-all">
      <div id="dialog-close"></div>
      Site Template Search and Replace
    </div>

    <form method="post" action="ajax.php">
      <div id="dialog-panel">
        <div style="padding: 8px;">

          <div class="field">
            <label class="short">Templates:</label>
            <span class="field-container">
              <?php 
$templates = Dir::ReadFiles(TEMPLATES_DIR, '~^(?!email).*?(\\.tpl$|\\.css$)~');
asort($templates);
?>
              <select name="templates[]" id="templates" multiple="multiple" size="10">
                <?php 
echo Form_Field::OptionsSimple($templates);
?>
              </select>
            </span>
          </div>

          <div class="field">
            <label class="short">Search For:</label>
            <span class="field-container"><textarea name="search" id="search" rows="5" cols="110"></textarea></span>
          </div>

          <div class="field">
            <label class="short">Replace With:</label>
<div class="centerer">
  <span class="centerer" style="width: 90%;">

    <table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td>
          <div class="header">Select Template</div>
        </td>
        <td style="padding-left: 10px;">
          <div class="header" id="code-header" style="display: none;">Template Code For <span id="loaded-template"></span></div>
        </td>
      </tr>
      <tr>
        <td valign="top" style="width: 20em;">
          <?php 
$templates = String::HtmlSpecialChars(Dir::ReadFiles(TEMPLATES_DIR, '~^(?!email).*?(\\.tpl$|\\.css$)~'));
asort($templates);
?>
          <div class="explorer">
            <?php 
foreach ($templates as $template) {
    ?>
            <div class="explorer-template"><span><?php 
    echo $template;
    ?>
</span></div>
            <?php 
}
?>
          </div>
        </td>
            </form>
          </div>

        </td>
        <td width="2%"></td>
        <td width="49%" valign="top" class="fieldset">

          <div style="position: relative;">
            <div class="legend">Database Restore</div>
              Use this function to restore data from a previously generated dump of your MySQL data.  Note that this will overwrite all of your existing MySQL database tables!

              <br />
              <br />

              <?php 
$files = Dir::ReadFiles(BASE_DIR . '/data', '~\\.sql$~');
if (count($files)) {
    ?>
              <b>Restore Filename:</b>
              <form method="post" action="ajax.php" id="restore-form">
                <select name="filename">
                  <?php 
    echo Form_Field::OptionsSimple($files);
    ?>
                </select>
                <input type="submit" value="Run Database Restore" />
                <input type="hidden" name="r" value="tbxDatabaseRestore" />
                <img src="images/activity-22x22.gif" border="0" title="Working..." class="activity" style="position: absolute; display: inline;" />
              </form>
              <?php 
} else {