Now we will be able to do this by following these steps:shrmaprem0202 wrote: ↑Thu Feb 01, 2024 10:57 am I want to create a random post code there i can use %total% tag in random tag
1. Create a Post Lister with the following:
Code: Select all
-Enter Code-
{{NULL()}}
-Enter Config-
<FORUMID>24031</FORUMID>
<LIMIT>1</LIMIT>
-Footer-
{{PAGING(%last%)}}
Code: Select all
#SET(end)#
#HIDE#
2. Now let's create a new TAG Code with the code to generate random numbers that I showed in the last message, with the exception that we will not define the "end" directly in the code, as it will be the value of the Post Lister's "paging last" - make sure the TAG Code will be right after the Post Lister:
Code: Select all
{{VALUE(1)@INT@SET(start)@NULL}}
{{DATE(U)@INT@SET(time)@NULL}}
{{RANDOM("013579")@INT@SET(seed1)@NULL}}
{{RANDOM("02468")@INT@SET(seed2)@NULL}}
{{VAR(time)@DIVIDE@VAR(seed1)@INT@SET(rseed_div)@NULL}}
{{VAR(rseed_div)@MULTIPLY@VAR(seed2)@INT@SET(rseed)@NULL}}
{{VAR(end)@MINUS@VAR(start)@PLUS(1)@SET(range)@NULL}}
{{VAR(rseed)@DIVIDE@VAR(range)@INT@SET(quotient)@NULL}}
{{VAR(quotient)@MULTIPLY@VAR(range)@SET(quotient_divisor)@NULL}}
{{VAR(rseed)@MINUS@VAR(quotient_divisor)@SET(remainder)@NULL}}
{{VAR(remainder)@PLUS@VAR(start)@SET(random_number)@NULL}}
{{VAR(random_number)}}
Code: Select all
#SET(random_post)#
#HIDE#
3. Now the last and most important thing, let's define a new Post Lister that will show the random post itself:
Code: Select all
-Enter Code-
<h3>%id% - %title%</h3> ... any code
-Enter Config-
<FORUMID>24031</FORUMID> <-- Same as the first Post Lister
<LIMIT>1</LIMIT>
<PAGE>{{VAR(random_post)}}</PAGE> <-- Here's the magic!