当前位置: 首页>>代码示例>>PHP>>正文


PHP replace_macros函数代码示例

本文整理汇总了PHP中replace_macros函数的典型用法代码示例。如果您正苦于以下问题:PHP replace_macros函数的具体用法?PHP replace_macros怎么用?PHP replace_macros使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了replace_macros函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get

 function get()
 {
     $args = '';
     $l = '';
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         if (isset($_POST['chord']) && strlen($_POST['chord'])) {
             $args .= escapeshellarg(ucfirst(trim($_POST['chord'])));
         }
         if (strlen($args) && isset($_POST['tuning']) && strlen($_POST['tuning'])) {
             $args .= ' ' . escapeshellarg($_POST['tuning']);
         }
         if (strlen($args) && isset($_POST['lefty'])) {
             $args .= ' lefty';
         }
     }
     if (!$_POST['chord'] && argc() > 1) {
         $_REQUEST['chord'] = argv(1);
         $args = escapeshellarg(ucfirst(basename(argv(1))));
     }
     $tunings = ['' => 'Em11 [Standard] (EADGBE)', 'openg' => 'G/D [Drop D] (DGDGBD)', 'opene' => 'Open E (EBEG#BE)', 'dadgad' => 'Dsus4 (DADGAD'];
     if (strlen($args)) {
         $chords = '<pre>';
         $chords .= shell_exec("addon/chords/chord " . $args);
         $chords .= '</pre>';
     }
     $p1 = t('This is a fairly comprehensive and complete guitar chord dictionary which will list most of the available ways to play a certain chord, starting from the base of the fingerboard up to a few frets beyond the twelfth fret (beyond which everything repeats). A couple of non-standard tunings are provided for the benefit of slide players, etc.');
     $p2 = t('Chord names start with a root note (A-G) and may include sharps (#) and flats (b). This software will parse most of the standard naming conventions such as maj, min, dim, sus(2 or 4), aug, with optional repeating elements.');
     $p3 = t('Valid examples include  A, A7, Am7, Amaj7, Amaj9, Ammaj7, Aadd4, Asus2Add4, E7b13b11 ...');
     $o .= replace_macros(get_markup_template('chords.tpl', 'addon/chords'), ['$header' => t('Guitar Chords'), '$desc' => t('The complete online chord dictionary'), '$p1' => $p1, '$p2' => $p2, '$p3' => $p3, '$chords' => $chords, '$tuning' => ['tuning', t('Tuning'), $_POST['tuning'], '', $tunings], '$chord' => ['chord', t('Chord name: example: Em7'), $_REQUEST['chord'], ''], '$lefty' => ['lefty', t('Show for left handed stringing'), $_POST['lefty'], ''], '$submit' => t('Submit')]);
     return $o;
 }
开发者ID:phellmes,项目名称:hubzilla-addons,代码行数:31,代码来源:Mod_Chords.php

示例2: vcard_from_xchan

function vcard_from_xchan($xchan, $observer = null, $mode = '')
{
    $a = get_app();
    if (!$xchan) {
        if (App::$poi) {
            $xchan = App::$poi;
        } elseif (is_array(App::$profile) && App::$profile['channel_hash']) {
            $r = q("select * from xchan where xchan_hash = '%s' limit 1", dbesc(App::$profile['channel_hash']));
            if ($r) {
                $xchan = $r[0];
            }
        }
    }
    if (!$xchan) {
        return;
    }
    // FIXME - show connect button to observer if appropriate
    $connect = false;
    if (local_channel()) {
        $r = q("select * from abook where abook_xchan = '%s' and abook_channel = %d limit 1", dbesc($xchan['xchan_hash']), intval(local_channel()));
        if (!$r) {
            $connect = t('Connect');
        }
    }
    if (array_key_exists('channel_id', $xchan)) {
        App::$profile_uid = $xchan['channel_id'];
    }
    $url = $observer ? z_root() . '/magic?f=&dest=' . $xchan['xchan_url'] . '&addr=' . $xchan['xchan_addr'] : $xchan['xchan_url'];
    return replace_macros(get_markup_template('xchan_vcard.tpl'), array('$name' => $xchan['xchan_name'], '$photo' => is_array(App::$profile) && array_key_exists('photo', App::$profile) ? App::$profile['photo'] : $xchan['xchan_photo_l'], '$follow' => $xchan['xchan_addr'], '$link' => zid($xchan['xchan_url']), '$connect' => $connect, '$newwin' => $mode === 'chanview' ? t('New window') : '', '$newtit' => t('Open the selected location in a different window or browser tab'), '$url' => $url));
}
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:30,代码来源:Contact.php

