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


PHP make_link函数代码示例

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


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


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