Page 2 of 3

Re: Can anyone tell me how to use this api new method

Posted: Mon Feb 05, 2024 3:23 am
by shrmaprem0202
francisco wrote: Sun Feb 04, 2024 4:36 pm
shrmaprem0202 wrote: Sun Feb 04, 2024 5:25 am I don't know why but it's still not working 🚫
What error are you getting?
If i use script tag display nothing was display and without script tag displayed code in text format

Re: Can anyone tell me how to use this api new method

Posted: Mon Feb 05, 2024 3:25 am
by francisco
shrmaprem0202 wrote: Mon Feb 05, 2024 3:23 am If i use script tag display nothing was display and without script tag displayed code in text format
This is weird, I don't know what the problem could be

Re: Can anyone tell me how to use this api new method

Posted: Mon Feb 05, 2024 3:31 am
by shrmaprem0202
francisco wrote: Mon Feb 05, 2024 3:25 am
shrmaprem0202 wrote: Mon Feb 05, 2024 3:23 am If i use script tag display nothing was display and without script tag displayed code in text format
This is weird, I don't know what the problem could be

Code: Select all

<script>
local tags = [=[
<div class="user-line">
<a href="/user/%id%/%username%"><b>%username%</b></a><br>
<i>Registered: %regdate%</i>
</div>
]=]

local param = {
    limit = 10,
    order = "id_desc"
}

local is_ok, list = api.user_info(param)


if is_ok then
    print('\n<div class="user-list">\n')
    print(html.render_tag(tags, list, true))
    print('\n</div>\n')
end

</script>
i used this simply i copied your code and paste

Re: Can anyone tell me how to use this api new method

Posted: Mon Feb 05, 2024 4:12 am
by francisco
Do not use <script> and </script>, this is Lua code, not Javascript.

Re: Can anyone tell me how to use this api new method

Posted: Mon Feb 05, 2024 5:11 pm
by shrmaprem0202
francisco wrote: Mon Feb 05, 2024 4:12 am Do not use <script> and </script>, this is Lua code, not Javascript.
I removed script tag and put this code in tag code then this result was show



local tags = [=[
%username%
Registered: %regdate%
]=] local param = { limit = 10, order = "id_desc" } local is_ok, list = api.user_info(param) if is_ok then print('\n
\n') print(html.render_tag(tags, list, true)) print('\n
\n') end

Re: Can anyone tell me how to use this api new method

Posted: Mon Feb 05, 2024 9:03 pm
by Xkria-uy

Code: Select all

local tags = [=[ %username% Registered: %regdate% <br> ]=] local param = { limit = 10, order = "id_desc" } local is_ok, list = api.user_info(param) if is_ok then print('\n \n') print(html.render_tag(tags, list, true)) print('\n \n') end
code
code
Screenshot_20240205-180047.png (38.79 KiB) Viewed 18604 times
resultados
resultados
Screenshot_20240205-175903.png (61.6 KiB) Viewed 18604 times

Re: Can anyone tell me how to use this api new method

Posted: Mon Feb 05, 2024 9:30 pm
by Xkria-uy

Code: Select all

local tags = [=[ <div class="container" id="form"> <b>User:</b> %username% <br> <b>Registered:</b> %regdate% </div> ]=] local param = { limit = 10, order = "id_desc" } local is_ok, list = api.user_info(param) if is_ok then print('\n \n') print(html.render_tag(tags, list, true)) print('\n \n') end
r
r
Screenshot_20240205-182739.png (94.49 KiB) Viewed 18590 times

Re: Can anyone tell me how to use this api new method

Posted: Tue Feb 06, 2024 2:06 am
by vikkas
Xkria-uy wrote: Mon Feb 05, 2024 9:30 pm

Code: Select all

local tags = [=[ <div class="container" id="form"> <b>User:</b> %username% <br> <b>Registered:</b> %regdate% </div> ]=] local param = { limit = 10, order = "id_desc" } local is_ok, list = api.user_info(param) if is_ok then print('\n \n') print(html.render_tag(tags, list, true)) print('\n \n') end

Screenshot_20240205-182739.png
Super, thank you 👍😊

Re: Can anyone tell me how to use this api new method

Posted: Tue Feb 06, 2024 6:32 pm
by shrmaprem0202
vikkas wrote: Tue Feb 06, 2024 2:06 am
Xkria-uy wrote: Mon Feb 05, 2024 9:30 pm

Code: Select all

local tags = [=[ <div class="container" id="form"> <b>User:</b> %username% <br> <b>Registered:</b> %regdate% </div> ]=] local param = { limit = 10, order = "id_desc" } local is_ok, list = api.user_info(param) if is_ok then print('\n \n') print(html.render_tag(tags, list, true)) print('\n \n') end

Screenshot_20240205-182739.png
Super, thank you 👍😊
Where you put this code

Re: Can anyone tell me how to use this api new method

Posted: Tue Feb 06, 2024 6:33 pm
by shrmaprem0202
francisco wrote: Mon Feb 05, 2024 4:12 am Do not use <script> and </script>, this is Lua code, not Javascript.
In tag code