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

PHP make_link函数代码示例

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

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



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

示例1: make_item

function make_item($dir)
{
    if (!permissions_grant($dir, NULL, "create")) {
        show_error($GLOBALS["error_msg"]["accessfunc"]);
    }
    $mkname = $GLOBALS['__POST']["mkname"];
    $mktype = $GLOBALS['__POST']["mktype"];
    $mkname = basename(stripslashes($mkname));
    if ($mkname == "") {
        show_error($GLOBALS["error_msg"]["miscnoname"]);
    }
    $new = get_abs_item($dir, $mkname);
    if (@file_exists($new)) {
        show_error($mkname . ": " . $GLOBALS["error_msg"]["itemdoesexist"]);
    }
    if ($mktype != "file") {
        $ok = @mkdir($new, 0777);
        $err = $GLOBALS["error_msg"]["createdir"];
    } else {
        $ok = @touch($new);
        $err = $GLOBALS["error_msg"]["createfile"];
    }
    if ($ok === false) {
        show_error($err);
    }
    header("Location: " . make_link("list", $dir, NULL));
}
开发者ID:sdoney,项目名称:nas4free,代码行数:27,代码来源:mkitem.php


示例2: comment_to_html

 protected function comment_to_html($comment, $trim = false)
 {
     $inner_id = $this->inner_id;
     // because custom themes can't add params, because PHP
     global $user;
     $tfe = new TextFormattingEvent($comment->comment);
     send_event($tfe);
     //$i_uid = int_escape($comment->owner_id);
     $h_name = html_escape($comment->owner_name);
     //$h_poster_ip = html_escape($comment->poster_ip);
     $h_comment = $trim ? substr($tfe->stripped, 0, 50) . "..." : $tfe->formatted;
     $i_comment_id = int_escape($comment->comment_id);
     $i_image_id = int_escape($comment->image_id);
     $stripped_nonl = str_replace("\n", "\\n", substr($tfe->stripped, 0, 50));
     $stripped_nonl = str_replace("\r", "\\r", $stripped_nonl);
     $h_userlink = "<a href='" . make_link("user/{$h_name}") . "'>{$h_name}</a>";
     $h_date = $comment->posted;
     $h_del = $user->can("delete_comment") ? ' - <a onclick="return confirm(\'Delete comment by ' . $h_name . ':\\n' . $stripped_nonl . '\');" ' . 'href="' . make_link('comment/delete/' . $i_comment_id . '/' . $i_image_id) . '">Del</a>' : '';
     $h_reply = "[<a href='" . make_link("post/view/{$i_image_id}") . "'>Reply</a>]";
     if ($inner_id == 0) {
         return "<div class='comment' style='margin-top: 8px;'>{$h_userlink}{$h_del} {$h_date} No.{$i_comment_id} {$h_reply}<p>{$h_comment}</p></div>";
     } else {
         return "<table><tr><td nowrap class='doubledash'>&gt;&gt;</td><td>" . "<div class='reply'>{$h_userlink}{$h_del} {$h_date} No.{$i_comment_id} {$h_reply}<p>{$h_comment}</p></div>" . "</td></tr></table>";
     }
 }
开发者ID:JarJak,项目名称:shimmie2,代码行数:25,代码来源:comment.theme.php


示例3: get_voter_html

 public function get_voter_html(Image $image)
 {
     $i_image_id = int_escape($image->id);
     $i_score = int_escape($image->numeric_score);
     $html = "\n\t\t\tCurrent Score: {$i_score}\n\n\t\t\t<p><form action='" . make_link("numeric_score_vote") . "' method='POST'>\n\t\t\t<input type='hidden' name='image_id' value='{$i_image_id}'>\n\t\t\t<input type='hidden' name='vote' value='up'>\n\t\t\t<input type='submit' value='Vote Up'>\n\t\t\t</form>\n\n\t\t\t<form action='" . make_link("numeric_score_vote") . "' method='POST'>\n\t\t\t<input type='hidden' name='image_id' value='{$i_image_id}'>\n\t\t\t<input type='hidden' name='vote' value='null'>\n\t\t\t<input type='submit' value='Remove Vote'>\n\t\t\t</form>\n\n\t\t\t<form action='" . make_link("numeric_score_vote") . "' method='POST'>\n\t\t\t<input type='hidden' name='image_id' value='{$i_image_id}'>\n\t\t\t<input type='hidden' name='vote' value='down'>\n\t\t\t<input type='submit' value='Vote Down'>\n\t\t\t</form>\n\t\t";
     return $html;
 }
