Sorry, this entry is only available in Deutsch.
CakePHP FormHelper “textarea” set value
Here is the code when you want to specify a textarea’s value manually.
1 2 3 4 5 6 7 | <?php echo $this->Form->input('Invoice.subject', array( 'type' => 'textarea', 'label' => __('subject'), 'value' => $this->request->data['Invoice']['subject'], // or your specified value you want to set 'escape' => false)); ?> |
In this Example you have to set those variable by using the specified controller in its action.
InvoicesController.php
60 61 62 63 64 65 66 67 68 69 70 71 | <?php .. .. if ($this->request->is('post')) { .. .. } else { $this->request->data['Invoice']['subject'] = __('Rechnung bezüglich [Webanwendung|Projekt] %s', $cProjectTitle); } .. .. ?> |
Custom loop in page template causes custom page menu not to be active
When I modify the posts loop by implementing a custom query in a custom page template, the menu item is not active anymore.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <?php query_posts('cat=51'); if(have_posts()) { /* Start the Loop */ while (have_posts()) { the_post(); get_template_part('content', 'post'); /* Display comments */ if ( theme_get_option('theme_allow_comments')) { comments_template(); } } } ?> |
Simply add the following code after you passed the loop.
16 17 18 | // go backwards to the original post for the custom menu wp_reset_query(); if(have_posts()) : the_post(); endif; |
Notice, if you are taking some more queries, always reset those queries by using the wp_reset_query()-function.
A simple mySQL-Query application
In case of a new class of my studies. We had to implement a simple mysql query tool. It was the first assignment so it is just a command line based application.
Start
You will also find the sourcecode in the ZIP-file. Those onces, who just want to run the program will find a batch file in the folder “/dist”. First look at the right parameters.
Parameters
- db
Name of the database - user
Username to get access to the database - pass
Password
Actually, this program just works on your own machine. That means just localhost. If you want to you can implement a new parameter for different _HOSTS.
Implementing a mask in Papervision
You don’t need much for implementing a mask in papervision. But at first, you have to know it. A mask defines an area in your viewport, which is only visible.
1 2 3 4 5 6 7 8 | viewport.cacheAsBitmap = true; var mask:MovieClip = new MovieClip(); mask.graphics.beginFill(0x00000); // Area which is only visible mask.graphics.drawRect( x, y, width, height); mask.graphics.endFill(); mask.cacheAsBitmap = true; viewport.mask = mask; |
Make Windows XP faster
After some months ago, it is possible that your system running with windows xp is less faster then in the first days. You have installed a lot of software, deleted some, but some is still running in the shadows of your system. For normal users it’s sometimes not that easy to find and delete this kind of software.
But there is help. I found a really nice tool directly from microsoft which is showing you software which is not really necessary. And sometimes after some configuration settings your system runs again like in the first days.
XP Mode with Windows 7 Home Premium Edition
In case of compability problems with different software, i wanted to use the Virtual PC Software. But I just have running the Windows Home Premium Edition. When you want to download Virtual PC from the Microsoft side it seems that Virtual PC only runs with higher versions of windows 7. So i searched for a solution for Home Premium.
In different communities there was always the same. Someone told the problem, but nobody had an answer. But finally i found one solution and it works. Its written down in an article on a blog written in german. You can find it here:
Article:
Windows 7 XP Mode geht auch mit Home Premium
But here are the most important things in english…..
Actionscript 3 – URLLoader wirft Exception
Vor kurzem benötigte ich für ein Projekt eine Klasse die Daten aus einer Textdatei liest. Adobe bietet ja eine umfangreiche Bibliothek an was Klassen und deren Funktionen betrifft. Aber als die load-Funktion des URLLoaders immer wieder einen Error wurf und ich diese nicht mit Hilfe einer try … catch Anweisung abfangen konnte, war ich schon etwas stutzig und musste erst mal 15 Min googlen.
Während meiner Recherche fand ich raus das andere meistens das selbe Problem hatten. Dann bin ich aber doch wieder bei Adobe gelandet, habe mir dann die Klasse des URLLoaders etwas genauer angeschaut und prompt war da auch ein Beispiel.