' : '<' ); $where = " AND clicks $link_moreless $link_limit"; } else { $link_filter = ''; } $date_filter = 'before'; $date_first = $date_second = ''; $base_page = yourls_admin_url( 'index.php' ); // Searching if( !empty($search) && !empty($_GET['s_in']) ) { switch($_GET['s_in']) { case 'keyword': $search_in_text = 'Short URL'; $search_in_sql = 'keyword'; break; case 'url': $search_in_text = 'URL'; $search_in_sql = 'url'; break; case 'title': $search_in_text = 'Title'; $search_in_sql = 'title'; break; case 'ip': $search_in_text = 'IP Address'; $search_in_sql = 'ip'; break; } $search_text = stripslashes($search); $search_display = "Searching for $search_text in $search_in_text. "; $search_url = "&s_search=$search_text &s_in=$search_in_sql"; $search = str_replace('*', '%', '*'.$search.'*'); $where .= " AND `$search_in_sql` LIKE ('$search')"; } // Time span if( !empty($_GET['date_filter']) ) { switch($_GET['date_filter']) { case 'before': $date_filter = 'before'; if( yourls_sanitize_date( $_GET['date_first'] ) ) { $date_first_sql = yourls_sanitize_date_for_sql( $_GET['date_first'] ); $where .= " AND `timestamp` < '$date_first_sql'"; $date_first = $_GET['date_first']; } break; case 'after': $date_filter = 'after'; if( yourls_sanitize_date( $_GET['date_first'] ) ) { $date_first_sql = yourls_sanitize_date_for_sql( $_GET['date_first'] ); $where .= " AND `timestamp` > '$date_first_sql'"; $date_first = $_GET['date_first']; } break; case 'between': $date_filter = 'between'; if( yourls_sanitize_date( $_GET['date_first'] ) && yourls_sanitize_date( $_GET['date_second'] ) ) { $date_first_sql = yourls_sanitize_date_for_sql( $_GET['date_first'] ); $date_second_sql = yourls_sanitize_date_for_sql( $_GET['date_second'] ); $where .= " AND `timestamp` BETWEEN '$date_first_sql' AND '$date_second_sql'"; $date_first = $_GET['date_first']; $date_second = $_GET['date_second']; } break; } } // Sorting if( !empty($_GET['s_by']) || !empty($_GET['s_order']) ) { switch($_GET['s_by']) { case 'keyword': $sort_by_text = 'Short URL'; $sort_by_sql = 'keyword'; break; case 'url': $sort_by_text = 'URL'; $sort_by_sql = 'url'; break; case 'timestamp': $sort_by_text = 'Date'; $sort_by_sql = 'timestamp'; break; case 'ip': $sort_by_text = 'IP Address'; $sort_by_sql = 'ip'; break; case 'clicks': $sort_by_text = 'Clicks'; $sort_by_sql = 'clicks'; break; } switch($_GET['s_order']) { case 'asc': $sort_order_text = 'Ascending Order'; $sort_order_sql = 'asc'; break; case 'desc': $sort_order_text = 'Descending Order'; $sort_order_sql = 'desc'; break; } } // Get URLs Count for current filter, total links in DB & total clicks list( $total_urls, $total_clicks ) = array_values( yourls_get_db_stats() ); if ( $where ) { list( $total_items, $total_items_clicks ) = array_values( yourls_get_db_stats( $where ) ); } else { $total_items = $total_urls; $total_items_clicks = false; } // This is a bookmarklet if ( isset( $_GET['u'] ) ) { $is_bookmark = true; yourls_do_action( 'bookmarklet' ); $url = yourls_sanitize_url( $_GET['u'] ); $keyword = ( isset( $_GET['k'] ) ? yourls_sanitize_keyword( $_GET['k'] ) : '' ); $title = ( isset( $_GET['t'] ) ? yourls_sanitize_title( $_GET['t'] ) : '' ); $return = yourls_add_new_link( $url, $keyword, $title ); // If fails because keyword already exist, retry with no keyword if ( isset( $return['status'] ) && $return['status'] == 'fail' && isset( $return['code'] ) && $return['code'] == 'error:keyword' ) { $msg = $return['message']; $return = yourls_add_new_link( $url, '', $ydb ); $return['message'] .= ' ('.$msg.')'; } // Stop here if bookmarklet with a JSON callback function if( isset( $_GET['jsonp'] ) && $_GET['jsonp'] == 'yourls' ) { $short = $return['shorturl'] ? $return['shorturl'] : ''; $message = $return['message']; header('Content-type: application/json'); echo yourls_apply_filter( 'bookmarklet_jsonp', "yourls_callback({'short_url':'$short','message':'$message'});" ); die(); } $s_url = stripslashes( $url ); $where = " AND `url` LIKE '$s_url' "; $page = $total_pages = $perpage = 1; $offset = 0; $text = ( isset( $_GET['s'] ) ? stripslashes( $_GET['s'] ) : '' ); // This is not a bookmarklet } else { $is_bookmark = false; // Checking $page, $offset, $perpage if(empty($page) || $page == 0) { $page = 1; } if(empty($offset)) { $offset = 0; } if(empty($perpage) || $perpage == 0) { $perpage = 50; } // Determine $offset $offset = ($page-1) * $perpage; // Determine Max Number Of Items To Display On Page if(($offset + $perpage) > $total_items) { $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() ; if ( !$is_bookmark ) { ?>
Display to of URLs$total_items_clicks " . yourls_plural('click', $total_items_clicks) ?>.
Overall, tracking links, clicks, and counting!
Your short link', '