开发者ID:jackrabbitjoey,项目名称:shimmie2,代码行数:7,代码来源:theme.php


示例4: display_aliases

 public function display_aliases(Page $page, $aliases, $is_admin, $pageNumber, $totalPages)
 {
     if ($is_admin) {
         $action = "<th width='10%'>Action</th>";
         $add = "\n\t\t\t\t<tr>\n\t\t\t\t\t<form action='" . make_link("alias/add") . "' method='POST'>\n\t\t\t\t\t\t<td><input type='text' name='oldtag'></td>\n\t\t\t\t\t\t<td><input type='text' name='newtag'></td>\n\t\t\t\t\t\t<td><input type='submit' value='Add'></td>\n\t\t\t\t\t</form>\n\t\t\t\t</tr>\n\t\t\t";
     } else {
         $action = "";
         $add = "";
     }
     $h_aliases = "";
     $n = 0;
     foreach ($aliases as $old => $new) {
         $h_old = html_escape($old);
         $h_new = "<a href='" . make_link("post/list/" . url_escape($new) . "/1") . "'>" . html_escape($new) . "</a>";
         $oe = $n++ % 2 == 0 ? "even" : "odd";
         $h_aliases .= "<tr class='{$oe}'><td>{$h_old}</td><td>{$h_new}</td>";
         if ($is_admin) {
             $h_aliases .= "\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<form action='" . make_link("alias/remove") . "' method='POST'>\n\t\t\t\t\t\t\t<input type='hidden' name='oldtag' value='{$h_old}'>\n\t\t\t\t\t\t\t<input type='submit' value='Remove'>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</td>\n\t\t\t\t";
         }
         $h_aliases .= "</tr>";
     }
     $html = "\n\t\t\t<script>\n\t\t\t\$(document).ready(function() {\n\t\t\t\t\$(\"#aliases\").tablesorter();\n\t\t\t});\n\t\t\t</script>\n\t\t\t<table id='aliases' class='zebra'>\n\t\t\t\t<thead><tr><th>From</th><th>To</th>{$action}</tr></thead>\n\t\t\t\t<tbody>{$h_aliases}</tbody>\n\t\t\t\t<tfoot>{$add}</tfoot>\n\t\t\t</table>\n\t\t\t<p><a href='" . make_link("alias/export/aliases.csv") . "'>Download as CSV</a></p>\n\t\t";
     $bulk_html = "\n\t\t\t<form enctype='multipart/form-data' action='" . make_link("alias/import") . "' method='POST'>\n\t\t\t\t<input type='file' name='alias_file'>\n\t\t\t\t<input type='submit' value='Upload List'>\n\t\t\t</form>\n\t\t";
     $page->set_title("Alias List");
     $page->set_heading("Alias List");
     $page->add_block(new NavBlock());
     $page->add_block(new Block("Aliases", $html));
     if ($is_admin) {
         $page->add_block(new Block("Bulk Upload", $bulk_html, "main", 51));
     }
     $this->display_paginator($page, "alias/list", null, $pageNumber, $totalPages);
 }
开发者ID:kmcasto,项目名称:shimmie2,代码行数:32,代码来源:theme.php


示例5: onPageRequest

 public function onPageRequest($event)
 {
     global $config, $page, $user;
     if ($event->page_matches("featured_image")) {
         if ($event->get_arg(0) == "set" && $user->check_auth_token()) {
             if ($user->is_admin() && isset($_POST['image_id'])) {
                 $id = int_escape($_POST['image_id']);
                 if ($id > 0) {
                     $config->set_int("featured_id", $id);
                     $page->set_mode("redirect");
                     $page->set_redirect(make_link("post/view/{$id}"));
                 }
             }
         }
         if ($event->get_arg(0) == "download") {
             $image = Image::by_id($config->get_int("featured_id"));
             if (!is_null($image)) {
                 $page->set_mode("data");
                 $page->set_type("image/jpeg");
                 $page->set_data(file_get_contents($image->get_image_filename()));
             }
         }
         if ($event->get_arg(0) == "view") {
             $image = Image::by_id($config->get_int("featured_id"));
             if (!is_null($image)) {
                 send_event(new DisplayingImageEvent($image, $page));
             }
         }
     }
 }
开发者ID:nsuan,项目名称:shimmie2,代码行数:30,代码来源:main.php


示例6: do_styles

