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


PHP makeURL函数代码示例

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


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

示例1: calendar

function calendar($s)
{
    global $db;
    global $lang;
    global $login;
    global $rights;
    $return = array();
    $tbl = MYSQL_TABLE_PREFIX . 'calendar';
    $isallowed = $rights->isAllowed('calendar', 'manage');
    if ($isallowed) {
        $result = $db->selectList($tbl, "*", "INSTR(`title`, '" . $s . "') > 0 OR\r\n\t\t\t\t\t\t\t\t\t\t\t\tINSTR(`description`, '" . $s . "') > 0");
    } else {
        if ($login->currentUser() === false) {
            $result = $db->selectList($tbl, "*", "(INSTR(`title`, '" . $s . "') > 0 OR\r\n\t\t\t\t\t\t\t\t\t\t\t\tINSTR(`description`, '" . $s . "') > 0 )\r\n\t\t\t\t\tAND ( (`visible`=2)  OR  (`visible`=0 AND `userid`=" . $login->currentUserID() . ") )");
        } else {
            $result = $db->selectList($tbl, "*", "(INSTR(`title`, '" . $s . "') > 0 OR\r\n\t\t\t\t\t\t\t\t\t\t\t\tINSTR(`description`, '" . $s . "') > 0 ) \r\n\t\t\t\t\tAND ( (`visible`=2)  OR  (`visible`=0 AND `userid`=" . $login->currentUserID() . ") OR (`visible`=1) )");
        }
    }
    if (count($result) > 0) {
        foreach ($result as $i => $r) {
            $engine = $lang->get('engines_calendar');
            $title = $r['title'];
            $description = $r['description'];
            $url = makeURL('calendar', array('mode' => 'view', 'calendarid' => $r['calendarid'], 'day' => $r['start']));
            $relevance = strcount($r['description'], $s);
            $return[] = array('engine' => $engine, 'title' => $title, 'description' => $description, 'url' => $url, 'relevance' => $relevance);
        }
    }
    return $return;
}
开发者ID:tech-nik89,项目名称:lpm4,代码行数:30,代码来源:calendar.php

示例2: smarty_function_makeurl

function smarty_function_makeurl($params, $template)
{
    if (isset($params['mod'])) {
        $mod = $params['mod'];
        unset($params['mod']);
        return makeURL($mod, $params);
    }
}
开发者ID:tech-nik89,项目名称:lpm4,代码行数:8,代码来源:function.makeurl.php

示例3: GetArticlesOlder

function GetArticlesOlder()
{
    global $db, $ts, $comments;
    $articles = $db->selectList('article', '*', '`timestamp` < ' . $ts['2weeks'] . ' AND `published`=1', '`timestamp` DESC');
    foreach ($articles as $i => $article) {
        $articles[$i]['url'] = makeURL('article', array('categoryid' => $article['categoryid'], 'articleid' => $article['articleid']));
        $articles[$i]['comments'] = $comments->count('article', $article['articleid']);
    }
    return $articles;
}
开发者ID:tech-nik89,项目名称:lpm4,代码行数:10,代码来源:article.function.php

示例4: getAllVisibleMinitools

function getAllVisibleMinitools()
{
    global $db;
    global $lang;
    $visibletools = $db->selectList('minitools', '`modename`');
    for ($i = 0; $i < count($visibletools); $i++) {
        $visibletools[$i]['url'] = makeHTMLUrl($lang->get($visibletools[$i]['modename']), makeURL('minitools', array('mode' => $visibletools[$i]['modename'])));
    }
    return $visibletools;
}
开发者ID:tech-nik89,项目名称:lpm4,代码行数:10,代码来源:minitools.function.php

