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


PHP yourls_admin_url函数代码示例

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


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

示例1: yourls_list_plugin_admin_pages

/**
 * Display list of links to plugin admin pages, if any
 */
function yourls_list_plugin_admin_pages()
{
    global $ydb;
    if (!property_exists($ydb, 'plugin_pages') || !$ydb->plugin_pages) {
        return;
    }
    echo '<ul id="admin_pluginmenu">' . "\n";
    foreach ((array) $ydb->plugin_pages as $page) {
        echo '<li><a href="' . yourls_admin_url('plugins.php?page=' . $page['slug']) . '">' . $page['title'] . "</a></li>\n";
    }
    echo "</ul>\n";
}
开发者ID:469306621,项目名称:Languages,代码行数:15,代码来源:functions-plugins.php

示例2: isset

if (preg_match("@^([{$pattern}]+)/?\$@", $request, $matches)) {
    $keyword = isset($matches[1]) ? $matches[1] : '';
    $keyword = yourls_sanitize_keyword($keyword);
    yourls_do_action('load_template_go', $keyword);
    require_once YOURLS_ABSPATH . '/yourls-go.php';
    exit;
}
// Stats:
if (preg_match("@^([{$pattern}]+)\\+(all)?/?\$@", $request, $matches)) {
    $keyword = isset($matches[1]) ? $matches[1] : '';
    $keyword = yourls_sanitize_keyword($keyword);
    $aggregate = isset($matches[2]) ? (bool) $matches[2] && yourls_allow_duplicate_longurls() : false;
    yourls_do_action('load_template_infos', $keyword);
    require_once YOURLS_ABSPATH . '/yourls-infos.php';
    exit;
}
// Prefix-n-Shorten sends to bookmarklet (doesn't work on Windows)
if (preg_match("@^[a-zA-Z]+://.+@", $request, $matches)) {
    $url = yourls_sanitize_url($matches[0]);
    if ($parse = yourls_get_protocol_slashes_and_rest($url, array('up', 'us', 'ur'))) {
        yourls_do_action('load_template_redirect_admin', $url);
        $parse = array_map('rawurlencode', $parse);
        // Redirect to /admin/index.php?up=<url protocol>&us=<url slashes>&ur=<url rest>
        yourls_redirect(yourls_add_query_arg($parse, yourls_admin_url('index.php')), 302);
        exit;
    }
}
// Past this point this is a request the loader could not understand
yourls_do_action('loader_failed', $request);
yourls_redirect(YOURLS_SITE, 302);
exit;
开发者ID:mimischi,项目名称:gu-urlshorter,代码行数:31,代码来源:yourls-loader.php

示例3: yourls_e

?>
</li>
		</ul>
		
		<p><?php 
yourls_e("If you want to share a description along with the link you're shortening, simply <span>select text</span> on the page you're viewing before clicking on your bookmarklet link");
?>
</p>
		
		<h3><?php 
yourls_e('The Bookmarklets');
?>
</h3>
        
        <?php 
$base_bookmarklet = yourls_admin_url('index.php');
?>
		
		<p><?php 
yourls_e('Click and drag links to your toolbar (or right-click and bookmark it)');
?>
</p>
        
        <table class="tblSorter" cellpadding="0" cellspacing="1">
			<thead>
			<tr>
				<td>&nbsp;</td>
				<th><?php 
yourls_e('Standard (new page)');
?>
</th>
开发者ID:Steadroy,项目名称:YOURLS,代码行数:31,代码来源:tools.php

