ph91.de
  • Home
  • About me
  • Categories
    • Software Development
    • New Zealand
    • Music
    • Tech & IT
    • Sports
    • Dublin
    • Junk
  • Contact
  • Disclaimer
ph91.de
ph91.de
  • Home
  • About me
  • Categories
    • Software Development
    • New Zealand
    • Music
    • Tech & IT
    • Sports
    • Dublin
    • Junk
  • Contact
  • Disclaimer
  • Software Development

wpDataTables Hack: Default to current year

  • 23. January 2021
  • Philipp

For speed-kini.de we have two types of tables:

  1. Tables which show the current rankings overall, women, juniors, foil..
  2. Tables which show rankings of previous years (archive) for overall, women, juniors, foil…

The initial approach was having two different wpDataTables: one for the current year and one with the year as variable. This duplication should ring all your software engineer alarm bells! 

Another possibility would have been to use the archive tables for the current rankings by just setting the variable to 2021, 2022 etc… this would mean work every year to edit the wordpress pages and manually increase the variable to the current year. So this is a bit nicer but still means regular maintenance work.

After some thought, I ended up with a neat approach how to use one table for both: current and archive.

For the current year you just leave the variable empty and for archive you specify the variable to your desired year. 
The mechanism to default to the current year in case no year is specified consists of two parts:

#1 Setting the default value of %VAR1% to a very high number (> 5000 should be enough 😉 )

#2 Small SQL modifications to the places which use %VAR1%

[...]

WHERE
YEAR(date) = LEAST(year(curdate()), %VAR1%)

[...]

Related Topics
  • speed-kini
  • wordpress
  • wpDataTables
Philipp

Previous Article
action adventure beach clouds
  • Software Development

Creating “Windwarner”

  • 2. January 2021
  • Philipp
View Post
17,194 comments

Comments navigation