示例3: suggest_content

function suggest_content(&$a)
{
    require_once "mod/proxy.php";
    $o = '';
    if (!local_user()) {
        notice(t('Permission denied.') . EOL);
        return;
    }
    $_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd;
    $a->page['aside'] .= findpeople_widget();
    $a->page['aside'] .= follow_widget();
    $r = suggestion_query(local_user());
    if (!count($r)) {
        $o .= t('No suggestions available. If this is a new site, please try again in 24 hours.');
        return $o;
    }
    require_once 'include/contact_selectors.php';
    foreach ($r as $rr) {
        $connlnk = $a->get_baseurl() . '/follow/?url=' . ($rr['connect'] ? $rr['connect'] : $rr['url']);
        $ignlnk = $a->get_baseurl() . '/suggest?ignore=' . $rr['id'];
        $photo_menu = array(array(t("View Profile"), zrl($rr["url"])));
        $photo_menu[] = array(t("Connect/Follow"), $connlnk);
        $photo_menu[] = array(t('Ignore/Hide'), $ignlnk);
        $contact_details = get_contact_details_by_url($rr["url"], local_user());
        $entry = array('url' => zrl($rr['url']), 'itemurl' => $contact_details['addr'] != "" ? $contact_details['addr'] : $rr['url'], 'img_hover' => $rr['url'], 'name' => $rr['name'], 'thumb' => proxy_url($rr['photo'], false, PROXY_SIZE_THUMB), 'details' => $contact_details['location'], 'tags' => $contact_details['keywords'], 'about' => $contact_details['about'], 'account_type' => $contact_details['community'] ? t('Forum') : '', 'ignlnk' => $ignlnk, 'ignid' => $rr['id'], 'conntxt' => t('Connect'), 'connlnk' => $connlnk, 'photo_menu' => $photo_menu, 'ignore' => t('Ignore/Hide'), 'network' => network_to_name($rr['network'], $rr['url']), 'id' => ++$id);
        $entries[] = $entry;
    }
    $tpl = get_markup_template('viewcontact_template.tpl');
    $o .= replace_macros($tpl, array('$title' => t('Friend Suggestions'), '$contacts' => $entries));
    return $o;
}
开发者ID:vinzv,项目名称:friendica,代码行数:31,代码来源:suggest.php

示例4: xrd_init

