예제 #1
0
    }
    return $first_id + 1;
}
if (empty($files)) {
    echo 'Incorrect the file path';
    exit;
}
foreach ($files as $file) {
    $counter = 0;
    if (!($old_file = file_get_contents($file))) {
        echo 'Error - could not open file:';
        echo "\n" . $file;
        exit;
    }
    if (!$is_forced && !$clear) {
        $counter = get_first_id($pattern, $old_file);
    }
    $new_file = preg_replace_callback($pattern, function ($matches) use($file) {
        global $counter, $is_forced, $clear;
        $id = $matches[1];
        $explode = explode('=', $matches[1], 2);
        if ($clear && $is_forced) {
            $id = '=' . $explode[1];
        } else {
            if ($clear && is_numeric($explode[0])) {
                $id = '=' . $explode[1];
            } else {
                if ($is_forced && is_numeric($explode[0])) {
                    $id = $counter++ . '=' . $explode[1];
                } else {
                    if (!$clear && '' === $explode[0]) {
예제 #2
0
<?php

/* This file handles the content of the main page. */
require_once 'repository_fns.php';
$first_id = get_first_id();
$first_title = get_this_title($first_id);
$first_discipline = get_this_discipline($first_id);
$first_language = get_this_language($first_id);
$second_id = get_second_id();
$second_title = get_this_title($second_id);
$second_discipline = get_this_discipline($second_id);
$second_language = get_this_language($second_id);
$third_id = get_third_id();
$third_title = get_this_title($third_id);
$third_discipline = get_this_discipline($third_id);
$third_language = get_this_language($third_id);
do_html_header_index();
do_page_content_index($first_id, $first_title, $first_discipline, $first_language, $second_id, $second_title, $second_discipline, $second_language, $third_id, $third_title, $third_discipline, $third_language);
do_html_footer();