Beispiel #1
0
function delMode($lists)
{
    $unsure = array();
    foreach ($lists['main-input-file'] as $key => $line) {
        foreach ($lists['second-input-file'] as $cLine) {
            if ($line[0] == $cLine[0] || $line[1] == $cLine[0]) {
                /*if($line[1] != $cLine[1]) {
                			$unsure[] = '#'.($key+1).': '.implode(',', $line);
                		} else {*/
                unset($lists['main-input-file'][$key]);
                break;
                //}
            }
        }
    }
    saveOutput($lists['main-input-file']);
    $_SESSION['msg'] = 'Feladat befejezve.';
    $_SESSION['unsure'] = $unsure;
    header("location:.");
}
Beispiel #2
0
$attend = $xpath->query("//div[contains(@class, 'attendees-placeholder')]");
$watch = $xpath->query("//div[contains(@class, 'trackers-placeholder')]");
$attend = getHtmlUserList($doc, 'attendees');
$watch = getHtmlUserList($doc, 'trackers');
$ical = "http://lanyrd.com/2011/big-geek-day-out-the-great-western-lego-show/big-geek-day-out-the-great-western-lego-show.ics";
$sign_up = $url;
$attend_num = getUserCount($doc, 'attendees');
$attend_num = $attend_num ? " ({$attend_num})" : '';
$watch_num = getUserCount($doc, 'trackers');
$watch_num = $watch_num ? " ({$watch_num})" : '';
$flickr = '';
//getFlickrHtml(FLICKR_API_KEY, FLICKR_SEARCH);
mb_internal_encoding("UTF-8");
$template = getTemplate();
$template = str_replace(array('###attend###', '###watch###', '###ical###', '###sign-up###', '###attend-num###', '###watch-num###', '###flickr###'), array($attend, $watch, $ical, $sign_up, $attend_num, $watch_num, $flickr), $template);
saveOutput($template);
$server = 80 == $_SERVER['SERVER_PORT'] ? $_SERVER['SERVER_NAME'] : $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'];
if (!isset($_GET['no_redirect'])) {
    header("Location: http://{$server}/");
}
exit;
function getTemplate()
{
    return file_get_contents($_SERVER['DOCUMENT_ROOT'] . FILE_TEMPLATE);
}
function saveOutput($template)
{
    return file_put_contents($_SERVER['DOCUMENT_ROOT'] . FILE_OUTPUT, $template);
}
function getHtmlUserList($doc, $type)
{