View Single Post
Old 01-16-2017, 05:43 PM   #3
julegner
Junior Member
julegner began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jan 2017
Device: Sony Reader
Kovid, thank you very much. That helped a lot - I was running in a totally wrong direction.

Finally, I found an other way and have a working solution.
This Solution is not good for everyone, because it does not work for all possible formats.

I added three custom columns (calculation from other columns):
Code:
epublinktext {formats:contains(EPUB,EPUB,)}
mobilinktext {formats:contains(MOBI,MOBI,)}
pdflinktext {formats:contains(PDF,PDF,)}
These column show the formatname, but only if the format is available.

Then I put this code into the summary.html instead of the "get"-button:
Code:
<a href="/get/epub/{title} - {authors}_{id}.epub">{#epublinktext}</a>
<a href="/get/mobi/{title} - {authors}_{id}.mobi">{#mobilinktext}</a>
<a href="/get/pdf/{title} - {authors}_{id}.pdf">{#pdflinktext}</a>
There are the downloadlinks for EPUB, MOBI and PDF. Because the "linktext"-fields ae only filled when the format is available, the links are only clickable if the format is available. Otherwise the links are in the html code, but not viewable in the browser.

This is working from the local network and from the internet per reverse proxy.

complete summary.html:
Code:
<div id="summary_{id}" class="summary">
    <div class="left">
        <a href="{get_url}" class="summary_thumb" title="Click to read {title} in $
        <img alt="Cover of {title}" src="{prefix}/get/thumb_90_120/{id}" /></a>
<div>
<a href="/get/epub/{title} - {authors}_{id}.epub">{#epublinktext}</a>
<a href="/get/mobi/{title} - {authors}_{id}.mobi">{#mobilinktext}</a>
<a href="/get/pdf/{title} - {authors}_{id}.pdf">{#pdflinktext}</a>
</div>
    </div>
    <div class="right">
        <div class="stars">
            <strong>{id}</strong>
            <span class="rating_container">{stars}</span>
            <span class="series">{series}</span>
            <a href="#" onclick="show_details(this); return false;" title="{detail$
            <a href="{prefix}/browse/book/{id}" title="{permalink_tt}">{permalink}$
        </div>
        <div class="title"><strong>{title}</strong></div>
        <div class="authors">{authors}</div>
        <strong>Languages:</strong> {languages}
        <div class="tags">{tags}</div>
        <div class="comments">{comments}</div>
    </div>
    <div class="details-href" title="{details_href}" style="display:none"></div>
</div>
julegner is offline   Reply With Quote