本文整理汇总了PHP中get_markup_template函数的典型用法代码示例。如果您正苦于以下问题:PHP get_markup_template函数的具体用法?PHP get_markup_template怎么用?PHP get_markup_template使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_markup_template函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: wallmessage_content
function wallmessage_content(&$a)
{
if (!get_my_url()) {
notice(t('Permission denied.') . EOL);
return;
}
$recipient = $a->argc > 1 ? $a->argv[1] : '';
if (!$recipient) {
notice(t('No recipient.') . EOL);
return;
}
$r = q("select * from user where nickname = '%s' limit 1", dbesc($recipient));
if (!count($r)) {
notice(t('No recipient.') . EOL);
logger('wallmessage: no recipient');
return;
}
$user = $r[0];
if (!intval($user['unkmail'])) {
notice(t('Permission denied.') . EOL);
return;
}
$r = q("select count(*) as total from mail where uid = %d and created > UTC_TIMESTAMP() - INTERVAL 1 day and unknown = 1", intval($user['uid']));
if ($r[0]['total'] > $user['cntunkmail']) {
notice(sprintf(t('Number of daily wall messages for %s exceeded. Message failed.', $user['username'])));
return;
}
$tpl = get_markup_template('wallmsg-header.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl(true), '$editselect' => '/(profile-jot-text|prvmail-text)/', '$nickname' => $user['nickname'], '$linkurl' => t('Please enter a link URL:')));
$tpl = get_markup_template('wallmessage.tpl');
$o .= replace_macros($tpl, array('$header' => t('Send Private Message'), '$subheader' => sprintf(t('If you wish for %s to respond, please check that the privacy settings on your site allow private mail from unknown senders.'), $user['username']), '$to' => t('To:'), '$subject' => t('Subject:'), '$recipname' => $user['username'], '$nickname' => $user['nickname'], '$subjtxt' => x($_REQUEST, 'subject') ? strip_tags($_REQUEST['subject']) : '', '$text' => x($_REQUEST, 'body') ? escape_tags(htmlspecialchars($_REQUEST['body'])) : '', '$readonly' => '', '$yourmessage' => t('Your message:'), '$select' => $select, '$parent' => '', '$upload' => t('Upload photo'), '$insert' => t('Insert web link'), '$wait' => t('Please wait')));
return $o;
}
开发者ID:robhell,项目名称:friendica,代码行数:33,代码来源:wallmessage.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: p_init
function p_init(&$a)
{
if (argc() < 2) {
http_status_exit(401);
}
$mid = str_replace('.xml', '', argv(1));
$r = q("select * from item where mid = '%s' and item_wall = 1 and item_private = 0 limit 1", dbesc($mid));
if (!$r || !perm_is_allowed($r[0]['uid'], '', 'view_stream')) {
http_status_exit(404);
}
$c = q("select * from channel where channel_id = %d limit 1", intval($r[0]['uid']));
if (!$c) {
http_status_exit(404);
}
$myaddr = $c[0]['channel_address'] . '@' . App::get_hostname();
$item = $r[0];
$title = $item['title'];
$body = bb2diaspora_itembody($item);
$created = datetime_convert('UTC', 'UTC', $item['created'], 'Y-m-d H:i:s \\U\\T\\C');
$tpl = get_markup_template('diaspora_post.tpl', 'addon/diaspora');
$msg = replace_macros($tpl, array('$body' => xmlify($body), '$guid' => $item['mid'], '$handle' => xmlify($myaddr), '$public' => 'true', '$created' => $created, '$provider' => $item['app'] ? $item['app'] : t('$projectname')));
header('Content-type: text/xml');
echo $msg;
killme();
}
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:25,代码来源:p.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: init
function init()
{
$uri = urldecode(notags(trim($_GET['uri'])));
logger('xrd: ' . $uri, LOGGER_DEBUG);
$resource = $uri;
if (substr($uri, 0, 4) === 'http') {
$uri = str_replace('~', '', $uri);
$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 channel WHERE channel_address = '%s' LIMIT 1", dbesc($name));
if (!$r) {
killme();
}
$dspr = replace_macros(get_markup_template('xrd_diaspora.tpl'), array('$baseurl' => z_root(), '$dspr_guid' => $r[0]['channel_guid'] . str_replace('.', '', \App::get_hostname()), '$dspr_key' => base64_encode(pemtorsa($r[0]['channel_pubkey']))));
$salmon_key = salmon_key($r[0]['channel_pubkey']);
header('Access-Control-Allow-Origin: *');
header("Content-type: application/xrd+xml");
$aliases = array('acct:' . channel_reddress($r[0]), z_root() . '/channel/' . $r[0]['channel_address'], z_root() . '/~' . $r[0]['channel_address']);
for ($x = 0; $x < count($aliases); $x++) {
if ($aliases[$x] === $resource) {
unset($aliases[$x]);
}
}
$o = replace_macros(get_markup_template('xrd_person.tpl'), array('$nick' => $r[0]['channel_address'], '$accturi' => $resource, '$aliases' => $aliases, '$profile_url' => z_root() . '/channel/' . $r[0]['channel_address'], '$hcard_url' => z_root() . '/hcard/' . $r[0]['channel_address'], '$atom' => z_root() . '/feed/' . $r[0]['channel_address'], '$zot_post' => z_root() . '/post/' . $r[0]['channel_address'], '$poco_url' => z_root() . '/poco/' . $r[0]['channel_address'], '$photo' => z_root() . '/photo/profile/l/' . $r[0]['channel_id'], '$dspr' => $dspr, '$modexp' => 'data:application/magic-public-key,' . $salmon_key, '$subscribe' => z_root() . '/follow?url={uri}', '$bigkey' => salmon_key($r[0]['channel_pubkey'])));
$arr = array('user' => $r[0], 'xml' => $o);
call_hooks('personal_xrd', $arr);
echo $arr['xml'];
killme();
}
开发者ID:phellmes,项目名称:hubzilla,代码行数:35,代码来源:Xrd.php
示例7: help_content
function help_content(&$a)
{
nav_set_selected('help');
global $lang;
$text = '';
if ($a->argc > 1) {
$text = load_doc_file('doc/' . $a->argv[1] . '.md');
$a->page['title'] = t('Help:') . ' ' . str_replace('-', ' ', notags($a->argv[1]));
}
$home = load_doc_file('doc/Home.md');
if (!$text) {
$text = $home;
$a->page['title'] = t('Help');
} else {
$a->page['aside'] = Markdown($home);
}
if (!strlen($text)) {
header($_SERVER["SERVER_PROTOCOL"] . ' 404 ' . t('Not Found'));
$tpl = get_markup_template("404.tpl");
return replace_macros($tpl, array('$message' => t('Page not found.')));
}
$html = Markdown($text);
$html = "<style>.md_warning { padding: 1em; border: #ff0000 solid 2px; background-color: #f9a3a3; color: #ffffff;</style>" . $html;
return $html;
}
开发者ID:ZerGabriel,项目名称:friendica,代码行数:25,代码来源:help.php
示例8: 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
示例9: 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
示例10: 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
示例11: 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
示例12: 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
示例13: 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
示例14: suggest_content
function suggest_content(&$a)
{
$o = '';
if (!local_user()) {
notice(t('Permission denied.') . EOL);
return;
}
$_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd;
$a->page['aside'] .= follow_widget();
$a->page['aside'] .= findpeople_widget();
$o .= '<h2>' . t('Friend Suggestions') . '</h2>';
$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;
}
$tpl = get_markup_template('suggest_friends.tpl');
foreach ($r as $rr) {
$connlnk = $a->get_baseurl() . '/follow/?url=' . ($rr['connect'] ? $rr['connect'] : $rr['url']);
$o .= replace_macros($tpl, array('$url' => zrl($rr['url']), '$name' => $rr['name'], '$photo' => $rr['photo'], '$ignlnk' => $a->get_baseurl() . '/suggest?ignore=' . $rr['id'], '$ignid' => $rr['id'], '$conntxt' => t('Connect'), '$connlnk' => $connlnk, '$ignore' => t('Ignore/Hide')));
}
$o .= cleardiv();
// $o .= paginate($a);
return $o;
}
开发者ID:jzacman,项目名称:friendica,代码行数:25,代码来源:suggest.php
示例15: pdledit_content
function pdledit_content(&$a)
{
if (!local_channel()) {
notice(t('Permission denied.') . EOL);
return;
}
if (argc() > 1) {
$module = 'mod_' . argv(1) . '.pdl';
} else {
$o .= '<h1>' . t('Edit System Page Description') . '</h1>';
$files = glob('mod/*');
if ($files) {
foreach ($files as $f) {
$name = basename($f, '.php');
$x = theme_include('mod_' . $name . '.pdl');
if ($x) {
$o .= '<a href="pdledit/' . $name . '" >' . $name . '</a><br />';
}
}
}
// list module pdl files
return $o;
}
$t = get_pconfig(local_channel(), 'system', $module);
if (!$t) {
$t = file_get_contents(theme_include($module));
}
if (!$t) {
notice(t('Layout not found.') . EOL);
return '';
}
$o = replace_macros(get_markup_template('pdledit.tpl'), array('$header' => t('Edit System Page Description'), '$mname' => t('Module Name:'), '$help' => t('Layout Help'), '$module' => argv(1), '$content' => htmlspecialchars($t, ENT_COMPAT, 'UTF-8'), '$submit' => t('Submit')));
return $o;
}
开发者ID:bashrc,项目名称:hubzilla,代码行数:34,代码来源:pdledit.php
示例16: 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
示例17: 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
示例18: get
function get()
{
$o = '';
if (!\App::$profile['profile_uid']) {
return;
}
$observer_hash = get_observer_hash();
if (!perm_is_allowed(\App::$profile['profile_uid'], $observer_hash, 'view_contacts')) {
notice(t('Permission denied.') . EOL);
return;
}
$o .= '<h2>' . t('Common connections') . '</h2>';
$t = count_common_friends(\App::$profile['profile_uid'], $observer_hash);
if (!$t) {
notice(t('No connections in common.') . EOL);
return $o;
}
$r = common_friends(\App::$profile['profile_uid'], $observer_hash);
if ($r) {
$tpl = get_markup_template('common_friends.tpl');
foreach ($r as $rr) {
$o .= replace_macros($tpl, array('$url' => $rr['xchan_url'], '$name' => $rr['xchan_name'], '$photo' => $rr['xchan_photo_m'], '$tags' => ''));
}
$o .= cleardiv();
}
return $o;
}
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:27,代码来源:Common.php
示例19: 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
示例20: get
function get()
{
if (!local_channel()) {
notice(t('Permission denied.') . EOL);
return;
}
$channel = \App::get_channel();
$app = null;
$embed = null;
if ($_REQUEST['appid']) {
$r = q("select * from app where app_id = '%s' and app_channel = %d limit 1", dbesc($_REQUEST['appid']), dbesc(local_channel()));
if ($r) {
$app = $r[0];
$term = q("select * from term where otype = %d and oid = %d", intval(TERM_OBJ_APP), intval($r[0]['id']));
if ($term) {
$app['categories'] = '';
foreach ($term as $t) {
if ($app['categories']) {
$app['categories'] .= ',';
}
$app['categories'] .= $t['term'];
}
}
}
$embed = array('embed', t('Embed code'), app_encode($app, true), '', 'onclick="this.select();"');
}
return replace_macros(get_markup_template('app_create.tpl'), array('$banner' => $app ? t('Edit App') : t('Create App'), '$app' => $app, '$guid' => $app ? $app['app_id'] : '', '$author' => $app ? $app['app_author'] : $channel['channel_hash'], '$addr' => $app ? $app['app_addr'] : $channel['xchan_addr'], '$name' => array('name', t('Name of app'), $app ? $app['app_name'] : '', t('Required')), '$url' => array('url', t('Location (URL) of app'), $app ? $app['app_url'] : '', t('Required')), '$desc' => array('desc', t('Description'), $app ? $app['app_desc'] : '', ''), '$photo' => array('photo', t('Photo icon URL'), $app ? $app['app_photo'] : '', t('80 x 80 pixels - optional')), '$categories' => array('categories', t('Categories (optional, comma separated list)'), $app ? $app['categories'] : '', ''), '$version' => array('version', t('Version ID'), $app ? $app['app_version'] : '', ''), '$price' => array('price', t('Price of app'), $app ? $app['app_price'] : '', ''), '$page' => array('page', t('Location (URL) to purchase app'), $app ? $app['app_page'] : '', ''), '$system' => $app ? intval($app['app_system']) : 0, '$requires' => $app ? $app['app_requires'] : '', '$embed' => $embed, '$submit' => t('Submit')));
}
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:28,代码来源:Appman.php
注:本文中的get_markup_template函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论