function do_styles($has_pipes = true, $uc = false, $start = 0, $end = 0, $sep = ' | ')
{
    global $styles, $image, $page, $style;
    $x = count($styles);
    for ($i = 0; $i < $x; ++$i) {
        if ($start) {
            echo $start;
        }
        if ($uc == false) {
            $echo_text = $styles[$i];
        } else {
            $echo_text = ucwords($styles[$i]);
        }
        if ($style != $styles[$i]) {
            echo make_link(array('page' => $page, 'image' => $image, 'style' => $styles[$i], 'text' => $echo_text));
        } else {
            echo $echo_text;
        }
        if ($has_pipes && $i < $x - 1) {
            echo $sep;
        }
        if ($end) {
            echo $end;
        }
    }
    return;
}
开发者ID:BackupTheBerlios,项目名称:nangband,代码行数:27,代码来源:layout.php


示例7: onSetupBuilding

 public function onSetupBuilding($event)
 {
     $sb = new SetupBlock("Blocks");
     $sb->add_label("See <a href='" . make_link("ext_doc/blocks") . "'>the docs</a> for formatting");
     $sb->add_longtext_option("blocks_text");
     $event->panel->add_block($sb);
 }
开发者ID:nsuan,项目名称:shimmie2,代码行数:7,代码来源:main.php


示例8: show_login

/**
If no user is logged in, show the login option
*/
function show_login()
{
    if (login_ok()) {
        return;
    }
    echo '<small> - <a href="' . make_link("login", NULL) . '">' . $GLOBALS['messages']['btnlogin'] . "</a></small>";
}
开发者ID:RX78NY1,项目名称:hustoj,代码行数:10,代码来源:footer.php


示例9: build_navigation

 protected function build_navigation($page_number, $total_pages, $search_terms)
 {
     $h_search_string = count($search_terms) == 0 ? "" : html_escape(implode(" ", $search_terms));
     $h_search_link = make_link();
     $h_search = "\n\t\t\t<p><form action='{$h_search_link}' method='GET'>\n\t\t\t\t<input name='search' type='text'\n\t\t\t\t\t\tvalue='{$h_search_string}' autocomplete='off' />\n\t\t\t\t<input type='hidden' name='q' value='/post/list'>\n\t\t\t\t<input type='submit' value='Find' style='display: none;' />\n\t\t\t</form>\n\t\t\t<div id='search_completions'></div>";
     return $h_search;
 }
开发者ID:kmcasto,项目名称:shimmie2,代码行数:7,代码来源:index.theme.php


示例10: display_admin_block

 public function display_admin_block()
 {
     global $page, $config;
     $html = "" . "<b>Current Commit</b>: " . $config->get_string('commit_hash') . " | (" . $config->get_string('update_time') . ")" . "<br><b>Latest Commit</b>: <span id='updatecheck'>Loading...</span>" . "<br><a href='" . make_link('update/download') . "' id='updatelink'></a>";
     //TODO: Show warning before use.
     $page->add_block(new Block("Software Update", $html, "main", 75));
 }
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:7,代码来源:theme.php


示例11: onUserBlockBuilding

 public function onUserBlockBuilding($event)
 {
     global $user;
     if ($user->is_admin()) {
         $event->add_link("Tips Editor", make_link("tips/list"));
     }
 }
开发者ID:kmcasto,项目名称:shimmie2,代码行数:7,代码来源:main.php


示例12: onUserBlockBuilding

 public function onUserBlockBuilding(UserBlockBuildingEvent $event)
 {
     global $user;
     if ($user->can("ban_image")) {
         $event->add_link("UnTags", make_link("untag/list/1"));
     }
 }
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:7,代码来源:main.php


示例13: display_image_banner

 public function display_image_banner(Page $page, Image $image)
 {
     global $config;
     $i_image = int_escape($image->id);
     $html = "\n\t\t\t<form action='" . make_link("image_report/add") . "' method='POST'>\n\t\t\t\t<input type='hidden' name='image_id' value='{$i_image}'>\n\t\t\t\t<input type='text' name='reason' value='Please enter a reason' onclick='this.value=\"\";'>\n\t\t\t\t<input type='submit' value='Report'>\n\t\t\t</form>\n\t\t";
     $page->add_block(new Block("Report Image", $html, "left"));
 }
开发者ID:jackrabbitjoey,项目名称:shimmie2,代码行数:7,代码来源:theme.php


