Changing Highest Rated to Featured

Need help? Post your questions here.

Moderator: moderators

Changing Highest Rated to Featured

Postby jonathanroz » Mon Jan 12, 2009 3:32 pm

I read a post linked below that talked about changing the "Highest Rated" Page to be a "Featured" page.

I looked through the JSP files in the /WEB-INF folder but I am not really certain what to do to complete this.

Can someone help give me guidance on how I would do this? I have never modified a JSP file before, but I am usually pretty good at figuring things out. I cannot even find the reference for that information anywhere in the JSP files.

http://forum.subsonic.org/forum/viewtopic.php?t=1388
jonathanroz
 
Posts: 172
Joined: Thu Dec 18, 2008 8:54 pm
Location: Frisco, TX USA

Postby jonathanroz » Wed Jan 14, 2009 7:06 pm

If anyone has any ideas I would be very appreciative. I understand if you do not want to spend a lot of time going step by step, but if you could point me to even the correct file I might be able to figure it out on my own.

I am running version 3.5 on a Windows box right now BTW if that helps.
jonathanroz
 
Posts: 172
Joined: Thu Dec 18, 2008 8:54 pm
Location: Frisco, TX USA

Postby jonathanroz » Sun Jan 18, 2009 3:07 am

zeekay was nice enough to send me this info so thought I would share. I have tested and this works great for me

You just need to change where it says Rating in the language file to Featured, look in WEB-INF/classes/net/sourceforge/subsonic/i18n/ResourceBundle_en.properties for english. And then replace WEB-INF/rating.jsp with:

Code: Select all
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="iso-8859-1"%>
<%@ include file="include.jsp" %>

<%--
Creates HTML for displaying the rating stars.
PARAMETERS
  path: Album path. May be null if readonly.
  readonly: Whether rating can be changed.
  rating: The rating, an integer from 0 (no rating), through 10 (lowest rating), to 50 (highest rating).
--%>

<c:forEach var="i" begin="1" end="1">

    <sub:url value="setRating.view" var="ratingUrl">
        <sub:param name="path" value="${param.path}"/>
        <sub:param name="action" value="rating"/>
        <sub:param name="rating" value="${i}"/>
    </sub:url>

    <c:choose>
        <c:when test="${param.rating ge i * 10}">
            <spring:theme code="ratingOnImage" var="imageUrl"/>
        </c:when>
        <c:when test="${param.rating ge i*10 - 7 and param.rating le i*10 - 3}">
            <spring:theme code="ratingHalfImage" var="imageUrl"/>
        </c:when>
        <c:otherwise>
            <spring:theme code="ratingOffImage" var="imageUrl"/>
        </c:otherwise>
    </c:choose>

    <c:choose>
        <c:when test="${param.readonly}">
            <img src="${imageUrl}" style="margin-right:-3px" alt="" title="Featured Album"/>
        </c:when>
        <c:otherwise>
            <a href="${ratingUrl}"><img src="${imageUrl}" style="margin-right:-3px" alt="" title="Feature"/></a>
        </c:otherwise>
    </c:choose>

</c:forEach>

<sub:url value="setRating.view" var="clearRatingUrl">
    <sub:param name="path" value="${param.path}"/>
    <sub:param name="action" value="rating"/>
    <sub:param name="rating" value="0"/>
</sub:url>

<c:if test="${not param.readonly}">
    | <a href="${clearRatingUrl}"><img src="<c:url value="/icons/clearRating.png"/>" alt="" title="Remove From Featured" style="margin-left:-3px; margin-right:5px"/></a>
</c:if>
jonathanroz
 
Posts: 172
Joined: Thu Dec 18, 2008 8:54 pm
Location: Frisco, TX USA


Return to Help

Who is online

Users browsing this forum: No registered users and 15 guests