示例4: filter_table_add_row_action_array

 /**
  * Yourls filter table_add_row_action_array
  *
  * @param $data
  * @return array
  */
 public function filter_table_add_row_action_array()
 {
     global $url_result;
     list($actions) = func_get_args();
     if (!isset($url_result)) {
         return array();
     }
     if (!$this->_hasPermission(self::PERMISSION_ACTION_EDIT_OTHER)) {
         if (!$this->_hasPermission(self::PERMISSION_ACTION_EDIT, $url_result->{self::SETTING_URL_PROJECTS})) {
             if ($url_result->{self::SETTING_URL_USER_CREATE} && YOURLS_USER !== $url_result->{self::SETTING_URL_USER_CREATE}) {
                 unset($actions['edit']);
             }
         }
     }
     if (!$this->_hasPermission(self::PERMISSION_ACTION_DELETE_OTHER)) {
         if (!$this->_hasPermission(self::PERMISSION_ACTION_DELETE, $url_result->{self::SETTING_URL_PROJECTS})) {
             if ($url_result->{self::SETTING_URL_USER_CREATE} && YOURLS_USER !== $url_result->{self::SETTING_URL_USER_CREATE}) {
                 unset($actions['delete']);
             }
         }
     }
     if (!$this->_hasPermission(self::PERMISSION_ACTION_EDIT_PROJECT)) {
         return $actions;
     }
     if (!$this->_hasPermission(self::PERMISSION_ACTION_EDIT_OTHER)) {
         if (!$this->_hasPermission(self::PERMISSION_ACTION_EDIT_PROJECT, $url_result->{self::SETTING_URL_PROJECTS})) {
             if ($url_result->{self::SETTING_URL_USER_CREATE} && YOURLS_USER !== $url_result->{self::SETTING_URL_USER_CREATE}) {
                 return $actions;
             }
         }
     }
     $id = yourls_string2htmlid($this->_keyword);
     $href = yourls_nonce_url('laemmi_edit_ldapgroup_' . $id, yourls_add_query_arg(['action' => 'laemmi_edit_ldapgroup', 'keyword' => $this->_keyword], yourls_admin_url('admin-ajax.php')));
     $actions['laemmi_edit_ldapgroup'] = ['href' => $href, 'id' => '', 'title' => yourls__('Edit Projects', self::APP_NAMESPACE), 'anchor' => 'edit_ldapgroup', 'onclick' => ''];
     return $actions;
 }
开发者ID:laemmi,项目名称:laemmi-yourls-bind-user-to-entry,代码行数:42,代码来源:Plugin.php

示例5: yourls_list_plugin_admin_pages

/**
 * Display list of links to plugin admin pages, if any
 */
function yourls_list_plugin_admin_pages()
{
    global $ydb;
    if (!property_exists($ydb, 'plugin_pages') || !$ydb->plugin_pages) {
        return;
    }
    $plugin_links = array();
    foreach ((array) $ydb->plugin_pages as $plugin => $page) {
        $plugin_links[$plugin] = array('url' => yourls_admin_url('plugins.php?page=' . $page['slug']), 'anchor' => $page['title']);
    }
    return $plugin_links;
}
开发者ID:GasmoN,项目名称:yourls,代码行数:15,代码来源:functions-plugins.php

示例6: yourls_site_url

?>
		<p>
			<img src="<?php 
yourls_site_url();
?>
/images/yourls-logo.png" alt="YOURLS" title="YOURLS" />
		</p>
		<?php 
// Print errors, warnings and success messages
foreach (array('error', 'warning', 'success') as $info) {
    if (count(${$info}) > 0) {
        echo "<ul class='{$info}'>";
        foreach (${$info} as $msg) {
            echo '<li>' . $msg . "</li>\n";
        }
        echo '</ul>';
    }
}
// Display install button or link to admin area if applicable
if (!yourls_is_installed() && !isset($_REQUEST['install'])) {
    echo '<p style="text-align: center;"><input type="submit" name="install" value="' . yourls__('Install YOURLS') . '" class="button" /></p>';
} else {
    if (count($error) == 0) {
        echo '<p style="text-align: center;">&raquo; <a href="' . yourls_admin_url() . '" title="' . yourls__('YOURLS Administration Page') . '">' . yourls__('YOURLS Administration Page') . '</a></p>';
    }
}
?>
	</form>