Older comments
Newer comments
  1. RandomNamebag says:
    12. November 2025 at 13:04

    learnandshine – Inspiring content that motivates me to keep learning every day.

  2. Jamesnum says:
    12. November 2025 at 13:05

    kraken
    https://kraken-shop24.com

  3. SamuelPautt says:
    12. November 2025 at 13:06

    Публикация предлагает читателю не просто информацию, а инструменты для анализа и саморазвития. Мы стимулируем критическое мышление, предлагая различные точки зрения и призывая к самостоятельному поиску решений.
    Не упусти важное! – https://studio-da.com/en/events

  4. Barryboync says:
    12. November 2025 at 13:24

    Эта статья сочетает в себе как полезные, так и интересные сведения, которые обогатят ваше понимание насущных тем. Мы предлагаем практические советы и рекомендации, которые легко внедрить в повседневную жизнь. Узнайте, как улучшить свои навыки и обогатить свой опыт с помощью простых, но эффективных решений.
    Обратиться к источнику – https://ostrana.ru/news-1025947-kitaj-zavalil-rossiyu-i-ves-mir-poddelnymi-videokartami-geforce-nvidia-nachala-gestoko-mstit.html

  5. Rhett Roldan says:
    12. November 2025 at 13:55

    adlift.click – Loved the layout today; clean, simple, and genuinely user-friendly overall.

  6. RandomNamebag says:
    12. November 2025 at 14:01

    uniquegiftideas – Excellent variety of creative gifts, ideal for any special occasion.

  7. Leroykef says:
    12. November 2025 at 14:04

    Всё, что важно https://gryada.org.ua сегодня: мода и стиль, бьюти-рутины, рецепты и фитнес, отношения и семья, путешествия и саморазвитие. Краткие выжимки, длинные разборы, подборки сервисов — удобно и полезно.

  8. Leroykef says:
    12. November 2025 at 14:13

    Всё, что важно https://gryada.org.ua сегодня: мода и стиль, бьюти-рутины, рецепты и фитнес, отношения и семья, путешествия и саморазвитие. Краткие выжимки, длинные разборы, подборки сервисов — удобно и полезно.

  9. RandomNamebag says:
    12. November 2025 at 14:38

    fashionmarketplace – Excellent variety of styles, feels like a hub for fashion lovers.

  10. Francesco Porcello says:
    12. November 2025 at 14:42

    clickgurus.click – Pages loaded fast, images appeared sharp, and formatting stayed consistent.

  11. RandomNamebag says:
    12. November 2025 at 14:49

    inspireeverymoment – Motivating platform that encourages positivity every single day.

  12. KennethRhish says:
    12. November 2025 at 14:50

    https://t.me/ah_1xbet/20

  13. TechWingik5duaft says:
    12. November 2025 at 14:57

    Je suis enthousiasme par Betway Casino, ca transporte dans un univers de plaisirs. La variete des jeux est epoustouflante, avec des machines a sous visuellement superbes. Avec des depots fluides. Le suivi est impeccable. Les transactions sont toujours fiables, mais encore plus de promotions frequentes boosteraient l’experience. En bref, Betway Casino merite un detour palpitant. A signaler le site est fluide et attractif, amplifie l’adrenaline du jeu. Particulierement interessant les transactions en crypto fiables, garantit des paiements securises.
    En savoir plus|

  14. Onita Echeverry says:
    12. November 2025 at 15:16

    clickprohub.click – Loved the layout today; clean, simple, and genuinely user-friendly overall.

  15. RandomNamebag says:
    12. November 2025 at 15:39

    findhappinessdaily – Uplifting messages and helpful tips that brighten my day instantly.

  16. Stewart Mayson says:
    12. November 2025 at 15:41

    discoverandbuy – So many unique finds here, browsing feels enjoyable and effortless.

  17. RandomNamebag says:
    12. November 2025 at 15:57

    purechoicehub – Clean design and high-quality items, really impressed with the layout.

  18. KennethRhish says:
    12. November 2025 at 16:15

    https://t.me/ah_1xbet/16

  19. RandomNamebag says:
    12. November 2025 at 16:23

    simplebuyoutlet – Smooth shopping experience, great deals and very clean design.

  20. Douglaslonse says:
    12. November 2025 at 16:41

    Женский журнал https://krasotka.kyiv.ua про баланс: красота, психология, карьера, деньги, дом и отдых. Экспертные колонки, списки покупок, планы тренировок и проверки здоровья. Материалы, к которым хочется возвращаться.

  21. Rafaelmeaps says:
    12. November 2025 at 16:41

    Глянец без иллюзий https://ladyone.kyiv.ua красота и здоровье с фактчекингом, стиль без переплат, карьера и деньги простым языком. Интервью, тесты, полезные гайды — меньше шума, больше пользы.

  22. Linwoodjag says:
    12. November 2025 at 16:42

    Онлайн-портал https://womanexpert.kyiv.ua для женщин, которые хотят жить в балансе. Красота, здоровье, семья, карьера и финансы в одном месте. Ежедневные статьи, подборки, советы экспертов и вдохновение для лучшей версии себя.

  23. RandomNamebag says:
    12. November 2025 at 16:49

    starttodaymoveforward – Positive and inspiring, encourages daily progress and self-growth.

  24. Douglaslonse says:
    12. November 2025 at 16:50

    Женский журнал https://krasotka.kyiv.ua про баланс: красота, психология, карьера, деньги, дом и отдых. Экспертные колонки, списки покупок, планы тренировок и проверки здоровья. Материалы, к которым хочется возвращаться.

  25. Rafaelmeaps says:
    12. November 2025 at 16:50

    Глянец без иллюзий https://ladyone.kyiv.ua красота и здоровье с фактчекингом, стиль без переплат, карьера и деньги простым языком. Интервью, тесты, полезные гайды — меньше шума, больше пользы.

  26. Linwoodjag says:
    12. November 2025 at 16:51

    Онлайн-портал https://womanexpert.kyiv.ua для женщин, которые хотят жить в балансе. Красота, здоровье, семья, карьера и финансы в одном месте. Ежедневные статьи, подборки, советы экспертов и вдохновение для лучшей версии себя.

  27. bahigo_iqer says:
    12. November 2025 at 17:12

    Die Plattform bietet zahlreiche Spiele und attraktive Angebote. Zusatzlich profitieren Stammkunden von einem umfassenden Bonus- und Treueprogramm. Durch die Zusammenarbeit mit renommierten Softwareanbietern garantiert Bahigo faire und hochwertige Spiele. Die Plattform ist sowohl auf Desktop- als auch auf Mobilgeraten verfugbar. Der Kundendienst steht rund um die Uhr zur Verfugung und antwortet schnell auf Anfragen. Bahigo ist vollstandig lizenziert und reguliert, was fur zusatzliche Sicherheit sorgt. Insgesamt uberzeugt Bahigo als zuverlassige und attraktive Plattform fur Schweizer Casino- und Wettfreunde.
    bahigo 23 https://bahigooo.com/

  28. Sunshine Coleson says:
    12. November 2025 at 17:14

    findnewinspiration – I like how this page mixes creativity with practical motivation.

  29. Chung Ariza says:
    12. November 2025 at 17:17

    dreambiggeralways – Inspiring content and positive energy, perfect for a daily mindset boost.

  30. Elba Waldroff says:
    12. November 2025 at 17:19

    stayfocusedandgrow – Helpful insights for maintaining discipline and a positive mindset.

  31. Trenton Harcar says:
    12. November 2025 at 17:21

    learnandimprove – Such a motivating site, encourages daily learning and better habits.

  32. KennethRhish says:
    12. November 2025 at 17:32

    https://t.me/s/ah_1xbet/6

  33. TechWingik5duaft says:
    12. November 2025 at 17:35

    Je suis bluffe par Betway Casino, il offre une experience dynamique. La bibliotheque est pleine de surprises, comprenant des titres adaptes aux cryptomonnaies. Avec des depots rapides et faciles. Les agents repondent avec rapidite. Les transactions sont fiables et efficaces, occasionnellement des bonus varies rendraient le tout plus fun. Globalement, Betway Casino garantit un plaisir constant. Ajoutons que la plateforme est visuellement electrisante, donne envie de prolonger l’aventure. Un element fort les transactions crypto ultra-securisees, offre des recompenses regulieres.
    Jeter un coup d’œil|

  34. RandomNamebag says:
    12. November 2025 at 18:14

    classystyleoutlet – Elegant fashion selections and well-curated items, love browsing here.

  35. the official ProcurementnNation says:
    12. November 2025 at 18:21

    Took me time to read the material, but I truly loved the article. It turned out to be very useful to me.

  36. read TraceLoans says:
    12. November 2025 at 18:31

    A cool post there mate ! Thank you for posting.

  37. RandomNamebag says:
    12. November 2025 at 18:45

    yourstylezone – Trendy site that really helps express personal fashion taste.

  38. KennethRhish says:
    12. November 2025 at 18:49

    https://t.me/ah_1xbet/8

  39. RandomNamebag says:
    12. November 2025 at 19:00

    startbuildingtoday – Inspiring site that motivates you to take action and grow.

  40. RandomNamebag says:
    12. November 2025 at 19:04

    thepowerofgrowth – Beautiful name that reminds you of personal and continuous improvement.

  41. Travisdet says:
    12. November 2025 at 19:58

    Мода и красота https://magiclady.kyiv.ua для реальной жизни: капсулы по сезонам, уход по типу кожи и бюджета, честные обзоры брендов, шопинг-листы и устойчивое потребление.

  42. VictorDup says:
    12. November 2025 at 19:59

    Всё для современной https://model.kyiv.ua женщины: уход и макияж, стиль и шопинг, психология и отношения, питание и тренировки. Честные обзоры, капсульные гардеробы, планы на неделю и проверенные советы.

  43. Anthonybor says:
    12. November 2025 at 20:01

    Сайт для женщин https://modam.com.ua о жизни без перегруза: здоровье и красота, отношения и семья, карьера и деньги, дом и путешествия. Экспертные статьи, гайды, чек-листы и подборки — только полезное и применимое.

  44. Jamesspock says:
    12. November 2025 at 20:03

    Что делает врач
    Подробнее тут – https://kapelnica-ot-zapoya-vidnoe7.ru/kapelnica-ot-zapoya-kruglosutochno-v-vidnom/

  45. KennethRhish says:
    12. November 2025 at 20:07

    https://t.me/s/ah_1xbet/19

  46. Travisdet says:
    12. November 2025 at 20:07

    Мода и красота https://magiclady.kyiv.ua для реальной жизни: капсулы по сезонам, уход по типу кожи и бюджета, честные обзоры брендов, шопинг-листы и устойчивое потребление.

  47. VictorDup says:
    12. November 2025 at 20:08

    Всё для современной https://model.kyiv.ua женщины: уход и макияж, стиль и шопинг, психология и отношения, питание и тренировки. Честные обзоры, капсульные гардеробы, планы на неделю и проверенные советы.

  48. Anthonybor says:
    12. November 2025 at 20:13

    Сайт для женщин https://modam.com.ua о жизни без перегруза: здоровье и красота, отношения и семья, карьера и деньги, дом и путешествия. Экспертные статьи, гайды, чек-листы и подборки — только полезное и применимое.

  49. RandomNamebag says:
    12. November 2025 at 21:01

    purestylemarket – Classy and minimal style collections, perfect for modern shoppers.

  50. RandomNamebag says:
    12. November 2025 at 21:13

    trendandfashionhub – Love how stylish and updated the latest trends are here.

Comments navigation

Older comments
Newer comments

Leave a Reply

Your email address will not be published. Required fields are marked *

ph91.de
Blog by Philipp Schreitmüller

Input your search keywords and press Enter.