renovatio's blog

Алгоритм - Календарь

Построение скрипта календаря

1. Необходимо расчитать количество дней в текущем месяце.
2. Будем использовать цикл с числом итераций равным кол-ву дней в текущем месяце и шагом равным одному дню

The code has been tested and works

Use Custom Graphic for Twitter Follow Button

How can you use a custom image for a Twitter Button?

Twitter has made it easy to add a “follow” button to your site using their widgets. But what if you want to use your OWN graphic? Not so easy. Or at least they would like you to think that. All I wanted was to customize the twitter follow button, but it took a bit of jumping through hoops to find out how.

The code has been tested and works

Bye, bye region.tpl.php and block--system--main.tpl.php

* Implements hook_page_alter().
function mytheme_page_alter(&$page) {
// Remove all the region wrappers.
foreach (element_children($page) as $key => $region) {
if (!empty($page[$region]['#theme_wrappers'])) {
$page[$region]['#theme_wrappers'] = array_diff($page[$region]['#theme_wrappers'], array('region'));
// Remove the wrapper from the main content block.
if (!empty($page['content']['system_main'])) {

The code has been tested and works

The best way to add a column to an existing table in drupal

* Implements hook_schema_alter().
function mymodule_schema_alter(&$schema) {
$schema['tablename']['fields']['fieldname'] = array(
'type' => 'varchar',
'default' => null

* Implements hook_install().
function mymodule_install() {
if (!db_field_exists('tablename', 'fieldname')) {
$schema = drupal_get_schema('tablename');
db_add_field('tablename', 'fieldname', $schema['fields']['fieldname']);

The code has been tested and works

Reinstall virtualbox debian

Uninstall VirtualBox -> sudo apt-get purge "^virtualbox-.*"

Check carefully what will be removed before you confirm.

Update the software repositories -> sudo apt-get update

Clean up -> sudo apt-get autoremove | sudo apt-get autoclean | sudo apt-get clean

rm -r /etc/init.d/vboxdrv
rm -r /var/lib/update-rc.d/vboxdrv
apt-get install virtualbox virtualbox-dkms virtualbox-guest-utils virtualbox-guest-additions virtualbox-qt


Subscribe to RSS - renovatio's blog