Example #1
0
function show404($shorturl)
{
    yourls_status_header(404);
    yourls_html_head('page404', 'This page does not exist');
    yourls_html_logo();
    ?>

<div class="main-column">
	<div class="panel panel-teaser">
		<div class="panel-header">
			<h1>Page Not Found</h1>
		</div>
		<div class="panel-body">
			<p>Leider konnten wir keine Adresse unter dem Kürzel <strong><?php 
    echo $shorturl;
    ?>
</strong> finden.
			Das bedeutet, dass diese Kurz-URL nicht existiert.
		</div>
	</div>
</div>
<div class="sidebar-column">

	<div class="panel panel-sidebar">
		<h2>Über den Kurz-URL-Dienst</h2>
		<div class="panel-body">
			<span class="caret"></span>

			<p>Auf der Website <?php 
    echo $_SERVER['SERVER_NAME'];
    ?>
 lassen sich Kurzlinks
			zu Ressourcen der <a href="http://www.uni-frankfurt.de/">Goethe-Universität Frankfurt</a>
			erstellen. <a href="/">Zur Startseite</a>
		</div>
	</div>

</div>


<?php 
    yourls_html_footer();
}
function GetPasswordForm()
{
    yourls_html_head('preview', 'Short URL preview');
    $form = <<<HTML
<section>\t\t\t\t
        <div id="container_demo" >
            <div id="wrapper">
\t\t\t\t<form method="post" action="{$url}"> 
\t\t\t\t\t<p class="text"> 
\t\t\t\t\t\t<strong>Provide Password</strong><br /><input type="text" id="submit-pass" name="pass" value="" class="text" size="40" />
\t\t\t\t\t<p class="login button"> 
\t\t\t\t\t\t<input type="submit" /> 
\t\t\t\t\t</p>
\t\t\t\t</form>
            </div>
        </div>  
    </section>
HTML;
    //yourls_html_footer();
    return $form;
}
Example #3
0
function ozh_preview_show($keyword)
{
    require_once YOURLS_INC . '/functions-html.php';
    yourls_html_head('preview', 'Short URL preview');
    yourls_html_logo();
    $title = yourls_get_keyword_title($keyword);
    $url = yourls_get_keyword_longurl($keyword);
    $base = YOURLS_SITE;
    $char = OZH_PREVIEW_CHAR;
    echo <<<HTML
        <h2>Link Preview</h2>
        <p>You requested the short URL <strong><a href="{$base}/{$keyword}">{$base}/{$keyword}</a></strong></p>
        <p>This short URL points to:</p>
        <ul>
        <li>Long URL: <strong><a href="{$base}/{$keyword}">{$url}</a></strong></li>
        <li>Page title: <strong>{$title}</strong></li>
        </ul>
        <p>If you still want to visit this link, please <strong><a href="{$base}/{$keyword}">click here</a></strong>.</p>

        <p>Thank you for using our shortening service.</p>
HTML;
    yourls_html_footer();
}
Example #4
0
session_start();
include "../../../includes/load-yourls.php";
include "muhtmlfunctions.php";
if (YOURLS_PRIVATE === false) {
    die;
    // NO DIRECT CALLS IF PUBLIC!
}
$act = $_GET['act'];
if ($act == "logout") {
    $_SESSION['user'] = "";
    unset($_SESSION);
    unset($_SESSION["user"]);
    $error_msg = "Signed off.";
}
if (!isLogged()) {
    yourls_html_head('login');
    mu_html_menu();
    // Login form
    switch ($act) {
        case "login":
            $username = yourls_escape($_POST['username']);
            $password = $_POST['password'];
            if (!empty($username) && !empty($password)) {
                if (isValidUser($username, $password)) {
                    $token = getUserTokenByEmail($username);
                    $id = getUserIdByToken($token);
                    $_SESSION['user'] = array("id" => $id, "user" => $username, "token" => $token);
                    yourls_redirect("index.php");
                } else {
                    $error_msg = "Problems to login.";
                    require_once 'form.php';
Example #5
0
<?php

// Make sure we're in YOURLS context
if (!defined('YOURLS_ABSPATH')) {
    // Attempt to guess URL via YOURLS
    $url = 'http://' . $_SERVER['HTTP_HOST'] . str_replace(array('/pages/', '.php'), array('/', ''), $_SERVER['REQUEST_URI']);
    echo "Try this instead: <a href='{$url}'>{$url}</a>";
    die;
}
// Display page content. Any PHP, HTML and YOURLS function can go here.
$url = YOURLS_SITE . '/credits';
yourls_html_head('credits', 'Credits');
yourls_html_logo();
?>
<div class="main-column">
	<div class="panel panel-teaser">
		<div class="panel-header">
			<h1>Über den KurzURL-Dienst an der Goethe-Universität</h1>
		</div>
		<div class="panel-body">
			<p>Dieser Kurz-URL-Dienst entstand auf Initiative durch Studenten des Projektes
			<a href="http://riedberg.tv">RiedbergTV</a>, welches durch den
			<a href="http://www.studiumdigitale.uni-frankfurt.de/elf/self15/index.html">studentischen eLearning-Förderfonds (SeLF) 2015/16</a>
			finanziert wird. Mit <a href="http://www.studiumdigitale.uni-frankfurt.de">Studiumdigitale</a>
			besitzt dieser Kurz-URL-Dienst einen Partner, der die langfristige Funktion dieses Dienstes
			garantieren kann.

			<p>Mit dem <a href="http://th.physik.uni-frankfurt.de">Institut für theoretische Physik</a>
			haben wir einen weiteren Unterstützer, der den reibungslosen technischen Betrieb dieses Dienstes
			bestärkt. Betrieben wird dieser Dienst durch das
			<a href="http://elearning.physik.uni-frankfurt.de/projekt">eLearning-Projekt des Fachbereichs Physik</a>.
Example #6
0
    if (yourls_create_htaccess()) {
        $success[] = 'File <tt>.htaccess</tt> successfully created/updated.';
    } else {
        $warning[] = 'Could not write file <tt>.htaccess</tt> in YOURLS root directory. You will have to do it manually. See <a href="http://yourls.org/htaccess">how</a>.';
    }
    // Create SQL tables
    $install = yourls_create_sql_tables();
    if (isset($install['error'])) {
        $error = array_merge($error, $install['error']);
    }
    if (isset($install['success'])) {
        $success = array_merge($success, $install['success']);
    }
}
// Start output
yourls_html_head('install', 'Install YOURLS');
?>
<div id="login">
	<form method="post" action="?"><?php 
// reset any QUERY parameters
?>
		<p>
			<img src="<?php 
echo YOURLS_SITE;
?>
/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) {
Example #7
0
    if (yourls_create_htaccess()) {
        $success[] = yourls__('File <tt>.htaccess</tt> successfully created/updated.');
    } else {
        $warning[] = yourls__('Could not write file <tt>.htaccess</tt> in YOURLS root directory. You will have to do it manually. See <a href="http://yourls.org/htaccess">how</a>.');
    }
    // Create SQL tables
    $install = yourls_create_sql_tables();
    if (isset($install['error'])) {
        $error = array_merge($error, $install['error']);
    }
    if (isset($install['success'])) {
        $success = array_merge($success, $install['success']);
    }
}
// Start output
yourls_html_head('install', yourls__('Install YOURLS'));
?>
<div id="login">
	<form method="post" action="?"><?php 
// reset any QUERY parameters
?>
		<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) {
Example #8
0
        $max_on_page = $total_items;
    } else {
        $max_on_page = $offset + $perpage;
    }
    // Determine Number Of Items To Display On Page
    if ($offset + 1 > $total_items) {
        $display_on_page = $total_items;
    } else {
        $display_on_page = $offset + 1;
    }
    // Determing Total Amount Of Pages
    $total_pages = ceil($total_items / $perpage);
}
// Begin output of the page
$context = $is_bookmark ? 'bookmark' : 'index';
yourls_html_head($context);
yourls_html_logo();
yourls_html_menu();
yourls_do_action('admin_page_before_content');
if (!$is_bookmark) {
    ?>
	<p><?php 
    echo $search_sentence;
    ?>
</p>
	<p><?php 
    printf(yourls__('Display <strong>%1$s</strong> to <strong class="increment">%2$s</strong> of <strong class="increment">%3$s</strong> URLs'), $display_on_page, $max_on_page, $total_items);
    if ($total_items_clicks !== false) {
        echo ", " . sprintf(yourls_n('counting <strong>1</strong> click', 'counting <strong>%s</strong> clicks', $total_items_clicks), yourls_number_format_i18n($total_items_clicks));
    }
    ?>
Example #9
0
    	echo "<pre>";
    	echo "referrers: "; print_r( $referrers );
    	echo "referrer sort: "; print_r( $referrer_sort );
    	echo "direct: $direct\n";
    	echo "notdirect: $notdirect\n";
    	echo "dates: "; print_r( $dates );
    	echo "list of days: "; print_r( $list_of_days );
    	echo "list_of_months: "; print_r( $list_of_months );
    	echo "list_of_years: "; print_r( $list_of_years );
    	echo "last_24h: "; print_r( $last_24h );
    	//echo "countries: "; print_r( $countries );
    
    	die();
    	/**/
}
yourls_html_head('infos', 'Statistics for ' . YOURLS_SITE . '/' . $keyword);
yourls_html_logo();
yourls_html_menu();
?>

