Display a captcha in a form, some of the times only - symfony-1.4

I have a blog coded in sf1.4; and I use recaptcha in the form
for comments. Some users have complained about the captcha, but I
don't want to remove it completely.
Is it possible to, for instance, remove the captcha, but turn it on
for a few minutes after the user has posted a comment ?
That way, it doesn't discourage occasional users from commenting, and
prevents someone from spamming automatically the website.
Thoughts ?

You can do something like enable it in a session after a user has made some number of posts which can be random as well like after 2-4 posts maybe? Even better display it after every say 1 + rand(5) posts?
Tracking the number of posts made in a session should not be difficult - you just need to keep a counter per user session.

Related

Woocommerce - Order Tracking Link

I want to include a 'check my order status' link in the thank you email. Woocommerce comes with a order tracking form, but the user has to input their order id and email. Is there a way to show the tracking page without going through the input form?
I know my accounts has a view order link, but that would only work if the user is registered.
Yes, you can show an order tracking link in your email. It is a bit convoluted way and will take some time. It is much easier to let the user input his information. This makes things a lot less complicated. But if you absolutely need the order tracking in the email, then,
Put this information somewhere other than your secured site,
Make sure you update this information regularly,
Take the ID of
this information from your database and make a GET endpoint(hoping
its a web application), such that it takes in the ID number of the
information and displays it,
This GET link needs to be embedded
into a HTML form/template which you are sending as the email
If you want the whole implementation, you need to specify the tech stack you are using and other details.
If you want to show one tracking page which page customers/users can search their order status without login, then you can use the plugin Order Tracker for WooCommerce
If you use the plugin then the user can check his/her order status without login/hassle free, and also you don't need to add any extra tracking number, user can search using their order ID and phone number.
you can use it the very easy way, like making a page template or using the [cbwct-order-tracker] shortcode, anytime anywhere, and it’s also working with ajax.
You can watch the video for the plugin documentation on how to use that plugin here is the
Video Tutorial

What is the best way to implement pagination in web?

Recently, I am developing a self-using blogging system, but I have some questions about the implementation of pagination.
The pagination I want is :
10 results per page
When user visits the home page(/), he/she could see the current page he/she is at(in this example is page one), and if there are more than 10 results, then he/she could be able to see the 'Next' Link.
If there are some results before this page, and there are also some results after this page, then this page should have 'Prev' and 'Next' Link and the current page number.
This thinking appeared when I was designing the algorithm about pagination:
If I want to implement this functionality, I need to know the total numbers of published posts.(If it is not published, it shouldn't be displayed), so maybe I need to write this SQL code :
SELECT COUNT(*) FROM post WHERE published IS NOT TRUE;
And I could pick the result above and the current page number the user is at to compute the pagination result.
But the question I want to ask is if there are many records , performance will be very terrible, how could I make this program more faster?
I see the pagination of a blog that has thousands of post and is built on top of WordPress is very fast, I want to know how could I archive this speed ?
Thanks a lot.
go through this sample PHP Pagination coding. Results won't be slow because of the LIMIT n,n+RecordsPerPage part of the mySQL query.

Symfony2 - Add a most viewed post to the sidebar

I've noticed some websites that have a most viewed posts section. I am looking to add this functionality to the side bar.
How can you setup a method that determines how many posts have been selected by a user then add in the top 3 or so viewed posts?
For example here (towards the middle of the page in the sidebar, the most viewed): http://america.aljazeera.com/
Is there a bundle that incorporates this?
Or is there an easier method by using a count based on how many times a user clicks on a post?
No, I don't know anyBundle doing that.
To have the 3 most viewed article you need to add a field in your database which save how much the article is important.
You have severals ways of doing it, this is what comes to my mind:
First: You add an relation ViewedByWeek -> Post.
Foreach post, this entity keep how much it have been visited.
Everytime an user visit the page, you improve the number of visits of the post for the current week.
Then, you can find the most popular post in the week, in the month, in the year.
If you don't use anything related to the time, the information will not be changing much

Restrict Access to wordpress page

Basically on my website launch I will be offering users a lot of app promo codes to get apps free. However, I want to know if there is a way that I can make it so that once they have clicked a page they are unable to access any of the others and get all the promo codes basically. So once they have one they are prevented from doing any more.
Thanks,
Harry
I dont think this is possible, because you can't denie a random visitor of your website access to a page if they just read an other page.
Maybe it would be possible if you make sure visitors can only read pages if they got an account. That way you can instal a page restric plugin and edit it yourself by adding a variable that checks how many posts are read and activites the page restrict plugin when x posts are read.
Never done something like this myself, and i dont see why you wouldnt provide all your promo codes to everyone, but thats your own choise:p
I might be completely wrong, but this is what i think.
There is a wordpress plugin called S2Members to help you restrict pages/posts from guest users.

Wordpress redirect on password to certain page

My client would like to give each customer a password and once entered, this should then redirect them to a certain page. I.e. password 'cake' would go to a page about cakes, password 'cats' would go to a page about cats. Sounds simple enough, is there a plugin that you guys are aware of that would do it? Or is it possible straight from WP itself?
Thanks
Take a look at Peter's Login Redirect. I haven't used it myself, but it has good ratings, has been updated recently, and it sounds like it can redirect based on the login criteria entered.
On a side note, I can't wait to see this website that features cats and cakes!
Good luck.
I'm sure there are better solutions out there. I accomplished what you are looking for by using conditional fields and html in Gravity forms. To mimic a password, I removed the Gravity forms submit button, and I basically created my own submit button in the html field to redirect the visitor to my desired url. Using conditional fields, I hide the button until the user enters the exact passphrase.
This method also allowed me to create hide/show multiple buttons matching different passcodes. We give private clients different passcodes to redirect them to different pages and content.
I've searched for hours for that solution! Here You go #ajguk: http://thecodecave.com/plugins/smart-passworded-pages/ or http://wordpress.org/plugins/smart-passworded-pages/
The plugin is called "Smart passwor pages" (for those experts that can't reed what the link says). It is as close as it gets 4 me. The plugin is old, but it works. Instalation is simple. You just need to put shortcode [smartpwpages] on a page which gives You a login field and every childpage under page with shortcode (if passworded protected throug WP) will work exactly like you asked. You will need to enter into login field only a password and it will redirect user to a page that this password protects... Just need to make your passwords unique for every childpage.
Cheers!

Resources