function xrd_init(&$a)
{
    $uri = urldecode(notags(trim($_GET['uri'])));
    if (substr($uri, 0, 4) === 'http') {
        $name = basename($uri);
    } else {
        $local = str_replace('acct:', '', $uri);
        if (substr($local, 0, 2) == '//') {
            $local = substr($local, 2);
        }
        $name = substr($local, 0, strpos($local, '@'));
    }
    $r = q("SELECT * FROM `user` WHERE `nickname` = '%s' LIMIT 1", dbesc($name));
    if (!count($r)) {
        killme();
    }
    $salmon_key = salmon_key($r[0]['spubkey']);
    header('Access-Control-Allow-Origin: *');
    header("Content-type: text/xml");
    if (get_config('system', 'diaspora_enabled')) {
        //$tpl = file_get_contents('view/xrd_diaspora.tpl');
        $tpl = get_markup_template('xrd_diaspora.tpl');
        $dspr = replace_macros($tpl, array('$baseurl' => $a->get_baseurl(), '$dspr_guid' => $r[0]['guid'], '$dspr_key' => base64_encode(pemtorsa($r[0]['pubkey']))));
    } else {
        $dspr = '';
    }
    //$tpl = file_get_contents('view/xrd_person.tpl');
    $tpl = get_markup_template('xrd_person.tpl');
    $o = replace_macros($tpl, array('$nick' => $r[0]['nickname'], '$accturi' => $uri, '$profile_url' => $a->get_baseurl() . '/profile/' . $r[0]['nickname'], '$hcard_url' => $a->get_baseurl() . '/hcard/' . $r[0]['nickname'], '$atom' => $a->get_baseurl() . '/dfrn_poll/' . $r[0]['nickname'], '$zot_post' => $a->get_baseurl() . '/post/' . $r[0]['nickname'], '$poco_url' => $a->get_baseurl() . '/poco/' . $r[0]['nickname'], '$photo' => $a->get_baseurl() . '/photo/profile/' . $r[0]['uid'] . '.jpg', '$dspr' => $dspr, '$salmon' => $a->get_baseurl() . '/salmon/' . $r[0]['nickname'], '$salmen' => $a->get_baseurl() . '/salmon/' . $r[0]['nickname'] . '/mention', '$subscribe' => $a->get_baseurl() . '/follow?url={uri}', '$modexp' => 'data:application/magic-public-key,' . $salmon_key, '$bigkey' => salmon_key($r[0]['pubkey'])));
    $arr = array('user' => $r[0], 'xml' => $o);
    call_hooks('personal_xrd', $arr);
    echo $arr['xml'];
    killme();
}
开发者ID:ZerGabriel,项目名称:friendica,代码行数:34,代码来源:xrd.php

示例5: get_feed_for

/**
 * @brief
 *
 * @param array $channel
 * @param string $observer_hash
 * @param array $params
 * @return string
 */
function get_feed_for($channel, $observer_hash, $params)
{
    if (!channel) {
        http_status_exit(401);
    }
    if ($params['pages']) {
        if (!perm_is_allowed($channel['channel_id'], $observer_hash, 'view_pages')) {
            http_status_exit(403);
        }
    } else {
        if (!perm_is_allowed($channel['channel_id'], $observer_hash, 'view_stream')) {
            http_status_exit(403);
        }
    }
    $items = items_fetch(array('wall' => '1', 'datequery' => $params['end'], 'datequery2' => $params['begin'], 'start' => $params['start'], 'records' => $params['records'], 'direction' => $params['direction'], 'pages' => $params['pages'], 'order' => 'post', 'top' => $params['top'], 'cat' => $params['cat']), $channel, $observer_hash, CLIENT_MODE_NORMAL, App::$module);
    $feed_template = get_markup_template('atom_feed.tpl');
    $atom = '';
    $atom .= replace_macros($feed_template, array('$version' => xmlify(Zotlabs\Lib\System::get_project_version()), '$red' => xmlify(Zotlabs\Lib\System::get_platform_name()), '$feed_id' => xmlify($channel['xchan_url']), '$feed_title' => xmlify($channel['channel_name']), '$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', 'now', ATOM_TIME)), '$hub' => '', '$salmon' => '', '$name' => xmlify($channel['channel_name']), '$profile_page' => xmlify($channel['xchan_url']), '$mimephoto' => xmlify($channel['xchan_photo_mimetype']), '$photo' => xmlify($channel['xchan_photo_l']), '$thumb' => xmlify($channel['xchan_photo_m']), '$picdate' => '', '$uridate' => '', '$namdate' => '', '$birthday' => '', '$community' => ''));
    call_hooks('atom_feed', $atom);
    if ($items) {
        $type = 'html';
        foreach ($items as $item) {
            if ($item['item_private']) {
                continue;
            }
            /** @BUG $owner is undefined in this call */
            $atom .= atom_entry($item, $type, null, $owner, true);
        }
    }
    call_hooks('atom_feed_end', $atom);
    $atom .= '</feed>' . "\r\n";
    return $atom;
}
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:41,代码来源:feedutils.php