<h2 id="informations"><?php 
echo $title;
?>
</h2>

<h3><span class="label">Short URL:</span> <img src="<?php 
echo YOURLS_SITE;
?>
/images/favicon.gif"/>
<?php 
if ($aggregate) {
Example #10
0
<?php

define('YOURLS_ADMIN', true);
define('YOURLS_NO_UPGRADE_CHECK', true);
// Bypass version checking to prevent loop
require_once dirname(dirname(__FILE__)) . '/includes/load-yourls.php';
require_once YOURLS_INC . '/functions-upgrade.php';
require_once YOURLS_INC . '/functions-install.php';
yourls_maybe_require_auth();
yourls_html_head('upgrade', 'Upgrade YOURLS');
yourls_html_logo();
yourls_html_menu();
?>
		<h2>Upgrade YOURLS</h2>
<?php 
// Check if upgrade is needed
if (!yourls_upgrade_is_needed()) {
    echo '<p>Upgrade not required. Go <a href="' . yourls_admin_url('index.php') . '">back to play</a>!</p>';
} else {
    /*
    step 1: create new tables and populate them, update old tables structure, 
    step 2: convert each row of outdated tables if needed
    step 3: - if applicable finish updating outdated tables (indexes etc)
            - update version & db_version in options, this is all done!
    */
    // From what are we upgrading?
    if (isset($_GET['oldver']) && isset($_GET['oldsql'])) {
        $oldver = yourls_sanitize_version($_GET['oldver']);
        $oldsql = yourls_sanitize_version($_GET['oldsql']);
    } else {
        list($oldver, $oldsql) = yourls_get_current_version_from_sql();
Example #11
0
<?php

define('YOURLS_ADMIN', true);
require_once dirname(dirname(__FILE__)) . '/includes/load-yourls.php';
yourls_maybe_require_auth();
yourls_html_head('tools', 'Cool YOURLS Tools');
yourls_html_logo();
yourls_html_menu();
?>

	<div class="sub_wrap">
	
	<h2>Bookmarklets</h2>
	
		<p>YOURLS comes with <span>four</span> handy <span>bookmarklets</span> for easier link shortening.</p>

		<h3>Standard or Instant, Simple or Custom</h3>
		
		<ul>
			<li>The <span>Standard Bookmarklets</span> will take you to a page where you can easily edit or delete your brand new short URL.</li>
			
			<li>The <span>Instant Bookmarklets</span> will pop the short URL without leaving the page you are viewing.</li>
			
			<li>The <span>Simple Bookmarklets</span> will generate a short URL with a random or sequential keyword</li>
			
			<li>The <span>Custom Keyword Bookmarklets</span> will prompt you for a custom keyword first</li>
		</ul>
		
		<p>With the Standard Bookmarklets you will also get a <span>Quick Share</span> tool box to make posting to Twitter, Facebook or Friendfeed a snap. 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>The Bookmarklets</h3>
Example #12
0
    if (yourls_create_htaccess()) {
        $success[] = 'File <tt>.htaccess</tt> successfully created/updated.';
    } else {
        $warning[] = 'Could not write file <tt>.htaccess</tt> in YOURLS root directory. You will have to do it manually. See <a href="http://yourls.org/htaccess">how</a>.';
    }
    // Create SQL tables
    $install = yourls_create_sql_tables();
    if (isset($install['error'])) {
        $error = array_merge($error, $install['error']);
    }
    if (isset($install['success'])) {
        $success = array_merge($success, $install['success']);
    }
}
// Start output
yourls_html_head('install');
?>
<div id="login">
	<form method="post" action="?"><?php 
// reset any QUERY parameters
?>
		<p>
			<img src="<?php 
echo YOURLS_SITE;
?>
/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) {
Example #13
0
<?php

// Make sure we're in YOURLS context
if (!defined('YOURLS_ABSPATH')) {
    // Attempt to guess URL via YOURLS
    $url = 'http://' . $_SERVER['HTTP_HOST'] . str_replace(array('/pages/', '.php'), array('/', ''), $_SERVER['REQUEST_URI']);
    echo "Try this instead: <a href='{$url}'>{$url}</a>";
    die;
}
// Display page content. Any PHP, HTML and YOURLS function can go here.
$url = YOURLS_SITE . '/infos';
yourls_html_head('infos', 'Informationen über YOURLS an der Goethe-Universität');
yourls_html_logo();
?>
<div class="main-column">
	<div class="panel panel-teaser">
		<div class="panel-header">
			<h1>Der Kurz-URL-Dienst an der Goethe-Universität</h1>
		</div>
		<div class="panel-body">
			<?php 
$host = $_SERVER['HTTP_HOST'];
$hostlink = "<a href='{$host}'>{$host}</a>";
?>
			<p>Willkommen beim Kurz-URL-Dienst an der <a href="http://www.uni-frankfurt.de">Goethe-Universität Frankfurt am Main</a>.
			
			<p>Sie erreichen diesen Dienst unter folgenden Adressen:
			<ul>
			<li> <a href="http://tinygu.de">tinygu.de</a> </li>
			<li> <a href="http://goethe.link">goethe.link</a> </li>
			</ul></p>
Example #14
0
    	echo "<pre>";
    	echo "referrers: "; print_r( $referrers );
    	echo "referrer sort: "; print_r( $referrer_sort );
    	echo "direct: $direct\n";
    	echo "notdirect: $notdirect\n";
    	echo "dates: "; print_r( $dates );
    	echo "list of days: "; print_r( $list_of_days );
    	echo "list_of_months: "; print_r( $list_of_months );
    	echo "list_of_years: "; print_r( $list_of_years );
    	echo "last_24h: "; print_r( $last_24h );
    	//echo "countries: "; print_r( $countries );
    
    	die();
    	/**/
}
yourls_html_head('infos');
yourls_html_logo();
yourls_html_menu();
?>

<h2 id="informations">Information</h2>

<h3>Short URL: <img src="<?php 
echo YOURLS_SITE;
?>
/images/favicon.gif"/>
<?php 
if ($aggregate) {
    $i = 0;
    foreach ($keyword_list as $k) {
        $i++;
Example #15
0
<?php

// Require Files
require_once dirname(dirname(__FILE__)) . '/includes/load-yourls.php';
yourls_maybe_require_auth();
yourls_html_head('tools');
?>
	<h1>
		<a href="<?php 
echo YOURLS_SITE;
?>
/admin/index.php" title="YOURLS"><span>YOURLS</span>: <span>Y</span>our <span>O</span>wn <span>URL</span> <span>S</span>hortener<br/>
		<img src="<?php 
echo YOURLS_SITE;
?>
/images/yourls-logo.png" alt="YOURLS" title="YOURLS" style="border: 0px;" /></a>
	</h1>
	<?php 
if (yourls_is_private()) {
    ?>
	<p>Your are logged in as: <strong><?php 
    echo YOURLS_USER;
    ?>
</strong>. <a href="?mode=logout" title="Logout">Logout</a></p>
	<?php 
}
?>

	<div id="tools_desc">

		<h2>Bookmarklet</h2>
Example #16
0
 /**
  * Yourls action auth_successful
  *
  * @return bool
  */
 public function action_auth_successful()
 {
     if (!yourls_is_admin()) {
         return true;
     }
     /**
      * Check page permissions
      */
     if (preg_match('#\\/admin\\/(.*?)\\.php#', $_SERVER['SCRIPT_FILENAME'], $matches)) {
         if (!in_array($matches[1], $this->helperGetAllowedPermissions())) {
             yourls_add_notice(yourls__('Denied access to this page', self::APP_NAMESPACE));
             yourls_html_head('accessdenied', yourls__('Denied access to this page', self::APP_NAMESPACE));
             yourls_html_logo();
             yourls_html_menu();
             yourls_html_footer();
             die;
         }
     }
     /**
      * Check action permissions
      */
     if (yourls_is_Ajax()) {
         $action = $this->getRequest('action');
         $permissions = $this->helperGetAllowedPermissions();
         $bol = false;
         switch ($action) {
             case 'edit_display':
             case 'edit_save':
                 if (!in_array('edit', $permissions['action'])) {
                     $bol = true;
                 }
                 break;
             case 'add':
             case 'delete':
                 if (!in_array($action, $permissions['action'])) {
                     $bol = true;
                 }
                 break;
         }
         if ($bol) {
             $this->setRequest('action_old', $action);
             $this->setRequest('action', 'accessdenied');
         }
     }
 }
Example #17
0
        }
    } else {
        $result = yourls__('No plugin specified, or not a valid plugin');
    }
    yourls_add_notice($result);
}
// Handle message upon succesfull (de)activation
if (isset($_GET['success']) && ($_GET['success'] == 'activated' or $_GET['success'] == 'deactivated')) {
    if ($_GET['success'] == 'activated') {
        $message = yourls__('Plugin has been activated');
    } elseif ($_GET['success'] == 'deactivated') {
        $message = yourls__('Plugin has been deactivated');
    }
    yourls_add_notice($message);
}
yourls_html_head('plugins', yourls__('Manage Plugins'));
yourls_html_logo();
yourls_html_menu();
?>

	<h2><?php 
