Adminer – a lightweight alternative to PhpMyAdmin

PhpMyAdmin is powerfull but the GUI is messy. Adminer is a lightweight alternative. You have to download the files and place them in your folder. # sudo apt-get isntall adminer # sudo ln -s /usr/share/adminer/ adminer The first line will install the files. They are saved in /usr/share/adminer. Therefore we need a symbolic link to… Continue reading Adminer – a lightweight alternative to PhpMyAdmin

SQL: Many-to-Many and One-to-Many

Here’s a short tutorial on how to solve some basic SQL cardinalities. First have a look at the ER-diagram for the database and the resulting tables in PhpMyAdmin. Many-to-Many Many to many cardinalities may be solved like this: SELECT cake, who FROM cakes, costumers, likes WHERE costumers.costumers_id = likes.costumers_id AND cakes.cakes_id = likes.cakes_id Note that… Continue reading SQL: Many-to-Many and One-to-Many

CSS i plugin

Dokumentationen på Codex er ikke lysende klar; men et plugin gør sådan: /* filters etc. */ add_action('wp_print_styles', 'add_hyperboard_stylesheet'); // (…) /*Required stylesheets */ function add_hyperboard_stylesheet() { $myStyleUrl = WP_PLUGIN_URL . '/hyperboard/styles.css'; $myStyleFile = WP_PLUGIN_DIR . '/hyperboard/styles.css'; if ( file_exists($myStyleFile) ) { wp_register_style('HyperBoardStyleSheets', $myStyleUrl); wp_enqueue_style( 'HyperBoardStyleSheets'); } } Pluginet sætter en krog i wp_print_styles.

Native admin tables i WordPress

Smashing Magazine (SM) har en artikel om at bruge WPs egen tabel-skaber-klasse til at skabe tabeller. Det giver en spændende funktionalitet. Læs “Create Native Admin Tables in WordPress”. Så vidt jeg kan se er artiklen i SM inspireret af dette plugin af Matt van Andel. På sitepoint findes en ganske hæderlig forklaring til udvikling af plugins… Continue reading Native admin tables i WordPress