Code to display number of comic pages?

Can't find the answer to your question in the Knowledge Base? Post it here and we'll answer it as quickly as possible.

Moderator: Help Desk Team

Forum rules
About
This board is designated for Smack Jeeves related support. If you have a question about using the site or the forums, you've come to the right place.

Before Posting
Please browse/search the Knowledge Base & FAQs Forum for the answer to your problem before posting. It contains an extremely helpful, organized list of common help topics.

Got a Bug?
Post it in Bugs & Glitches, not here.

Rules

    1) Use descriptive titles for your threads. Example: "How do I upload comics?" Do not use vague titles like, "question," "HELP! ANYBODY??"

    2) Describe your problem in detail. Explain exactly what is wrong. Post images, screen shots, links, code snippets - whatever is relevant. The better the information you provide, the better the solution you will receive.

    3) One question per thread. Do not post multiple questions in one thread; that way, we can resolve questions individually. Make a new thread for each question you have, unless your questions are closely related.

    4) Be polite. The more polite you are, the more people will want to help you. Be patient, and we will help you find the solution to your problem.

If your question has been resolved, please say so. A thank you would also be nice. If your question has NOT been answered, say so in the original topic. If your topic has been moved to resolved, you may then AND ONLY THEN post a new topic regarding the same issue.

Code to display number of comic pages?

Postby Pan-Mingshu » January 10th, 2017, 8:33 am

I'd like to add a dynamic code to my site to display the number of pages available to Patrons, so that I don't have to keep going back into the page editor and changing it every time I queue a new page.

I only have a rudimentary understanding of Javascript at best, and I'm wondering if anybody could come up with something streamlined (retrieve/return number of actual pages, as opposed to number of visible pages or something like that?)
Image
User avatar
Pan-Mingshu
 
Posts: 9
Joined: January 9th, 2009, 5:14 am

Re: Code to display number of comic pages?

Postby Admin » January 10th, 2017, 8:49 am

Could you give me an example of the text you want to display?

On a side note, I noticed in your page layout you don't actually display the page title of the current comic page - I find that a little confusing from a reader's perspective. Is that intentional?
User avatar
Admin
Site Admin
 
Posts: 1217
Joined: August 17th, 2005, 11:10 pm

Re: Code to display number of comic pages?

Postby Pan-Mingshu » January 10th, 2017, 5:14 pm

In my author's comments I've included a signature that says "$5 patrons are up to page 13" but at the moment, "13" is an actual number in the HTML. I'd like it if I could include a bit of code to make that number change depending on the amount of actual pages I've uploaded to SJ. So for example, when I've posted/queued a total of 55 pages to SJ, the signature will say "$5 patrons are up to page 55" without me having to go back into the page editor to change it manually.

Regarding the page titles, my pages are just named [chapter number] : [page number], so I removed the display code from the comic page HTML in favour of just showing the post time and date. Would it be more reader-friendly to display it anyway, for the sake of clarity?
Image
User avatar
Pan-Mingshu
 
Posts: 9
Joined: January 9th, 2009, 5:14 am

Re: Code to display number of comic pages?

Postby eishiya » January 10th, 2017, 5:34 pm

I think including the page number is more reader-friendly, since it makes it easier for people to know where they are, so that they know where to resume next time they come back - especially useful for those readers who don't check every update.
I also use very basic page naming (1.01, 1.02, and so on) and I also don't display the title anywhere on the site, and I think that's a bad decision on my part - an oversight while I was designing my template, I didn't leave a nice spot for it.
Image
User avatar
eishiya
 
Posts: 9021
Joined: December 5th, 2009, 11:17 am

Re: Code to display number of comic pages?

Postby Admin » January 11th, 2017, 8:59 am

Alright. I added a new template variable:

Code: Select all
{PATREON_PAGE_COUNT}


Doesn't seem like a popular request, so I'm not going to list it anywhere in comic management, but if more people end up wanting to use it I'll list it somewhere appropriate.
User avatar
Admin
Site Admin
 
Posts: 1217
Joined: August 17th, 2005, 11:10 pm

Re: Code to display number of comic pages?

Postby eishiya » January 11th, 2017, 9:46 am

Is there any chance of a {PAGE_COUNT} for the pages visible to everyone? I can see that being useful for both people who want to list how many pages ahead patrons are (calculate {PATREON_PAGE_COUNT} - {PAGE_COUNT} in JS), and for gag-a-day strips that take pride in how many pages they have and might want to display that on their website.
Not all that useful/important either, but it seems odd to me to have a counter for Patreon pages, but not for public pages.
Image
User avatar
eishiya
 
Posts: 9021
Joined: December 5th, 2009, 11:17 am

Re: Code to display number of comic pages?

Postby Pan-Mingshu » January 11th, 2017, 8:38 pm

Admin wrote:Alright. I added a new template variable:

Code: Select all
{PATREON_PAGE_COUNT}


Doesn't seem like a popular request, so I'm not going to list it anywhere in comic management, but if more people end up wanting to use it I'll list it somewhere appropriate.


Thank you so much, that was fast! :D
Image
User avatar
Pan-Mingshu
 
Posts: 9
Joined: January 9th, 2009, 5:14 am

Re: Code to display number of comic pages?

Postby Pan-Mingshu » January 17th, 2017, 8:19 pm

I just queued up a new page, but the code doesn't seem to be working. It's still displaying the number "13," even though I have the {PATREON_PAGE_COUNT} switch in the page html.

I've had to change it back to a hard number for now to keep up to date with the queued pages.
Image
User avatar
Pan-Mingshu
 
Posts: 9
Joined: January 9th, 2009, 5:14 am


Return to New Questions

Who is online

Users browsing this forum: wehajl and 3 guests