示例6: dirfind_content

function dirfind_content(&$a)
{
    $search = notags(trim($_REQUEST['search']));
    if (strpos($search, '@') === 0) {
        $search = substr($search, 1);
    }
    $o = '';
    $o .= '<h2>' . t('People Search') . ' - ' . $search . '</h2>';
    if ($search) {
        $p = $a->pager['page'] != 1 ? '&p=' . $a->pager['page'] : '';
        if (strlen(get_config('system', 'directory_submit_url'))) {
            $x = fetch_url('http://dir.friendica.com/lsearch?f=' . $p . '&search=' . urlencode($search));
        }
        //TODO fallback local search if global dir not available.
        //		else
        //			$x = post_url($a->get_baseurl() . '/lsearch', $params);
        $j = json_decode($x);
        if ($j->total) {
            $a->set_pager_total($j->total);
            $a->set_pager_itemspage($j->items_page);
        }
        if (count($j->results)) {
            $tpl = get_markup_template('match.tpl');
            foreach ($j->results as $jj) {
                $o .= replace_macros($tpl, array('$url' => zrl($jj->url), '$name' => $jj->name, '$photo' => $jj->photo, '$tags' => $jj->tags));
            }
        } else {
            info(t('No matches') . EOL);
        }
    }
    $o .= '<div class="clear"></div>';
    $o .= paginate($a);
    return $o;
}
开发者ID:jzacman,项目名称:friendica,代码行数:34,代码来源:dirfind.php

示例7: libravatar_plugin_admin

/**
 * Display admin settings for this addon
 */
function libravatar_plugin_admin(&$a, &$o)
{
    $t = get_markup_template("admin.tpl", "addon/libravatar");
    $default_avatar = get_config('libravatar', 'default_img');
    // set default values for first configuration
    if (!$default_avatar) {
        $default_avatar = 'identicon';
    }
    // pseudo-random geometric pattern based on email hash
    // Available options for the select boxes
    $default_avatars = array('mm' => t('generic profile image'), 'identicon' => t('random geometric pattern'), 'monsterid' => t('monster face'), 'wavatar' => t('computer generated face'), 'retro' => t('retro arcade style face'));
    // Show warning if PHP version is too old
    if (!version_compare(PHP_VERSION, '5.3.0', '>=')) {
        $o = '<h5>' . t('Warning') . '</h5><p>';
        $o .= sprintf(t('Your PHP version %s is lower than the required PHP >= 5.3.'), PHP_VERSION);
        $o .= '<br>' . t('This addon is not functional on your server.') . '<p><br>';
        return;
    }
    // Libravatar falls back to gravatar, so show warning about gravatar addon if enabled
    $r = q("SELECT * FROM `addon` WHERE `name` = '%s' and `installed` = 1", dbesc('gravatar'));
    if (count($r)) {
        $o = '<h5>' . t('Information') . '</h5><p>' . t('Gravatar addon is installed. Please disable the Gravatar addon.<br>The Libravatar addon will fall back to Gravatar if nothing was found at Libravatar.') . '</p><br><br>';
    }
    // output Libravatar settings
    $o .= '<input type="hidden" name="form_security_token" value="' . get_form_security_token("libravatarsave") . '">';
    $o .= replace_macros($t, array('$submit' => t('Save Settings'), '$default_avatar' => array('avatar', t('Default avatar image'), $default_avatar, t('Select default avatar image if none was found. See README'), $default_avatars)));
}
开发者ID:ZerGabriel,项目名称:friendica-addons,代码行数:30,代码来源:libravatar.php

示例8: gravatar_plugin_admin

/**
 * Display admin settings for this addon
 */
