Advertisement:

Author Topic: Dangerous Marsupial Page Index  (Read 173 times)

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,927
  • Master of BBC Abuse
Dangerous Marsupial Page Index
« on: February 13, 2020, 11:24:02 AM »
Link to Mod

This mod replaces the default page index with an HTML select (or dropdown, if you prefer).
It also has next page and previous page buttons built in, each side of the select.
The mod comes with CSS to support RTL languages.



Changelog

v.1.0.2 - 14/2/2020 - Incorporated Bugo's suggestions of cache cleaning code in install.xml, and removing fixed width from CSS for .subject .antPages_select (small selects on message index).

Offline Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 3,242
  • Gender: Male
  • Learning more every day!
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: Dangerous Marsupial Page Index
« Reply #1 on: February 13, 2020, 12:13:18 PM »
It seems very good I will try it on a test site I have, great job! :D


Regards!
¡Regresando como cual Fenix! ~ Bomber Code © 2020
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,927
  • Master of BBC Abuse
Re: Dangerous Marsupial Page Index
« Reply #2 on: February 13, 2020, 03:31:09 PM »
I thought it was a sensible idea. I actually coded the thing literally years ago, but for some reason had never got around to submitting it.

Offline Bugo

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,552
  • Gender: Male
    • dragomano on GitHub
    • @dragomano on Twitter
    • Russian translations for SMF mods
Re: Dangerous Marsupial Page Index
« Reply #3 on: February 13, 2020, 03:36:31 PM »
Please, add this line to <install> section in package-info.xml:
Code: [Select]
<code type="inline">clean_cache();</code>
It will help to clean cache after the mod installing (to avoid doing this manually).

In addition, on the topic list page (MessageIndex), I noticed that when long words are using (i.e., "Страница" instead of "Page"), the right page select is not displayed completely. See my screenshot below. Removing the "width" property (".subject .antPages_select" rule in index.css) fixes the problem.

In any case, this mod is classy. Big thanks :)

Online vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 21,953
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Dangerous Marsupial Page Index
« Reply #4 on: February 13, 2020, 03:47:36 PM »
Please, add this line to <install> section in package-info.xml:
Code: [Select]
<code type="inline">clean_cache();</code>
It will help to clean cache after the mod installing (to avoid doing this manually).

Wow that is a good idea. Should that be in SMF by default? every-time  a mod is installed?
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,927
  • Master of BBC Abuse
Re: Dangerous Marsupial Page Index
« Reply #5 on: February 13, 2020, 03:57:07 PM »
Please, add this line to <install> section in package-info.xml:
Code: [Select]
<code type="inline">clean_cache();</code>
It will help to clean cache after the mod installing (to avoid doing this manually).

You mean like this?

Code: [Select]
<?xml version="1.0"?>
<!DOCTYPE package-info SYSTEM "http://www.simplemachines.org/xml/package-info">
<package-info xmlns="http://www.simplemachines.org/xml/package-info" xmlns:smf="http://www.simplemachines.org/">
<id>Antechinus:Dangerous_Marsupial_Page_Index</id>
<name>Dangerous Marsupial Page Index</name>
<version>1.0.1</version>
<type>modification</type>
<install for="2.0, 2.0.1 -2.0.99">
<modification format="xml" type="file">Dangerous_Marsupial_Page_Index.xml</modification>
<readme parsebbc="true">readme.txt</readme>
<code type="inline">clean_cache();</code>
</install>

Ok, cool. will do.

Quote
In addition, on the topic list page (MessageIndex), I noticed that when long words are using (i.e., "%u0421%u0442%u0440%u0430%u043D%u0438%u0446%u0430" instead of "Page"), the right page select is not displayed completely. See my screenshot below. Removing the "width" property (".subject .antPages_select" rule in index.css) fixes the problem.

Now there's a point. Come to think of it, I'm not sure why I set a fixed width there anyway. I'll change it now. :)

ETA: Aha! I just remembered. I was using the fixed width on local to hide the "of 26" text after the "Page 1", to make the default display more compact on the message index. I just thought it looked neater like that. But sure, I can see it causing problems with other languages.

What I'll do is remove the width in the default CSS, and add a comment there suggesting that people can tweak the display themselves for their preferred language if they want to. Which still won't be a perfect solution for multi-language sites, but anyone who is really keen can always run a browser extension like Stylem.

ETA: Ok, done. Version 1.0.2 uploaded. :)
« Last Edit: February 13, 2020, 04:23:52 PM by Antechinus »