• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP local_channel函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: search_ac_init

function search_ac_init(&$a)
{
    if (!local_channel()) {
        killme();
    }
    $start = x($_REQUEST, 'start') ? $_REQUEST['start'] : 0;
    $count = x($_REQUEST, 'count') ? $_REQUEST['count'] : 100;
    $search = x($_REQUEST, 'search') ? $_REQUEST['search'] : "";
    if (x($_REQUEST, 'query') && strlen($_REQUEST['query'])) {
        $search = $_REQUEST['query'];
    }
    // Priority to people searches
    if ($search) {
        $people_sql_extra = protect_sprintf(" AND `xchan_name` LIKE '%" . dbesc($search) . "%' ");
        $tag_sql_extra = protect_sprintf(" AND term LIKE '%" . dbesc($search) . "%' ");
    }
    $r = q("SELECT `abook_id`, `xchan_name`, `xchan_photo_s`, `xchan_url`, `xchan_addr` FROM `abook` left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d \n\t\t{$people_sql_extra}\n\t\tORDER BY `xchan_name` ASC ", intval(local_channel()));
    $results = array();
    if ($r) {
        foreach ($r as $g) {
            $results[] = array("photo" => $g['xchan_photo_s'], "name" => '@' . $g['xchan_name'], "id" => $g['abook_id'], "link" => $g['xchan_url'], "label" => '', "nick" => '');
        }
    }
    $r = q("select distinct term, tid, url from term where type in ( %d, %d ) {$tag_sql_extra} group by term order by term asc", intval(TERM_HASHTAG), intval(TERM_COMMUNITYTAG));
    if (count($r)) {
        foreach ($r as $g) {
            $results[] = array("photo" => $a->get_baseurl() . '/images/hashtag.png', "name" => '#' . $g['term'], "id" => $g['tid'], "link" => $g['url'], "label" => '', "nick" => '');
        }
    }
    header("content-type: application/json");
    $o = array('start' => $start, 'count' => $count, 'items' => $results);
    echo json_encode($o);
    logger('search_ac: ' . print_r($x, true));
    killme();
}
开发者ID:TamirAl,项目名称:hubzilla,代码行数:35,代码来源:search_ac.php


示例2: get

 function get()
 {
     if (!local_channel()) {
         return;
     }
     $postid = $_REQUEST['postid'];
     if (!$postid) {
         return;
     }
     $emoji = $_REQUEST['emoji'];
     if ($_REQUEST['emoji']) {
         $i = q("select * from item where id = %d and uid = %d", intval($postid), intval(local_channel()));
         if (!$i) {
             return;
         }
         $channel = \App::get_channel();
         $n = array();
         $n['aid'] = $channel['channel_account_id'];
         $n['uid'] = $channel['channel_id'];
         $n['item_origin'] = true;
         $n['parent'] = $postid;
         $n['parent_mid'] = $i[0]['mid'];
         $n['mid'] = item_message_id();
         $n['verb'] = ACTIVITY_REACT . '#' . $emoji;
         $n['body'] = "\n\n[zmg=32x32]" . z_root() . '/images/emoji/' . $emoji . '.png[/zmg]' . "\n\n";
         $n['author_xchan'] = $channel['channel_hash'];
         $x = item_store($n);
         if ($x['success']) {
             $nid = $x['item_id'];
             \Zotlabs\Daemon\Master::Summon(array('Notifier', 'like', $nid));
         }
     }
 }
开发者ID:BlaBlaNet,项目名称:hubzilla,代码行数:33,代码来源:React.php


示例3: get

 function get()
 {
     require_once 'include/acl_selectors.php';
     if (!local_channel()) {
         notice(t('Permission denied.') . EOL);
         return;
     }
     if (\App::$argc != 2) {
         return;
     }
     $contact_id = intval(\App::$argv[1]);
     $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($contact_id), intval(local_channel()));
     if (!count($r)) {
         notice(t('Contact not found.') . EOL);
         return;
     }
     $contact = $r[0];
     $o = '<h3>' . t('Suggest Friends') . '</h3>';
     $o .= '<div id="fsuggest-desc" >' . sprintf(t('Suggest a friend for %s'), $contact['name']) . '</div>';
     $o .= '<form id="fsuggest-form" action="fsuggest/' . $contact_id . '" method="post" >';
     // FIXME contact_selector deprecated, removed
     //	$o .= contact_selector('suggest','suggest-select', false,
     //		array('size' => 4, 'exclude' => $contact_id, 'networks' => 'DFRN_ONLY', 'single' => true));
     $o .= '<div id="fsuggest-submit-wrapper"><input id="fsuggest-submit" type="submit" name="submit" value="' . t('Submit') . '" /></div>';
     $o .= '</form>';
     return $o;
 }
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:27,代码来源:Fsuggest.php


