markup and all CSS & JS files yourls_html_head(); // Display title $site = trim( YOURLS_SITE, 'http://' ); echo "

$site's URL Shortener

\n"; // Display left hand menu yourls_html_menu() ; // Part to be executed if FORM has been submitted if ( isset( $_REQUEST['url'] ) ) { $url = yourls_sanitize_url( $_REQUEST['url'] ); $keyword = isset( $_REQUEST['keyword'] ) ? yourls_sanitize_keyword( $_REQUEST['keyword'] ): '' ; $title = isset( $_REQUEST['title'] ) ? yourls_sanitize_title( $_REQUEST['title'] ) : '' ; $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'] : ''; // Include the Copy box and the Quick Share box yourls_share_box( $url, $shorturl, $title ); // Initialize clipboard -- requires js/share.js and js/jquery.zclip.min.js to be properly loaded echo << init_clipboard(); JS; // Part to be executed when no form has been submitted } else { $site = YOURLS_SITE; // Display the form echo <<Enter a new URL to shorten

HTML; } // Display bookmarklet hint and link echo <<

Bookmarklet

Bookmark this link (drag to bookmark bar) : Shorten BOOK; // Display page footer yourls_html_footer();