當前位置: 首頁>>代碼示例>>PHP>>正文


PHP COM_buildUrl函數代碼示例

本文整理匯總了PHP中COM_buildUrl函數的典型用法代碼示例。如果您正苦於以下問題:PHP COM_buildUrl函數的具體用法?PHP COM_buildUrl怎麽用?PHP COM_buildUrl使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了COM_buildUrl函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: CUSTOM_multilangstory

/**
 * sidに対応する多言語記事が存在する場合はその記事へのリンクを作成し返す関數
 *   $sid : story id
 *   --------------
 *   return : 多言語記事へのリンク
**/
function CUSTOM_multilangstory($sid)
{
    global $_CONF, $_TABLES;
    $retval = '';
    if (empty($_CONF['languages']) || empty($_CONF['language_files']) || count($_CONF['languages']) != count($_CONF['language_files'])) {
        return $retval;
    }
    $work = split('_', $sid);
    $cur_lang = array_pop($work);
    if (empty($cur_lang) || !array_key_exists($cur_lang, $_CONF['languages'])) {
        return $retval;
    }
    $entries = array();
    $mini_sid = implode('_', $work);
    foreach ($_CONF['languages'] as $key => $value) {
        if ($cur_lang != $key) {
            $mul_sid = DB_getItem($_TABLES['stories'], 'sid', 'sid="' . $mini_sid . '_' . $key . '"');
            if (!empty($mul_sid)) {
                $url = COM_buildUrl($_CONF['site_url'] . '/article.php?story=' . $mul_sid);
                $entries[] = '<a href="' . $url . '">' . $value . '</a>';
            }
        }
    }
    if (sizeof($entries) > 0) {
        $retval .= COM_makeList($entries);
    }
    return $retval;
}
開發者ID:mistgrass,項目名稱:geeklog-ivywe,代碼行數:34,代碼來源:custom_multilangstory.php

示例2: SEC_hasRights

            }
        } else {
            $show_comments = true;
        }
        // Display the comments, if there are any ..
        if ($story->displayElements('commentcode') >= 0 and $show_comments) {
            $delete_option = SEC_hasRights('story.edit') && $story->getAccess() == 3 ? true : false;
            require_once $_CONF['path_system'] . 'lib-comment.php';
            $story_template->set_var('commentbar', CMT_userComments($story->getSid(), $story->displayElements('title'), 'article', $order, $mode, 0, $page, false, $delete_option, $story->displayElements('commentcode')));
        }
        if ($_CONF['trackback_enabled'] && $story->displayElements('trackbackcode') >= 0 && $show_comments) {
            if (SEC_hasRights('story.ping')) {
                if ($story->displayElements('draft_flag') == 0 && $story->displayElements('day') < time()) {
                    $url = $_CONF['site_admin_url'] . '/trackback.php?mode=sendall&amp;id=' . $story->getSid();
                    $story_template->set_var('send_trackback_link', COM_createLink($LANG_TRB['send_trackback'], $url));
                    $story_template->set_var('send_trackback_url', $url);
                    $story_template->set_var('lang_send_trackback_text', $LANG_TRB['send_trackback']);
                }
            }
            $permalink = COM_buildUrl($_CONF['site_url'] . '/article.php?story=' . $story->getSid());
            $story_template->set_var('trackback', TRB_renderTrackbackComments($story->getSID(), 'article', $story->displayElements('title'), $permalink));
        } else {
            $story_template->set_var('trackback', '');
        }
        $display .= $story_template->finish($story_template->parse('output', 'article'));
        $display .= COM_siteFooter();
    }
} else {
    $display .= COM_refresh($_CONF['site_url'] . '/index.php');
}
COM_output($display);
開發者ID:alxstuart,項目名稱:ajfs.me,代碼行數:31,代碼來源:article.php

示例3: LIB_GetListField

function LIB_GetListField($fieldname, $fieldvalue, $A, $icon_arr)
{
    global $_CONF;
    global $LANG_ACCESS;
    $retval = '';
    switch ($fieldname) {
        //編集アイコン
        case 'editid':
            $retval = "<a href=\"{$_CONF['site_admin_url']}";
            $retval .= "/plugins/" . THIS_SCRIPT;
            $retval .= "?mode=edit";
            $retval .= "&amp;id={$A['group_id']}\">";
            $retval .= "{$icon_arr['edit']}</a>";
            break;
        case 'copy':
            $url = $_CONF['site_admin_url'] . "/plugins/" . THIS_SCRIPT;
            $url .= "?";
            $url .= "mode=copy";
            $url .= "&amp;id={$A['group_id']}";
            $retval = COM_createLink($icon_arr['copy'], $url);
            break;
        case 'code':
            $name = COM_applyFilter($A['code']);
            $url = $_CONF['site_url'] . "/" . THIS_SCRIPT2;
            $url .= "?";
            $url .= "gcode=" . $A['code'];
            $url .= "&amp;m=gcode";
            $url = COM_buildUrl($url);
            $retval = COM_createLink($name, $url);
            break;
        case 'group_id':
            $name = COM_applyFilter($A['group_id']);
            $url = $_CONF['site_url'] . "/" . THIS_SCRIPT2;
            $url .= "?";
            $url .= "gid=" . $A['group_id'];
            $url .= "&amp;m=gid";
            $url = COM_buildUrl($url);
            $retval = COM_createLink($name, $url);
            break;
            //各項目
        //各項目
        default:
            $retval = $fieldvalue;
            break;
    }
    return $retval;
}
開發者ID:mistgrass,項目名稱:geeklog-ivywe,代碼行數:47,代碼來源:lib_group.php