示例4: dwpost_post_local

function dwpost_post_local(&$a, &$b)
{
    // This can probably be changed to allow editing by pointing to a different API endpoint
    if ($b['edit']) {
        return;
    }
    if (!local_channel() || local_channel() != $b['uid']) {
        return;
    }
    if ($b['item_private'] || $b['parent']) {
        return;
    }
    logger('Dreamwidth xpost invoked');
    $dw_post = intval(get_pconfig(local_channel(), 'dwpost', 'post'));
    $dw_enable = $dw_post && x($_REQUEST, 'dwpost_enable') ? intval($_REQUEST['dwpost_enable']) : 0;
    if ($_REQUEST['api_source'] && intval(get_pconfig(local_channel(), 'dwpost', 'post_by_default'))) {
        $dw_enable = 1;
    }
    if (!$dw_enable) {
        return;
    }
    if (strlen($b['postopts'])) {
        $b['postopts'] .= ',';
    }
    $b['postopts'] .= 'dwpost';
}
开发者ID:phellmes,项目名称:hubzilla-addons,代码行数:26,代码来源:dwpost.php


示例5: filer_content

function filer_content(&$a)
{
    if (!local_channel()) {
        killme();
    }
    $term = unxmlify(trim($_GET['term']));
    $item_id = $a->argc > 1 ? intval($a->argv[1]) : 0;
    logger('filer: tag ' . $term . ' item ' . $item_id);
    if ($item_id && strlen($term)) {
        // file item
        store_item_tag(local_channel(), $item_id, TERM_OBJ_POST, TERM_FILE, $term, '');
        // protect the entire conversation from periodic expiration
        $r = q("select parent from item where id = %d and uid = %d limit 1", intval($item_id), intval(local_channel()));
        if ($r) {
            $x = q("update item set item_retained = 1 where id = %d and uid = %d", intval($r[0]['parent']), intval(local_channel()));
        }
    } else {
        $filetags = array();
        $r = q("select distinct(term) from term where uid = %d and type = %d order by term asc", intval(local_channel()), intval(TERM_FILE));
        if (count($r)) {
            foreach ($r as $rr) {
                $filetags[] = $rr['term'];
            }
        }
        $tpl = get_markup_template("filer_dialog.tpl");
        $o = replace_macros($tpl, array('$field' => array('term', t("Save to Folder:"), '', '', $filetags, t('- select -')), '$submit' => t('Save')));
        echo $o;
    }
    killme();
}
开发者ID:msooon,项目名称:hubzilla,代码行数:30,代码来源:filer.php


示例6: bookmarks_content

function bookmarks_content(&$a)
{
    if (!local_channel()) {
        notice(t('Permission denied.') . EOL);
        return;
    }
    require_once 'include/menu.php';
    require_once 'include/conversation.php';
    $channel = App::get_channel();
    $o = profile_tabs($a, true, $channel['channel_address']);
    $o .= '<div class="generic-content-wrapper-styled">';
    $o .= '<h3>' . t('My Bookmarks') . '</h3>';
    $x = menu_list(local_channel(), '', MENU_BOOKMARK);
    if ($x) {
        foreach ($x as $xx) {
            $y = menu_fetch($xx['menu_name'], local_channel(), get_observer_hash());
            $o .= menu_render($y, '', true);
        }
    }
    $o .= '<h3>' . t('My Connections Bookmarks') . '</h3>';
    $x = menu_list(local_channel(), '', MENU_SYSTEM | MENU_BOOKMARK);
    if ($x) {
        foreach ($x as $xx) {
            $y = menu_fetch($xx['menu_name'], local_channel(), get_observer_hash());
            $o .= menu_render($y, '', true);
        }
    }
    $o .= '</div>';
    return $o;
}
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:30,代码来源:bookmarks.php


示例7: nofed_post_local

