Esempio n. 1
0
function choose_words($cont_array, $usr_input)
{
    $final_words = $cont_array[0];
    for ($i = 1; $i < $usr_input; $i++) {
        if (isset($_POST["uppercase"])) {
            $final_words = ucwords($final_words) . separator() . ucwords($cont_array[rand(0, count($cont_array))]);
        } else {
            $final_words = $final_words . separator() . $cont_array[rand(0, count($cont_array))];
        }
    }
    if (isset($_POST["end_num"])) {
        $final_words = $final_words . rand(0, 9);
    }
    return $final_words;
}
    echo '<section>';
    ArticleForm($website_plumeos_section0_article0, $page);
    echo '</section>';
    separator();
    echo '<section>';
    ArticleForm($website_plumeos_section1_article0, $page);
    echo '</br>';
    ArticleForm($website_plumeos_section1_article1, $page);
    echo '</section>';
    separator();
    echo '<section>';
    ArticleForm($website_plumeos_section2_article0, $page);
    echo '</br>';
    ArticleForm($website_plumeos_section2_article1, $page);
    echo '</section>';
    separator();
    echo '<section>';
    ArticleForm($website_plumeos_section0_article1, $page);
    echo '</section>';
} else {
    echo '<div>
    <h3>' . $website_section_articleO[0] . '</h3>
    ';
    echo '<div class="wrapper">
          <ul id="filter-container" class="grid cs-style-1">
        <li class="home">
      <figure>
     <section>
            <article>
              <h3>' . $website_section_articleO[1] . '</h3>
              <p>' . $website_section_article1[1] . '</p>
Esempio n. 3
0
         </form>
            </br></br>
         <form method=post action="web.php?code=' . $page . '&page=' . $subpage . '">
            <fieldset>
                 <label>Nouveau thème : </label>
                <input name="themes" type=text placeholder="Nom du thème" />
                <input name="newtheme" type=submit value="Créer" />
     ';
 if (isset($_GET['error']) and $_GET['error'] == 'name') {
     $web['cssEditForm'] = $web['cssEditForm'] . '
             </br><p>Ce nom de thème existe déjà.</p>
         ';
 }
 $web['cssEditForm'] = $web['cssEditForm'] . '</fieldset>
         </form></br></br>
     ' . separator() . '<form method=post action="web.php?code=' . $page . '&page=' . $subpage . '">
             <input name="newname" type=text value="' . $css_name . '" />
             </br>' . textarea($css_content, "content", 20, 100);
 if ($css_owner == $_SESSION['masterkey']) {
     $web['cssEditForm'] = $web['cssEditForm'] . '
                 <input name="name" type="hidden" value="' . $css_name . '" />
                 <input name="save_css" type=submit value="Sauvegarder" />
         ';
     if ($css_name != 'standard') {
         $web['cssEditForm'] = $web['cssEditForm'] . '
             <input name="delete" type=submit value="Supprimer"/>
          ';
     }
 }
 $web['cssEditForm'] = $web['cssEditForm'] . '
             <input name="copy" type=submit value="Copier ce thème"/>
Esempio n. 4
0
/**
 * Smarty substring modifier plugin
 *
 * Type:     modifier<br>
 * Name:     number_format<br>
 * Purpose:  Format a number. Same arguments as
 *           PHP number_format function.
 * @link based on number_format(): http://www.php.net/manual/function.number-format.php
 * @author   lindon
 * @param number
 * @param decimals: sets the number of decimal places (default=0)
 * @param dec_point: sets the separator for the decimal point
 * @param thousands: thousands separator
 * @return number
 */
function smarty_modifier_number_format($number, $decimals = 2, $dec_point = '.', $thousands = ',')
{
    $dec_point = separator($dec_point);
    $thousands = separator($thousands);
    return number_format($number, $decimals, $dec_point, $thousands);
}
Esempio n. 5
0
/**
 * Merge two language arrays
 * This function does all the work. Any missing text strings are copied
 * over from english.php. Also does some pretty-printing.
 */
function mergeArrays($ENG, $OTHER, $arrayName, $comment = '')
{
    global $mb, $config_constants;
    $numElements = count($ENG);
    $counter = 0;
    if ($comment !== false) {
        separator();
    }
    if (!empty($comment)) {
        $comments = explode("\n", $comment);
        foreach ($comments as $c) {
            echo "# {$c}\n";
        }
    }
    echo "\n\${$arrayName} = array(\n";
    foreach ($ENG as $key => $txt) {
        $counter++;
        if (is_numeric($key)) {
            echo "    {$key} => ";
        } else {
            echo "    '{$key}' => ";
        }
        if (empty($OTHER[$key])) {
            // string does not exist in other language - use English text
            $newText = $txt;
        } else {
            if (isset($ENG[$key]) && empty($ENG[$key])) {
                // string is now empty in English language file - remove it
                $newText = '';
            } else {
                // string exists in other language - keep it
                $newText = $OTHER[$key];
            }
        }
        if (!is_array($newText)) {
            $newText = my_str_replace("\n", '\\n', $newText);
        }
        if (is_array($newText)) {
            // mainly for the config selects
            if (!empty($OTHER[$key]) && count($ENG[$key]) != count($OTHER[$key])) {
                // In case there are new entries for a config, merge those
                // into the existing one to keep the translation intact.
                // Note: We can't use array_merge() or "+" since we want to
                // keep the original order intact.
                $newText = array();
                foreach ($ENG[$key] as $eKey => $eValue) {
                    $oKey = array_search($eValue, $OTHER[$key], true);
                    if ($oKey === false) {
                        $newText[$eKey] = $eValue;
                    } else {
                        $newText[$oKey] = $eValue;
                    }
                }
            }
            $quotedText = 'array(';
            foreach ($newText as $nKey => $nTxt) {
                $quotedText .= "'" . my_str_replace("'", "\\'", $nKey) . "' => ";
                if ($nTxt === true) {
                    $quotedText .= 'true';
                } elseif ($nTxt === false) {
                    $quotedText .= 'false';
                } elseif (is_numeric($nTxt)) {
                    $quotedText .= $nTxt;
                } elseif (in_array($nTxt, $config_constants)) {
                    $quotedText .= $nTxt;
                } else {
                    $quotedText .= "'" . my_str_replace("'", "\\'", $nTxt) . "'";
                }
                $quotedText .= ', ';
            }
            if ($mb) {
                $quotedText = mb_substr($quotedText, 0, -2);
            } else {
                $quotedText = substr($quotedText, 0, -2);
            }
            $quotedText .= ')';
            // hack for this special case ...
            if ($quotedText == "array('True' => 1, 'False' => '')") {
                $quotedText = "array('True' => TRUE, 'False' => FALSE)";
            }
            // ??? $quotedText = mb_ereg_replace("\n", '\n', $quotedtext);
        } else {
            $quotedText = prepareText($newText);
        }
        $quotedText = makeXHTML($quotedText);
        if ($counter != $numElements) {
            $quotedText .= ',';
        }
        echo "{$quotedText}\n";
    }
    if ($comment === false) {
        echo ");\n";
    } else {
        echo ");\n\n";
    }
}