示例4: searchFormatCallback

 /**
  * Callback function for the ListFactory class
  *
  * This function gets called by the ListFactory class and formats
  * each row accordingly for example pulling usernames from the
  * users table and displaying a link to their profile.
  *
  * @param array $row An array of plain data to format
  * @return array A reformatted version of the input array
  *
  */
 public function searchFormatCallback($preSort, $row)
 {
     global $_CONF, $LANG09;
     if ($preSort) {
         if (is_array($row[LF_SOURCE_TITLE])) {
             $row[LF_SOURCE_TITLE] = implode($_CONF['search_separator'], $row[LF_SOURCE_TITLE]);
         }
         if (is_numeric($row['uid'])) {
             if (empty($this->_names[$row['uid']])) {
                 $this->_names[$row['uid']] = htmlspecialchars(COM_getDisplayName($row['uid']));
                 if ($row['uid'] != 1) {
                     $this->_names[$row['uid']] = COM_createLink($this->_names[$row['uid']], $_CONF['site_url'] . '/users.php?mode=profile&amp;uid=' . $row['uid']);
                 }
             }
             $row['uid'] = $this->_names[$row['uid']];
         }
     } else {
         $row[LF_SOURCE_TITLE] = COM_createLink($row[LF_SOURCE_TITLE], $this->_searchURL . '&amp;type=' . $row[LF_SOURCE_NAME] . '&amp;mode=search');
         if ($row['url'] != '#') {
             $row['url'] = ($row['url'][0] == '/' ? $_CONF['site_url'] : '') . $row['url'];
             if (isset($this->_url_rewrite[$row[LF_SOURCE_NAME]]) && $this->_url_rewrite[$row[LF_SOURCE_NAME]]) {
                 $row['url'] = COM_buildUrl($row['url']);
             }
             if (isset($this->_append_query[$row[LF_SOURCE_NAME]]) && $this->_append_query[$row[LF_SOURCE_NAME]]) {
                 if (!empty($this->_query)) {
                     $row['url'] .= (strpos($row['url'], '?') ? '&amp;' : '?') . 'query=' . urlencode($this->_query);
                 }
             }
         }
         $row['title'] = $this->_shortenText($this->_query, $row['title'], 8);
         $row['title'] = stripslashes(str_replace('$', '&#36;', $row['title']));
         $row['title'] = COM_createLink($row['title'], $row['url']);
         if ($row['description'] == 'LF_NULL') {
             $row['description'] = '<i>' . $LANG09[70] . '</i>';
         } elseif ($row['description'] != '<i>' . $LANG09[70] . '</i>') {
             $row['description'] = stripslashes($this->_shortenText($this->_query, PLG_replaceTags($row['description']), $this->_wordlength));
         }
         if ($row['date'] != 'LF_NULL') {
             $dt = COM_getUserDateTimeFormat(intval($row['date']));
             $row['date'] = $dt[0];
         }
         if ($row['hits'] != 'LF_NULL') {
             $row['hits'] = COM_NumberFormat($row['hits']) . ' ';
             // simple solution to a silly problem!
         }
     }
     return $row;
 }
開發者ID:milk54,項目名稱:geeklog-japan,代碼行數:59,代碼來源:search.class.php

示例5: getItemsByDate

 /**
  * Returns an array of (
  *   'id'        => $id (string),
  *   'title'     => $title (string),
  *   'uri'       => $uri (string),
  *   'date'      => $date (int: Unix timestamp),
  *   'image_uri' => $image_uri (string)
  * )
  */
 public function getItemsByDate($tid = '', $all_langs = FALSE)
 {
     global $_CONF, $_TABLES;
     $entries = array();
     if (empty(Dataproxy::$startDate) or empty(Dataproxy::$endDate)) {
         return $entries;
     }
     $sql = "SELECT sid, title, UNIX_TIMESTAMP(date) AS day " . "  FROM {$_TABLES['stories']} " . "WHERE (draft_flag = 0) AND (date <= NOW()) " . "  AND (UNIX_TIMESTAMP(date) BETWEEN '" . Dataproxy::$startDate . "' AND '" . Dataproxy::$endDate . "') ";
     if (!empty($tid)) {
         $sql .= "AND (tid = '" . addslashes($tid) . "') ";
     }
     if (!Dataproxy::isRoot()) {
         $sql .= COM_getTopicSql('AND', Dataproxy::uid()) . COM_getPermSql('AND', Dataproxy::uid());
         if (function_exists('COM_getLangSQL') and $all_langs === FALSE) {
             $sql .= COM_getLangSQL('sid', 'AND');
         }
     }
     $result = DB_query($sql);
     if (DB_error()) {
         return $entries;
     }
     while (($A = DB_fetchArray($result, FALSE)) !== FALSE) {
         $entry = array();
         $entry['id'] = stripslashes($A['sid']);
         $entry['title'] = stripslashes($A['title']);
         $entry['uri'] = COM_buildUrl($_CONF['site_url'] . '/article.php?story=' . stripslashes($A['sid']));
         $entry['date'] = $A['day'];
         $entry['imageurl'] = FALSE;
         $entries[] = $entry;
     }
     return $entries;
 }