示例5: getMembers

 function getMembers()
 {
     global $db;
     $tbl_gr = MYSQL_TABLE_PREFIX . 'tournamentgroupregister';
     $tbl_u = MYSQL_TABLE_PREFIX . 'users';
     $members = $db->selectList($tbl_gr . '`, `' . $tbl_u, "*", "`tournamentid`=" . $this->tournamentid . " AND `groupid`=" . $this->id . "\r\n\t\t\t\tAND `" . $tbl_gr . "`.`memberid`=`" . $tbl_u . "`.`userid`");
     foreach ($members as $i => $member) {
         $members[$i]['url'] = makeURL('profile', array('userid' => $member['userid']));
     }
     return $members;
 }
开发者ID:tech-nik89,项目名称:lpm4,代码行数:11,代码来源:group.class.php

示例6: getPages

 function getPages()
 {
     global $db;
     $pages = $db->queryToList("\r\n\t\t\t\tselect `key` as k,\r\n\t\t\t\t(\r\n\t\t\t\tselect count(*) \r\n\t\t\t\tfrom " . MYSQL_TABLE_PREFIX . "content as c2\r\n\t\t\t\twhere c2.`key` = c.`key`\r\n\t\t\t\t) as version_count,\r\n\t\t\t\t(\r\n\t\t\t\tselect title\r\n\t\t\t\tfrom " . MYSQL_TABLE_PREFIX . "content as c3\r\n\t\t\t\twhere c3.`key` = c.`key`\r\n\t\t\t\torder by version desc\r\n\t\t\t\tlimit 1\r\n\t\t\t\t) as title\r\n\t\t\t\tfrom " . MYSQL_TABLE_PREFIX . "content as c\r\n\t\t\t\tgroup by `key`\r\n\t\t\t\torder by `key` asc\r\n\t\t\t");
     if (count($pages) > 0) {
         foreach ($pages as $i => $v) {
             $pages[$i]['title'] = cutString($v['title']);
             $pages[$i]['edit_url'] = makeURL('admin', array('mode' => 'content', 'action' => 'edit', 'key' => $v['k']));
             $pages[$i]['remove_url'] = makeURL('admin', array('mode' => 'content', 'action' => 'remove', 'key' => $v['k']));
             $pages[$i]['url'] = makeURL($v['k']);
         }
     }
     return $pages;
 }
开发者ID:tech-nik89,项目名称:lpm4,代码行数:14,代码来源:content.core.php

示例7: get

 function get()
 {
     global $db, $login;
     $list = array();
     if ($login->currentUser() !== false) {
         $list = $db->selectList($this->table, "*", "`userid`=" . $login->currentUserId());
         if (count($list) > 0) {
             foreach ($list as $i => $l) {
                 $list[$i]['url'] = makeURL($l['mod'], unserialize($l['params']));
             }
         }
     }
     return $list;
 }
开发者ID:tech-nik89,项目名称:lpm4,代码行数:14,代码来源:favorites.core.php

示例8: getPolls

 function getPolls($limit, $count, $orderby = "date", $orderhow = "DESC")
 {
     global $comments;
     $sql = $this->db->query("SELECT * FROM " . MYSQL_TABLE_PREFIX . "poll ORDER BY " . secureMySQL($orderby) . " " . secureMySQL($orderhow) . " LIMIT " . (int) $limit . "," . secureMySQL($count) . ";");
     while ($result = mysql_fetch_assoc($sql)) {
         $result['name'] = makeHtmlURL(makeLineBreaks($result['name']), makeURL('poll', array('pollid' => $result['ID'])));
         $result['commenturl'] = makeURL('poll', array('pollid' => $result['ID'])) . "#comments";
         $result['questions'] = $this->getQuestionsByPollID($result['ID']);
         $result['given_answers'] = $this->getSumOfAnswers($result['ID']);
         $result['comment_count'] = $comments->count('poll', $result['ID']);
         $result['allready_voted'] = 1;
         $polls[] = $result;
     }
     return $polls;
 }
开发者ID:tech-nik89,项目名称:lpm4,代码行数:15,代码来源:poll.class.php