yourls_e('Plugins');
?>
</h2>
	
	<?php 
$plugins = (array) yourls_get_plugins();
uasort($plugins, 'yourls_plugins_sort_callback');
$count = count($plugins);
$plugins_count = sprintf(yourls_n('%s plugin', '%s plugins', $count), $count);
$count_active = yourls_has_active_plugins();
Example #18
0
/**
 * Handle plugin administration page
 *
 */
function yourls_plugin_admin_page($plugin_page)
{
    global $ydb;
    // Check the plugin page is actually registered
    if (!isset($ydb->plugin_pages[$plugin_page])) {
        yourls_die('This page does not exist. Maybe a plugin you thought was activated is inactive?', 'Invalid link');
    }
    // Draw the page itself
    yourls_do_action('load-' . $plugin_page);
    yourls_html_head('plugin_page_' . $plugin_page, $ydb->plugin_pages[$plugin_page]['title']);
    yourls_html_logo();
    yourls_html_menu();
    call_user_func($ydb->plugin_pages[$plugin_page]['function']);
    yourls_html_footer();
    die;
}
Example #19
0
            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']);
    }
}
yourls_html_head('plugins', 'Manage Plugins');
yourls_html_logo();
yourls_html_menu();
?>

	<h2>Plugins</h2>
	
	<?php 