function gravatar_plugin_admin(&$a, &$o)
{
    $t = get_markup_template("admin.tpl", "addon/gravatar/");
    $default_avatar = get_config('gravatar', 'default_img');
    $rating = get_config('gravatar', 'rating');
    // set default values for first configuration
    if (!$default_avatar) {
        $default_avatar = 'identicon';
    }
    // pseudo-random geometric pattern based on email hash
    if (!$rating) {
        $rating = 'g';
    }
    // suitable for display on all websites with any audience type
    // Available options for the select boxes
    $default_avatars = array('mm' => t('generic profile image'), 'identicon' => t('random geometric pattern'), 'monsterid' => t('monster face'), 'wavatar' => t('computer generated face'), 'retro' => t('retro arcade style face'));
    $ratings = array('g' => 'g', 'pg' => 'pg', 'r' => 'r', 'x' => 'x');
    // Check if Libravatar is enabled and show warning
    $r = q("SELECT * FROM `addon` WHERE `name` = '%s' and `installed` = 1", dbesc('libravatar'));
    if (count($r)) {
        $o = '<h5>' . t('Information') . '</h5><p>' . t('Libravatar addon is installed, too. Please disable Libravatar addon or this Gravatar addon.<br>The Libravatar addon will fall back to Gravatar if nothing was found at Libravatar.') . '</p><br><br>';
    }
    // output Gravatar settings
    $o .= '<input type="hidden" name="form_security_token" value="' . get_form_security_token("gravatarsave") . '">';
    $o .= replace_macros($t, array('$submit' => t('Save Settings'), '$default_avatar' => array('avatar', t('Default avatar image'), $default_avatar, t('Select default avatar image if none was found at Gravatar. See README'), $default_avatars), '$rating' => array('rating', t('Rating of images'), $rating, t('Select the appropriate avatar rating for your site. See README'), $ratings)));
}
开发者ID:ZerGabriel,项目名称:friendica-addons,代码行数:29,代码来源:gravatar.php

示例9: lostpass_content

function lostpass_content(&$a)
{
    if (x($_GET, 'verify')) {
        $verify = $_GET['verify'];
        $r = q("SELECT * FROM account WHERE account_reset = '%s' LIMIT 1", dbesc($verify));
        if (!$r) {
            notice(t("Request could not be verified. (You may have previously submitted it.) Password reset failed.") . EOL);
            goaway(z_root());
            return;
        }
        $aid = $r[0]['account_id'];
        $email = $r[0]['account_email'];
        $new_password = autoname(6) . mt_rand(100, 9999);
        $salt = random_string(32);
        $password_encoded = hash('whirlpool', $salt . $new_password);
        $r = q("UPDATE account SET account_salt = '%s', account_password = '%s', account_reset = '', account_flags = (account_flags & ~%d) where account_id = %d", dbesc($salt), dbesc($password_encoded), intval(ACCOUNT_UNVERIFIED), intval($aid));
        if ($r) {
            $tpl = get_markup_template('pwdreset.tpl');
            $o .= replace_macros($tpl, array('$lbl1' => t('Password Reset'), '$lbl2' => t('Your password has been reset as requested.'), '$lbl3' => t('Your new password is'), '$lbl4' => t('Save or copy your new password - and then'), '$lbl5' => '<a href="' . $a->get_baseurl() . '">' . t('click here to login') . '</a>.', '$lbl6' => t('Your password may be changed from the <em>Settings</em> page after successful login.'), '$newpass' => $new_password, '$baseurl' => $a->get_baseurl()));
            info("Your password has been reset." . EOL);
            $email_tpl = get_intltext_template("passchanged_eml.tpl");
            $message = replace_macros($email_tpl, array('$sitename' => $a->config['sitename'], '$siteurl' => $a->get_baseurl(), '$username' => sprintf(t('Site Member (%s)'), $email), '$email' => $email, '$new_password' => $new_password, '$uid' => $newuid));
            $subject = email_header_encode(sprintf(t('Your password has changed at %s'), get_config('system', 'sitename')), 'UTF-8');
            $res = mail($email, $subject, $message, 'From: ' . 'Administrator@' . $_SERVER['SERVER_NAME'] . "\n" . 'Content-type: text/plain; charset=UTF-8' . "\n" . 'Content-transfer-encoding: 8bit');
            return $o;
        }
    } else {
        $tpl = get_markup_template('lostpass.tpl');
        $o .= replace_macros($tpl, array('$title' => t('Forgot your Password?'), '$desc' => t('Enter your email address and submit to have your password reset. Then check your email for further instructions.'), '$name' => t('Email Address'), '$submit' => t('Reset')));
        return $o;
    }
}
开发者ID:TamirAl,项目名称:hubzilla,代码行数:32,代码来源:lostpass.php

