本文整理汇总了PHP中generate_map函数的典型用法代码示例。如果您正苦于以下问题:PHP generate_map函数的具体用法?PHP generate_map怎么用?PHP generate_map使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了generate_map函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: bb_map_coords
function bb_map_coords($match)
{
// the extra space in the following line is intentional
return str_replace($match[0], '<div class="map" >' . generate_map(str_replace('/', ' ', $match[1])) . '</div>', $match[0]);
}
开发者ID:vinzv,项目名称:friendica,代码行数:5,代码来源:bbcode.php
示例2: photos_content
//.........这里部分代码省略.........
$nextlink = array($nextlink, t('Next'));
}
// Do we have an item for this photo?
$linked_items = q("SELECT * FROM item WHERE resource_id = '%s' and resource_type = 'photo' \n\t\t\t{$sql_extra} LIMIT 1", dbesc($datum));
$map = null;
if ($linked_items) {
xchan_query($linked_items);
$linked_items = fetch_post_tags($linked_items, true);
$link_item = $linked_items[0];
$item_normal = item_normal();
$r = q("select * from item where parent_mid = '%s' \n\t\t\t\t{$item_normal} and uid = %d {$sql_extra} ", dbesc($link_item['mid']), intval($link_item['uid']));
if ($r) {
xchan_query($r);
$r = fetch_post_tags($r, true);
$r = conv_sort($r, 'commented');
}
$tags = array();
if ($link_item['term']) {
$cnt = 0;
foreach ($link_item['term'] as $t) {
$tags[$cnt] = array(0 => format_term_for_display($t));
if ($can_post && $ph[0]['uid'] == $owner_uid) {
$tags[$cnt][1] = 'tagrm/drop/' . $link_item['id'] . '/' . bin2hex($t['term']);
//?f=&item=' . $link_item['id'];
$tags[$cnt][2] = t('Remove');
}
$cnt++;
}
}
if (local_channel() && local_channel() == $link_item['uid']) {
q("UPDATE `item` SET item_unseen = 0 WHERE parent = %d and uid = %d and item_unseen = 1", intval($link_item['parent']), intval(local_channel()));
}
if ($link_item['coord']) {
$map = generate_map($link_item['coord']);
}
}
// logger('mod_photo: link_item' . print_r($link_item,true));
// FIXME - remove this when we move to conversation module
$r = $r[0]['children'];
$edit = null;
if ($can_post) {
$album_e = $ph[0]['album'];
$caption_e = $ph[0]['description'];
$aclselect_e = $_is_owner ? populate_acl($ph[0]) : '';
$albums = array_key_exists('albums', $a->data) ? $a->data['albums'] : photos_albums_list($a->data['channel'], $a->data['observer']);
$_SESSION['album_return'] = bin2hex($ph[0]['album']);
$edit = array('edit' => t('Edit photo'), 'id' => $link_item['id'], 'rotatecw' => t('Rotate CW (right)'), 'rotateccw' => t('Rotate CCW (left)'), 'albums' => $albums['albums'], 'album' => $album_e, 'newalbum_label' => t('Enter a new album name'), 'newalbum_placeholder' => t('or select an existing one (doubleclick)'), 'nickname' => $a->data['channel']['channel_address'], 'resource_id' => $ph[0]['resource_id'], 'capt_label' => t('Caption'), 'caption' => $caption_e, 'tag_label' => t('Add a Tag'), 'permissions' => t('Permissions'), 'aclselect' => $aclselect_e, 'lockstate' => $lockstate[0], 'help_tags' => t('Example: @bob, @Barbara_Jensen, @[email protected]'), 'item_id' => count($linked_items) ? $link_item['id'] : 0, 'adult_enabled' => feature_enabled($owner_uid, 'adult_photo_flagging'), 'adult' => array('adult', t('Flag as adult in album view'), intval($ph[0]['is_nsfw']), ''), 'submit' => t('Submit'), 'delete' => t('Delete Photo'));
}
if (count($linked_items)) {
$cmnt_tpl = get_markup_template('comment_item.tpl');
$tpl = get_markup_template('photo_item.tpl');
$return_url = $a->cmd;
$like_tpl = get_markup_template('like_noshare.tpl');
$likebuttons = '';
if ($can_post || $can_comment) {
$likebuttons = array('id' => $link_item['id'], 'likethis' => t("I like this (toggle)"), 'nolike' => t("I don't like this (toggle)"), 'share' => t('Share'), 'wait' => t('Please wait'));
}
$comments = '';
if (!count($r)) {
if ($can_post || $can_comment) {
$commentbox = replace_macros($cmnt_tpl, array('$return_path' => '', '$mode' => 'photos', '$jsreload' => $return_url, '$type' => 'wall-comment', '$id' => $link_item['id'], '$parent' => $link_item['id'], '$profile_uid' => $owner_uid, '$mylink' => $observer['xchan_url'], '$mytitle' => t('This is you'), '$myphoto' => $observer['xchan_photo_s'], '$comment' => t('Comment'), '$submit' => t('Submit'), '$preview' => t('Preview'), '$ww' => '', '$feature_encrypt' => false));
}
}
$alike = array();
$dlike = array();
$like = '';
开发者ID:spthaolt,项目名称:hubzilla,代码行数:67,代码来源:photos.php
示例3: prepare_body
function prepare_body(&$item, $attach = false)
{
require_once 'include/identity.php';
// if($item['html']) {
// $s = bb_observer($item['html']);
// }
// else {
call_hooks('prepare_body_init', $item);
// unobscure($item);
$s = prepare_text($item['body'], $item['mimetype'], false);
// }
$photo = '';
$is_photo = $item['obj_type'] === ACTIVITY_OBJ_PHOTO ? true : false;
if ($is_photo) {
$object = json_decode($item['object'], true);
// if original photo width is <= 640px prepend it to item body
if ($object['link'][0]['width'] && $object['link'][0]['width'] <= 640) {
$s = '<div class="inline-photo-item-wrapper"><a href="' . zid(rawurldecode($object['id'])) . '" target="_newwin"><img class="inline-photo-item" style="max-width:' . $object['link'][0]['width'] . 'px; width:100%; height:auto;" src="' . zid(rawurldecode($object['link'][0]['href'])) . '"></a></div>' . $s;
}
// if original photo width is > 640px make it a cover photo
if ($object['link'][0]['width'] && $object['link'][0]['width'] > 640) {
$scale = $object['link'][1]['width'] == 1024 || $object['link'][1]['height'] == 1024 ? 1 : 0;
$photo = '<a href="' . zid(rawurldecode($object['id'])) . '" target="_newwin"><img style="max-width:' . $object['link'][$scale]['width'] . 'px; width:100%; height:auto;" src="' . zid(rawurldecode($object['link'][$scale]['href'])) . '"></a>';
}
}
$prep_arr = array('item' => $item, 'html' => $s, 'photo' => $photo);
call_hooks('prepare_body', $prep_arr);
$s = $prep_arr['html'];
$photo = $prep_arr['photo'];
// q("update item set html = '%s' where id = %d",
// dbesc($s),
// intval($item['id'])
// );
if (!$attach) {
return $s;
}
if (strpos($s, '<div class="map">') !== false && $item['coord']) {
$x = generate_map(trim($item['coord']));
if ($x) {
$s = preg_replace('/\\<div class\\=\\"map\\"\\>/', '$0' . $x, $s);
}
}
$attachments = theme_attachments($item);
$writeable = get_observer_hash() == $item['owner_xchan'] ? true : false;
$tags = format_hashtags($item);
if ($item['resource_type']) {
$mentions = format_mentions($item);
}
$categories = format_categories($item, $writeable);
if (local_channel() == $item['uid']) {
$filer = format_filer($item);
}
$s = sslify($s);
// Look for spoiler
$spoilersearch = '<blockquote class="spoiler">';
// Remove line breaks before the spoiler
while (strpos($s, "\n" . $spoilersearch) !== false) {
$s = str_replace("\n" . $spoilersearch, $spoilersearch, $s);
}
while (strpos($s, "<br />" . $spoilersearch) !== false) {
$s = str_replace("<br />" . $spoilersearch, $spoilersearch, $s);
}
while (strpos($s, $spoilersearch) !== false) {
$pos = strpos($s, $spoilersearch);
$rnd = random_string(8);
$spoilerreplace = '<br /> <span id="spoiler-wrap-' . $rnd . '" style="white-space:nowrap;" class="fakelink" onclick="openClose(\'spoiler-' . $rnd . '\');">' . sprintf(t('Click to open/close')) . '</span>' . '<blockquote class="spoiler" id="spoiler-' . $rnd . '" style="display: none;">';
$s = substr($s, 0, $pos) . $spoilerreplace . substr($s, $pos + strlen($spoilersearch));
}
// Look for quote with author
$authorsearch = '<blockquote class="author">';
while (strpos($s, $authorsearch) !== false) {
$pos = strpos($s, $authorsearch);
$rnd = random_string(8);
$authorreplace = '<br /> <span id="author-wrap-' . $rnd . '" style="white-space:nowrap;" class="fakelink" onclick="openClose(\'author-' . $rnd . '\');">' . sprintf(t('Click to open/close')) . '</span>' . '<blockquote class="author" id="author-' . $rnd . '" style="display: block;">';
$s = substr($s, 0, $pos) . $authorreplace . substr($s, $pos + strlen($authorsearch));
}
$prep_arr = array('item' => $item, 'photo' => $photo, 'html' => $s, 'categories' => $categories, 'folders' => $filer, 'tags' => $tags, 'mentions' => $mentions, 'attachments' => $attachments);
call_hooks('prepare_body_final', $prep_arr);
unset($prep_arr['item']);
return $prep_arr;
}
开发者ID:23n,项目名称:hubzilla,代码行数:81,代码来源:text.php
示例4: prepare_body
function prepare_body(&$item, $attach = false)
{
call_hooks('prepare_body_init', $item);
$s = '';
$photo = '';
$is_photo = $item['verb'] === ACTIVITY_POST && $item['obj_type'] === ACTIVITY_OBJ_PHOTO ? true : false;
if ($is_photo) {
$object = json_decode($item['obj'], true);
// if original photo width is <= 640px prepend it to item body
if ($object['link'][0]['width'] && $object['link'][0]['width'] <= 640) {
$s .= '<div class="inline-photo-item-wrapper"><a href="' . zid(rawurldecode($object['id'])) . '" target="_blank"><img class="inline-photo-item" style="max-width:' . $object['link'][0]['width'] . 'px; width:100%; height:auto;" src="' . zid(rawurldecode($object['link'][0]['href'])) . '"></a></div>' . $s;
}
// if original photo width is > 640px make it a cover photo
if ($object['link'][0]['width'] && $object['link'][0]['width'] > 640) {
$scale = $object['link'][1]['width'] == 1024 || $object['link'][1]['height'] == 1024 ? 1 : 0;
$photo = '<a href="' . zid(rawurldecode($object['id'])) . '" target="_blank"><img style="max-width:' . $object['link'][$scale]['width'] . 'px; width:100%; height:auto;" src="' . zid(rawurldecode($object['link'][$scale]['href'])) . '"></a>';
}
}
$s .= prepare_text($item['body'], $item['mimetype'], false);
$event = $item['obj_type'] === ACTIVITY_OBJ_EVENT ? format_event_obj($item['obj']) : false;
$prep_arr = array('item' => $item, 'html' => $event ? $event['content'] : $s, 'event' => $event['header'], 'photo' => $photo);
call_hooks('prepare_body', $prep_arr);
$s = $prep_arr['html'];
$photo = $prep_arr['photo'];
$event = $prep_arr['event'];
// q("update item set html = '%s' where id = %d",
// dbesc($s),
// intval($item['id'])
// );
if (!$attach) {
return $s;
}
if (strpos($s, '<div class="map">') !== false && $item['coord']) {
$x = generate_map(trim($item['coord']));
if ($x) {
$s = preg_replace('/\\<div class\\=\\"map\\"\\>/', '$0' . $x, $s);
}
}
$attachments = theme_attachments($item);
$writeable = get_observer_hash() == $item['owner_xchan'] ? true : false;
$tags = format_hashtags($item);
if ($item['resource_type']) {
$mentions = format_mentions($item);
}
$categories = format_categories($item, $writeable);
if (local_channel() == $item['uid']) {
$filer = format_filer($item);
}
$s = sslify($s);
$prep_arr = array('item' => $item, 'photo' => $photo, 'html' => $s, 'event' => $event, 'categories' => $categories, 'folders' => $filer, 'tags' => $tags, 'mentions' => $mentions, 'attachments' => $attachments);
call_hooks('prepare_body_final', $prep_arr);
unset($prep_arr['item']);
return $prep_arr;
}
开发者ID:einervonvielen,项目名称:hubzilla,代码行数:54,代码来源:text.php
示例5: prepare_body
//.........这里部分代码省略.........
// Replace the blockquotes with quotes that are used in mails
$mailquote = '<blockquote type="cite" class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">';
$s = str_replace(array('<blockquote>', '<blockquote class="spoiler">', '<blockquote class="author">'), array($mailquote, $mailquote, $mailquote), $s);
return $s;
}
$as = '';
$vhead = false;
$arr = explode('[/attach],', $item['attach']);
if (count($arr)) {
$as .= '<div class="body-attach">';
foreach ($arr as $r) {
$matches = false;
$icon = '';
$cnt = preg_match_all('|\\[attach\\]href=\\"(.*?)\\" length=\\"(.*?)\\" type=\\"(.*?)\\" title=\\"(.*?)\\"|', $r, $matches, PREG_SET_ORDER);
if ($cnt) {
foreach ($matches as $mtch) {
$mime = $mtch[3];
if (local_user() == $item['uid'] && $item['contact-id'] != $a->contact['id'] && $item['network'] == NETWORK_DFRN) {
$the_url = $a->get_baseurl() . '/redir/' . $item['contact-id'] . '?f=1&url=' . $mtch[1];
} else {
$the_url = $mtch[1];
}
if (strpos($mime, 'video') !== false) {
if (!$vhead) {
$vhead = true;
$a->page['htmlhead'] .= replace_macros(get_markup_template('videos_head.tpl'), array('$baseurl' => $a->get_baseurl()));
$a->page['end'] .= replace_macros(get_markup_template('videos_end.tpl'), array('$baseurl' => $a->get_baseurl()));
}
$id = end(explode('/', $the_url));
$as .= replace_macros(get_markup_template('video_top.tpl'), array('$video' => array('id' => $id, 'title' => t('View Video'), 'src' => $the_url, 'mime' => $mime)));
}
$filetype = strtolower(substr($mime, 0, strpos($mime, '/')));
if ($filetype) {
$filesubtype = strtolower(substr($mime, strpos($mime, '/') + 1));
$filesubtype = str_replace('.', '-', $filesubtype);
} else {
$filetype = 'unkn';
$filesubtype = 'unkn';
}
$icon = '<div class="attachtype icon s22 type-' . $filetype . ' subtype-' . $filesubtype . '"></div>';
/*$icontype = strtolower(substr($mtch[3],0,strpos($mtch[3],'/')));
switch($icontype) {
case 'video':
case 'audio':
case 'image':
case 'text':
$icon = '<div class="attachtype icon s22 type-' . $icontype . '"></div>';
break;
default:
$icon = '<div class="attachtype icon s22 type-unkn"></div>';
break;
}*/
$title = strlen(trim($mtch[4])) ? escape_tags(trim($mtch[4])) : escape_tags($mtch[1]);
$title .= ' ' . $mtch[2] . ' ' . t('bytes');
$as .= '<a href="' . strip_tags($the_url) . '" title="' . $title . '" class="attachlink" target="_blank" >' . $icon . '</a>';
}
}
}
$as .= '<div class="clear"></div></div>';
}
$s = $s . $as;
// map
if (strpos($s, '<div class="map">') !== false && $item['coord']) {
$x = generate_map(trim($item['coord']));
if ($x) {
$s = preg_replace('/\\<div class\\=\\"map\\"\\>/', '$0' . $x, $s);
}
}
// Look for spoiler
$spoilersearch = '<blockquote class="spoiler">';
// Remove line breaks before the spoiler
while (strpos($s, "\n" . $spoilersearch) !== false) {
$s = str_replace("\n" . $spoilersearch, $spoilersearch, $s);
}
while (strpos($s, "<br />" . $spoilersearch) !== false) {
$s = str_replace("<br />" . $spoilersearch, $spoilersearch, $s);
}
while (strpos($s, $spoilersearch) !== false) {
$pos = strpos($s, $spoilersearch);
$rnd = random_string(8);
$spoilerreplace = '<br /> <span id="spoiler-wrap-' . $rnd . '" style="white-space:nowrap;" class="fakelink" onclick="openClose(\'spoiler-' . $rnd . '\');">' . sprintf(t('Click to open/close')) . '</span>' . '<blockquote class="spoiler" id="spoiler-' . $rnd . '" style="display: none;">';
$s = substr($s, 0, $pos) . $spoilerreplace . substr($s, $pos + strlen($spoilersearch));
}
// Look for quote with author
$authorsearch = '<blockquote class="author">';
while (strpos($s, $authorsearch) !== false) {
$pos = strpos($s, $authorsearch);
$rnd = random_string(8);
$authorreplace = '<br /> <span id="author-wrap-' . $rnd . '" style="white-space:nowrap;" class="fakelink" onclick="openClose(\'author-' . $rnd . '\');">' . sprintf(t('Click to open/close')) . '</span>' . '<blockquote class="author" id="author-' . $rnd . '" style="display: block;">';
$s = substr($s, 0, $pos) . $authorreplace . substr($s, $pos + strlen($authorsearch));
}
// replace friendica image url size with theme preference
if (x($a->theme_info, 'item_image_size')) {
$ps = $a->theme_info['item_image_size'];
$s = preg_replace('|(<img[^>]+src="[^"]+/photo/[0-9a-f]+)-[0-9]|', "\$1-" . $ps, $s);
}
$prep_arr = array('item' => $item, 'html' => $s);
call_hooks('prepare_body_final', $prep_arr);
return $prep_arr['html'];
}
开发者ID:rahmiyildiz,项目名称:friendica,代码行数:101,代码来源:text.php
示例6: prepare_body
function prepare_body(&$item, $attach = false)
{
call_hooks('prepare_body_init', $item);
unobscure($item);
$s = prepare_text($item['body'], $item['mimetype']);
$prep_arr = array('item' => $item, 'html' => $s);
call_hooks('prepare_body', $prep_arr);
$s = $prep_arr['html'];
if (!$attach) {
return $s;
}
if (strpos($s, '<div class="map">') !== false && $item['coord']) {
$x = generate_map(trim($item['coord']));
if ($x) {
$s = preg_replace('/\\<div class\\=\\"map\\"\\>/', '$0' . $x, $s);
}
}
$s .= theme_attachments($item);
$writeable = get_observer_hash() == $item['owner_xchan'] ? true : false;
$s .= format_hashtags($item);
if ($item['resource_type']) {
$s .= format_mentions($item);
}
$s .= format_categories($item, $writeable);
if (local_channel() == $item['uid']) {
$s .= format_filer($item);
}
$s = sslify($s);
// Look for spoiler
$spoilersearch = '<blockquote class="spoiler">';
// Remove line breaks before the spoiler
while (strpos($s, "\n" . $spoilersearch) !== false) {
$s = str_replace("\n" . $spoilersearch, $spoilersearch, $s);
}
while (strpos($s, "<br />" . $spoilersearch) !== false) {
$s = str_replace("<br />" . $spoilersearch, $spoilersearch, $s);
}
while (strpos($s, $spoilersearch) !== false) {
$pos = strpos($s, $spoilersearch);
$rnd = random_string(8);
$spoilerreplace = '<br /> <span id="spoiler-wrap-' . $rnd . '" style="white-space:nowrap;" class="fakelink" onclick="openClose(\'spoiler-' . $rnd . '\');">' . sprintf(t('Click to open/close')) . '</span>' . '<blockquote class="spoiler" id="spoiler-' . $rnd . '" style="display: none;">';
$s = substr($s, 0, $pos) . $spoilerreplace . substr($s, $pos + strlen($spoilersearch));
}
// Look for quote with author
$authorsearch = '<blockquote class="author">';
while (strpos($s, $authorsearch) !== false) {
$pos = strpos($s, $authorsearch);
$rnd = random_string(8);
$authorreplace = '<br /> <span id="author-wrap-' . $rnd . '" style="white-space:nowrap;" class="fakelink" onclick="openClose(\'author-' . $rnd . '\');">' . sprintf(t('Click to open/close')) . '</span>' . '<blockquote class="author" id="author-' . $rnd . '" style="display: block;">';
$s = substr($s, 0, $pos) . $authorreplace . substr($s, $pos + strlen($authorsearch));
}
$prep_arr = array('item' => $item, 'html' => $s);
call_hooks('prepare_body_final', $prep_arr);
return $prep_arr['html'];
}
开发者ID:einervonvielen,项目名称:redmatrix,代码行数:55,代码来源:text.php
示例7: photos_content
//.........这里部分代码省略.........
$lock = $ph[0]['uid'] == local_user() && (strlen($ph[0]['allow_cid']) || strlen($ph[0]['allow_gid']) || strlen($ph[0]['deny_cid']) || strlen($ph[0]['deny_gid'])) ? t('Private Message') : Null;
}
if ($cmd === 'edit') {
$tpl = get_markup_template('photo_edit_head.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, array('$prevlink' => $prevlink, '$nextlink' => $nextlink));
}
if ($prevlink) {
$prevlink = array($prevlink, '<div class="icon prev"></div>');
}
$photo = array('href' => $a->get_baseurl() . '/photo/' . $hires['resource-id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']], 'title' => t('View Full Size'), 'src' => $a->get_baseurl() . '/photo/' . $lores['resource-id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?f=&_u=' . datetime_convert('', '', '', 'ymdhis'), 'height' => $hires['height'], 'width' => $hires['width'], 'album' => $hires['album'], 'filename' => $hires['filename']);
if ($nextlink) {
$nextlink = array($nextlink, '<div class="icon next"></div>');
}
// Do we have an item for this photo?
// FIXME! - replace following code to display the conversation with our normal
// conversation functions so that it works correctly and tracks changes
// in the evolving conversation code.
// The difference is that we won't be displaying the conversation head item
// as a "post" but displaying instead the photo it is linked to
$linked_items = q("SELECT * FROM `item` WHERE `resource-id` = '%s' {$sql_extra} LIMIT 1", dbesc($datum));
$map = null;
if (count($linked_items)) {
$link_item = $linked_items[0];
$r = q("SELECT COUNT(*) AS `total`\n\t\t\t\tFROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`\n\t\t\t\tWHERE `parent-uri` = '%s' AND `uri` != '%s' AND `item`.`deleted` = 0 and `item`.`moderated` = 0\n\t\t\t\tAND `contact`.`blocked` = 0 AND `contact`.`pending` = 0\n\t\t\t\tAND `item`.`uid` = %d\n\t\t\t\t{$sql_extra} ", dbesc($link_item['uri']), dbesc($link_item['uri']), intval($link_item['uid']));
if (count($r)) {
$a->set_pager_total($r[0]['total']);
}
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,\n\t\t\t\t`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`network`,\n\t\t\t\t`contact`.`rel`, `contact`.`thumb`, `contact`.`self`,\n\t\t\t\t`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`\n\t\t\t\tFROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`\n\t\t\t\tWHERE `parent-uri` = '%s' AND `uri` != '%s' AND `item`.`deleted` = 0 and `item`.`moderated` = 0\n\t\t\t\tAND `contact`.`blocked` = 0 AND `contact`.`pending` = 0\n\t\t\t\tAND `item`.`uid` = %d\n\t\t\t\t{$sql_extra}\n\t\t\t\tORDER BY `parent` DESC, `id` ASC LIMIT %d ,%d ", dbesc($link_item['uri']), dbesc($link_item['uri']), intval($link_item['uid']), intval($a->pager['start']), intval($a->pager['itemspage']));
if (local_user() && local_user() == $link_item['uid']) {
q("UPDATE `item` SET `unseen` = 0 WHERE `parent` = %d and `uid` = %d", intval($link_item['parent']), intval(local_user()));
update_thread($link_item['parent']);
}
if ($link_item['coord']) {
$map = generate_map($link_item['coord']);
}
}
$tags = Null;
if (count($linked_items) && strlen($link_item['tag'])) {
$arr = explode(',', $link_item['tag']);
// parse tags and add links
$tag_str = '';
foreach ($arr as $t) {
if (strlen($tag_str)) {
$tag_str .= ', ';
}
$tag_str .= bbcode($t);
}
$tags = array(t('Tags: '), $tag_str);
if ($cmd === 'edit') {
$tags[] = $a->get_baseurl() . '/tagrm/' . $link_item['id'];
$tags[] = t('[Remove any tag]');
}
}
$edit = Null;
if ($cmd === 'edit' && $can_post) {
$edit_tpl = get_markup_template('photo_edit.tpl');
// Private/public post links for the non-JS ACL form
$private_post = 1;
if ($_REQUEST['public']) {
$private_post = 0;
}
$query_str = $a->query_string;
if (strpos($query_str, 'public=1') !== false) {
$query_str = str_replace(array('?public=1', '&public=1'), array('', ''), $query_str);
}
// I think $a->query_string may never have ? in it, but I could be wrong
开发者ID:vinzv,项目名称:friendica,代码行数:67,代码来源:photos.php
注:本文中的generate_map函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论