inherit
speedbbb@aol.com
199078
0
Oct 2, 2024 13:51:27 GMT -8
branjita
118
August 2013
branjita
|
Post by branjita on Aug 29, 2013 16:14:15 GMT -8
Hi guys, I need some help. I'm fluent in HTML and CSS, and can understand/read but not write jQuery/JavaScript from scratch.
Here's what I am trying to do to my V5 board:
I have my forum set up to display 20 posts per page, which is fantastic for the entire forum... except for one board that is in its own category. This board is for custom action figures, and people (including myself) tend to post about 10 pictures per post in this category to show their finished work. This is problematic as far as bandwidth concerns go with image hosting, because I currently have at least 200 pics per page on several pages where I was transferring over my pictures one post at a time to my new forum. I'd like to limit the posts in this category OR board to 10 posts per page, that way it won't be such a long load time or bandwidth killer.
So my questions for you guys are...
1) Where can I put the code? In the Forum Wrapper? Advanced Styles & CSS? Build a plugin as JS?
2) What code do I need to create or modify? I don't have a clue. I'm not entirely sure what it needs to target either, or how to target it, but that's mostly because I don't know where the existing code is that makes my forum have 20 posts per page or what this existing code might look like.
|
|
inherit
speedbbb@aol.com
199078
0
Oct 2, 2024 13:51:27 GMT -8
branjita
118
August 2013
branjita
|
Post by branjita on Aug 29, 2013 17:18:24 GMT -8
I just browsed through all of the "Layout Templates" in the Admin section and I don't see any mention of what I believe to be the code controlling this (part of line 18 if you View Source on a thread page of your forum):
['lm_total',"20"],['lm_limit',"20"],['lm_page',1]
|
|
inherit
194160
0
Mar 23, 2015 9:54:45 GMT -8
blc
2,641
May 2013
blc
|
Post by blc on Aug 29, 2013 20:26:27 GMT -8
I am interested in this very thing, but for another reason.
I have my site set up to show 30 posts per page, but when people start a thread for music and videos, it really slows the page load down for that page and I would like to be able to make a category/board/forum that only has 5 posts per page.
|
|
inherit
The Great Cinnamon Roll
191518
0
Oct 19, 2016 22:17:44 GMT -8
David Clark
Care for some tai chi with your chai tea?
17,602
March 2013
davidlinc1
|
Post by David Clark on Aug 30, 2013 9:08:09 GMT -8
Unfortunately the post-per-page setting is hard coded into the admin panel, and layout templates have no bearing whatsoever on it, so it wouldn't be possible to customize it per-category with an easy variable modification.
You'd have to request this one on the Plugins board.
|
|
inherit
194160
0
Mar 23, 2015 9:54:45 GMT -8
blc
2,641
May 2013
blc
|
Post by blc on Aug 30, 2013 15:31:58 GMT -8
Unfortunately the post-per-page setting is hard coded into the admin panel, and layout templates have no bearing whatsoever on it, so it wouldn't be possible to customize it per-category with an easy variable modification. You'd have to request this one on the Plugins board. Thanks David. I wasn't sure what was the best way to accomplish this. Thanks for pointing us in the right direction. David, is it possible for you to move this thread to the proper area?
|
|
inherit
The Great Cinnamon Roll
191518
0
Oct 19, 2016 22:17:44 GMT -8
David Clark
Care for some tai chi with your chai tea?
17,602
March 2013
davidlinc1
|
Post by David Clark on Aug 30, 2013 15:39:09 GMT -8
Done.
|
|
inherit
194160
0
Mar 23, 2015 9:54:45 GMT -8
blc
2,641
May 2013
blc
|
Post by blc on Aug 30, 2013 15:49:07 GMT -8
Thank you very much! It saves us from having to repost the material.
|
|
inherit
speedbbb@aol.com
199078
0
Oct 2, 2024 13:51:27 GMT -8
branjita
118
August 2013
branjita
|
Post by branjita on Aug 31, 2013 9:42:21 GMT -8
Great, hopefully someone will share how this can be done! I like copy and pasting code much more than I do installing others' plugins in which I can't learn how something is functioning.
|
|
inherit
speedbbb@aol.com
199078
0
Oct 2, 2024 13:51:27 GMT -8
branjita
118
August 2013
branjita
|
Post by branjita on Aug 31, 2013 9:52:59 GMT -8
I did just now verify that, for example: ['lm_total',"51"],['lm_limit',"20"],['lm_page',1],['lm_data',{"thread_id":"55"}] the lm_limit is the number of posts per page. In the example above, 51 is how many posts were in this specific thread, the page is what page I had opened of the thread, and the thread id is just the thread id of what topic I had open. This example is clearer than the example I used previously, because it had only 20 posts coincidentally in the thread. So whatever code can accomplish this, needs to target the lm_limit (as far as I can tell) for a specified board #. In my case, it needs to be applied to www.urlofproboards.net/board/7/name-of-section And by targeting that, you can hopefully specify 5, 10, 15, 20, 25, 30, 35, 40 posts per page for a specific board(s).
|
|
inherit
194160
0
Mar 23, 2015 9:54:45 GMT -8
blc
2,641
May 2013
blc
|
Post by blc on Aug 31, 2013 10:14:25 GMT -8
Great, hopefully someone will share how this can be done! I like copy and pasting code much more than I do installing others' plugins in which I can't learn how something is functioning. I'm a little intimidated about messing with code, but if its simple enough I can do it. lol
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Sept 1, 2013 0:55:25 GMT -8
I did just now verify that, for example: ['lm_total',"51"],['lm_limit',"20"],['lm_page',1],['lm_data',{"thread_id":"55"}] the lm_limit is the number of posts per page. In the example above, 51 is how many posts were in this specific thread, the page is what page I had opened of the thread, and the thread id is just the thread id of what topic I had open. This example is clearer than the example I used previously, because it had only 20 posts coincidentally in the thread. So whatever code can accomplish this, needs to target the lm_limit (as far as I can tell) for a specified board #. In my case, it needs to be applied to www.urlofproboards.net/board/7/name-of-section And by targeting that, you can hopefully specify 5, 10, 15, 20, 25, 30, 35, 40 posts per page for a specific board(s). If you think of those delicious tidbits of data you found as Nutritional facts on a cereal box you'll get a better idea of just how useful they are to what you're trying to accomplish. Pretty much like those Recommended Daily Allowance values on that cereal box, they have already been determined at the factory, by the time that forum page hits your browser the amount of posts that is sprinkled on the page has already determined at the server, and that data is merely informational. Javascript works on the page after the browser receives it and begins parsing, so on a purely image count basis there's a small window (no pun intended) when images are downloading that a code could interrupt such downloads but it is not consistent across browsers since they differ on what point they decide to allow DOM access. It is not impossible that a plugin could use some creative caching (similar to how the sub-sub-board code in V4 operated) to prune down the posts per page count but keep in mind it will be after the fact so the stated reason of a performance speedup would be negligible. Your better alternative (performance-wise) would be to attack the problem further upstream perhaps with a browser addon or built-in browser setting (most modern browsers now have outright image blocking or perhaps click-to-view as either a page or accessibility option) and at that level the image requests don't even get sent while at the javascript level it is more of a whack-a-mole approach.
|
|
inherit
speedbbb@aol.com
199078
0
Oct 2, 2024 13:51:27 GMT -8
branjita
118
August 2013
branjita
|
Post by branjita on Sept 2, 2013 13:36:35 GMT -8
It wouldn't be possible to use onload or some other function of JavaScript before the document has finished loading? I'm a JS newbie, but it seems like it'd be possible, but I may we wrong. Can you tell me what sort of code is loading/determining the number of posts from the server in the first place?
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Sept 2, 2013 15:59:16 GMT -8
It wouldn't be possible to use onload or some other function of JavaScript before the document has finished loading? I'm a JS newbie, but it seems like it'd be possible, but I may we wrong. on a purely image count basis there's a small window (no pun intended) when images are downloading that a code could interrupt such downloads but it is not consistent across browsers since they differ on what point they decide to allow DOM access. ...at the javascript level it is more of a whack-a-mole approach I didn't say it was not possible, that was the reason I italicized the words "not impossible" but the expectations given for wanting such a code would mean the code would be viewed as a complete failure. Using the cereal box analogy again, if it was discovered that thumbtacks were maliciously added to the ingredients of a batch of cereal that had already left the factory, it would be better to intercept the shipment at the regional distributor or at a private company's warehouse or even off the shelf at their retail store but kicking in the door and yelling "stop chewing!" at a family huddled around a table having breakfast means you'll undoubtedly miss a few thumbtacks. When the browser is already chewing on the data that is the breakfast table scenario. The further up the pipeline you attack the problem the better your success rate. An addon or browser setting could intercept an image request even before it is processed meaning no request is even sent back to the server. Javascript on the other hand can only wait for the image tag to be parsed then a request is queued if no free connection slot exists then ultimately a request is sent off and then wait for an answer then as you suggest setup an onload which fires once the image finishes downloading then finally abort (the only time it would be saving is the time it takes the browser to render the image). Another approach that might look more promising on the surface is setting the SRC to an empty string (or an insignificant sized image if empty string is rejected as invalid) but the problem there is the HTTP protocol makes no provisions for aborting a transfer so a second transfer would be started in parallel with the one already going. A browser could opt to break the connection but none that I know will do so while a transfer is in progress. Some browsers such as Firefox will abort if the image is still waiting in queue (not actively transferring) but others won't even do that much (e.g Chrome). On servers that accept byte-range requests this approach becomes workable if the browser makes use of that byte range feature to request chunks rather than entire files since they simply don't need to request the next chunk if aborted. If your focus is with the communication between the client (browser) and the server then simply put, javascript is a poor tool for what you're looking to accomplish. Can you tell me what sort of code is loading/determining the number of posts from the server in the first place? That's something an admin would have to address but as a general rule they neither confirm or deny any conjectures regarding oprations on the server side
|
|
inherit
speedbbb@aol.com
199078
0
Oct 2, 2024 13:51:27 GMT -8
branjita
118
August 2013
branjita
|
Post by branjita on Sept 3, 2013 10:47:45 GMT -8
I understand what you're saying; that's a good analogy. I think you're onto something different from what I'm requesting however. What I'd like to have (using cereal as an analogy) is have 20 cereal boxes per shelf on my entire forum, EXCEPT, on one shelf, I want only 10 cereal boxes, because these boxes tend to have more prizes/toys inside them, so each box on this specific shelf are a lot bigger. [/analogy] So I want 20 posts per page on my entire forum (already have that), but on one board, I want only 10 posts per page. The content of the posts is not important to my concerns. I just want the server on this one board that is a part of my forum to serve up 10 posts per page instead of 20. I'm sure it's possible with whatever language is serving up the posts in the first place, but I don't have a clue how. I know this isn't possible with CSS, but just using it as an example, it'd be like: .board { posts:20; } .board .limittoten { posts:10; } So whatever code needs to be modified, (and I believe you'd agree with this) would need to either override the code telling it 20 immediately, or it needs to overwrite it before it has time to load. In other words, it'd be stupid and not work effectively if 20 posts loaded (or starting loading), and then the code I am wanting created came in later in the DOM structure and said "10 posts" and sent the other ten away. That'd be ridiculous, and I think you're saying that and I agree. I don't know server side languages or how any of that works, so I know it's outside my realm of expertise.
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Sept 3, 2013 16:04:03 GMT -8
I understand what you're saying; that's a good analogy. I think you're onto something different from what I'm requesting however. What I'd like to have (using cereal as an analogy) is have 20 cereal boxes per shelf on my entire forum, EXCEPT, on one shelf, I want only 10 cereal boxes, because these boxes tend to have more prizes/toys inside them, so each box on this specific shelf are a lot bigger. [/analogy] So I want 20 posts per page on my entire forum (already have that), but on one board, I want only 10 posts per page. The content of the posts is not important to my concerns. I just want the server on this one board that is a part of my forum to serve up 10 posts per page instead of 20. That part is crystal clear, the stated goal of the request is not at issue here I'm sure it's possible with whatever language is serving up the posts in the first place, but I don't have a clue how. I know this isn't possible with CSS, but just using it as an example, it'd be like: .board { posts:20; } .board .limittoten { posts:10; } So whatever code needs to be modified, (and I believe you'd agree with this) would need to either override the code telling it 20 immediately, or it needs to overwrite it before it has time to load. In other words, it'd be stupid and not work effectively if 20 posts loaded (or starting loading), and then the code I am wanting created came in later in the DOM structure and said "10 posts" and sent the other ten away. That'd be ridiculous, and I think you're saying that and I agree. I don't know server side languages or how any of that works, so I know it's outside my realm of expertise. You have the right idea of wanting to attack it further up the pipeline, ideally on the server side before it even gets sent out to the browser but here is the problem, processes that execute on the server are not and have never been subject to any influence except through admin panel forum settings, it is simply not accessible to anyone not an employee of the company. Any code you write/run for Proboards executes on the client side not the server side. Things the Wizard of Oz does behind the curtain are neither confirmed or denied. A plugin runs within the browser so the statements I made earlier regarding browser codes means a plugin request would not be feasible. It could be done if all you were interested in is the final result rather than any performance gains but both people who posted in this request thread held performance as THE major reason for requesting. Your best bet would be a feature request instead since, if accepted, that would influence coding on the server side which is where something like that needs to be handled. Barring acceptance of such a request then a request to resurrect the V4 profile option of disabling images perhaps on a board by board basis could also work. and if that fails then the original suggestion of a browser addon means you'll still be upstream but using something within your control.
|
|