Plugin Directory

Changeset 765497


Ignore:
Timestamp:
09/01/2013 09:00:19 PM (13 years ago)
Author:
canitb
Message:

0.9.2.4

  • Added sorting on last uploaded and highest rating on the competition page.
Location:
soundcloud-sound-competition/trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • soundcloud-sound-competition/trunk/Classes/class-remixers.php

    r727715 r765497  
    4141    $public_query_vars[] = 'rmxid';
    4242    $public_query_vars[] = 'voting_rmx';
     43    $public_query_vars[] = 'sortid';
    4344    return $public_query_vars;
    4445}
     
    7677        //echo($session_ip."-".$session."<br>");
    7778       
    78         //Get rmx
     79        //Variables
    7980        $remix_id = urldecode(get_query_var('rmxid'));
    8081        $voting_rmx = urldecode(get_query_var('voting_rmx'));
     82        $sort_id = urldecode(get_query_var('sortid'));
    8183        $remix_db_slug = $atts['type'];
     84       
     85       
     86        if ($sort_id != null) {
     87
     88            if ($sort_id != null && $sort_id == 1) {
     89                $_SESSION['sort'] = "1";
     90            }
     91            else {
     92                $_SESSION['sort'] = "2";
     93            }
     94        }   
     95       
    8296       
    8397        //Hvis voting_rmx så skal låten registreres hvis den ikke har blitt votet før på den brukeren.
     
    135149        //------------------------------------------------------------------------------------------
    136150        if ($remix_id ) {
     151            //Dokumentasjon http://codex.wordpress.org/Function_Reference/add_query_arg
     152            //http://codex.wordpress.org/Function_Reference/get_query_var
     153            //http://wordpress.stackexchange.com/questions/31821/pretty-url-with-add-query-var
    137154            $base_url = $the_url;
    138155            $base_url_voting = $the_url; 
    139156            $base_url_remixers = $the_url;    //Getting current url
    140157            $params3 = array( 'rmxid' );
    141             $params4 = array( 'voting_rmx' );
     158            $params4 = array( 'voting_rmx' );
     159            //$params5 = array( 'sortid' );
    142160            $base_url_voting = remove_query_arg( $params3, $base_url_voting );
    143             $base_url_remixers = remove_query_arg( $params4, $base_url_remixers ); 
     161            $base_url_remixers = remove_query_arg( $params4, $base_url_remixers );
     162            //$base_url_sortid = remove_query_arg( $params5, $base_url_sortid ); 
    144163            $base_url = remove_query_arg( $params3, $base_url );
    145             $base_url = remove_query_arg( $params4, $base_url ); 
     164            $base_url = remove_query_arg( $params4, $base_url );
     165            //$base_url = remove_query_arg( $params5, $base_url ); 
    146166            /***************************************************************************************
    147167                                            LIST ONE
     
    176196            }//end if sql res
    177197               
    178         echo("<a href='".$base_url."'><h2>All entrees</h2></a><br>");
     198        echo("<a href='".$base_url."'><h2>All entrees</h2></a>");     
    179199       
    180200        }//End if remix_id
    181201       
     202        //echo("<a href='".add_query_arg( array( 'sortid' => 1 ), $base_url )."'>Latest uploads</a> "."<a href='".add_query_arg( array( 'sortid' => 2 ), $base_url )."'>Highest rated</a><br>");
     203        _e("<div style=\"float:right;\"><a id=\"ken_latest\" href='".add_query_arg( array( 'sortid' => 1 ), $base_url )."'>Latest uploads</a> <a id=\"ken_rated\" href='".add_query_arg( array( 'sortid' => 2 ), $base_url )."'>Highest rated</a></div><div id=\"clear\">");
    182204       
    183205        /***************************************************************************************
    184206                                        LIST ALL
    185207        ****************************************************************************************/
    186        
     208        //Sort
     209        if ($_SESSION['sort'] == 1) {
     210            $sort_query = "ORDER BY rce_id DESC";
     211        }
     212        else {
     213            $sort_query = "ORDER BY rce_vote_count DESC";
     214        }
     215           
    187216    // This query selects all contracts that are published
    188     $sql = "
    189             SELECT * FROM ".$wpdb->prefix."ken_remixcomp_entrees
     217    $sql = "SELECT * FROM ".$wpdb->prefix."ken_remixcomp_entrees
    190218            JOIN ".$wpdb->prefix."ken_remixcomp_users ON rcu_id = rce_rcu_id
    191             WHERE rce_remix='".$remix_db_slug."';";
    192     $results = $wpdb->get_results($sql);  // Run our query, getting results as an object
     219            WHERE rce_remix='".$remix_db_slug."' ".$sort_query.";";
     220       
     221        $results = $wpdb->get_results($sql);  // Run our query, getting results as an object
    193222
    194223        if (!empty($results)) {                 // If the query returned something
  • soundcloud-sound-competition/trunk/css/style.css

    r727715 r765497  
    2727}
    2828
     29#ken_latest {
     30margin-bottom: 5px;
     31background: url(../images/button-latest.png) no-repeat 0 0;
     32height: 21px;
     33width: 89px;
     34display: inline-block;
     35text-indent: -9999px;
     36opacity: 0.6;
     37}
     38#ken_latest:hover {
     39opacity: 1;
     40}
     41#ken_rated {
     42margin-bottom: 5px;
     43background: url(../images/button-rating.png) no-repeat 0 0;
     44height: 21px;
     45width: 90px;
     46display: inline-block;
     47text-indent: -9999px;
     48opacity: 0.6;
     49}
     50#ken_rated:hover {
     51opacity: 1;
     52}
     53
    2954#ken_upload {
    3055margin-bottom: 5px;
     
    139164top:0;
    140165right:0;
    141 width: 50px;
     166width: 55px;
    142167text-align: right;
    143168border: 0px solid #000;
  • soundcloud-sound-competition/trunk/readme.txt

    r731803 r765497  
    44Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=U7ZQC4QH7MVP2
    55Requires at least: 3.0
    6 Tested up to: 3.5
    7 Stable tag: 0.9.2.3
     6Tested up to: 3.6
     7Stable tag: 0.9.2.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9999== Changelog ==
    100100
     101= 0.9.2.4 =
     102* Added sorting on last uploaded and highest rating on the competition page.
     103
    101104= 0.9.2.3 =
    102105* Updated to new Soundcloud API.
  • soundcloud-sound-competition/trunk/soundcloud-sound-competition.php

    r729381 r765497  
    44Plugin URI: http://webhjelpen.no/wordpress-plugin/soundcloud-sound-competition/
    55Description: Host your own Sound Contest integrated with SoundCloud, users connect easy with SoundCloud to choose track to add to your competition. Everything within your WordPress web site.
    6 Version: 0.9.2.3
     6Version: 0.9.2.4
    77Author: Kenneth Berentzen
    88Author URI: http://webhjelpen.no/wordpress-plugin
Note: See TracChangeset for help on using the changeset viewer.