示例14: display_mass_tagger

 public function display_mass_tagger(Page $page, Event $event, $config)
 {
     $data_href = get_base_href();
     $body = "\n\t\t\t<form action='" . make_link("mass_tagger/tag") . "' method='POST'>\n\t\t\t\t<input id='mass_tagger_activate' type='button' onclick='activate_mass_tagger(\"{$data_href}\");' value='Activate'/>\n\t\t\t\t<div id='mass_tagger_controls' style='display: none;'>\n\t\t\t\t\tClick on images to mark them. Use the 'Index Options' in the Board Config to increase the amount of shown images.\n\t\t\t\t\t<br />\n\t\t\t\t\t<input type='hidden' name='ids' id='mass_tagger_ids' />\n\t\t\t\t\tSet instead of add? <input type='checkbox' name='setadd' value='set' />\n\t\t\t\t\t<label>Tags: <input type='text' name='tag' /></label>\n\n\t\t\t\t\t<input type='submit' value='Tag Marked Images' />\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t";
     $block = new Block("Mass Tagger", $body, "left", 50);
     $page->add_block($block);
 }
开发者ID:JarJak,项目名称:shimmie2,代码行数:7,代码来源:theme.php


示例15: display_image

 public function display_image(Page $page, Image $image)
 {
     $ilink = make_link("get_svg/{$image->id}/{$image->id}.svg");
     //		$ilink = $image->get_image_link();
     $html = "\n\t\t\t<object data='{$ilink}' type='image/svg+xml' width='{$image->width}' height='{$image->height}'>\n\t\t\t    <embed src='{$ilink}' type='image/svg+xml' width='{$image->width}' height='{$image->height}' />\n\t\t\t</object>\n\t\t";
     $page->add_block(new Block("Image", $html, "main", 0));
 }
开发者ID:kmcasto,项目名称:shimmie2,代码行数:7,代码来源:theme.php


示例16: build_navigation

 /**
  * @param int $page_number
  * @param int $total_pages
  * @param string[] $search_terms
  * @return string
  */
 protected function build_navigation($page_number, $total_pages, $search_terms)
 {
     $h_search_string = count($search_terms) == 0 ? "" : html_escape(implode(" ", $search_terms));
     $h_search_link = make_link();
     $h_search = "\n\t\t\t<p><form action='{$h_search_link}' method='GET'>\n\t\t\t\t<input name='search' type='text' value='{$h_search_string}' class='autocomplete_tags' placeholder=''  style='width:75%'/>\n\t\t\t\t<input type='submit' value='Go' style='width:20%'>\n\t\t\t\t<input type='hidden' name='q' value='/post/list'>\n\t\t\t</form>\n\t\t\t<div id='search_completions'></div>";
     return $h_search;
 }
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:13,代码来源:index.theme.php


示例17: build_stats

 private function build_stats(Image $image)
 {
     $h_owner = html_escape($image->get_owner()->name);
     $h_ownerlink = "<a href='" . make_link("user/{$h_owner}") . "'>{$h_owner}</a>";
     $h_ip = html_escape($image->owner_ip);
     $h_date = autodate($image->posted);
     $h_filesize = to_shorthand_int($image->filesize);
     global $user;
     if ($user->can("view_ip")) {
         $h_ownerlink .= " ({$h_ip})";
     }
     $html = "\n\t\tId: {$image->id}\n\t\t<br>Posted: {$h_date} by {$h_ownerlink}\n\t\t<br>Size: {$image->width}x{$image->height}\n\t\t<br>Filesize: {$h_filesize}\n\t\t";
     if (!is_null($image->source)) {
         $h_source = html_escape($image->source);
         if (substr($image->source, 0, 7) != "http://" && substr($image->source, 0, 8) != "https://") {
             $h_source = "http://" . $h_source;
         }
         $html .= "<br>Source: <a href='{$h_source}'>link</a>";
     }
     if (class_exists("Ratings")) {
         if ($image->rating == null || $image->rating == "u") {
             $image->rating = "u";
         }
         $h_rating = Ratings::rating_to_human($image->rating);
         $html .= "<br>Rating: {$h_rating}";
     }
     return $html;
 }
开发者ID:JarJak,项目名称:shimmie2,代码行数:28,代码来源:view.theme.php


