最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

plugins - How can I change page content for good once a button is pressed?

programmeradmin6浏览0评论

I am building a verification website that utilises QR codes which once scanned show a page which says that the product is genuine.

I want to add a "claim listing" button to the bottom of the page which will show a "successfully claimed this listing" page.

Problem: After the listing has been claimed I want the same QR code to show a page which states "this listing has already been claimed".

I have racked my brain for hours now, trying to figure out the easiest method to achieve this but am constantly hitting walls, any help would be greatly appreciated!

Thanks folks, Dan

I am building a verification website that utilises QR codes which once scanned show a page which says that the product is genuine.

I want to add a "claim listing" button to the bottom of the page which will show a "successfully claimed this listing" page.

Problem: After the listing has been claimed I want the same QR code to show a page which states "this listing has already been claimed".

I have racked my brain for hours now, trying to figure out the easiest method to achieve this but am constantly hitting walls, any help would be greatly appreciated!

Thanks folks, Dan

Share Improve this question asked May 2, 2020 at 12:17 Daniel ProctorDaniel Proctor 1
Add a comment  | 

1 Answer 1

Reset to default 0

Do I understand problem correctly?

[QR1] -> Scan -> [Claim listing] -> [QR1->QR2 claimed] -> [QR2]

Here what comes to mind

class RenderPage 
  function gen_qr(is_claimed)
    if (is_claimed) return generate_qr2;
    else return generate_qr1


  function display_page()
    $qr_code = gen_qr(get_option('<page_id>_qr'));

    // on button click update_option('<page_id>_qr')

It's a bit schematic, but I think you got the idea.

P.S. Just to clarify. Method display_page() renders page withrespect to the fact if listing is claimed (whatever that mean :D), it also has button, that sets "listing claimed" tag to database. qr_gen() generates code that will contain required information based on database option for corresponding page.

发布评论

评论列表(0)

  1. 暂无评论