示例9: makeNews

 function makeNews(&$comments, &$db, $table, $tbl_users, $start, $end, $title)
 {
     global $lng;
     $news = '';
     $result = $db->query("SELECT * FROM `" . $table . "`, `" . $tbl_users . "`\r\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE `" . $table . "`.`userid` = `" . $tbl_users . "`.`userid` \r\n\t\t\t\t\t\t\t\t\t\t\t\tAND `timestamp`>" . $start . " \r\n\t\t\t\t\t\t\t\t\t\t\t\tAND `timestamp`<" . $end . " \r\n\t\t\t\t\t\t\t\t\t\t\t\tAND (`language` = '" . secureMySQL($lng) . "' OR `language` = '')\r\n\t\t\t\t\t\t\t\t\t\t\t\tAND (`domainid` = 0 OR `domainid` = " . getCurrentDomainIndex() . ")\r\n\t\t\t\t\t\t\t\t\t\t\t\tORDER BY `timestamp` DESC;");
     while ($row = mysql_fetch_assoc($result)) {
         $row['time'] = timeElapsed($row['timestamp']);
         $row['url'] = makeURL('news', array('newsid' => $row['newsid']));
         $row['text'] = stripslashes($row['text']);
         $row['title'] = stripslashes($row['title']);
         $row['user_url'] = makeURL('profile', array('userid' => $row['userid']));
         $row['comments'] = $comments->count('news', $row['newsid']);
         $news[] = $row;
     }
     return array('title' => $title, 'news' => $news, 'news_count' => mysql_num_rows($result));
 }
开发者ID:tech-nik89,项目名称:lpm4,代码行数:16,代码来源:news.mod.php

示例10: listActive

 function listActive()
 {
     global $db;
     global $config;
     $limit = (int) $config->get('login', 'session-time');
     $tbl_users = MYSQL_TABLE_PREFIX . 'users';
     $time = time() - $limit;
     $sql = "SELECT * FROM `" . $tbl_users . "` WHERE `lastaction`>=" . $time;
     $result = $db->query($sql);
     while ($row = mysql_fetch_assoc($result)) {
         $row['str_lastaction'] = timeElapsed($row['lastaction']);
         $row['url'] = makeURL('profile', array('userid' => $row['userid']));
         $list[] = $row;
     }
     return $list;
 }
开发者ID:tech-nik89,项目名称:lpm4,代码行数:16,代码来源:sessions.class.php

示例11: shoutbox

function shoutbox($s)
{
    global $db, $lang;
    $tbl = MYSQL_TABLE_PREFIX . 'shoutbox';
    $return = array();
    $result = $db->selectList($tbl, "*", "INSTR(`text`, '" . $s . "') > 0");
    if (count($result) > 0) {
        foreach ($result as $i => $r) {
            $engine = $lang->get('engines_shoutbox');
            $title = $s;
            $description = $r['text'];
            $url = makeURL('shoutbox');
            $relevance = strcount($r['text'], $s);
            $return[] = array('engine' => $engine, 'title' => $title, 'description' => $description, 'url' => $url, 'relevance' => $relevance);
        }
    }
    return $return;
}
开发者ID:tech-nik89,项目名称:lpm4,代码行数:18,代码来源:shoutbox.php

示例12: users

function users($s)
{
    global $db, $lang;
    $tbl = MYSQL_TABLE_PREFIX . 'users';
    $return = array();
    $result = $db->selectList($tbl, "*", "INSTR(`nickname`, '" . $s . "') > 0 OR\r\n\t\t\t\t\t\t\t\t\t\t\t\tINSTR(`prename`, '" . $s . "') > 0");
    if (count($result) > 0) {
        foreach ($result as $i => $r) {
            $engine = $lang->get('engines_user');
            $title = $r['nickname'];
            $description = $r['prename'] . " '" . $r['nickname'] . "' " . stripLastName($r['lastname']);
            $url = makeURL('profile', array('userid' => $r['userid']));
            $relevance = strcount($r['prename'] . $r['nickname'], $s);
            $return[] = array('engine' => $engine, 'title' => $title, 'description' => $description, 'url' => $url, 'relevance' => $relevance);
        }
    }
    return $return;
}
开发者ID:tech-nik89,项目名称:lpm4,代码行数:18,代码来源:users.php

