本文整理汇总了PHP中makelink函数的典型用法代码示例。如果您正苦于以下问题:PHP makelink函数的具体用法?PHP makelink怎么用?PHP makelink使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了makelink函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: do_block
function do_block($page, $param1, $param2)
{
$num = (int) trim($param1) > 0 ? (int) trim($param1) : 15;
$exp = array();
foreach (array_map('trim', explode("\n", $param2)) as $s) {
if ($s != '') {
$exp[] = $s;
}
}
$db = DataBase::getinstance();
$query = "SELECT pagename,timestamp FROM page";
if ($exp != array()) {
$_exp = $db->escape('(?:' . join('|', $exp) . ')');
$query .= " WHERE php('mb_ereg', '{$_exp}', pagename) = 0";
}
$query .= " ORDER BY timestamp DESC, pagename ASC LIMIT {$num}";
$result = $db->query($query);
$list = array();
while ($row = $db->fetch($result)) {
$list[date('Y-m-d', $row['timestamp'])][] = makelink(Page::getinstance($row['pagename']));
}
$smarty = $this->getSmarty();
$smarty->assign('list', $list);
return $smarty->fetch('recent.tpl.htm');
}
示例2: generateHsList
/**
* Generate the Honor List
*
* @return string
*/
function generateHsList()
{
global $roster;
//Highest Lifetime Rank
$query = "SELECT `name`, `lifetimeRankName` FROM `" . $roster->db->table('players') . "` WHERE `guild_id` = '" . $roster->data['guild_id'] . "' ORDER BY `lifetimeHighestRank`DESC, `lifetimeHK` DESC LIMIT 0 , 1";
$result = $roster->db->query($query) or die_quietly($roster->db->error(), 'Database Error', __FILE__, __LINE__, $query);
$row = $roster->db->fetch($result);
if ($row) {
$roster->tpl->assign_block_vars('hslist', array('ROW_CLASS' => $roster->switch_row_class(), 'LINK' => makelink('guild-memberslist-honorlist'), 'VALUE' => $roster->locale->act['hslist1'], 'NAME' => $row['name'], 'COUNT' => $row['lifetimeRankName'] ? $row['lifetimeRankName'] : ' '));
}
//Highest LifeTime HKs
$query = "SELECT `name`, `lifetimeHK` FROM `" . $roster->db->table('players') . "` WHERE `guild_id` = '" . $roster->data['guild_id'] . "' ORDER BY `lifetimeHK` DESC, `lifetimeHighestRank` DESC LIMIT 0 , 1";
$result = $roster->db->query($query) or die_quietly($roster->db->error(), 'Database Error', __FILE__, __LINE__, $query);
$row = $roster->db->fetch($result);
if ($row) {
$roster->tpl->assign_block_vars('hslist', array('ROW_CLASS' => $roster->switch_row_class(), 'LINK' => makelink('guild-memberslist-honorlist'), 'VALUE' => $roster->locale->act['hslist2'], 'NAME' => $row['name'], 'COUNT' => $row['lifetimeHK']));
}
//Highest honorpoints
$query = "SELECT `name`, `honorpoints` FROM `" . $roster->db->table('players') . "` WHERE `guild_id` = '" . $roster->data['guild_id'] . "' ORDER BY `honorpoints` DESC LIMIT 0 , 1";
$result = $roster->db->query($query) or die_quietly($roster->db->error(), 'Database Error', __FILE__, __LINE__, $query);
$row = $roster->db->fetch($result);
if ($row) {
$roster->tpl->assign_block_vars('hslist', array('ROW_CLASS' => $roster->switch_row_class(), 'LINK' => makelink('guild-memberslist-honorlist'), 'VALUE' => $roster->locale->act['hslist3'], 'NAME' => $row['name'], 'COUNT' => $row['honorpoints']));
}
//Highest arenapoints
$query = "SELECT `name`, `arenapoints` FROM `" . $roster->db->table('players') . "` WHERE `guild_id` = '" . $roster->data['guild_id'] . "' ORDER BY `arenapoints` DESC LIMIT 0 , 1";
$result = $roster->db->query($query) or die_quietly($roster->db->error(), 'Database Error', __FILE__, __LINE__, $query);
$row = $roster->db->fetch($result);
if ($row) {
$roster->tpl->assign_block_vars('hslist', array('ROW_CLASS' => $roster->switch_row_class(), 'LINK' => makelink('guild-memberslist-honorlist'), 'VALUE' => $roster->locale->act['hslist4'], 'NAME' => $row['name'], 'COUNT' => $row['arenapoints']));
}
$roster->db->free_result($result);
$roster->tpl->set_handle('hslist', 'hslist.html');
return $roster->tpl->fetch('hslist');
}
示例3: table_dns
function table_dns()
{
global $construct, $db, $vars;
$form_search_dns = $this->form_search_dns();
if (substr($form_search_dns->data[1]['value'], -strlen("." . $vars['dns']['root_zone'])) == "." . $vars['dns']['root_zone']) {
$form_search_dns->data[1]['value'] = substr($form_search_dns->data[1]['value'], 0, -strlen("." . $vars['dns']['root_zone']));
}
$where = $form_search_dns->db_data_where(array("dns_zones__name" => "starts_with"));
$table_dns = new table(array('TABLE_NAME' => 'table_dns', 'FORM_NAME' => 'table_dns'));
$table_dns->db_data('dns_zones.id AS dns_zones__id, dns_zones.name AS dns_zones__name, dns_zones.type, dns_zones.date_in, dns_zones.status, nodes.name AS nodes__name, nodes.id AS nodes__id', 'dns_zones
LEFT JOIN nodes ON dns_zones.node_id = nodes.id', $where, "", "dns_zones.status ASC, dns_zones.type ASC, dns_zones.name ASC");
for ($i = 1; $i < count($table_dns->data); $i++) {
if (isset($table_dns->data[$i])) {
$table_dns->data[$i]['nodes__name'] .= " (#" . $table_dns->data[$i]['nodes__id'] . ")";
if ($table_dns->data[$i]['type'] == 'forward') {
$table_dns->data[$i]['dns_zones__name'] .= "." . $vars['dns']['root_zone'];
}
$table_dns->info['EDIT'][$i] = makelink(array("page" => "nodes", "node" => $table_dns->data[$i]['nodes__id']));
}
}
$table_dns->info['EDIT_COLUMN'] = 'nodes__name';
$table_dns->db_data_remove('dns_zones__id', 'type', 'nodes__id');
$table_dns->db_data_translate('dns_zones__status');
return $table_dns;
}
示例4: do_block
function do_block($page, $param1, $param2)
{
$prefix = resolvepath(trim($param1));
if ($prefix == '') {
$prefix = $page->getpagename();
}
$prefix .= '/';
$db = DataBase::getinstance();
$query = "SELECT pagename FROM page";
$query .= " WHERE pagename like '{$prefix}%'";
$query .= " ORDER BY pagename ASC";
$result = $db->query($query);
$list = array();
while ($row = $db->fetch($result)) {
$list[] = $row['pagename'];
}
if ($list == array()) {
return '';
}
natsort($list);
$len = strlen($prefix);
foreach ($list as $pagename) {
$link[] = '<li>' . makelink(Page::getinstance($pagename), substr($pagename, $len)) . '</li>';
}
return "<ul>\n" . join("\n", $link) . "\n</ul>\n";
}
示例5: search
function search($search, $limit = 10, $page = 0)
{
global $roster;
$first = $page * $limit;
$sql = "SELECT `member_id`, `name`, `server`, `region`, `guild_id`, `class`, `level`, `note`, `guild_rank`,`guild_title`, `zone`, `last_online`" . " FROM `" . $roster->db->table('members') . "`" . " WHERE (`member_id` LIKE '%{$search}%'" . " OR `name` LIKE '%" . ucfirst($search) . "%'" . " OR `name` LIKE '%" . $search . "%'" . " OR `server` LIKE '%{$search}%'" . " OR `region` LIKE '%{$search}%'" . " OR `guild_id` LIKE '%{$search}%'" . " OR `class` LIKE '%{$search}%'" . " OR `level` LIKE '%{$search}%'" . " OR `note` LIKE '%{$search}%'" . " OR `guild_rank` LIKE '%{$search}%'" . " OR `guild_title` LIKE '%{$search}%'" . " OR `zone` LIKE '%{$search}%')" . " GROUP BY `member_id`" . ($limit > 0 ? " LIMIT {$first}," . $limit : '') . ';';
// calculating the search time
$this->start_search = format_microtime();
$result = $roster->db->query($sql);
$this->stop_search = format_microtime();
$this->time_search = $this->stop_search - $this->start_search;
$nrows = $roster->db->num_rows($result);
$crows = 0;
$x = $limit > $nrows ? $nrows : ($limit > 0 ? $limit : $nrows);
if ($nrows > 0) {
while ($x > 0) {
list($member_id, $name, $server, $region, $guild_id, $class, $level, $note, $guild_rank, $guild_title, $zone, $last_online) = $roster->db->fetch($result);
$item['title'] = $name;
$item['date'] = $last_online;
$item['html'] = '<td class="SearchRowCell">' . $level . '</td><td class="SearchRowCell">' . $class . '</td><td class="SearchRowCell"><a href="' . makelink("char-info&a=c:{$member_id}") . '"><strong>' . $name . '</strong></a></td><td class="SearchRowCellRight">' . $guild_title . '</td>';
$this->add_result($item);
unset($item);
$x--;
}
}
$roster->db->free_result($result);
}
示例6: get_news
function get_news($db)
{
$sql = "SELECT t.topic_id, topic_poster, p.post_text, u.username, u.user_email, t.topic_time, t.topic_posts_approved, t.topic_title, t.forum_id\n" . "FROM phpbb3_topics AS t, phpbb3_users AS u, phpbb3_posts AS p\n" . "WHERE(t.forum_id = 2 or t.forum_id = 38) AND t.topic_poster = u.user_id AND t.topic_id = p.topic_id AND t.topic_time = p.post_time\n" . "ORDER BY t.topic_time DESC\n" . "LIMIT 5";
$res = mysqli_query($db, $sql);
$newstemplate = file_get_contents('templates/newsitem.html');
$news = "";
$newskeys = array('#HEADLINE#', '#BODY#', '#POSTER#', '#POSTDATE#');
while ($row = mysqli_fetch_array($res)) {
if ($row['forum_id'] == 38) {
if (preg_match('/^\\[(game|map|engine|website|misc)\\] (.*)$/', $row['topic_title'], $arr) === FALSE) {
continue;
}
if (sizeof($arr) == 0) {
continue;
}
$title = $arr[1] . ": " . htmlspecialchars_decode($arr[2]);
} else {
$title = $row['topic_title'];
}
$postlink = '/phpbb/viewtopic.php?t=' . $row['topic_id'];
$title = makelink($postlink, $title);
$newstext = link_replace(parse_bbcode($row['post_text']));
$poster = $row['username'];
$postdate = date("Y-m-d H:i", $row['topic_time']);
$newsdata = array($title, $newstext, $poster, $postdate);
$news .= str_replace($newskeys, $newsdata, $newstemplate);
}
return $news;
}
示例7: skill_dropdown
function skill_dropdown()
{
global $roster;
$query = 'SELECT DISTINCT `skill_order`, `skill_type`, `skill_name` ' . 'FROM `' . $roster->db->table('skills') . '` ' . 'ORDER BY `skill_order`;';
$result = $roster->db->query($query);
$output = '<form name="skillpicker" action="' . makelink() . '" method="post">' . "\n";
$output .= ' <select name="skill" onchange="document.forms[\'skillpicker\'].submit();">' . "\n";
$type = null;
while ($row = $roster->db->fetch($result)) {
if ($row['skill_type'] !== $type) {
if ($type !== null) {
$output .= ' </optgroup>' . "\n";
}
$output .= ' <optgroup label="' . $row['skill_type'] . '">' . "\n";
$type = $row['skill_type'];
}
$output .= ' <option value="' . $row['skill_name'] . '">' . $row['skill_name'] . '</option>' . "\n";
}
if ($type == null) {
return '';
}
$output .= ' </optgroup>' . "\n";
$output .= ' </select>' . "\n";
$output .= '</form>' . "\n";
return $output;
}
示例8: do_block
function do_block($page, $param1, $param2)
{
if (!mb_ereg('^(.+?)/\\d{4}-\\d{2}-\\d{2}', $page->getpagename(), $m)) {
throw new PluginException('このページからは呼び出せません(1)', $this);
}
$home = $m[1];
$datelist = Plugin_blognavi_DateList::getinstance($home);
$collist = Plugin_blognavi_ColumnList::getinstance($datelist);
if ($datelist->isdatepage($page->getpagename())) {
$prev = $datelist->getprev($page->getpagename());
$next = $datelist->getnext($page->getpagename());
} else {
if ($collist->iscolumnpage($page->getpagename())) {
$prev = $collist->getprev($page->getpagename());
$next = $collist->getnext($page->getpagename());
} else {
throw new PluginException('このページからは呼び出せません(2)', $this);
}
}
$str[] = '<div class="plugin_blognavi">';
if ($prev != null) {
$str[] = '[' . makelink($prev, $this->prevmes) . ']';
} else {
$str[] = '[' . htmlspecialchars($this->prevmes) . ']';
}
if ($next != null) {
$str[] = '[' . makelink($next, $this->nextmes) . ']';
} else {
$str[] = '[' . htmlspecialchars($this->nextmes) . ']';
}
$str[] = '[' . makelink($home, $this->homemes) . ']';
$str[] = '</div>';
return join("\n", $str);
}
示例9: table_services
function table_services()
{
global $construct, $db, $lang;
$form_search_services = $this->form_search_services();
$where = $form_search_services->db_data_where();
$table_services = new table(array('TABLE_NAME' => 'table_services', 'FORM_NAME' => 'table_services'));
$table_services->db_data('services.title, nodes.name AS nodes__name, nodes.id AS nodes__id, ip_addresses.ip, nodes_services.url, nodes_services.info, nodes_services.date_in, nodes_services.status, IFNULL(nodes_services.protocol, services.protocol) AS protocol, IFNULL(nodes_services.port, services.port) AS port', 'nodes_services
LEFT JOIN nodes on nodes_services.node_id = nodes.id
LEFT JOIN services on nodes_services.service_id = services.id
LEFT JOIN ip_addresses ON ip_addresses.id = nodes_services.ip_id', $where, '', "nodes_services.date_in DESC");
$table_services->db_data_search($form_search_services);
foreach ((array) $table_services->data as $key => $value) {
if ($key != 0) {
if ($table_services->data[$key]['ip']) {
$table_services->data[$key]['ip'] = long2ip($table_services->data[$key]['ip']);
if ($table_services->data[$key]['protocol'] && $table_services->data[$key]['port']) {
$table_services->data[$key]['ip'] .= ' (' . $lang['db']['nodes_services__protocol-' . $table_services->data[$key]['protocol']] . '/' . $table_services->data[$key]['port'] . ')';
}
}
$table_services->data[$key]['nodes__name'] .= " (#" . $table_services->data[$key]['nodes__id'] . ")";
$table_services->info['LINK']['nodes__name'][$key] = makelink(array("page" => "nodes", "node" => $table_services->data[$key]['nodes__id']));
$table_services->info['LINK']['services__title'][$key] = $table_services->data[$key]['url'];
}
}
$table_services->db_data_translate('nodes_services__status');
$table_services->db_data_remove('nodes__id', 'nodes_services__id', 'url', 'protocol', 'port');
return $table_services;
}
示例10: do_block
function do_block($page, $param1, $param2)
{
$prefix = trim($param1);
$pattern = '^' . mb_ereg_quote($prefix) . '/(\\d{1,4})-(\\d{2})';
if (mb_ereg($pattern, $page->getpagename(), $m)) {
$year = $m[1];
$month = $m[2];
} else {
if (isset(Vars::$get['year']) && isset(Vars::$get['month'])) {
$year = Vars::$get['year'];
$month = Vars::$get['month'];
} else {
$year = date('Y');
$month = date('n');
}
}
$smarty = $this->getSmarty();
$day = 1;
$last = date('t', mktime(0, 0, 0, $month, 1, $year));
while ($day <= $last) {
$line = array_fill(0, 7, ' ');
$d = date('w', mktime(0, 0, 0, $month, $day, $year));
for (; $d < 7 && $day <= $last; $d++, $day++) {
$p = Page::getinstance(sprintf('%s/%04d-%02d-%02d', $prefix, $year, $month, $day));
$line[$d] = $p->isexist() ? makelink($p, $day) : $day;
}
$table[] = $line;
}
$smarty->assign('table', $table);
$smarty->assign('year', $year);
$smarty->assign('month', $month);
$smarty->assign('prefix', $prefix);
$smarty->assign('page', $page->getpagename());
return $smarty->fetch('blogcalendar.tpl.htm');
}
示例11: guild_value
/**
* Controls Output of the Guild Name Column
*
* @param array $row
* @return string - Formatted output
*/
function guild_value($row, $field)
{
global $roster;
if ($row['guild_id']) {
return '<div style="display:none;">' . $row['guild_name'] . '</div><a href="' . makelink('guild-memberslist&a=g:' . $row['guild_id']) . '">' . $row['guild_name'] . '</a></div>';
} else {
return '<div style="display:none;">' . $row['guild_name'] . '</div>' . $row['guild_name'];
}
}
示例12: getCrumbsa
function getCrumbsa($topic)
{
global $roster, $addon;
$queryb = "SELECT \n\t\t`forums`.`title` as forum, \n\t\t`forums`.`forum_id` as forum_id \n\t\tFROM `" . $roster->db->table('forums', $addon['basename']) . "` forums " . "WHERE `forums`.`forum_id` = '" . $topic . "'; ";
$resultsb = $roster->db->query($queryb);
$row = $roster->db->fetch($resultsb);
$loc = '<a href="' . makelink('guild-' . $addon['basename'] . '') . '">Forums</a> > <a href="' . makelink('guild-' . $addon['basename'] . '-forum&id=' . $row['forum_id']) . '">' . $row['forum'] . '</a>';
return $loc;
}
示例13: format_author
/**
* Format author's name & wrap it to links etc.
*/
function format_author($author)
{
global $page;
if (isset($page['project'])) {
// FIXME 'h' - use only if available
return '<a href="' . makelink(array('a' => 'search', 'p' => $page['project'], 'h' => 'HEAD', 'st' => 'author', 's' => $author)) . '">' . htmlentities_wrapper($author) . '</a>';
} else {
return htmlentities_wrapper($author);
}
}
示例14: output
function output()
{
if ($_SERVER['REQUEST_METHOD'] == 'POST' && method_exists($this, 'output_onpost_' . $_POST['form_name'])) {
return call_user_func(array($this, 'output_onpost_' . $_POST['form_name']));
}
global $construct;
$this->tpl['link_ranges_search'] = makelink(array("page" => "ranges", "subpage" => "search"));
$this->tpl['link_ranges_allocation'] = makelink(array("page" => "ranges", "subpage" => "allocation"));
$this->tpl['table_areas'] = $construct->table($this->table_areas(), __FILE__);
return template($this->tpl, __FILE__);
}
示例15: _eventList
function _eventList()
{
global $roster, $addon;
$events = $this->_getGuildEvents();
$roster->tpl->assign_vars(array('START_BORDER' => border('syellow', 'start'), 'STOP_BORDER' => border('syellow', 'end'), 'FORMLINK' => makelink()));
foreach ($events as $event) {
$roster->tpl->assign_block_vars('body_row', array('EVENTID' => $event->id, 'EVENTNAME' => $event->eventName, 'DDS' => $event->damageDealtSum, 'HDS' => $event->healingDoneSum, 'DTS' => $event->damageTakenSum, 'HTS' => $event->healingTakenSum, 'DRUIDICON' => $roster->config['img_url'] . 'class/druid_icon.jpg', 'HUNTERICON' => $roster->config['img_url'] . 'class/hunter_icon.jpg', 'MAGEICON' => $roster->config['img_url'] . 'class/mage_icon.jpg', 'PALADINICON' => $roster->config['img_url'] . 'class/paladin_icon.jpg', 'PRIESTICON' => $roster->config['img_url'] . 'class/priest_icon.jpg', 'ROGUEICON' => $roster->config['img_url'] . 'class/rogue_icon.jpg', 'SHAMANICON' => $roster->config['img_url'] . 'class/shaman_icon.jpg', 'WARLOCKICON' => $roster->config['img_url'] . 'class/warlock_icon.jpg', 'WARRIORICON' => $roster->config['img_url'] . 'class/warrior_icon.jpg', 'DRUIDCOUNT' => isset($event->memberClasses['DRUID']) ? $event->memberClasses['DRUID'] : 0, 'HUNTERCOUNT' => isset($event->memberClasses['HUNTER']) ? $event->memberClasses['HUNTER'] : 0, 'MAGECOUNT' => isset($event->memberClasses['MAGE']) ? $event->memberClasses['MAGE'] : 0, 'PALADINCOUNT' => isset($event->memberClasses['PALADIN']) ? $event->memberClasses['PALADIN'] : 0, 'PRIESTCOUNT' => isset($event->memberClasses['PRIEST']) ? $event->memberClasses['PRIEST'] : 0, 'ROGUECOUNT' => isset($event->memberClasses['ROGUE']) ? $event->memberClasses['ROGUE'] : 0, 'SHAMANCOUNT' => isset($event->memberClasses['SHAMAN']) ? $event->memberClasses['SHAMAN'] : 0, 'WARLOCKCOUNT' => isset($event->memberClasses['WARLOCK']) ? $event->memberClasses['WARLOCK'] : 0, 'WARRIORCOUNT' => isset($event->memberClasses['WARRIOR']) ? $event->memberClasses['WARRIOR'] : 0));
}
$roster->tpl->set_filenames(array('eventListBody' => $addon['basename'] . '/assessment.view.eventlist.body.html'));
$roster->tpl->display('eventListBody');
}