1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Unmaintained [XenResource] GoodForNothing Order by Rating Count 1.0.0 Beta 1

Adds a new tab to order resource items by most rated to least.

  1. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

    51463 likes this.
  2. 51463

    51463 Well-Known Member

    Is there any way i can delete the Most Downloaded Tab?

    I tried deleting:

    Code:
    <li class="{xen:if '{$order} == "download_count"', active}"><a href="{xen:link resources, '', '_params={$pageNavParams}', 'order=download_count'}">{xen:phrase most_downloaded}</a></li>

    from
    Code:
    <xen:title>{xen:phrase resources}</xen:title>
    
    <xen:container var="$searchBar.resourceUpdate"><xen:include template="search_bar_resource" /></xen:container>
    <xen:container var="$head.canonical">
        <link rel="canonical" href="{xen:link 'canonical:resources', '', "page={xen:if '{$page} > 1', $page, ''}"}" /></xen:container>
    
    <xen:require css="resource_list.css" />
    
    <xen:if is="{$canAddResource}">
        <xen:topctrl><a href="{xen:link resources/add, '', 'resource_category_id={$category.resource_category_id}'}" class="callToAction OverlayTrigger"><span>{xen:phrase add_resource}</span></a></xen:topctrl>
    </xen:if>
    
    <div class="resourceListBlock">
    
    <div class="resourceListSidebar">
        <div class="secondaryContent categoryList">
            <h3>{xen:phrase categories}</h3>
            <xen:if is="{$categories}">
                <ol>
                <xen:foreach loop="$categories" value="$_category">
                    <li class="{xen:if '{$_category.resource_category_id} == {$selectedCategoryId}', selected}">
                        <a href="{xen:link resources/categories, $_category}" {xen:if $_category.category_description, 'title="{xen:helper striphtml, $_category.category_description}" class="Tooltip" data-tipclass="resourceCategoryTooltip"'}>{$_category.category_title}</a>
                        <span class="count">{xen:number $_category.resource_count}</span>
                    </li>
                </xen:foreach>
                </ol>
            <xen:else />
                <div>{xen:phrase n_a}</div>
            </xen:if>
        </div>
    
        <xen:if is="{$topResources}">
            <div class="secondaryContent miniResourceList">
                <h3><a href="{xen:link resources, '', 'order=rating_weighted'}" class="concealed">{xen:phrase top_resources}</a></h3>
                <xen:include template="resource_list_mini">
                    <xen:map from="$topResources" to="$resources" />
                </xen:include>
            </div>
        </xen:if>
    
        <xen:if is="{$activeAuthors}">
            <div class="secondaryContent avatarList">
                <h3><a href="{xen:link resources/authors}" class="concealed">{xen:phrase most_active_authors}</a></h3>
                <ol>
                <xen:foreach loop="$activeAuthors" value="$author">
                    <li>
                        <xen:avatar user="$author" size="s" img="true" href="{xen:link resources/authors, $author}" class="NoOverlay" />
                        <xen:username user="$author" rich="true" href="{xen:link resources/authors, $author}" class="NoOverlay" />
                        <div class="extraData"><a href="{xen:link resources/authors, $author}">{xen:phrase resources}: {xen:number $author.resource_count}</a></div>
                    </li>
                </xen:foreach>
                </ol>
            </div>
        </xen:if>
    </div>
    
    <div class="resourceListMain">
        <xen:if is="{$featuredResources}">
            <div class="section">
                <h2 class="textHeading">
                    <a class="viewAllFeatured" href="{xen:link resources/featured}">{xen:phrase view_all}</a>
                    {xen:phrase featured_resources}
                </h2>
                <xen:include template="resource_featured_list" />
            </div>
        </xen:if>
    
        <div class="section">
    
        <xen:include template="resource_helper_filters">
            <xen:set var="$linkBase" value="resources" />
            <xen:set var="$linkData" value="" />
        </xen:include>
    
        <div class="resourceHeaders">
            <xen:if is="{$showFilterTabs}">
                <div class="extraLinks">
                    <div class="Popup filterLink JsOnly">
                        <a rel="Menu">{xen:phrase filters}</a>
                        <div class="Menu resourceFilterMenu" id="ResourceFilterMenu"
                            data-contentsrc="{xen:link resources/filter-menu, '', 'params={$pageNavParams}'}"
                            data-contentdest="#ResourceFilterMenu > .primaryContent"
                            data-insertfn="replaceAll"
                        >
                            <div class="primaryContent">{xen:phrase loading}...</div>
                        </div>
                    </div>
                </div>
            </xen:if>
            <ol class="tabs">
                <li class="{xen:if '{$order} == "last_update"', active}"><a href="{xen:link resources, '', '_params={$pageNavParams}', 'order='}">{xen:phrase latest_updates}</a></li>
                <li class="{xen:if '{$order} == "resource_date"', active}"><a href="{xen:link resources, '', '_params={$pageNavParams}', 'order=resource_date'}">{xen:phrase newest_resources}</a></li>
                <li class="{xen:if '{$order} == "rating_weighted"', active}"><a href="{xen:link resources, '', '_params={$pageNavParams}', 'order=rating_weighted'}">{xen:phrase top_resources}</a></li>
                <li class="{xen:if '{$order} == "download_count"', active}"><a href="{xen:link resources, '', '_params={$pageNavParams}', 'order=download_count'}">{xen:phrase most_downloaded}</a></li>
            </ol>
        </div>
    
        <form action="{xen:link resources/inline-mod/switch}" method="post"
            class="InlineModForm"
            data-cookieName="resources"
            data-controls="#InlineModControls"
            data-imodOptions="#ModerationSelect option">
    
            <ol class="resourceList">
            <xen:if is="{$resources}">
                <xen:foreach loop="$resources" value="$resource">
                    <xen:include template="resource_list_item">
                        <xen:set var="$linkPrefixHtml" value="{xen:if $resource.prefix_id, {xen:link resources, '', '_params={$pageNavParams}', 'prefix_id={$resource.prefix_id}'}, ''}" />
                        <xen:set var="$showCategoryTitle">1</xen:set>
                    </xen:include>
                </xen:foreach>
            <xen:else />
                <li class="primaryContent">{xen:phrase there_currently_no_resources_to_display}</li>
            </xen:if>
            </ol>
       
            <div class="pageNavLinkGroup">
                <xen:if is="{$inlineModOptions}"><div class="linkGroup InlineMod SelectionCountContainer"></div></xen:if>
                <div class="linkGroup"{xen:if '!{$ignoredNames}', ' style="display: none"'}><a href="javascript:" class="muted jsOnly DisplayIgnoredContent Tooltip" title="{xen:phrase show_hidden_content_by_x, "names={xen:helper implode, $ignoredNames, ', '}"}">{xen:phrase show_ignored_content}</a></div>
                <xen:pagenav link="resources" linkparams="{$pageNavParams}" page="{$page}" perpage="{$perPage}" total="{$totalResources}" />
            </div>
    
            <xen:if is="{$inlineModOptions}">
                <xen:include template="inline_mod_controls_resource" />
            </xen:if>
        </form>
        </div>
    </div>
    
    </div>
    
    

    it works but, the problem is it also deletes your "Most Rated" tab as well.. I'm using it as a review so most downloaded isn't needed


    Capture.PNG



    thanks,
     
  3. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

    That's because the template modification searches for the "Most Downloaded" tab and inserts the new tab below it.
    So what you can do is replace the above string with this one:
    Code:
    <li class="{xen:if '{$order} == "rating_count"', active}"><a href="{xen:link resources, '', '_params={$pageNavParams}', 'order=rating_count'}">{xen:phrase most_rated}</a></li>
     
    51463 likes this.
  4. 51463

    51463 Well-Known Member

    oh ya!! i forgot to look at the template modification.

    it works now!! thanks!!
     

Share This Page