</div>
<?php 
yourls_html_footer();
开发者ID:steenhulthin,项目名称:hult.in,代码行数:31,代码来源:install.php

示例7: yourls_db_connect

    yourls_db_connect();
}
// Allow early inclusion of a cache layer
if (file_exists(YOURLS_USERDIR . '/cache.php')) {
    require_once YOURLS_USERDIR . '/cache.php';
}
// Read options right from start
yourls_get_all_options();
// Register shutdown function
register_shutdown_function('yourls_shutdown');
// Core now loaded
yourls_do_action('init');
// plugins can't see this, not loaded yet
// Check if need to redirect to install procedure
if (!yourls_is_installed() && !yourls_is_installing()) {
    yourls_redirect(yourls_admin_url('install.php'), 302);
}
// Check if upgrade is needed (bypassed if upgrading or installing)
if (!yourls_is_upgrading() && !yourls_is_installing()) {
    if (yourls_upgrade_is_needed()) {
        yourls_redirect(YOURLS_SITE . '/admin/upgrade.php', 302);
    }
}
// Init all plugins
yourls_load_plugins();
yourls_do_action('plugins_loaded');
// Is there a new version of YOURLS ?
yourls_new_core_version_notice();
if (yourls_is_admin()) {
    yourls_do_action('admin_init');
}
开发者ID:mimischi,项目名称:gu-urlshorter,代码行数:31,代码来源:load-yourls.php

示例8: authmgr_require_capability

function authmgr_require_capability($capability)
{
    if (!authmgr_have_capability($capability)) {
        // TODO: display a much nicer error page
        //die('Sorry, you are not authorized for the action: '.$capability);
        yourls_redirect(yourls_admin_url('?access=denied'), 302);
        die;
    }
}
开发者ID:mimischi,项目名称:gu-urlshorter,代码行数:9,代码来源:plugin.php

示例9: yourls_e

</p>
			<p><?php 
            yourls_e("On every step, if <span class='error'>something goes wrong</span>, you'll see a message and hopefully a way to fix.");
            ?>
</p>
			<p><?php 
            yourls_e('If everything goes too fast and you cannot read, <span class="success">good for you</span>, let it go :)');
            ?>
</p>
			<p><?php 
            yourls_e('Once you are ready, press "Upgrade" !');
            ?>
</p>
			<?php 
            echo "\n\t\t\t<form action='upgrade.php?' method='get'>\n\t\t\t<input type='hidden' name='step' value='1' />\n\t\t\t<input type='hidden' name='oldver' value='{$oldver}' />\n\t\t\t<input type='hidden' name='newver' value='{$newver}' />\n\t\t\t<input type='hidden' name='oldsql' value='{$oldsql}' />\n\t\t\t<input type='hidden' name='newsql' value='{$newsql}' />\n\t\t\t<input type='submit' class='primary' value='" . yourls_esc_attr__('Upgrade') . "' />\n\t\t\t</form>";
            break;
        case 1:
        case 2:
            $upgrade = yourls_upgrade($step, $oldver, $newver, $oldsql, $newsql);
            break;
        case 3:
            $upgrade = yourls_upgrade(3, $oldver, $newver, $oldsql, $newsql);
            echo '<p>' . yourls__('Your installation is now up to date ! ') . '</p>';
            echo '<p>' . yourls_s('Go back to <a href="%s">the admin interface</a>', yourls_admin_url('index.php')) . '</p>';
    }
}
?>
	

<?php 
yourls_html_footer();
开发者ID:Git-Host,项目名称:AMPPS,代码行数:31,代码来源:mod_upgrade.php