$plugins = (array) yourls_get_plugins();
$count = count($plugins);
$count_active = yourls_has_active_plugins();
?>
	
	<p id="plugin_summary">You currently have <strong><?php 
echo $count . ' ' . yourls_plural('plugin', $count);
?>
Example #20
0
<?php

define('YOURLS_ADMIN', true);
require_once dirname(dirname(__FILE__)) . '/includes/load-yourls.php';
yourls_maybe_require_auth();
yourls_html_head('tools', yourls__('Cool YOURLS Tools'));
yourls_html_logo();
yourls_html_menu();
?>

	<div class="sub_wrap">
	
	<h2><?php 
yourls_e('Bookmarklets');
?>
</h2>
	
		<p><?php 
yourls_e('YOURLS comes with <span>four</span> handy <span>bookmarklets</span> for easier link shortening.');
?>
</p>

		<h3><?php 
yourls_e('Standard or Instant, Simple or Custom');
?>
</h3>
		
		<ul>
			<li><?php 
yourls_e('The <span>Standard Bookmarklets</span> will take you to a page where you can easily edit or delete your brand new short URL.');
?>
<?php

// Make sure we're in YOURLS context
if (!defined('YOURLS_ABSPATH')) {
    // Attempt to guess URL via YOURLS
    $url = 'http://' . $_SERVER['HTTP_HOST'] . str_replace(array('/pages/', '.php'), array('/', ''), $_SERVER['REQUEST_URI']);
    echo "Try this instead: <a href='{$url}'>{$url}</a>";
    die;
}
// Display page content. Any PHP, HTML and YOURLS function can go here.
$url = YOURLS_SITE . '/erlaubte-domain-liste';
yourls_html_head('erlaubte-domain-liste', 'Informationen über YOURLS an der Goethe-Universität');
yourls_html_logo();
?>
<div class="main-column">
	<div class="panel panel-teaser">
		<div class="panel-header">
			<h1>Liste erlaubter Domains</h1>
		</div>
		<div class="panel-body">
			<p>Folgende Domains werden derzeit zum Kürzen erlaubt:</p>

			<dl class="dl">
				<?php 