示例10: apps_content

function apps_content(&$a)
{
    if (argc() == 2 && argv(1) == 'edit') {
        $mode = 'edit';
    } else {
        $mode = 'list';
    }
    $_SESSION['return_url'] = $a->cmd;
    $apps = array();
    $syslist = get_system_apps();
    if (local_channel()) {
        $list = app_list(local_channel());
        if ($list) {
            foreach ($list as $x) {
                $syslist[] = app_encode($x);
            }
        }
    }
    usort($syslist, 'app_name_compare');
    //	logger('apps: ' . print_r($syslist,true));
    foreach ($syslist as $app) {
        $apps[] = app_render($app, $mode);
    }
    return replace_macros(get_markup_template('myapps.tpl'), array('$sitename' => get_config('system', 'sitename'), '$title' => t('Apps'), '$apps' => $apps));
}
开发者ID:msooon,项目名称:hubzilla,代码行数:25,代码来源:apps.php

示例11: uexport_content

function uexport_content(&$a)
{
    if ($a->argc > 1) {
        header("Content-type: application/json");
        header('Content-Disposition: attachment; filename="' . $a->user['nickname'] . '.' . $a->argv[1] . '"');
        switch ($a->argv[1]) {
            case "backup":
                uexport_all($a);
                killme();
                break;
            case "account":
                uexport_account($a);
                killme();
                break;
            default:
                killme();
        }
    }
    /**
     * options shown on "Export personal data" page
     * list of array( 'link url', 'link text', 'help text' )
     */
    $options = array(array('/uexport/account', t('Export account'), t('Export your account info and contacts. Use this to make a backup of your account and/or to move it to another server.')), array('/uexport/backup', t('Export all'), t('Export your accout info, contacts and all your items as json. Could be a very big file, and could take a lot of time. Use this to make a full backup of your account (photos are not exported)')));
    call_hooks('uexport_options', $options);
    $tpl = get_markup_template("uexport.tpl");
    return replace_macros($tpl, array('$baseurl' => $a->get_baseurl(), '$title' => t('Export personal data'), '$options' => $options));
}
开发者ID:ridcully,项目名称:friendica,代码行数:27,代码来源:uexport.php

示例12: dirstats_content