function nofed_post_local(&$a, &$b)
{
    if ($b['created'] != $b['edited']) {
        return;
    }
    if ($b['mid'] !== $b['parent_mid']) {
        return;
    }
    if (local_channel() && local_channel() == $b['uid']) {
        if ($b['allow_cid'] || $b['allow_gid'] || $b['deny_cid'] || $b['deny_gid']) {
            return;
        }
        $nofed_post = get_pconfig(local_channel(), 'nofed', 'post');
        if (!$nofed_post) {
            return;
        }
        $nofed_enable = $nofed_post && x($_REQUEST, 'nofed_enable') ? intval($_REQUEST['nofed_enable']) : 0;
        // if API is used, default to the chosen settings
        if ($_REQUEST['api_source'] && intval(get_pconfig(local_channel(), 'nofed', 'post_by_default'))) {
            $nofed_enable = 1;
        }
        if ($nofed_enable) {
            return;
        }
        if (strlen($b['postopts'])) {
            $b['postopts'] .= ',';
        }
        $b['postopts'] .= 'nodeliver';
    }
}
开发者ID:royalterra,项目名称:hubzilla-addons,代码行数:30,代码来源:nofed.php


示例8: likebanner_content

function likebanner_content(&$a)
{
    if (local_channel()) {
        $channel = $a->get_channel();
    } else {
        $channel = null;
    }
    $o = '<h1>Like Banner</h1>';
    $def = $_REQUEST['addr'];
    if ($channel && !$def) {
        $def = $channel['xchan_addr'];
    }
    $o .= '<form action="likebanner" method="get" >';
    $o .= t('Your Webbie:');
    $o .= '<br /><br />';
    $o .= '<input type="text" name="addr" size="32" value="' . $def . '" />';
    $o .= '<br /><br />' . t('Fontsize (px):');
    $o .= '<br /><br />';
    $o .= '<input type="text" name="size" size="32" value="' . ($_REQUEST['size'] ? $_REQUEST['size'] : 28) . '" /><br /><br />';
    $o .= '<input type="submit" name="submit" value="' . t('Submit') . '" /></form><br /><br/>';
    if ($_REQUEST['addr']) {
        $o .= '<img style="border: 1px solid #000;" src="likebanner/show/?f=&addr=' . urlencode($_REQUEST['addr']) . '&size=' . $_REQUEST['size'] . '" alt="banner" />';
        if ($channel) {
            $p = q("select profile_guid from profile where uid = %d and is_default = 1 limit 1", intval($channel['channel_id']));
            if ($p) {
                $link = z_root() . '/like/profile/' . $p[0]['profile_guid'] . '?f=&verb=like&interactive=1';
                $o .= EOL . EOL . t('Link:') . EOL . '<input type="text" size="64" onclick="this.select();" value="' . $link . '" />';
                $html = '<a href="' . $link . '" ><img src="' . z_root() . '/likebanner?f=&addr=' . $def . '&size=' . $_REQUEST['size'] . '" alt="' . t('Like us on RedMatrix') . '" /></a>';
                $o .= EOL . EOL . t('Embed:') . EOL . '<input type="text" size="64" onclick="this.select();" value="' . htmlspecialchars($html, ENT_QUOTES, 'UTF-8') . '" />';
            }
        }
    }
    return $o;
}
开发者ID:einervonvielen,项目名称:redmatrix-addons,代码行数:34,代码来源:likebanner.php


示例9: login_content

function login_content(&$a)
{
    if (local_channel()) {
        goaway(z_root());
    }
    return login($a->config['system']['register_policy'] == REGISTER_CLOSED ? false : true);
}
开发者ID:TamirAl,项目名称:hubzilla,代码行数:7,代码来源:login.php


示例10: get

 function get()
 {
     if (!local_channel()) {
         killme();
     }
     if (argc() > 2 && intval(argv(1)) && argv(2)) {
         $r = q("SELECT abook_xchan from abook where abook_xchan = '%s' and abook_channel = %d and abook_self = 0 limit 1", dbesc(base64url_decode(argv(2))), intval(local_channel()));
         if ($r) {
             $change = $r[0]['abook_xchan'];
         }
     }
     if (argc() > 1 && intval(argv(1))) {
         $r = q("SELECT * FROM `groups` WHERE `id` = %d AND `uid` = %d AND `deleted` = 0 LIMIT 1", intval(argv(1)), intval(local_channel()));
         if (!$r) {
             killme();
         }
         $group = $r[0];
         $members = group_get_members($group['id']);
         $preselected = array();
         if (count($members)) {
             foreach ($members as $member) {
                 $preselected[] = $member['xchan_hash'];
             }
         }
         if ($change) {
             if (in_array($change, $preselected)) {
                 group_rmv_member(local_channel(), $group['gname'], $change);
             } else {
                 group_add_member(local_channel(), $group['gname'], $change);
             }
         }
     }
     killme();
 }
开发者ID:BlaBlaNet,项目名称:hubzilla,代码行数:34,代码来源:Contactgroup.php


示例11: viewsrc_content