示例10: yourls_sanitize_version

        $oldsql = yourls_sanitize_version($_GET['oldsql']);
    } else {
        list($oldver, $oldsql) = yourls_get_current_version_from_sql();
    }
    // To what are we upgrading ?
    $newver = YOURLS_VERSION;
    $newsql = YOURLS_DB_VERSION;
    // Verbose & ugly details
    $ydb->show_errors = true;
    // Let's go
    $step = isset($_GET['step']) ? intval($_GET['step']) : 0;
    switch ($step) {
        default:
        case 0:
            echo "\n\t\t\t<p>Your current installation needs to be upgraded.</p>\n\t\t\t<p>Please, pretty please, it is recommended that\n\t\t\tyou <strong>backup</strong> your database<br/>(you should do this regularly anyway)</p>\n\t\t\t<p>Nothing awful <em>should</em> happen, but this doesn't mean it <em>won't</em> happen, right? ;)</p>\n\t\t\t<p>On every step, if <span class='error'>something goes wrong</span>, you'll see a message and hopefully a way to fix</p>\n\t\t\t<p>If everything goes too fast and you cannot read, <span class='success'>good for you</span>, let it go :)</p>\n\t\t\t<p>Once you are ready, press Upgrade!</p>\n\t\t\t<form action='upgrade.php?' method='get'>\n\t\t\t<input type='hidden' name='step' value='1' />\n\t\t\t<input type='hidden' name='oldver' value='{$oldver}' />\n\t\t\t<input type='hidden' name='newver' value='{$newver}' />\n\t\t\t<input type='hidden' name='oldsql' value='{$oldsql}' />\n\t\t\t<input type='hidden' name='newsql' value='{$newsql}' />\n\t\t\t<input type='submit' class='primary' value='Upgrade' />\n\t\t\t</form>";
            break;
        case 1:
        case 2:
            $upgrade = yourls_upgrade($step, $oldver, $newver, $oldsql, $newsql);
            break;
        case 3:
            $upgrade = yourls_upgrade(3, $oldver, $newver, $oldsql, $newsql);
            $admin = yourls_admin_url('index.php');
            echo "\n\t\t\t<p>Your installation is now up to date !</p>\n\t\t\t<p>Go back to <a href='{$admin}'>the admin interface</a></p>\n\t\t\t";
    }
}
?>
	

<?php 
yourls_html_footer();
开发者ID:469306621,项目名称:Languages,代码行数:31,代码来源:upgrade.php