global $allowed_domains;
foreach ($allowed_domains as $d) {
    echo "<dt><a href='http://{$d['domain']}' title='Mal ausprobieren, was da kommt'>{$d['domain']}</a></dt><dd>{$d['desc']}</dd>\n";
}
?>
			</dl>
Example #22
0
<?php

// Make sure we're in YOURLS context
if (!defined('YOURLS_ABSPATH')) {
    echo "Try using a URL without the /pages/ part";
    die;
}
// Display page content. Any PHP, HTML and YOURLS function can go here.
$url = YOURLS_SITE . '/examplepage';
yourls_html_head('examplepage', 'Example page');
?>

<p>This is an example page. Its URL is simply <?php 
echo $url;
?>
</p>

<?php 
yourls_html_footer();
Example #23
0
<?php

define('YOURLS_ADMIN', true);
define('YOURLS_UPGRADING', true);
require_once dirname(dirname(__FILE__)) . '/includes/load-yourls.php';
require_once YOURLS_INC . '/functions-upgrade.php';
require_once YOURLS_INC . '/functions-install.php';
if (empty($_POST['softlogin'])) {
    yourls_maybe_require_auth();
}
yourls_html_head('upgrade', yourls__('Upgrade YOURLS'));
yourls_html_logo();
yourls_html_menu();
?>
		<h2><?php 
