Пример #1
0
function mail_look($person)
{
    include_once 'plan_read.php';
    $userinfo = unserialize(file_get_contents("{$_SERVER['PWUSERS_DIR']}/{$person}/userinfo.dat"));
    $watchedlist = file("{$_SERVER['PWUSERS_DIR']}/{$person}/watchedlist.txt");
    $output .= "[planwatch.org]: planwatch automailer\n\nHere's what's been updated:\n";
    $sortby = trim(str_replace("sort by ", '', $watchedlist[0]));
    if (strpos($watchedlist[0], 'sort by ') !== FALSE) {
        unset($watchedlist[0]);
    }
    $output .= str_replace(" ", ' ', strip_tags(list_format_html($watchedlist, $sortby, '', "\n")));
    $output .= "\n\n\n\n";
    mail($userinfo['email'], "your watched list updates " . date("F jS Y"), $output, "From: watched@planwatch.org");
}
Пример #2
0
function format_watched_list_html($controls = TRUE)
{
    // WATCHED LIST
    //------------------------------------------------------------------------------
    if (!user_is_valid($_SERVER['USERINFO_ARRAY']['username'], $_SERVER['USERINFO_ARRAY']['userpass'])) {
        //		$planwatchlist = "\n<li class='listheader'>Advertised Plans</li>\n";
        $list_fn = "{$_SERVER['FILE_ROOT']}/resources/advertised.txt";
        // read in the advertised plans list, break it into an array,
        // and run it through the list formatter
        if (file_exists($list_fn)) {
            $list = file($list_fn);
            $list = array_merge(array("!!!", "!prune31d", "#Advertised Plans"), $list);
            $planwatchlist .= list_format_html($list, 'time');
        }
    } else {
        $_SERVER['STOPWATCH']['watched_begin'] = array_sum(explode(' ', microtime()));
        $loadtime = formattime(time());
        if ($controls) {
            $planwatchlist = "\n\t\t<li style='font-size: 120%; float: right;'>\n\t\t\t<a class='tool' id='menuwatched_icon' href='javascript:var editlinks=document.getElementById(\"watched_list_edit\");if (editlinks.style.display==\"none\") editlinks.style.display=\"block\"; else editlinks.style.display=\"none\"; void(null);' ><span class='hidden'>edit</span> &#x2699;</a>\n\t\t\t<a class='tool' href='javascript:watched_list_refresh();void(null);' title='{$loadtime}'><span class='hidden'>{$loadtime}</span> &#x21bb;\n\t\t\t</a>\n\t\t</li>\n\t\t<li><ul style='list-style: none; display: none; padding-left: 0px; margin-left: 0px; line-height: 100%; border-bottom: 1px dashed rgba(255,255,255,0.8); background: rgba(255,255,255,0.6); border-radius: 10px;' id='watched_list_edit'>" . menus_populate('watched') . "</ul></li>\n";
        }
        //		if ($_SERVER['USER']!='jwdavidson' && !strstr($_SERVER['REQUEST_URI'],'watched'))
        $planwatchlist .= list_format_html();
        $key = md5($planwatchlist);
        if (!stristr($_SERVER['HTTP_USER_AGENT'], 'blackberry')) {
            $planwatchlist .= "<li style='display: none;' id='key'>{$key}</li>";
        }
        $_SERVER['WATCHED_KEY'] = $key;
        $_SERVER['STOPWATCH']['watched_end'] = array_sum(explode(' ', microtime()));
        // SNOOP LIST
        //------------------------------------------------------------------------------
        include_once 'snoop.php';
        $_SERVER['STOPWATCH']['snoop_begin'] = array_sum(explode(' ', microtime()));
        if ($_SERVER['USERINFO_ARRAY']['showsnoop']) {
            $snooplinks = snoop_list("planwatch");
            if (trim(strip_tags($snooplinks))) {
                if (agent_is_lowfi()) {
                    $planwatchlist .= "\n<br /><br /><div><b>Snoops</b></div>\n{$snooplinks}\n\n";
                } else {
                    $planwatchlist .= "\n<li class='listheader'>Snoops</li>\n{$snooplinks}\n\n";
                }
            }
        }
        $_SERVER['STOPWATCH']['snoop_end'] = array_sum(explode(' ', microtime()));
    }
    // SPIEL LIST
    //------------------------------------------------------------------------------
    $_SERVER['STOPWATCH']['spiel_begin'] = array_sum(explode(' ', microtime()));
    include_once 'spiel.php';
    $planwatchlist .= spiel_format_list_html();
    $_SERVER['STOPWATCH']['spiel_end'] = array_sum(explode(' ', microtime()));
    return $planwatchlist;
}