示例18: display_aliases

 /**
  * Show a page of aliases.
  *
  * Note: $can_manage = whether things like "add new alias" should be shown
  *
  * @param array $aliases An array of ($old_tag => $new_tag)
  * @param int $pageNumber
  * @param int $totalPages
  */
 public function display_aliases($aliases, $pageNumber, $totalPages)
 {
     global $page, $user;
     $can_manage = $user->can("manage_alias_list");
     if ($can_manage) {
         $h_action = "<th width='10%'>Action</th>";
         $h_add = "\n\t\t\t\t<tr>\n\t\t\t\t\t" . make_form(make_link("alias/add")) . "\n\t\t\t\t\t\t<td><input type='text' name='oldtag'></td>\n\t\t\t\t\t\t<td><input type='text' name='newtag'></td>\n\t\t\t\t\t\t<td><input type='submit' value='Add'></td>\n\t\t\t\t\t</form>\n\t\t\t\t</tr>\n\t\t\t";
     } else {
         $h_action = "";
         $h_add = "";
     }
     $h_aliases = "";
     foreach ($aliases as $old => $new) {
         $h_old = html_escape($old);
         $h_new = "<a href='" . make_link("post/list/" . url_escape($new) . "/1") . "'>" . html_escape($new) . "</a>";
         $h_aliases .= "<tr><td>{$h_old}</td><td>{$h_new}</td>";
         if ($can_manage) {
             $h_aliases .= "\n\t\t\t\t\t<td>\n\t\t\t\t\t\t" . make_form(make_link("alias/remove")) . "\n\t\t\t\t\t\t\t<input type='hidden' name='oldtag' value='{$h_old}'>\n\t\t\t\t\t\t\t<input type='submit' value='Remove'>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</td>\n\t\t\t\t";
         }
         $h_aliases .= "</tr>";
     }
     $html = "\n\t\t\t<table id='aliases' class='sortable zebra'>\n\t\t\t\t<thead><tr><th>From</th><th>To</th>{$h_action}</tr></thead>\n\t\t\t\t<tbody>{$h_aliases}</tbody>\n\t\t\t\t<tfoot>{$h_add}</tfoot>\n\t\t\t</table>\n\t\t\t<p><a href='" . make_link("alias/export/aliases.csv") . "'>Download as CSV</a></p>\n\t\t";
     $bulk_html = "\n\t\t\t" . make_form(make_link("alias/import"), 'post', true) . "\n\t\t\t\t<input type='file' name='alias_file'>\n\t\t\t\t<input type='submit' value='Upload List'>\n\t\t\t</form>\n\t\t";
     $page->set_title("Alias List");
     $page->set_heading("Alias List");
     $page->add_block(new NavBlock());
     $page->add_block(new Block("Aliases", $html));
     if ($can_manage) {
         $page->add_block(new Block("Bulk Upload", $bulk_html, "main", 51));
     }
     $this->display_paginator($page, "alias/list", null, $pageNumber, $totalPages);
 }
开发者ID:JarJak,项目名称:shimmie2,代码行数:41,代码来源:theme.php


示例19: onPageRequest

 public function onPageRequest(PageRequestEvent $event)
 {
     global $config, $user, $page;
     if ($user->is_admin() && isset($_GET['sha'])) {
         if ($event->page_matches("update/download")) {
             $ok = $this->download_shimmie();
             $page->set_mode("redirect");
             if ($ok) {
                 $page->set_redirect(make_link("update/update", "sha=" . $_GET['sha']));
             } else {
                 $page->set_redirect(make_link("admin"));
             }
             //TODO: Show error?
         } elseif ($event->page_matches("update/update")) {
             $ok = $this->update_shimmie();
             $page->set_mode("redirect");
             if ($ok) {
                 $page->set_redirect(make_link("admin"));
             } else {
                 $page->set_redirect(make_link("admin"));
             }
             //TODO: Show error?
         }
     }
 }
开发者ID:JarJak,项目名称:shimmie2,代码行数:25,代码来源:main.php


示例20: data

 private function data(Image $image)
 {
     global $config;
     $text_link = $image->parse_link_template($config->get_string("ext_link-img_text-link_format"));
     $text_link = trim($text_link) == "" ? null : $text_link;
     // null blank setting so the url gets filled in on the text links.
     return array('thumb_src' => make_http($image->get_thumb_link()), 'image_src' => make_http($image->get_image_link()), 'post_link' => make_http(make_link("post/view/{$image->id}")), 'text_link' => $text_link);
 }
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:8,代码来源:main.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP make_list函数代码示例发布时间:2022-05-15
下一篇:
PHP make_jumpbox函数代码示例发布时间: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