Skip to content

Commit

Permalink
fix broken voteURLs && use nice Templates for voteURLs
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3247 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
allo committed Jan 18, 2007
1 parent fbe7815 commit 979656f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions htroot/Surftips.html
Expand Up @@ -38,8 +38,8 @@ <h2 class="yacy">Surftips</h2>
<img src="/env/grafics/empty.gif" title="" alt="" class="recommendIcon" />
<img src="/env/grafics/empty.gif" title="" alt="" class="deleteIcon" />
::
<a href="#[positiveVoteLink]#" title="positive vote" class="recommendlink" onclick="this.href=pcomment('#[positiveVoteLink]#')"><img src="/env/grafics/empty.gif" title="positive vote" alt="Give positive vote" class="recommendIcon" /></a>
<a href="#[negativeVoteLink]#" title="negative vote" class="deletelink" ><img src="/env/grafics/empty.gif" title="negative vote" alt="Give negative vote" class="deleteIcon" /></a>
<a href="/Surftips.html?votePositive=#[urlhash]#&amp;refid=#[refid]#&amp;url=#[url]#&amp;title=#[title]#&description=#[description]#&amp;display=#[display]##(showScore)#::&amp;score=true#(/showScore)#" title="positive vote" class="recommendlink" onclick="pcomment(this.href);void(0);"><img src="/env/grafics/empty.gif" title="positive vote" alt="Give positive vote" class="recommendIcon" /></a>
<a href="/Surftips.html?voteNegative=#[urlhash]#&amp;refid=#[refid]#&amp;display=#[display]##(showScore)#::&amp;score=true#(/showScore)#" title="negative vote" class="deletelink" ><img src="/env/grafics/empty.gif" title="negative vote" alt="Give negative vote" class="deleteIcon" /></a>
#(/recommend)#
</div>
#(/authorized)#
Expand Down
11 changes: 9 additions & 2 deletions htroot/Surftips.java
Expand Up @@ -139,8 +139,15 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
}
prop.put("surftips_results_" + i + "_authorized", (authenticated) ? 1 : 0);
prop.put("surftips_results_" + i + "_authorized_recommend", (voted) ? 0 : 1);
prop.put("surftips_results_" + i + "_authorized_recommend_negativeVoteLink", "/Surftips.html?voteNegative=" + urlhash + "&amp;refid=" + refid + "&amp,display=" + display + ((showScore) ? "&amp;score=" : "")); // for negaive votes, we don't send around the bad url again, the hash is enough
prop.put("surftips_results_" + i + "_authorized_recommend_positiveVoteLink", "/Surftips.html?votePositive=" + urlhash + "&amp;refid=" + refid + "&amp;url=" + crypt.simpleEncode(url,null,'b') + "&amp;title=" + crypt.simpleEncode(title,null,'b') + "&amp;description=" + crypt.simpleEncode(description,null,'b') + "&amp;display=" + display + ((showScore) ? "&amp;score=" : ""));

prop.put("surftips_results_" + i + "_authorized_recommend_urlhash", urlhash);
prop.put("surftips_results_" + i + "_authorized_recommend_refid", refid);
prop.putASIS("surftips_results_" + i + "_authorized_recommend_url", crypt.simpleEncode(url, null, 'b'));
prop.putASIS("surftips_results_" + i + "_authorized_recommend_title", crypt.simpleEncode(title, null, 'b'));
prop.putASIS("surftips_results_" + i + "_authorized_recommend_description", crypt.simpleEncode(description, null, 'b'));
prop.put("surftips_results_" + i + "_authorized_recommend_display", display);
prop.put("surftips_results_" + i + "_authorized_recommend_showScore", (showScore ? 1 : 0));

prop.put("surftips_results_" + i + "_authorized_urlhash", urlhash);
prop.put("surftips_results_" + i + "_url", de.anomic.data.wikiCode.replaceXMLEntities(url));
prop.put("surftips_results_" + i + "_urlname", nxTools.shortenURLString(url, 60));
Expand Down

0 comments on commit 979656f

Please sign in to comment.