The WordPress plugin Remove Fields main purpose is to help you get more comments to your blog by removing the website field from the comment form, and trust me, it works, the reason is that a lot of people think that the website field is mandatory, when they see it they will refrain from posting… Continue reading Remove Fields [WP Plugin]
Heberjahiz réveille-toi on est en 2013
N’achetez surtout pas votre nom de domaine chez Heberjahiz, ne faites pas la même erreur que moi! Voici mon histoire avec Heberjahiz Le 11 mai 2013: C’ést un samedi, j’achète un nom de domaine .ma en ligne sur le site de la société, je paye instantanément avec PayPal, après quelques secondes, je reçois des courriels… Continue reading Heberjahiz réveille-toi on est en 2013
Drupal Commerce: Redirect to cart after adding a product
Sometimes, you want the visitor to go directly to the cart, instead of staying in the same page and having a success message telling him that his product has been added to the cart.
WordPress and dashes (m-dash & n-dash)
This post is outdated as of WordPress 6.0. See the first comment. I got you there, I too didn’t know there were n and m dashes “–” and “—“. Anyways, the process of using one of these in my life was something like this:
Joomla 3.0 – Fix Application Instantiation Error
Everything went smoothly as usual in my local machine, but as soon as I moved the website to the client server, it wouldn’t run normally, instead it gives me the dreaded error message: Error displaying the error page: Application Instantiation Error After a small search on Google, I found that all people were saying to… Continue reading Joomla 3.0 – Fix Application Instantiation Error
PHP: empty() is your friend
It’s easy to miss things that are very obvious, this is the proper way to check that a variable has a value that is not nothing (null, 0, FALSE, “false”, array(), etc) without getting PHP E_NOTICE messages (that I encourage you to show when developing): // Check that $var is set and is not empty:… Continue reading PHP: empty() is your friend
MySQL tip: Update a column with random values
I’m always impressed with what you can do with MySQL (my favorite RDBMS), not long ago I needed to add a column in a table and fill it with some random values. Instead of using a PHP (could be C, Java, perl…) script that goes row by row and calculates a random value, I thought… Continue reading MySQL tip: Update a column with random values
What is MVC?
The MVC design pattern separates business logic from user interface Model–View–Controller is a design pattern or a software engineering concept that separates the model, the view and the controller from each others, thus dividing the labour in your application in such a way that: The model is the brain, the knowledge, or simply data and… Continue reading What is MVC?
PHP code to remove breadcrumbs in a Drupal page
Sometimes you want to hide the breadcrumbs in a single page an keep it in the others, either using a module or inside a node. You can remove the breadcrumb from a Drupal page with this line of code: This is how I do it: drupal_set_breadcrumb(array());
Check that a user is an administrator in Drupal
You can check that a user is an administrator or not like this: if(user_access(‘administer’)) echo ‘I am an admin’; else echo ‘I am not an admin’;