Search found 14 matches

by jesuisnk
Fri May 10, 2024 11:15 am
Forum: Tutorials
Topic: [LUA] Article pagination method with lua
Replies: 4
Views: 23547

Re: [LUA] Article pagination method with lua

Xkria-uy wrote: Fri May 10, 2024 8:54 am AddText_05-10-05.53.33.jpg
You can run a loop yourself that includes posts that don't belong to the "chat" category for the above case
by jesuisnk
Thu May 09, 2024 9:29 am
Forum: General Discussion
Topic: [SHARE][LUA] Simple blog with lua-lang for wapka
Replies: 1
Views: 14953

[SHARE][LUA] Simple blog with lua-lang for wapka

Hi everybody. Today I would like to share with you my open source code written in lua on the wapka.co platform. This source code is an example of how to use the lua programming language for beginners using wapka.org. The source code has many shortcomings, but it is also very basic so you can build y...
by jesuisnk
Thu May 09, 2024 2:30 am
Forum: Tutorials
Topic: [LUA] Plugin video and BBcode as same as Dorew with lua
Replies: 0
Views: 11611

[LUA] Plugin video and BBcode as same as Dorew with lua

DEMO: https://i.imgur.com/ao9xHj2.png First, create a 'plugin' file with the following lua code: fullurl0 = req.get.link if not fullurl0 or fullurl0 == "" then fullurl0 = "https://www.youtube.com/watch?v=vWGhEKJZ2yI" end -- Khởi tạo function cần thiết cho các plugin local functi...
by jesuisnk
Thu May 09, 2024 1:29 am
Forum: Tutorials
Topic: [LUA] Article infomation with lua
Replies: 0
Views: 11543

[LUA] Article infomation with lua

DEMO: https://i.imgur.com/HNH8xbA.png URL: https://{yourdomain}/article/{post_id}-{post_slug}.html Example: https://shared.wapka.top/article/70227-automation-studio-5-0-full-crack.html LUA: include('jesuisnk') local article = string.match(req.url, '/article/(%d+)') if article then -- Get id's' arti...
by jesuisnk
Thu May 09, 2024 12:02 am
Forum: Tutorials
Topic: [LUA] Article pagination method with lua
Replies: 4
Views: 23547

Re: [LUA] Article pagination method with LUA

Then I tried passing OFFSET to api.post_info(), but it failed. So I, created a function that works similar to LIMIT and OFFSET like SQL. This will affect the performance of the site, because of too many loops, but it's still good if your 'index' doesn't have too many loops. function slice(tbl, first...
by jesuisnk
Wed May 08, 2024 11:57 pm
Forum: Tutorials
Topic: [LUA] Article pagination method with lua
Replies: 4
Views: 23547

Re: [LUA] Article pagination method with LUA

- Let me explain a little about the above code. I intentionally wrote loops to cut the multidimensional array into pieces with the number of pages received from the request as follows: local post_check, post_check_list, post_check_stats = api.post_info() post_total = tonumber(post_check_stats['total...
by jesuisnk
Wed May 08, 2024 11:55 pm
Forum: Tutorials
Topic: [LUA] Article pagination method with lua
Replies: 4
Views: 23547

[LUA] Article pagination method with lua

DEMO: https://i.imgur.com/evnhDNp.png First, create file 'jesuisnk', with lua code: -- Slug function slugVN(text) local diacriticsMap = { { base = 'a', regex = '[àáảãạăắằẵặẳâầấậẫẩ]' }, { base = 'e', regex = '[èéẻẽẹêếềễệể]' }, { base = 'i', regex = '[ìíỉĩị]' }, { base = 'o', regex = '[òóỏõọôồốổỗộơờớ...
by jesuisnk
Tue May 07, 2024 11:12 pm
Forum: Tutorials
Topic: [LUA] Create, rename and get detail categories (forum) with lua for Wapka
Replies: 1
Views: 11552

Re: [LUA] Create, rename and get detail categories (forum) with lua for Wapka

Full code: List categories DEMO: https://i.imgur.com/5Zi0bB2.png LUA: local cat_check, cat_check_list, cat_check_stats = api.forum_info() cat_total = cat_check_stats['total'] local cat_check1, cat_list, cat_stats = api.forum_info({limit=cat_total}) table.insert(cat_list, 1, cat_list[0]) if tonumber...
by jesuisnk
Tue May 07, 2024 9:10 am
Forum: Tutorials
Topic: [LUA] Create, rename and get detail categories (forum) with lua for Wapka
Replies: 1
Views: 11552

[LUA] Create, rename and get detail categories (forum) with lua for Wapka

- Creator: -- CATEGORY ---- /api/Category/Creator.json if url.map("/api/Category/Creator.json") then result = "false" msg = "Thao tác không hợp lệ" if (env.userid ~= 0) then if (req.method == "POST") then local param = { name = req.post.title } local title = ...
by jesuisnk
Tue May 07, 2024 1:56 am
Forum: Tutorials
Topic: [LUA] BBcode with lua for wapka
Replies: 0
Views: 11629

[LUA] BBcode with lua for wapka

Use smileys from DorewSite. SMILEYS: function smile(input_string) local arrEmoName = {'ami', 'anya', 'aru', 'aka', 'dauhanh', 'dora', 'le', 'menhera', 'moew', 'nam', 'pepe', 'qoobee', 'qoopepe', 'thobaymau', 'troll', 'dui', 'firefox', 'conan'} for _, emoName in ipairs(arrEmoName) do local pattern = ...