function dirstats_content(&$a)
{
    $hubcount = get_config('dirstats', 'hubcount');
    $zotcount = get_config('dirstats', 'zotcount');
    $friendicacount = get_config('dirstats', 'friendicacount');
    $diasporacount = get_config('dirstats', 'diasporacount');
    $channelcount = get_config('dirstats', 'channelcount');
    $friendicachannelcount = get_config('dirstats', 'friendicachannelcount');
    $diasporachannelcount = get_config('dirstats', 'diasporachannelcount');
    $over35s = get_config('dirstats', 'over35s');
    $under35s = get_config('dirstats', 'under35s');
    $average = get_config('dirstats', 'averageage');
    $chatrooms = get_config('dirstats', 'chatrooms');
    $tags = get_config('dirstats', 'tags');
    $ob = $a->get_observer();
    $observer = $ob['xchan_hash'];
    // Requested by Martin
    $fountainofyouth = get_xconfig($observer, 'dirstats', 'averageage');
    if (intval($fountainofyouth)) {
        $average = $fountainofyouth;
    }
    if (argv(1) == 'json') {
        $dirstats = array('hubcount' => $hubcount, 'zotcount' => $zotcount, 'friendicacount' => $friendicacount, 'diasporacount' => $diasporacount, 'channelcount' => $channelcount, 'friendicachannelcount' => $friendicachannelcount, 'diasporachannelcount' => $diasporachannelcount, 'over35s' => $over35s, 'under35s' => $under35s, 'average' => $average, 'chatrooms' => $chatrooms, 'tags' => $tags);
        echo json_return_and_die($dirstats);
    } elseif (argv(1) == 'genpost' && get_config('dirstats', 'allowfiledump')) {
        $result = '[b]Hub count[/b] : ' . $hubcount . "\n" . '[b]Hubzilla Hubs[/b] : ' . $zotcount . "\n" . '[b]Friendica Hubs[/b] : ' . $friendicacount . "\n" . '[b]Diaspora Pods[/b] : ' . $diasporacount . "\n" . '[b]Hubzilla Channels[/b] : ' . $channelcount . "\n" . '[b]Friendica Profiles[/b] : ' . $friendicachannelcount . "\n" . '[b]Diaspora Profiles[/b] : ' . $diasporachannelcount . "\n" . '[b]People aged 35 and above[/b] : ' . $over35s . "\n" . '[b]People aged 34 and below[/b] : ' . $under35s . "\n" . '[b]Average Age[/b] : ' . $average . "\n" . '[b]Known Chatrooms[/b] : ' . $chatrooms . "\n" . '[b]Unique Profile Tags[/b] : ' . $tags . "\n";
        file_put_contents('genpost', $result);
    } else {
        $tpl = get_markup_template("dirstats.tpl", "addon/dirstats/");
        return replace_macros($tpl, array('$title' => t('Hubzilla Directory Stats'), '$hubtitle' => t('Total Hubs'), '$hubcount' => $hubcount, '$zotlabel' => t('Hubzilla Hubs'), '$zotcount' => $zotcount, '$friendicalabel' => t('Friendica Hubs'), '$friendicacount' => $friendicacount, '$diasporalabel' => t('Diaspora Pods'), '$diasporacount' => $diasporacount, '$zotchanlabel' => t('Hubzilla Channels'), '$channelcount' => $channelcount, '$friendicachanlabel' => t('Friendica Channels'), '$friendicachannelcount' => $friendicachannelcount, '$diasporachanlabel' => t('Diaspora Channels'), '$diasporachannelcount' => $diasporachannelcount, '$over35label' => t('Aged 35 and above'), '$over35s' => $over35s, '$under35label' => t('Aged 34 and under'), '$under35s' => $under35s, '$averageagelabel' => t('Average Age'), '$average' => $average, '$chatlabel' => t('Known Chatrooms'), '$chatrooms' => $chatrooms, '$tagslabel' => t('Known Tags'), '$tags' => $tags, '$disclaimer' => t('Please note Diaspora and Friendica statistics are merely those **this directory** is aware of, and not all those known in the network.  This also applies to chatrooms,')));
    }
}
开发者ID:git-marijus,项目名称:hubzilla-addons,代码行数:32,代码来源:dirstats.php

示例13: quattro_form

function quattro_form(&$a, $align, $color)
{
    $colors = array("dark" => "Quattro", "green" => "Green");
    $t = file_get_contents(dirname(__FILE__) . "/theme_settings.tpl");
    $o .= replace_macros($t, array('$submit' => t('Submit'), '$baseurl' => $a->get_baseurl(), '$title' => t("Theme settings"), '$align' => array('quattro_align', t('Alignment'), $align, '', array('left' => t('Left'), 'center' => t('Center'))), '$color' => array('quattro_color', t('Color scheme'), $color, '', $colors)));
    return $o;
}
开发者ID:robhell,项目名称:friendica,代码行数:7,代码来源:config.php

示例14: allfriends_content