function viewsrc_content(&$a)
{
    $o = '';
    $sys = get_sys_channel();
    $item_id = argc() > 1 ? intval(argv(1)) : 0;
    $json = argc() > 2 && argv(2) === 'json' ? true : false;
    if (!local_channel()) {
        notice(t('Permission denied.') . EOL);
    }
    if (!$item_id) {
        App::$error = 404;
        notice(t('Item not found.') . EOL);
    }
    $item_normal = item_normal();
    if (local_channel() && $item_id) {
        $r = q("select id, item_flags, item_obscured, body from item where uid in (%d , %d) and id = %d {$item_normal} limit 1", intval(local_channel()), intval($sys['channel_id']), intval($item_id));
        if ($r) {
            if (intval($r[0]['item_obscured'])) {
                $r[0]['body'] = crypto_unencapsulate(json_decode($r[0]['body'], true), get_config('system', 'prvkey'));
            }
            $o = $json ? json_encode($r[0]['body']) : str_replace("\n", '<br />', $r[0]['body']);
        }
    }
    if (is_ajax()) {
        print '<div><i class="icon-pencil"> ' . t('Source of Item') . ' ' . $r[0]['id'] . '</i></div>';
        echo $o;
        killme();
    }
    return $o;
}
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:30,代码来源:viewsrc.php


示例12: 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


示例13: msgfooter_post_hook

function msgfooter_post_hook($a, &$item)
{
    /**
     *
     * An item was posted on the local system.
     * We are going to look for specific items:
     *      - A status post by a profile owner
     *      - The profile owner must have allowed our plugin
     *
     */
    logger('msgfooter invoked');
    if (!local_channel()) {
        /* non-zero if this is a logged in user of this system */
        return;
    }
    if (local_channel() != $item['uid']) {
        /* Does this person own the post? */
        return;
    }
    if ($item['item_type']) {
        return;
    }
    if ($item['parent']) {
        /* If the item has a parent, this is a comment or something else, not a status post. */
        return;
    }
    /* Retrieve our config setting */
    $footer = get_config('msgfooter', 'msgfooter_text');
    if (!$footer) {
        return;
    }
    $item['body'] .= '[footer]' . $footer . '[/footer]';
    return;
}
开发者ID:phellmes,项目名称:hubzilla-addons,代码行数:34,代码来源:msgfooter.php


示例14: set_mode

 /**
  * Set the mode we'll be displayed on
  */
 private function set_mode($mode)
 {
     if ($this->get_mode() == $mode) {
         return;
     }
     $a = $this->get_app();
     $this->observer = App::get_observer();
     $ob_hash = $this->observer ? $this->observer['xchan_hash'] : '';
     switch ($mode) {
         case 'network':
             $this->profile_owner = local_channel();
             $this->writable = true;
             break;
         case 'channel':
             $this->profile_owner = App::$profile['profile_uid'];
             $this->writable = perm_is_allowed($this->profile_owner, $ob_hash, 'post_comments');
             break;
         case 'display':
             // in this mode we set profile_owner after initialisation (from conversation()) and then
             // pull some trickery which allows us to re-invoke this function afterward
             // it's an ugly hack so FIXME
             $this->writable = perm_is_allowed($this->profile_owner, $ob_hash, 'post_comments');
             break;
         case 'page':
             $this->profile_owner = App::$profile['uid'];
             $this->writable = perm_is_allowed($this->profile_owner, $ob_hash, 'post_comments');
             break;
         default:
             logger('[ERROR] Conversation::set_mode : Unhandled mode (' . $mode . ').', LOGGER_DEBUG);
             return false;
             break;
     }
     $this->mode = $mode;
 }
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:37,代码来源:ConversationObject.php


示例15: post

 function post()
 {
     // logger('file upload: ' . print_r($_REQUEST,true));
     $channel = $_REQUEST['channick'] ? get_channel_by_nick($_REQUEST['channick']) : null;
     if (!$channel) {
         logger('channel not found');
         killme();
     }
     $_REQUEST['source'] = 'file_upload';
     if ($channel['channel_id'] != local_channel()) {
         $_REQUEST['contact_allow'] = expand_acl($channel['channel_allow_cid']);
         $_REQUEST['group_allow'] = expand_acl($channel['channel_allow_gid']);
         $_REQUEST['contact_deny'] = expand_acl($channel['channel_deny_cid']);
         $_REQUEST['group_deny'] = expand_acl($channel['channel_deny_gid']);
     }
     if ($_REQUEST['filename']) {
         $_REQUEST['allow_cid'] = perms2str($_REQUEST['contact_allow']);
         $_REQUEST['allow_gid'] = perms2str($_REQUEST['group_allow']);
         $_REQUEST['deny_cid'] = perms2str($_REQUEST['contact_deny']);
         $_REQUEST['deny_gid'] = perms2str($_REQUEST['group_deny']);
         $r = attach_mkdir($channel, get_observer_hash(), $_REQUEST);
     } else {
         $r = attach_store($channel, get_observer_hash(), '', $_REQUEST);
     }
     goaway(z_root() . '/' . $_REQUEST['return_url']);
 }