開發者ID:milk54,項目名稱:geeklog-japan,代碼行數:41,代碼來源:article.class.php

示例6: savestory

/**
* Saves a story submission
*
* @param    array   $A  Data for that submission
* @return   string      HTML redirect
*
*/
function savestory($A)
{
    global $_CONF, $_TABLES, $_USER;
    $retval = '';
    $story = new Story();
    $story->loadSubmission();
    // pseudo-formatted story text for the spam check
    $result = PLG_checkforSpam($story->GetSpamCheckFormat(), $_CONF['spamx']);
    if ($result > 0) {
        COM_updateSpeedlimit('submit');
        COM_displayMessageAndAbort($result, 'spamx', 403, 'Forbidden');
    }
    COM_updateSpeedlimit('submit');
    $result = $story->saveSubmission();
    if ($result == STORY_NO_ACCESS_TOPIC) {
        // user doesn't have access to this topic - bail
        $retval = COM_refresh($_CONF['site_url'] . '/index.php');
    } elseif ($result == STORY_SAVED || $result == STORY_SAVED_SUBMISSION) {
        if (isset($_CONF['notification']) && in_array('story', $_CONF['notification'])) {
            sendNotification($_TABLES['storysubmission'], $story);
        }
        if ($result == STORY_SAVED) {
            $retval = COM_refresh(COM_buildUrl($_CONF['site_url'] . '/article.php?story=' . $story->getSid()));
        } else {
            $retval = COM_refresh($_CONF['site_url'] . '/index.php?msg=2');
        }
    }
    return $retval;
}
開發者ID:hostellerie,項目名稱:nexpro,代碼行數:36,代碼來源:submit.php

示例7: TRB_makeTrackbackUrl

/**
* Returns the trackback URL for an entry
*
* Note: Trackback pings default to stories, so we leave off the type if it
*       is 'article' to create shorter URLs.
*
* @param    string  $id     the entry's ID
* @param    string  $type   type of the entry ('article' = story, etc.)
* @return   string          trackback URL for that entry
*
*/
function TRB_makeTrackbackUrl($id, $type = 'article')
{
    global $_CONF;
    $url = $_CONF['site_url'] . '/trackback.php?id=' . $id;
    if (!empty($type) && $type != 'article') {
        $url .= '&amp;type=' . $type;
    }
    return COM_buildUrl($url);
}
開發者ID:milk54,項目名稱:geeklog-japan,代碼行數:20,代碼來源:lib-trackback.php

示例8: userprofile


