plugins – How do I allow a user to purchase an expiring passcode to access part of my website, from my online store, similar to pay-per-view?

I am trying to add functionality to a website I am starting to create, which is a bit like a pay-per-view video channel, where a user (without registering) would go onto my online store and purchase a product, which in this case would be an automatically-generated passcode.

The user would receive the passcode via email and then use it to gain access to a specific (hidden/private) part of the website. The passcode would automatically expire a certain amount of time after it is first used, such as a few days.

I have done a bit of research and come across various membership plugins, such as MemberPress and Restrict Content Pro. However, these do not do what I require. I don’t want the user to create an online account; I simply want a passcode to be generated when paid for through the online store.

Is this possible? Could someone point me in the right direction for a plugin, or even a tutorial that explains how to do this? Thanks!

usability – Why do nearly all the social media platforms have nearly the same layout for “user’s post” and how can I implement similar layout in my design?

So I am making an art sharing app ( image sharing ) and have noticed that nearly all the existing social media platforms have similar layout for user’s post.

e.g.

  1. Facebook

enter image description here

  1. Instagram

enter image description here

  1. Twitter

enter image description here

Now as it is quite clear from the above pictures that they follow a similar layout which goes something like this :

  1. Profile photo and user name, with follow button if user isn’t following that user.
  2. The caption, description, tweet etc.
  3. Images ( if any ) ( in case of instagram, point 2 and 3 are interchanged ).
  4. Then comes the interaction button.

My question is why all of them have Poster’s name and profile photo ( optional ) above the content of the post and not below it ? What is wrong with having the poster’s name and pic below the main content ? And also, in most of the cases, description is above the image ( if any ) ? Is it because our eyes start reading from top to bottom ?

If so, how can I improve the layout of my app which is just the opposite and quite frankly looks not that good.

Layout of my app :

enter image description here

Red area is for the image ( which is the main content of my app ), I want at least 70% of the users screen to show the image, also I don’t want to overlay any buttons or text on the image cause it can hide important details of the picture. What can I do make it look more good and at the same time easy to use ?

ServersBase.com – Fully Managed Dedicated Servers – 4 IPv4 – i7 or Similar, 4GB RAM, 1TB HDD | Proxies-free

We offers a very broad line of dedicated servers from basic to sophisticated with the latest technologies. All of our Dedicated Servers are categorized above to suit any business needs. Our dedicated servers are managed so you do not have to worry about running your dedicated servers or fixing any problems.

Let’s get straight to our offerings:

Dedicated Servers

Intel Core i7 950 For $163.00/m
4GB Dedicated RAM
1TB Disk Space
10TB Bandwidth
1Gbps Dedicated Port
4 Dedicated IPv4
Upto 5Gb/s DDoS Portection Included
Free OS Reinstalls
24/7 Tech Support
<<Order Today>>

Intel Core i3-2100 For $170.00/m
8GB Dedicated RAM
1TB Disk Space
10TB Bandwidth
1Gbps Dedicated Port
6 Dedicated IP
Upto 5Gb/s DDoS Protection Included
Free OS Reinstalls
24/7 Tech Support
<<Order Today>>

2x Intel Xeon E5620 2.40GHz For $189.00/m
16GB Dedicated RAM
2TB Disk Space
50TB Bandwidth
1Gbps Dedicated Port
10 Dedicated IP
Upto 5Gb/s DDoS Protection Included
Free OS Reinstalls
24/7 Tech Support
<<Order Today>>

2x Intel Xeon E5-2620v4 For $290.00/m
32GB Dedicated RAM
2TB Disk Space
100TB Bandwidth
1Gbps Dedicated Port
16 Dedicated IP
Upto 20Gb/s DDoS Protection Included
Free OS Reinstalls
24/7 Tech Support
<<Order Today>>

Payment Modes:
PayPal, Bitcoins & AltCoins

Bank Transfer:
We do accept bank transfer from Indian users [just submit ticket for details]

More questions?
Browse our website: www.serversbase.com
Contact our sales department

 

webserver – Correct way of specifying similar locations for nginx

