rejetto forum

macro for ip range

Guest · 3 · 4333

0 Members and 1 Guest are viewing this topic.

Guest

  • Guest
Is there a way to use a macro for a ip range like, 192.168.1.20-192.168.1.40 ?
Read the forum macro section and the wiki. Tried to modify some examples I
found for ip's with no luck. Not having much luck understanding macros.
I need it to work as:
if in this ip range then display this [section] but if not, display nothing.

Thanks


Offline TSG

  • Operator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
{{if |{{match|127.*;10.*;192.168.*|%ip%}}| {{$section}} }} Is what i use for specific addresses.

If you had read the Wiki http://www.rejetto.com/wiki/index.php?title=HFS:_Template_macros you would have seen this for IP ranges.

match address | A | B
    just like the macro match, but the mask supports ip ranges like 10.0.0.1-10.0.0.25


Soo... something like this I would assume.
{{if |{{match address|192.168.1.20-192.168.1.40|%ip%}}| {{$section1}} | {{$section2}} }}
« Last Edit: January 16, 2008, 03:59:37 PM by That_Stevens_Guy »


Guest

  • Guest
Thanks T.S.G.
Went back and looked at the wiki, don't know how I overlooked it.
Anyway, it worked.
Thanks again.