php7.2: the each() function is deprecated

The each() function is deprecated under php7.2. If we run the following code we will get errors: <?php $arr=array( ‘glasses1’ => ‘reading glasses’, ‘glasses2’ => ‘bifocal glasses’, ‘glasses3’ => ‘progressive glasses’ ); while(list($key,$val)=each($arr)){ echo $key.’—>’.$val.'<br>’; } ?>   Deprecated: The each() function is deprecated. This message will be suppressed on further calls in E:\xampp\htdocs\index.php on […]

Sublime Text 3 – How Can We Add Our PHP Tags?

I want to add some custom tags for my development – but I don’t know how to do it. I have tried snippets but it doesn’t work because my tags have some special symbols. How can I add my tags so that the snippets work? Eg: when I fill pre in sublime text, it will […]

You can’t add that domain: you don’t have permission to add!

Today I tried to add web-design-world.com to my Dreamhost account, after I click ‘Add Hosting to a Domain / Sub-Domain’ under DreamHost admin Panel, and try to add this domain name, failed, and I got a message, says ‘You can’t add that domain: you don’t have permission to add!. I googled but did not find […]

Creating Multiple Single Posts for Different Categories

If each post only belongs to one category, and each category has different post template, just modify single.php, we can use the following code: if ( in_category(‘fruit’) ) { include ‘single-fruit.php’; } elseif ( in_category(‘vegetables’) ) { include ‘single-vegetables.php’; } else { // Continue with normal Loop if ( have_posts() ) : while ( have_posts() […]

X-cart V4.7.8 Customer Head Menu

<li><a href=”javascript:;”>Eyeglasses</a> <ul class=”dropdown”> {foreach from=$categories_menu_list item=c} <li><a href=”home.php?cat={$c.categoryid}”>{$c.category}{if $c.top_product_count} ({$c.top_product_count}){/if}</a> {if $c.childs} {foreach from=$c.childs item=sc name=sc} {if $smarty.foreach.sc.first}<ul class=”dropdown”>{/if} <li><a href=”home.php?cat={$sc.categoryid}”>{$sc.category}{if $sc.top_product_count} ({$sc.top_product_count}){/if}</a> {if $sc.childs} {foreach from=$sc.childs item=ssc name=ssc} {if $smarty.foreach.ssc.first}<ul class=”dropdown”>{/if} <li><a href=”home.php?cat={$ssc.categoryid}”>{$ssc.category}{if $ssc.top_product_count} ({$ssc.top_product_count}){/if}</a> {if $ssc.childs} {foreach from=$ssc.childs item=sssc name=sssc} {if $smarty.foreach.sssc.first}<ul class=”dropdown”>{/if} <li><a href=”home.php?cat={$sssc.categoryid}”>{$sssc.category}{if $sssc.top_product_count} ({$sssc.top_product_count}){/if}</a> {if $sssc.childs} {foreach from=$sssc.childs item=ssssc […]

How to Change the “page” slug in Pagination of WordPress?

When pagination of www.cheapglasses123.com/blog is activated, the pagination URL will display as “www.cheapglasses123.com/blog/page/2” as default. How can we change the pagination to “cheapglasses123.com/blog/eyeglasses/2”?

How to Drop all Databases from Mysql?

Sometimes I need to clean a mysql server so I can re-import it clean from the backups. A DROP ALL DATABASES; would have been nice, but the following does the trick. It will drop all databases except for mysql, test and information_schema mysql -uroot -pPASS -e “show databases” | grep -v Database | grep -v […]

X-cart Seo For Nginx

Create a file called xcart.conf, and add the following code in this new file: if ($uri !~ “^/(payment|admin|provider|partner)/”){ set $rule_0 1$rule_0; } if ($request_filename !~ “\.(gif|jpe?g|png|js|css|swf|php|ico)$”){ set $rule_0 2$rule_0; } if (!-f $request_filename){ set $rule_0 3$rule_0; } if (!-d $request_filename){ set $rule_0 4$rule_0; } if ($request_filename !~ “-l”){ set $rule_0 5$rule_0; } if ($rule_0 = […]

Zen Cart V1.5.5 Add Extra Text at Category Footer

Modify mysql database, add a field called ‘categories_footer’ at the table of ‘categories_description’, same field names and description of the field called ‘categories_description’. Add the function at admin panel, to create or modify a category, we need to modify categories.php which is under the admin fold. Within this file we need to add an extra […]