开发者ID:BlaBlaNet,项目名称:hubzilla,代码行数:26,代码来源:File_upload.php


示例16: tasks_content

function tasks_content(&$a)
{
    if (!local_channel()) {
        return;
    }
    return '';
}
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:7,代码来源:tasks.php


示例17: 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


示例18: libertree_post_local

function libertree_post_local(&$a, &$b)
{
    // This can probably be changed to allow editing by pointing to a different API endpoint
    if ($b['edit']) {
        return;
    }
    if (!local_channel() || local_channel() != $b['uid']) {
        return;
    }
    if ($b['item_private'] || $b['mid'] != $b['parent_mid']) {
        return;
    }
    $ltree_post = intval(get_pconfig(local_channel(), 'libertree', 'post'));
    $ltree_enable = $ltree_post && x($_REQUEST, 'libertree_enable') ? intval($_REQUEST['libertree_enable']) : 0;
    if ($_REQUEST['api_source'] && intval(get_pconfig(local_channel(), 'libertree', 'post_by_default'))) {
        $ltree_enable = 1;
    }
    if (!$ltree_enable) {
        return;
    }
    if (strlen($b['postopts'])) {
        $b['postopts'] .= ',';
    }
    $b['postopts'] .= 'libertree';
}
开发者ID:einervonvielen,项目名称:redmatrix-addons,代码行数:25,代码来源:libertree.php


示例19: get

 function get()
 {
     if (!local_channel()) {
         goaway(z_root() . '/' . $_SESSION['photo_return']);
         // NOTREACHED
     }
     // remove tag on the fly if item and tag are provided
     if (argc() == 4 && argv(1) === 'drop' && intval(argv(2))) {
         $item = intval(argv(2));
         $tag = argv(3);
         $r = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($item), intval(local_channel()));
         if (!$r) {
             goaway(z_root() . '/' . $_SESSION['photo_return']);
         }
         $r = fetch_post_tags($r, true);
         $item = $r[0];
         $new_tags = array();
         if ($item['term']) {
             for ($x = 0; $x < count($item['term']); $x++) {
                 if ($item['term'][$x]['term'] !== hex2bin($tag)) {
                     $new_tags[] = $item['term'][$x];
                 }
             }
         }
         if ($new_tags) {
             $item['term'] = $new_tags;
         } else {
             unset($item['term']);
         }
         item_store_update($item);
         info(t('Tag removed') . EOL);
         goaway(z_root() . '/' . $_SESSION['photo_return']);
     }
     //if we got only the item print a list of tags to select
     if (argc() == 3 && argv(1) === 'drop' && intval(argv(2))) {
         $o = '';
         $item = intval(argv(2));
         $r = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($item), intval(local_channel()));
         if (!$r) {
             goaway(z_root() . '/' . $_SESSION['photo_return']);
         }
         $r = fetch_post_tags($r, true);
         if (!count($r[0]['term'])) {
             goaway(z_root() . '/' . $_SESSION['photo_return']);
         }
         $o .= '<h3>' . t('Remove Item Tag') . '</h3>';
         $o .= '<p id="tag-remove-desc">' . t('Select a tag to remove: ') . '</p>';
         $o .= '<form id="tagrm" action="tagrm" method="post" >';
         $o .= '<input type="hidden" name="item" value="' . $item . '" />';
         $o .= '<ul>';
         foreach ($r[0]['term'] as $x) {
             $o .= '<li><input type="checkbox" name="tag" value="' . bin2hex($x['term']) . '" >' . bbcode($x['term']) . '</input></li>';
         }
         $o .= '</ul>';
         $o .= '<input id="tagrm-submit" type="submit" name="submit" value="' . t('Remove') . '" />';
         $o .= '<input id="tagrm-cancel" type="submit" name="submit" value="' . t('Cancel') . '" />';
         $o .= '</form>';
         return $o;
     }
 }
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:60,代码来源:Tagrm.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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP local_date函数代码示例发布时间:2022-05-15
下一篇:
PHP localAPI函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap