inherit
Official Code Helper
65613
0
1
Jun 17, 2025 4:28:50 GMT -8
Chris
pb.data('is_inevitable',1)
9,187
December 2005
horace
|
Post by Chris on May 12, 2025 20:44:42 GMT -8
The source code is pretty large, but I can surmise that categories are used for organization. Users are assigned individual items regardless of category (as in the quote about items without category still being able to be donated to users, just not showing up in any organizational listing) Someone familiar with the day-to-day usage of the plugin can confirm or refute. Did your answer change regarding my above edit? You can tell me to kindly eat rocks if I'm annoying you. My boyfriend and I are about to take a look at the source code ourselves, though. Wish us luck. That was directed at dustys I mean if you change it for every item in the category. Change all category 2 items to category 3. Can they just move over to 3 and nothing changes to the items people bought? I do, however, retract my previous statement after spotting a bug in the array sort, where it only returns 2 of the possible 3 values, resulting in an inadequate sorting algorithm. The code e = e.sort(function(a, b) { return (a["category_name"] > b["category_name"]) ? 1 : 0 }); Should be... e = e.sort(function(a, b) { return a["category_name"].localeCompare( b["category_name"]) }); ...to return -1 for less than, 0 for equal, and +1 for greater than Finally leading me to the code that builds the shop tabs, which ultimately uses the category ID even if the sort is performed correctly. So yes, the code does use the category ID to build the shop tabs instead of the name, contrary to my previous statement.
|
|
inherit
6871
0
Jun 10, 2024 2:25:35 GMT -8
bigballofyarn
"If you wish to make an apple pie from scratch, you must first invent the universe." -Carl Sagan
8,287
January 2003
bigballofyarn
|
Post by bigballofyarn on May 13, 2025 2:15:03 GMT -8
Chris , My question was regarding what you said to me. "The source code shows that categories are sorted only by name, not ID..." Not what you said to anyone else. I guess I quoted you by accident, thus causing the confusion. Thank you, though. You: "The source code shows that categories are sorted only by name, not ID..." Me: Edit 2: No. If I rename "Machinery" to "Weapons" it stays in its spot and doesn't move to the last category. *Shrugs* Me again: Did your answer change regarding my above edit? You can tell me to kindly eat rocks if I'm annoying you. My boyfriend and I are about to take a look at the source code ourselves, though. Wish us luck. -- Marsupilami hasn't been my forum's banner in over 10 years, but is technically still there under the new one. Funny how that's what you see and how you don't see the banner that occupies the entire box. I guess Marsu does show up when you view my forum in "creative" ways though.  I suppose I'm exactly where I was before. I can only use the rest of R-Z unless I want to rename things again and somehow keep all the sentiments exactly the same. We're good!
|
|
inherit
Official Code Helper
65613
0
1
Jun 17, 2025 4:28:50 GMT -8
Chris
pb.data('is_inevitable',1)
9,187
December 2005
horace
|
Post by Chris on May 13, 2025 2:39:07 GMT -8
I believe the shop is left in an editable state in which case you could have your boyfriend add the following to the global header to redefine the way the tabs get built
<script>
/* redefine create_shop_tabs function to sort and build by category name instead of id */ monetary.shop.create_shop_tabs = function(){ let category_items = this.plugin.settings.categories.sort(function(a, b) { return a["category_name"].localeCompare( b["category_name"]) }); var html = '<div class="ui-tabMenu"><ul class="ui-helper-clearfix">'; var counter = 0;
for(var key of category_items){ var id = parseInt(key.category_id);
if(this.category_lookup[id]){ var klass = (counter == 0)? ' class="ui-active"' : ""; var cat_name = (id == 99)? "Forum Enhancements" : this.category_lookup[id].category_name; var css = (id == 99)? " style='margin-left: 25px'" : "";
html += '<li' + css + klass + ' id="category_tab_' + id + '"><a href="#">' + cat_name + '</a></li>'; counter ++; } }
html += '<li style="float: right"><div class="ui-search" style="padding: 3px 10px 0px 4px;"><input width="90px" style="height: 17px" type="text" class="search-input" maxlength="50" placeholder="' + this.settings.text.search + ' ' + this.settings.text.shop + '..." role="search" accesskey="w" id="search_field"><span style="height: 16px" class="search-filters-button"><span class="icon"><img src="//images.proboards.com/v5/images/icon-search-filters.png"></span></span></div></li>';
html += '<li style="float: right; margin-right: 10px" id="basket_items_tab"><a href="#">' + this.settings.text.basket + ' (0)</a></li>'; html += '<li style="float: right; margin-right: 10px; display: none;" id="search_results_tab"><a href="#">' + this.settings.text.search + ' ' + this.settings.text.results + ' (0)</a></li>';
html += "</ul></div>";
return html; } </script>
I haven't actually ran the code yet but the dry modifications sorts the categories via name then uses that sorted order to build the tabs
|
|
inherit
6871
0
Jun 10, 2024 2:25:35 GMT -8
bigballofyarn
"If you wish to make an apple pie from scratch, you must first invent the universe." -Carl Sagan
8,287
January 2003
bigballofyarn
|
Post by bigballofyarn on May 13, 2025 2:45:22 GMT -8
I can take care of that myself.
5 minutes later.
Jackpot! I have "Weapons" instead of "Machinery" and "Support" instead of "Homages." They are listed correctly in alphabetical order.
Very nice.
|
|
dustys
Junior Member

Posts: 498
inherit
258526
0
Jun 27, 2025 14:20:08 GMT -8
dustys
498
May 2019
dustys
|
Post by dustys on May 13, 2025 2:52:27 GMT -8
Do all of you wrote all your own code and where you learned
I am making a new forum and want the shop
|
|
inherit
6871
0
Jun 10, 2024 2:25:35 GMT -8
bigballofyarn
"If you wish to make an apple pie from scratch, you must first invent the universe." -Carl Sagan
8,287
January 2003
bigballofyarn
|
Post by bigballofyarn on May 13, 2025 2:57:44 GMT -8
dustys, I learned at the library and in school when I was a kid, but that was a long time ago, and I'm not an active or proficient coder. I can code a lot of things myself, but not everything. My boyfriend went to college for game simulation. We're currently working on an RPG with other forum members. Some of my plugins are unique to my forum. The only reason I don't share them is because I probably can't offer tech support for them. I designed them all myself. Whether my boyfriend or I did most of the coding depends on the plugin. The shop can require a lot of maintenance, but works really well "out of the box" too. Don't assume you have to do a lot of coding to use the shop. It can function fine without any coding on your part.
|
|
inherit
Official Code Helper
65613
0
1
Jun 17, 2025 4:28:50 GMT -8
Chris
pb.data('is_inevitable',1)
9,187
December 2005
horace
|
Post by Chris on May 13, 2025 19:52:56 GMT -8
😀  
|
|
inherit
6871
0
Jun 10, 2024 2:25:35 GMT -8
bigballofyarn
"If you wish to make an apple pie from scratch, you must first invent the universe." -Carl Sagan
8,287
January 2003
bigballofyarn
|
Post by bigballofyarn on May 14, 2025 2:50:39 GMT -8
|
|
dustys
Junior Member

Posts: 498
inherit
258526
0
Jun 27, 2025 14:20:08 GMT -8
dustys
498
May 2019
dustys
|
Post by dustys on May 14, 2025 3:07:48 GMT -8
I didn't make it yet My dad and me are starting over in a new forum What happens if someone steals your shop items
|
|
inherit
6871
0
Jun 10, 2024 2:25:35 GMT -8
bigballofyarn
"If you wish to make an apple pie from scratch, you must first invent the universe." -Carl Sagan
8,287
January 2003
bigballofyarn
|
Post by bigballofyarn on May 14, 2025 3:38:55 GMT -8
dustys, My shop items or the general "you"? Someone copied the majority of my shop once. They didn't just steal free domain images. They stole images I drew in Photoshop. I was told by someone else, and this other person reported them to the Abuse Department before telling me. The offending party ended up disabling their shop rather than coming up with their own items and descriptions. If I had found this shop on my own, I would have tried to contact the admin and have an adult conversation. On a similar note, one person found my forum to be visually appealing and copied everything about it except for the butterfly banner. They joined my forum just to see how it looked on the inside, copied all the colors, made a few posts, and then deleted their account. I don't own the color blue though, and other than talking to this person, I didn't pursue anything. I forgot their forum existed until now. If either of these two were to happen to you, I'd encourage you to be civil. Imitation can be compliment. If they refuse to stop using what they stole, you can either let it go or contact the Abuse Department.
|
|