//.........這裏部分代碼省略.........
    $user_templates->set_var('lang_pgpkey', $LANG04[8]);
    $user_templates->set_var('user_pgp', nl2br($A['pgpkey']));
    $user_templates->set_var('start_block_last10stories', COM_startBlock($LANG04[82] . ' ' . $display_name));
    $user_templates->set_var('start_block_last10comments', COM_startBlock($LANG04[10] . ' ' . $display_name));
    $user_templates->set_var('start_block_postingstats', COM_startBlock($LANG04[83] . ' ' . $display_name));
    $user_templates->set_var('lang_title', $LANG09[16]);
    $user_templates->set_var('lang_date', $LANG09[17]);
    // for alternative layouts: use these as headlines instead of block titles
    $user_templates->set_var('headline_last10stories', $LANG04[82]);
    $user_templates->set_var('headline_last10comments', $LANG04[10]);
    $user_templates->set_var('headline_postingstats', $LANG04[83]);
    $result = DB_query("SELECT tid FROM {$_TABLES['topics']}" . COM_getPermSQL());
    $nrows = DB_numRows($result);
    $tids = array();
    for ($i = 0; $i < $nrows; $i++) {
        $T = DB_fetchArray($result);
        $tids[] = $T['tid'];
    }
    $topics = "'" . implode("','", $tids) . "'";
    // list of last 10 stories by this user
    if (count($tids) > 0) {
        $sql = "SELECT sid,title,UNIX_TIMESTAMP(date) AS unixdate FROM {$_TABLES['stories']} WHERE (uid = {$user}) AND (draft_flag = 0) AND (date <= NOW()) AND (tid IN ({$topics}))" . COM_getPermSQL('AND');
        $sql .= " ORDER BY unixdate DESC LIMIT 10";
        $result = DB_query($sql);
        $nrows = DB_numRows($result);
    } else {
        $nrows = 0;
    }
    if ($nrows > 0) {
        for ($i = 0; $i < $nrows; $i++) {
            $C = DB_fetchArray($result);
            $user_templates->set_var('cssid', $i % 2 + 1);
            $user_templates->set_var('row_number', $i + 1 . '.');
            $articleUrl = COM_buildUrl($_CONF['site_url'] . '/article.php?story=' . $C['sid']);
            $user_templates->set_var('article_url', $articleUrl);
            $C['title'] = str_replace('$', '&#36;', $C['title']);
            $user_templates->set_var('story_title', COM_createLink(stripslashes($C['title']), $articleUrl, array('class' => 'b')));
            $storytime = COM_getUserDateTimeFormat($C['unixdate']);
            $user_templates->set_var('story_date', $storytime[0]);
            $user_templates->parse('story_row', 'strow', true);
        }
    } else {
        $user_templates->set_var('story_row', '<tr><td>' . $LANG01[37] . '</td></tr>');
    }
    // list of last 10 comments by this user
    $sidArray = array();
    if (count($tids) > 0) {
        // first, get a list of all stories the current visitor has access to
        $sql = "SELECT sid FROM {$_TABLES['stories']} WHERE (draft_flag = 0) AND (date <= NOW()) AND (tid IN ({$topics}))" . COM_getPermSQL('AND');
        $result = DB_query($sql);
        $numsids = DB_numRows($result);
        for ($i = 1; $i <= $numsids; $i++) {
            $S = DB_fetchArray($result);
            $sidArray[] = $S['sid'];
        }
    }
    $sidList = implode("', '", $sidArray);
    $sidList = "'{$sidList}'";
    // then, find all comments by the user in those stories
    $sql = "SELECT sid,title,cid,UNIX_TIMESTAMP(date) AS unixdate FROM {$_TABLES['comments']} WHERE (uid = {$user}) GROUP BY sid,title,cid,UNIX_TIMESTAMP(date)";
    // SQL NOTE:  Using a HAVING clause is usually faster than a where if the
    // field is part of the select
    // if (!empty ($sidList)) {
    //     $sql .= " AND (sid in ($sidList))";
    // }
    if (!empty($sidList)) {
開發者ID:hostellerie,項目名稱:nexpro,代碼行數:67,代碼來源:usersettings.php

示例9: getItems

 /**
  * Returns an array of (
  *   'id'        => $id (string),
  *   'title'     => $title (string),
  *   'uri'       => $uri (string),
  *   'date'      => $date (int: Unix timestamp),
  *   'image_uri' => $image_uri (string)
  * )
  */
 function getItems($category, $all_langs = false)
 {
     global $_CONF, $_TABLES, $_CONF_ADVT;
     $entries = array();
     if ($this->uid == 1 and $this->isLoginRequired() === true) {
         return $entries;
     }
     $sql = "SELECT * " . "FROM {$_TABLES['ad_ads']} " . "WHERE (cat_id ='" . DB_escapeString($category) . "') " . "ORDER BY ad_id";
     $result = DB_query($sql);
     if (DB_error()) {
         return $entries;
     }
     while (($A = DB_fetchArray($result, false)) !== false) {
         $entry = array();
         $entry['id'] = $A['ad_id'];
         $entry['title'] = $A['subject'];
         $entry['uri'] = COM_buildUrl($_CONF['site_url'] . '/' . $_CONF_ADVT['pi_name'] . '/index.php?mode=detail&amp;id=' . urlencode($A['ad_id']));
         $entry['date'] = $A['add_date'];
         $entry['image_uri'] = $retval['uri'];
         $entries[] = $entry;
     }
     return $entries;
 }
開發者ID:NewRoute,項目名稱:classifieds,代碼行數:32,代碼來源:classifieds.class.php

示例10: plugin_autotags_topic

/**
* Implements the [topic:] autotag.
*
* @param    string  $op         operation to perform
* @param    string  $content    item (e.g. topic text), including the autotag
* @param    array   $autotag    parameters used in the autotag
* @param    mixed               tag names (for $op='tagname') or formatted content
*
*/
function plugin_autotags_topic($op, $content = '', $autotag = '')
{
    global $_CONF, $_TABLES, $LANG27, $_GROUPS;
    if ($op == 'tagname') {
        return array('topic', 'related_topics', 'related_items');
    } elseif ($op == 'permission' || $op == 'nopermission') {
        if ($op == 'permission') {
            $flag = true;
        } else {
            $flag = false;
        }
        $tagnames = array();
        if (isset($_GROUPS['Topic Admin'])) {
            $group_id = $_GROUPS['Topic Admin'];
        } else {
            $group_id = DB_getItem($_TABLES['groups'], 'grp_id', "grp_name = 'Topic Admin'");
        }
        $owner_id = SEC_getDefaultRootUser();
        if (COM_getPermTag($owner_id, $group_id, $_CONF['autotag_permissions_topic'][0], $_CONF['autotag_permissions_topic'][1], $_CONF['autotag_permissions_topic'][2], $_CONF['autotag_permissions_topic'][3]) == $flag) {
            $tagnames[] = 'topic';
        }
        if (COM_getPermTag($owner_id, $group_id, $_CONF['autotag_permissions_related_topics'][0], $_CONF['autotag_permissions_related_topics'][1], $_CONF['autotag_permissions_related_topics'][2], $_CONF['autotag_permissions_related_topics'][3]) == $flag) {
            $tagnames[] = 'related_topics';
        }
        if (COM_getPermTag($owner_id, $group_id, $_CONF['autotag_permissions_related_items'][0], $_CONF['autotag_permissions_related_items'][1], $_CONF['autotag_permissions_related_items'][2], $_CONF['autotag_permissions_related_items'][3]) == $flag) {
            $tagnames[] = 'related_items';
        }
        if (count($tagnames) > 0) {
            return $tagnames;
        }
    } elseif ($op == 'description') {
        return array('topic' => $LANG27['autotag_desc_topic'], 'related_topics' => $LANG27['autotag_desc_related_topics'], 'related_items' => $LANG27['autotag_desc_related_items']);
    } elseif ($op == 'parse') {
        if ($autotag['tag'] != 'topic' && $autotag['tag'] != 'related_topics' && $autotag['tag'] != 'related_items') {
            return $content;
        }
        if ($autotag['tag'] == 'topic') {
            $tid = COM_applyFilter($autotag['parm1']);
            if (!empty($tid) && SEC_hasTopicAccess($tid) > 0) {
                $tid = DB_escapeString($tid);
                $sql = "SELECT COUNT(*) AS count FROM {$_TABLES['topics']} WHERE tid = '{$tid}'";
                $result = DB_query($sql);
                $A = DB_fetchArray($result);
                if ($A['count'] == 1) {
                    $url = COM_buildUrl($_CONF['site_url'] . '/index.php?topic=' . $tid);
                    $linktext = $autotag['parm2'];
                    if (empty($linktext)) {
                        $linktext = stripslashes(DB_getItem($_TABLES['topics'], 'topic', "tid = '{$tid}'"));
                    }
                    $link = COM_createLink($linktext, $url);
                    $content = str_replace($autotag['tagstr'], $link, $content);
                }
            }
        } elseif ($autotag['tag'] == 'related_topics') {
            $id = COM_applyFilter($autotag['parm1']);
            $type = '';
            $max = $_CONF['related_topics_max'];
            // Article Default
            $tids = array();
            $skip = 0;
            $px = explode(' ', trim($autotag['parm2']));
            if (is_array($px)) {
                foreach ($px as $part) {
                    if (substr($part, 0, 5) == 'type:') {
                        $a = explode(':', $part);
                        $type = $a[1];
                        $skip++;
                    } elseif (substr($part, 0, 4) == 'max:') {
                        $a = explode(':', $part);
                        $max = $a[1];
                        $skip++;
                    } elseif (substr($part, 0, 6) == 'topic:') {
                        $a = explode(':', $part);
                        $tids[] = $a[1];
                        // Add each topic when found
                        $skip++;
                    } else {
                        break;
                    }
                }
            }
            $related_topics = '';
            if (!empty($type) and !empty($id)) {
                // Return topics of object
                $related_topics = TOPIC_relatedTopics($type, $id, $max);
            } elseif (!empty($tids)) {
                // Since list of topics specified add id to topic list (since really a topic)
                if (!empty($id)) {
                    $tids[] = $id;
                }
                $related_topics = TOPIC_relatedTopics('', '', $max, $tids);
//.........這裏部分代碼省略.........
開發者ID:Geeklog-Core,項目名稱:geeklog,代碼行數:101,代碼來源:lib-topic.php

示例11: SITEMAPMENU_listStory

/**
* Returns a list of stories with a give topic id
*/
function SITEMAPMENU_listStory($tid)
{
    global $_CONF, $_TABLES, $LANG_DIR;
    $retval = '';
    $sql = "SELECT sid, title, UNIX_TIMESTAMP(date) AS day " . "FROM {$_TABLES['stories']} " . "WHERE (draft_flag = 0) AND (date <= NOW())";
    if ($tid != 'all') {
        $sql .= " AND (tid = '{$tid}')";
    }
    $sql .= COM_getTopicSql('AND') . COM_getPermSql('AND') . " ORDER BY date DESC";
    $result = DB_query($sql);
    $numrows = DB_numRows($result);
    if ($numrows > 0) {
        $entries = array();
        for ($i = 0; $i < $numrows; $i++) {
            $A = DB_fetchArray($result);
            $url = COM_buildUrl($_CONF['site_url'] . '/article.php?story=' . $A['sid']);
            $entries[] = '<a class="nav-link" href="' . $url . '">' . SITEMAPMENU_esc(stripslashes($A['title'])) . '</a>';
        }
        $retval .= COM_makeList($entries) . LB;
    }
    return $retval;
}
開發者ID:Geeklog-Japan,項目名稱:geeklog-custom,代碼行數:25,代碼來源:phpblock_sitemapmenu.php

示例12: fncsendmail

function fncsendmail($m = "", $id = 0, $username = "", $email = "")
{
    $pi_name = "userbox";
    global $_CONF;
    global $_TABLES;
    global $LANG_USERBOX_MAIL;
    global $LANG_USERBOX_ADMIN;
    global $_USER;
    global $_USERBOX_CONF;
    global $LANG28;
    $retval = '';
    $site_name = $_CONF['site_name'];
    $subject = $LANG_USERBOX_MAIL['subject_' . $m];
    $message = $LANG_USERBOX_MAIL['message_' . $m];
    if ($m === "data_delete") {
        $msg .= $LANG28['2'] . ":" . $id . LB;
        $msg .= $LANG28['3'] . ":" . $title . LB;
        //URL
        $url = $_CONF['site_url'] . "/userbox/profile.php";
        $url = COM_buildUrl($url);
    } else {
        $sql = "SELECT ";
        $sql .= " t1.*";
        $sql .= " ,t2.uid";
        $sql .= " ,t2.username";
        $sql .= " ,t2.fullname";
        $sql .= " ,t2.email";
        $sql .= " FROM ";
        $sql .= $_TABLES['USERBOX_base'] . " AS t1";
        $sql .= "," . $_TABLES['users'] . " AS t2";
        $sql .= " WHERE ";
        $sql .= " t1.id = {$id}";
        $sql .= " AND t1.id = t2.uid";
        $result = DB_query($sql);
        $numrows = DB_numRows($result);
        if ($numrows > 0) {
            $A = DB_fetchArray($result);
            $A = array_map('stripslashes', $A);
            $email = $A['email'];
            //下書
            if ($A['draft_flag'] == 1) {
                $msg .= $LANG_USERBOX_ADMIN['draft'] . LB;
            }
            //コア
            $msg .= $LANG28['2'] . ":" . $A['uid'] . LB;
            $msg .= $LANG28['3'] . ":" . $A['username'] . LB;
            $msg .= $LANG28['4'] . ":" . $A['fullname'] . LB;
            //基本項目
            $msg .= $LANG_USERBOX_ADMIN['page_title'] . ":" . $A['page_title'] . LB;
            $msg .= $LANG_USERBOX_ADMIN['description'] . ":" . $A['description'] . LB;
            $msg .= $LANG_USERBOX_ADMIN['hits'] . ":" . $A['hits'] . LB;
            $msg .= $LANG_USERBOX_ADMIN['comments'] . ":" . $A['comments'] . LB;
            $msg .= $LANG_USERBOX_ADMIN['meta_description'] . ":" . $A['meta_description'] . LB;
            $msg .= $LANG_USERBOX_ADMIN['meta_keywords'] . ":" . $A['meta_keywords'] . LB;
            $msg .= $LANG_USERBOX_ADMIN['commentcode'] . ":" . $A['commentcode'] . LB;
            $msg .= $LANG_USERBOX_ADMIN['comment_expire'] . ":" . $A['comment_expire'] . LB;
            // 準備中 $msg.=  $LANG_USERBOX_ADMIN['language_id'].":".$A['language_id'].LB;
            $msg .= $LANG_USERBOX_ADMIN['owner_id'] . ":" . $A['owner_id'] . LB;
            $msg .= $LANG_USERBOX_ADMIN['group_id'] . ":" . $A['group_id'] . LB;
            $msg .= $LANG_USERBOX_ADMIN['perm_owner'] . ":" . $A['perm_owner'] . LB;
            $msg .= $LANG_USERBOX_ADMIN['perm_group'] . ":" . $A['perm_group'] . LB;
            $msg .= $LANG_USERBOX_ADMIN['perm_members'] . ":" . $A['perm_members'] . LB;
            $msg .= $LANG_USERBOX_ADMIN['perm_anon'] . ":" . $A['perm_anon'] . LB;
            $msg .= $LANG_USERBOX_ADMIN['modified'] . ":" . $A['modified'] . LB;
            $msg .= $LANG_USERBOX_ADMIN['created'] . ":" . $A['created'] . LB;
            $msg .= $LANG_USERBOX_ADMIN['expired'] . ":" . $A['expired'] . LB;
            $msg .= $LANG_USERBOX_ADMIN['released'] . ":" . $A['released'] . LB;
            $msg .= $LANG_USERBOX_ADMIN['orderno'] . ":" . $A['orderno'] . LB;
            $msg .= $LANG_USERBOX_ADMIN['trackbackcode'] . ":" . $A['trackbackcode'] . LB;
            $msg .= $LANG_USERBOX_ADMIN['draft'] . ":" . $A['draft'] . LB;
            $msg .= $LANG_USERBOX_ADMIN['udatetime'] . ":" . $A['udatetime'] . LB;
            $msg .= $LANG_USERBOX_ADMIN['uuid'] . ":" . $A['uuid'] . LB;
            //koko
            //カテゴリ
            $msg .= DATABOX_getcategoriesText($id, 0, $pi_name);
            //追加項目
            $group_id = stripslashes($A['group_id']);
            $owner_id = stripslashes($A['owner_id']);
            $chk_user = DATABOX_chkuser($group_id, $owner_id, "userbox.admin");
            $addition_def = DATABOX_getadditiondef($pi_name);
            $additionfields = DATABOX_getadditiondatas($id, $pi_name);
            $msg .= DATABOX_getaddtionfieldsText($additionfields, $addition_def, $chk_user, $pi_name, $A['fieldset_id']);
            //タイムスタンプ 更新ユーザ
            $msg .= $LANG_USERBOX_ADMIN['udatetime'] . ":" . $A['udatetime'] . LB;
            $msg .= $LANG_USERBOX_ADMIN['uuid'] . ":" . $A['uuid'] . LB;
            //URL
            $url = $_CONF['site_url'] . "/userbox/profile.php";
            $url .= "?";
            if ($_USERBOX_CONF['datacode']) {
                $url .= "m=code";
                $url .= "&code=" . $A['username'];
            } else {
                $url .= "m=id";
                $url .= "&id=" . $A['id'];
            }
            $url = COM_buildUrl($url);
        }
    }
    if ($_USERBOX_CONF['mail_to_draft'] == 0 and $A['draft_flag'] == 1) {
    } else {
//.........這裏部分代碼省略.........
開發者ID:mistgrass,項目名稱:geeklog-ivywe,代碼行數:101,代碼來源:profile.php

示例13: PLG_replaceTags

/**
* This function will allow plugins to support the use of custom autolinks
* in other site content. Plugins can now use this API when saving content
* and have the content checked for any autolinks before saving.
* The autolink would be like:  [story:20040101093000103 here]
*
* @param   string   $content   Content that should be parsed for autolinks
* @param   string   $plugin    Optional if you only want to parse using a specific plugin
*
*/
function PLG_replaceTags($content, $plugin = '')
{
    global $_CONF, $_TABLES, $LANG32;
    if (isset($_CONF['disable_autolinks']) && $_CONF['disable_autolinks'] == 1) {
        // autolinks are disabled - return $content unchanged
        return $content;
    }
    $autolinkModules = PLG_collectTags();
    // For each supported module, scan the content looking for any AutoLink tags
    $tags = array();
    $contentlen = MBYTE_strlen($content);
    $content_lower = MBYTE_strtolower($content);
    foreach ($autolinkModules as $moduletag => $module) {
        $autotag_prefix = '[' . $moduletag . ':';
        $offset = 0;
        $prev_offset = 0;
        while ($offset < $contentlen) {
            $start_pos = MBYTE_strpos($content_lower, $autotag_prefix, $offset);
            if ($start_pos === false) {
                break;
            } else {
                $end_pos = MBYTE_strpos($content_lower, ']', $start_pos);
                $next_tag = MBYTE_strpos($content_lower, '[', $start_pos + 1);
                if ($end_pos > $start_pos and ($next_tag === false or $end_pos < $next_tag)) {
                    $taglength = $end_pos - $start_pos + 1;
                    $tag = MBYTE_substr($content, $start_pos, $taglength);
                    $parms = explode(' ', $tag);
                    // Extra test to see if autotag was entered with a space
                    // after the module name
                    if (MBYTE_substr($parms[0], -1) == ':') {
                        $startpos = MBYTE_strlen($parms[0]) + MBYTE_strlen($parms[1]) + 2;
                        $label = str_replace(']', '', MBYTE_substr($tag, $startpos));
                        $tagid = $parms[1];
                    } else {
                        $label = str_replace(']', '', MBYTE_substr($tag, MBYTE_strlen($parms[0]) + 1));
                        $parms = explode(':', $parms[0]);
                        if (count($parms) > 2) {
                            // whoops, there was a ':' in the tag id ...
                            array_shift($parms);
                            $tagid = implode(':', $parms);
                        } else {
                            $tagid = $parms[1];
                        }
                    }
                    $newtag = array('module' => $module, 'tag' => $moduletag, 'tagstr' => $tag, 'startpos' => $start_pos, 'length' => $taglength, 'parm1' => str_replace(']', '', $tagid), 'parm2' => $label);
                    $tags[] = $newtag;
                } else {
                    // Error: tags do not match - return with no changes
                    return $content . $LANG32[32];
                }
                $prev_offset = $offset;
                $offset = $end_pos;
            }
        }
    }
    // If we have found 1 or more AutoLink tag
    if (count($tags) > 0) {
        // Found the [tag] - Now process them all
        foreach ($tags as $autotag) {
            $function = 'plugin_autotags_' . $autotag['module'];
            if ($autotag['module'] == 'geeklog' and (empty($plugin) or $plugin == 'geeklog')) {
                $url = '';
                $linktext = $autotag['parm2'];
                if ($autotag['tag'] == 'story') {
                    $autotag['parm1'] = COM_applyFilter($autotag['parm1']);
                    if (!empty($autotag['parm1'])) {
                        $url = COM_buildUrl($_CONF['site_url'] . '/article.php?story=' . $autotag['parm1']);
                        if (empty($linktext)) {
                            $linktext = stripslashes(DB_getItem($_TABLES['stories'], 'title', "sid = '{$autotag['parm1']}'"));
                        }
                    }
                }
                if (!empty($url)) {
                    $filelink = COM_createLink($linktext, $url);
                    $content = str_replace($autotag['tagstr'], $filelink, $content);
                }
            } elseif (function_exists($function) and (empty($plugin) or $plugin == $autotag['module'])) {
                $content = $function('parse', $content, $autotag);
            }
        }
    }
    return $content;
}
開發者ID:Geeklog-Core,項目名稱:test-framework,代碼行數:93,代碼來源:lib-plugins.php

示例14: list

$p->set_var('LANG_title', $LANG_GF01['TITLE']);
$p->set_var('LANG_date', $LANG_GF01['DATE']);
$p->set_var('LANG_comments', $LANG_GF01['COMMENTS']);
if ($nrows > 0) {
    $base_url = $_CONF['site_admin_url'] . '/plugins/forum/migrate.php';
    if (!empty($curtopic)) {
        $base_url .= '?tid=' . $curtopic;
    }
    for ($i = 0; $i < $nrows; $i++) {
        list($topic, $sid, $story, $date, $comments) = DB_fetchArray($result);
        $p->set_var('sid', $sid);
        $p->set_var('topic', stripslashes($topic));
        if ($curtopic == "submissions") {
            $story_link = $_CONF['site_admin_url'] . '/story.php?mode=editsubmission&amp;id=' . $sid;
        } else {
            $story_link = COM_buildUrl($_CONF['site_url'] . '/article.php?story=' . $sid);
        }
        $p->set_var('story_link', $story_link);
        $p->set_var('story_title', $story);
        $p->set_var('date', $date);
        $p->set_var('num_comments', $comments);
        $p->set_var('cssid', $i % 2 + 1);
        $p->parse('story_record', 'records', true);
    }
    $p->set_var('page_navigation', COM_printPageNavigation($base_url, $page, $numpages));
}
$p->set_var('gltoken_name', CSRF_TOKEN);
$p->set_var('gltoken', SEC_createToken());
$p->parse('output', 'page');
$display .= $p->finish($p->get_var('output'));
$display .= COM_endBlock();
開發者ID:milk54,項目名稱:geeklog-japan,代碼行數:31,代碼來源:migrate.php

示例15: LIB_GetListField

function LIB_GetListField($fieldname, $fieldvalue, $A, $icon_arr)
{
    global $_CONF, $LANG_ACCESS;
    $retval = '';
    $allow_display = COM_applyFilter($A['allow_display'], true);
    switch ($fieldname) {
        //編集アイコン
        case 'editid':
            $retval = "<a href=\"{$_CONF['site_admin_url']}";
            $retval .= "/plugins/" . THIS_SCRIPT;
            $retval .= "?mode=edit";
            $retval .= "&amp;id={$A['category_id']}\">";
            $retval .= "{$icon_arr['edit']}</a>";
            break;
        case 'copy':
            $url = $_CONF['site_admin_url'] . "/plugins/" . THIS_SCRIPT;
            $url .= "?";
            $url .= "mode=copy";
            $url .= "&amp;id={$A['category_id']}";
            $retval = COM_createLink($icon_arr['copy'], $url);
            break;
            //コード
        //コード
        case 'code':
            if ($allow_display < 2) {
                $name = COM_applyFilter($A['code']);
                $url = $_CONF['site_url'] . "/" . THIS_SCRIPT;
                $url .= "?";
                $url .= "code=" . $A['code'];
                $url .= "&amp;m=code";
                $url = COM_buildUrl($url);
                $retval = COM_createLink($name, $url);
                break;
            }
        case 'category_id':
            if ($allow_display < 2) {
                $name = COM_applyFilter($A['category_id']);
                $url = $_CONF['site_url'] . "/" . THIS_SCRIPT;
                $url .= "?";
                $url .= "id=" . $A['category_id'];
                $url .= "&amp;m=id";
                $url = COM_buildUrl($url);
                $retval = COM_createLink($name, $url);
                break;
            }
            //各項目
        //各項目
        default:
            $retval = $fieldvalue;
            break;
    }
    return $retval;
}
開發者ID:mistgrass,項目名稱:geeklog-ivywe,代碼行數:53,代碼來源:lib_category.php


注:本文中的COM_buildUrl函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。