yourls_e('Upgrade YOURLS');
?>
</h2>
<?php 
// Check if upgrade is needed
if (!yourls_upgrade_is_needed()) {
    echo '<p>' . yourls_s('Upgrade not required. Go <a href="%s">back to play</a>!', yourls_admin_url('index.php')) . '</p>';
} else {
    /*
    step 1: create new tables and populate them, update old tables structure, 
    step 2: convert each row of outdated tables if needed
    step 3: - if applicable finish updating outdated tables (indexes etc)
            - update version & db_version in options, this is all done!
    */
    // From what are we upgrading?
    if (isset($_GET['oldver']) && isset($_GET['oldsql'])) {
Example #24
0
function yourls_login_screen($error_msg = '')
{
    yourls_html_head('login');
    $action = isset($_GET['mode']) && $_GET['mode'] == 'logout' ? '?' : '';
    yourls_html_logo();
    ?>
	<div id="login">
		<form method="post" action="<?php 
    echo $action;
    ?>
"> <?php 
    // reset any QUERY parameters
    ?>
			<?php 
    if (!empty($error_msg)) {
        echo '<p class="error">' . $error_msg . '</p>';
    }
    ?>
			<p>
				<label for="username">Username</label><br />
				<input type="text" id="username" name="username" size="30" class="text" />
			</p>
			<p>
				<label for="password">Password</label><br />
				<input type="password" id="password" name="password" size="30" class="text" />
			</p>
			<p style="text-align: right;">
				<input type="submit" id="submit" name="submit" value="Login" class="button" />
			</p>
		</form>
		<script type="text/javascript">$('#username').focus();</script>
	</div>
	<?php 
    yourls_html_footer();
    die;
}
Example #25
0
    $return = yourls_add_new_link($url, $keyword, $title);
    $shorturl = isset($return['shorturl']) ? $return['shorturl'] : '';
    $message = isset($return['message']) ? $return['message'] : '';
    $title = isset($return['title']) ? $return['title'] : '';
    $status = isset($return['status']) ? $return['status'] : '';
    // Stop here if bookmarklet with a JSON callback function ("instant" bookmarklets)
    if (isset($_GET['jsonp']) && $_GET['jsonp'] == 'yourls') {
        $short = $return['shorturl'] ? $return['shorturl'] : '';
        $message = "Short URL (Ctrl+C to copy)";
        header('Content-type: application/json');
        echo yourls_apply_filter('bookmarklet_jsonp', "yourls_callback({'short_url':'{$short}','message':'{$message}'});");
        die;
    }
}
// Insert <head> markup and all CSS & JS files
yourls_html_head();
// // Display left hand menu
// yourls_html_menu() ;
// Part to be executed if FORM has been submitted
if (isset($_REQUEST['url']) && $_REQUEST['url'] != 'http://') {
    // Display result message of short link creation
    if (isset($message)) {
        echo "<h2>{$message}</h2>";
    }
    if ($status == 'success') {
        // Include the Copy box and the Quick Share box
        yourls_share_box($url, $shorturl, $title, $text);
        // Initialize clipboard -- requires js/share.js and js/jquery.zclip.min.js to be properly loaded in the <head>
        echo "<script>init_clipboard();</script>\n";
    }
    // Part to be executed when no form has been submitted
Example #26
0
    /**
    	echo "<pre>";
    	echo "referrers: "; print_r( $referrers );
    	echo "referrer sort: "; print_r( $referrer_sort );
    	echo "direct: $direct\n";
    	echo "notdirect: $notdirect\n";
    	echo "dates: "; print_r( $dates );
    	echo "list of days: "; print_r( $list_of_days );
    	echo "list_of_months: "; print_r( $list_of_months );
    	echo "list_of_years: "; print_r( $list_of_years );
    	echo "last_24h: "; print_r( $last_24h );
    	echo "countries: "; print_r( $countries );
    	die();
    	/**/
}
yourls_html_head('infos', yourls_s('Statistics for %s', YOURLS_SITE . '/' . $keyword));
yourls_html_logo();
//yourls_html_menu();
?>

<div class="panel panel-teaser">
<div class="panel-header">
	<h2 id="informations"><?php 
echo yourls_esc_html($title);
?>
</h2>
</div>
<div class="panel-body">

<h3><span class="label"><?php 
yourls_e('Short URL');
Example #27
0
<?php

// Make sure we're in YOURLS context
if (!defined('YOURLS_ABSPATH')) {
    // Attempt to guess URL via YOURLS
    $url = 'http://' . $_SERVER['HTTP_HOST'] . str_replace(array('/pages/', '.php'), array('/', ''), $_SERVER['REQUEST_URI']);
    echo "Try this instead: <a href='{$url}'>{$url}</a>";
    die;
}
// Display page content. Any PHP, HTML and YOURLS function can go here.
$url = YOURLS_SITE . '/specs';
yourls_html_head('specs', 'Technische Details zur laufenden YOURLS-Installation');
yourls_html_logo();
?>
<div class="main-column">
	<div class="panel panel-teaser">
		<div class="panel-header">
			<h1>Der Kurz-URL-Dienst an der Goethe-Universität</h1>
			<p>Technische Details</p>
		</div>
		<div class="panel-body">
			Diese Seite ist zur schnellen Übersicht über die technischen Hintergründe, wo diese
			Installation derzeit läuft und welcher Datenbestand genutzt wird. Damit soll auch die
			gemeinsame Entwicklung des KurzURL-Dienstes über Github gestärkt werden.
		</div>
	</div>

	<div class="row">
		<div class="col-md-4">
			<div class="panel panel-box"><div class="panel-body">
				<h3><i class="fa fa-linux"></i> Basics</h3>