示例11: yourls_verify_nonce

    yourls_verify_nonce('manage_plugins', $_REQUEST['nonce']);
    // Check plugin file is valid
    if (isset($_GET['plugin']) && yourls_validate_plugin_file(YOURLS_PLUGINDIR . '/' . $_GET['plugin'] . '/plugin.php')) {
        global $ydb;
        // Activate / Deactive
        switch ($_GET['action']) {
            case 'activate':
                $result = yourls_activate_plugin($_GET['plugin'] . '/plugin.php');
                if ($result === true) {
                    yourls_redirect(yourls_admin_url('plugins.php?success=activated'), 302);
                }
                break;
            case 'deactivate':
                $result = yourls_deactivate_plugin($_GET['plugin'] . '/plugin.php');
                if ($result === true) {
                    yourls_redirect(yourls_admin_url('plugins.php?success=deactivated'), 302);
                }
                break;
            default:
                $result = 'Unsupported action';
                break;
        }
    } else {
        $result = 'No plugin specified, or not a valid plugin';
    }
    yourls_add_notice($result);
}
// Handle message upon succesfull (de)activation
if (isset($_GET['success'])) {
    if ($_GET['success'] == 'activated' or $_GET['success'] == 'deactivated') {
        yourls_add_notice('Plugin ' . $_GET['success']);
开发者ID:469306621,项目名称:Languages,代码行数:31,代码来源:plugins.php

示例12: yourls_do_action

// Now load required template and exit
yourls_do_action('pre_load_template', $request);
// At this point, $request is not sanitized. Sanitize in loaded template.
// Redirection:
if (preg_match("@^([{$pattern}]+)/?\$@", $request, $matches)) {
    $keyword = isset($matches[1]) ? $matches[1] : '';
    $keyword = yourls_sanitize_keyword($keyword);
    yourls_do_action('load_template_go', $keyword);
    include YOURLS_ABSPATH . '/yourls-go.php';
    exit;
}
// Stats:
if (preg_match("@^([{$pattern}]+)\\+(all)?/?\$@", $request, $matches)) {
    $keyword = isset($matches[1]) ? $matches[1] : '';
    $keyword = yourls_sanitize_keyword($keyword);
    $aggregate = isset($matches[2]) ? (bool) $matches[2] && yourls_allow_duplicate_longurls() : false;
    yourls_do_action('load_template_infos', $keyword);
    include YOURLS_ABSPATH . '/yourls-infos.php';
    exit;
}
// Prefix-n-Shorten sends to bookmarklet (doesn't work on Windows)
if (preg_match("@^[a-zA-Z]+://.+@", $request, $matches)) {
    $url = yourls_sanitize_url($matches[0]);
    yourls_do_action('load_template_redirect_admin', $url);
    yourls_redirect(yourls_admin_url('index.php') . '?u=' . rawurlencode($url), 302);
    exit;
}
// Past this point this is a request the loader could not understand
yourls_do_action('loader_failed', $request);
yourls_redirect(YOURLS_SITE, 302);
exit;
开发者ID:TheProjecter,项目名称:yourls-ext,代码行数:31,代码来源:yourls-loader.php

示例13: yourls_table_add_row

function yourls_table_add_row($keyword, $url, $title = '', $ip, $clicks, $timestamp)
{
    $keyword = yourls_sanitize_string($keyword);
    $display_keyword = htmlentities($keyword);
    $url = yourls_sanitize_url($url);
    $display_url = htmlentities(yourls_trim_long_string($url));
    $title_url = htmlspecialchars($url);
    $title = yourls_sanitize_title($title);
    $display_title = yourls_trim_long_string($title);
    $title = htmlspecialchars($title);
    $id = yourls_string2int($keyword);
    // used as HTML #id
    $date = date('M d, Y H:i', $timestamp + YOURLS_HOURS_OFFSET * 3600);
    $clicks = number_format($clicks, 0, '', '');
    $shorturl = YOURLS_SITE . '/' . $keyword;
    $statlink = $shorturl . '+';
    if ($title) {
        $display_link = "<a href=\"{$url}\" title=\"{$title}\">{$display_title}</a><br/><small><a href=\"{$url}\" title=\"{$title_url}\">{$display_url}</a></small>";
    } else {
        $display_link = "<a href=\"{$url}\" title=\"{$title_url}\">{$display_url}</a>";
    }
    $delete_link = yourls_nonce_url('delete-link_' . $id, yourls_add_query_arg(array('id' => $id, 'action' => 'delete', 'keyword' => $keyword), yourls_admin_url('admin-ajax.php')));
    $edit_link = yourls_nonce_url('edit-link_' . $id, yourls_add_query_arg(array('id' => $id, 'action' => 'edit', 'keyword' => $keyword), yourls_admin_url('admin-ajax.php')));
    $actions = <<<ACTION
<a href="{$statlink}" id="statlink-{$id}" title="Stats" class="button button_stats">Stats</a><a href="" id="share-button-{$id}" name="share-button" title="Share" class="button button_share" onclick="toggle_share('{$id}');return false;">Share</a><a href="{$edit_link}" id="edit-button-{$id}" name="edit-button" title="Edit" class="button button_edit" onclick="edit('{$id}');return false;">Edit</a><a href="{$delete_link}" id="delete-button-{$id}" name="delete-button" title="Delete" class="button button_delete" onclick="remove('{$id}');return false;">Delete</a>
ACTION;
    $actions = yourls_apply_filter('action_links', $actions, $keyword, $url, $ip, $clicks, $timestamp);
    $row = <<<ROW
<tr id="id-{$id}"><td id="keyword-{$id}" class="keyword"><a href="{$shorturl}">{$display_keyword}</a></td><td id="url-{$id}" class="url">{$display_link}</td><td id="timestamp-{$id}" class="timestamp">{$date}</td><td id="ip-{$id}" class="ip">{$ip}</td><td id="clicks-{$id}" class="clicks">{$clicks}</td><td class="actions" id="actions-{$id}">{$actions}<input type="hidden" id="keyword_{$id}" value="{$keyword}"/></td></tr>
ROW;
    $row = yourls_apply_filter('table_add_row', $row, $keyword, $url, $title, $ip, $clicks, $timestamp);
    return $row;
}
开发者ID:TheProjecter,项目名称:yourls-ext,代码行数:33,代码来源:functions.php

示例14: vva_change_password_display_page

/**
 * Display the change password page
 */
function vva_change_password_display_page()
{
    // verify we have all necessary features
    if (!vva_change_password_verify_capabilities()) {
        return;
    }
    $error_message = NULL;
    $form_submitted = FALSE;
    $password_changed = FALSE;
    // if a form was submitted check for errors & minimum requirements
    if (isset($_REQUEST['submit'])) {
        $error_message = vva_change_password_get_form_errors();
        $form_submitted = TRUE;
    }
    // if the new password meets requirements update it
    if ($form_submitted && empty($error_message)) {
        $password_changed = vva_change_password_write_file($_REQUEST['new_password']);
        if (!$password_changed) {
            return;
        }
    }
    // show password updated message or the form
    if ($password_changed) {
        ?>
		<div id="password_updated" class="success">
			<p>Your password has been updated.</p>
			<p><a href="<?php 
        echo yourls_admin_url('index.php');
        ?>
">Continue</a></p>
		</div>
		<?php 
    } else {
        vva_change_password_display_form($error_message);
    }
}
开发者ID:walkfor,项目名称:YOURLS-Change-Password,代码行数:39,代码来源:plugin.php

示例15: yourls_e

				<th class="header"><?php 
yourls_e('Custom Keyword');
?>
</th>
				<td><a href="javascript:(function()%7Bvar%20d=document,w=window,enc=encodeURIComponent,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),s2=((s.toString()=='')?s:enc(s)),f='<?php 
echo yourls_admin_url('index.php');
?>
',l=d.location,k=prompt(%22Custom%20URL%22),k2=(k?'&k='+k:%22%22),p='?u='+enc(l.href)+'&t='+enc(d.title)+'&s='+s2+k2,u=f+p;if(k!=null)%7Btry%7Bthrow('ozhismygod');%7Dcatch(z)%7Ba=function()%7Bif(!w.open(u))l.href=u;%7D;if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();%7Dvoid(0)%7D%7D)()" class="bookmarklet" onclick="alert('<?php 
echo yourls_esc_attr__('Drag to your toolbar!');
?>
');return false;"><?php 
yourls_e('Custom shorten');
?>
</a></td>
				<td><a href="javascript:(function()%7Bvar%20d=document,k=prompt('Custom%20URL'),s=d.createElement('script');if(k!=null){window.yourls_callback=function(r)%7Bif(r.short_url)%7Bprompt(r.message,r.short_url);%7Delse%7Balert('An%20error%20occured:%20'+r.message);%7D%7D;s.src='<?php 
echo yourls_admin_url('index.php');
?>
?u='+encodeURIComponent(d.location.href)+'&k='+k+'&jsonp=yourls';void(d.body.appendChild(s));%7D%7D)();" class="bookmarklet" onclick="alert('<?php 
echo yourls_esc_attr__('Drag to your toolbar!');
?>
');return false;"><?php 
yourls_e('Instant Custom Shorten');
?>
</a></td>
			</tr>
			</tbody>
		</table>
		
	<h2><?php 
yourls_e('Prefix-n-Shorten');
?>
开发者ID:GasmoN,项目名称:yourls,代码行数:31,代码来源:tools.php


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