示例13: getList

 function getList($eventid = 0)
 {
     global $db;
     global $register;
     if ((int) $eventid > 0) {
         $list = $db->selectList($this->table, "*", "`eventid`=" . (int) $eventid, "CASE `state`    WHEN 1 THEN 0 \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHEN 2 THEN 1 \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHEN 3 THEN 2 \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHEN 0 THEN 4 \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tEND");
     } else {
         $list = $db->selectList($this->table, "*", "1", "CASE `state`   WHEN 1 THEN 0 \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHEN 2 THEN 1 \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHEN 3 THEN 2 \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHEN 0 THEN 4 \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tEND");
     }
     if (count($list) > 0) {
         foreach ($list as $i => $tournament) {
             $list[$i]['url'] = makeURL('tournament', array('tournamentid' => $tournament['tournamentid']));
             $list[$i]['state'] = tournamentStateToString($tournament['state']);
             $list[$i]['joinstate'] = $register->getRegCount($tournament['tournamentid']) . " / " . $tournament['playerlimit'];
         }
     }
     return $list;
 }
开发者ID:tech-nik89,项目名称:lpm4,代码行数:18,代码来源:tournamentList.class.php

示例14: article

function article($s)
{
    global $db, $lang;
    $tbl = MYSQL_TABLE_PREFIX . 'article';
    $return = array();
    $result = $db->selectList($tbl, "*", "INSTR(`title`, '" . $s . "') > 0 OR\r\n\t\t\t\t\t\t\t\t\t\t\t\tINSTR(`text`, '" . $s . "') > 0");
    if (count($result) > 0) {
        foreach ($result as $i => $r) {
            $engine = $lang->get('engines_article');
            $title = $r['title'];
            $description = $r['preview'];
            $url = makeURL('article', array('articleid' => $r['articleid']));
            $relevance = strcount($r['text'] . $r['title'], $s);
            $return[] = array('engine' => $engine, 'title' => $title, 'description' => $description, 'url' => $url, 'relevance' => $relevance);
        }
    }
    return $return;
}
开发者ID:tech-nik89,项目名称:lpm4,代码行数:18,代码来源:article.php

示例15: content

function content($s)
{
    global $db, $lang;
    $tbl = MYSQL_TABLE_PREFIX . 'content';
    $return = array();
    $result = $db->queryToList("select c.key, c.title, c.text, c.box_content\r\n\t\t\tfrom (\r\n\t\t\tselect `key`, max(version) as latest\r\n\t\t\tfrom " . $tbl . "\r\n\t\t\tgroup by `key`\r\n\t\t\t)\r\n\t\t\tas x\r\n\t\t\tinner join " . $tbl . " as c\r\n\t\t\ton c.key = x.key and c.version = x.latest\r\n\t\t\twhere title like '%" . $s . "%'\r\n\t\t\tor text like '%" . $s . "%'\r\n\t\t\tor box_content like '%" . $s . "%'");
    if (count($result) > 0) {
        foreach ($result as $i => $r) {
            $engine = $lang->get('engines_content');
            $title = cutString($r['title']);
            $description = $r['text'];
            $url = makeURL($r['key']);
            $relevance = strcount($r['text'] . ' ' . $r['title'] . ' ' . $r['title'] . ' ' . $r['title'], $s);
            $return[] = array('engine' => $engine, 'title' => $title, 'description' => $description, 'url' => $url, 'relevance' => $relevance);
        }
    }
    return $return;
}
开发者ID:tech-nik89,项目名称:lpm4,代码行数:18,代码来源:content.php


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