I’m very new to hosting and nginx and fairly new to linux and just started to host a web-app on my raspberry pi (intranet only) using nginx.
It serves an angular SPA on /, redirects to a .NET API on /api and redirects to a signalR hub on /realTimeFeed (that basically means websockets if you don’t know signalR).

Everything seems to work fine but as you’re able to see below, there is a lot of redundancy between /api and /realTimeFeed.
How can I change that? Should I even change that? Is this even remotely correct?

My references are the following (admittedly, I copied my solution together from these links):

Below is my configuration file for nginx at /etc/nginx/sites-available/default.

server {
    listen       80;
    server_name  localhost;

    root /var/www/html;
    index index.html;

    location /api {
        proxy_pass         http://localhost:5000/api;
        proxy_http_version 1.1;
        proxy_set_header   Upgrade $http_upgrade;
        proxy_set_header   Connection keep-alive;
        proxy_set_header   Host $host;
        proxy_cache_bypass $http_upgrade;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Proto $scheme;
    }

    location /realTimeFeed {
        proxy_pass         http://localhost:5000/realTimeFeed;
        proxy_http_version 1.1;
        proxy_set_header   Upgrade $http_upgrade;
        proxy_set_header   Connection $connection_upgrade;
        proxy_set_header   Host $host;
        proxy_cache_bypass $http_upgrade;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Proto $scheme;
    }

    location / {
        root   /usr/share/nginx/html;
        try_files $uri /index.html; # redirect all request to index.html
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
}

In order for signalR / websockets to work correctly, I also added this section to /etc/nginx/nginx.conf:

# For SignalR
map $http_upgrade $connection_upgrade {
    default Upgrade;
    ''      close;
}

If this is off-topic and or belongs elsewhere, please let me know 🙂

ServersBase.Com ⚡️⚡Fully Managed Dedicated Servers – 4 IPv4 – i7 or Similar, 4GB RAM, 1TB HDD


We offers a very broad line of dedicated servers from basic to sophisticated with the latest technologies. All of our Dedicated Servers are categorized above to suit any business needs. Our dedicated servers are managed so you do not have to worry about running your dedicated servers or fixing any problems.

Let’s get straight to our offerings:

Dedicated Servers

Intel Core i7 950 For $163.00/m

4GB Dedicated RAM

1TB Disk Space

10TB Bandwidth

1Gbps Dedicated Port

4 Dedicated IPv4

Upto 5Gb/s DDoS Portection Included

Free OS Reinstalls

24/7 Tech Support
<<Order Today>>

Intel Core i3-2100 For $170.00/m

8GB Dedicated RAM

1TB Disk Space

10TB Bandwidth

1Gbps Dedicated Port

6 Dedicated IP

Upto 5Gb/s DDoS Portection Included

Free OS Reinstalls

24/7 Tech Support
<<Order Today>>

2x Intel Xeon E5620 2.40GHz For $189.00/m

16GB Dedicated RAM

2TB Disk Space

50TB Bandwidth

1Gbps Dedicated Port

10 Dedicated IP

Upto 5Gb/s DDoS Portection Included

Free OS Reinstalls

24/7 Tech Support
<<Order Today>>

2x Intel Xeon E5-2620v4 For $290.00/m

32GB Dedicated RAM

2TB Disk Space

100TB Bandwidth

1Gbps Dedicated Port

16 Dedicated IP

Upto 20Gb/s DDoS Protection Included

Free OS Reinstalls

24/7 Tech Support
<<Order Today>>

Payment Modes:

PayPal, Bitcoins & AltCoins

Bank Transfer:

We do accept bank transfer from Indian users [just submit ticket for details]

More questions?

Browse our website: www.serversbase.com
Contact our sales department

arduino – Is there a C++ preprocessor directive or similar that I can use to convert units

I am doing a bit of motor control, and instead of saying 39553 encoder ticks, it would be easier for my human brain to say 6.5 inches. I would like to save processor overhead by converting this at compile time. Is there a way to do this with preprocessor directives or templates maybe? Thanks.