function allfriends_content(&$a)
{
    $o = '';
    if (!local_user()) {
        notice(t('Permission denied.') . EOL);
        return;
    }
    if ($a->argc > 1) {
        $cid = intval($a->argv[1]);
    }
    if (!$cid) {
        return;
    }
    $c = q("select name, url, photo from contact where id = %d and uid = %d limit 1", intval($cid), intval(local_user()));
    $a->page['aside'] .= '<div class="vcard">' . '<div class="fn label">' . $c[0]['name'] . '</div>' . '<div id="profile-photo-wrapper">' . '<a href="/contacts/' . $cid . '"><img class="photo" width="175" height="175" 
		src="' . $c[0]['photo'] . '" alt="' . $c[0]['name'] . '" /></div>' . '</div>';
    if (!count($c)) {
        return;
    }
    $o .= '<h2>' . sprintf(t('Friends of %s'), $c[0]['name']) . '</h2>';
    $r = all_friends(local_user(), $cid);
    if (!count($r)) {
        $o .= t('No friends to display.');
        return $o;
    }
    $tpl = get_markup_template('common_friends.tpl');
    foreach ($r as $rr) {
        $o .= replace_macros($tpl, array('$url' => $rr['url'], '$name' => $rr['name'], '$photo' => $rr['photo'], '$tags' => ''));
    }
    $o .= cleardiv();
    //	$o .= paginate($a);
    return $o;
}
开发者ID:jzacman,项目名称:friendica,代码行数:33,代码来源:allfriends.php

示例15: lostpass_content

function lostpass_content(&$a)
{
    if (x($_GET, 'verify')) {
        $verify = $_GET['verify'];
        $hash = hash('whirlpool', $verify);
        $r = q("SELECT * FROM `user` WHERE `pwdreset` = '%s' LIMIT 1", dbesc($hash));
        if (!count($r)) {
            notice(t("Request could not be verified. (You may have previously submitted it.) Password reset failed.") . EOL);
            goaway(z_root());
            return;
        }
        $uid = $r[0]['uid'];
        $username = $r[0]['username'];
        $email = $r[0]['email'];
        $new_password = autoname(6) . mt_rand(100, 9999);
        $new_password_encoded = hash('whirlpool', $new_password);
        $r = q("UPDATE `user` SET `password` = '%s', `pwdreset` = ''  WHERE `uid` = %d LIMIT 1", dbesc($new_password_encoded), intval($uid));
        if ($r) {
            $tpl = get_markup_template('pwdreset.tpl');
            $o .= replace_macros($tpl, array('$lbl1' => t('Password Reset'), '$lbl2' => t('Your password has been reset as requested.'), '$lbl3' => t('Your new password is'), '$lbl4' => t('Save or copy your new password - and then'), '$lbl5' => '<a href="' . $a->get_baseurl() . '">' . t('click here to login') . '</a>.', '$lbl6' => t('Your password may be changed from the <em>Settings</em> page after successful login.'), '$newpass' => $new_password, '$baseurl' => $a->get_baseurl()));
            info("Your password has been reset." . EOL);
            $email_tpl = get_intltext_template("passchanged_eml.tpl");
            $email_tpl = replace_macros($email_tpl, array('$sitename' => $a->config['sitename'], '$siteurl' => $a->get_baseurl(), '$username' => $username, '$email' => $email, '$new_password' => $new_password, '$uid' => $newuid));
            $res = mail($email, "Your password has changed at {$a->config['sitename']}", $email_tpl, 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n" . 'Content-type: text/plain; charset=UTF-8' . "\n" . 'Content-transfer-encoding: 8bit');
            return $o;
        }
    } else {
        $tpl = get_markup_template('lostpass.tpl');
        $o .= replace_macros($tpl, array('$title' => t('Forgot your Password?'), '$desc' => t('Enter your email address and submit to have your password reset. Then check your email for further instructions.'), '$name' => t('Nickname or Email: '), '$submit' => t('Reset')));
        return $o;
    }
}
开发者ID:nextgensh,项目名称:friendica,代码行数:32,代码来源:lostpass.php


注:本文中的replace_macros函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。