Tech Blog

Intranet Link to Lotus Notes

03.02.2010
 von Pascal
 | 0 Kommentare

If you want to add a menu entry with a link to a lotus notes application then the error message "The path 'notes://path' is either invalid or you do not have access to it." will show up.

The problem is that Drupal does not allow the Protocol "notes" by default.

The filter module will check whether the protocol is allowed or not in the function filter_xss_bad_protocol.

<?php
variable_get
('filter_allowed_protocols', array('http''https''ftp''news''nntp''telnet'
'mailto''irc''ssh''sftp''webcal''rtsp')));
?>

Drupal cheat sheet

02.07.2009
 von Pascal
 | 0 Kommentare

Snippets

Image Cache Usage

<?php
print theme('imagecache'$preset$image['filepath'], $alt$title,  $attributes); 
?>

Manually load a bunch of nodes with SQL

<?php
$nodes 
= array();
$sql "SELECT nid FROM content_type_event";
$result db_query($sql);
while (
$result && ($object db_fetch_object($result))) {
    
$nodes[] = node_load($object->nid);
}
?>

Manually load a menu

<?php
$menu_global 
menu_navigation_links("secondary-links"0);
$menu1 menu_navigation_links("primary-links"0);?>

Community Manager und Webdesigner gesucht

26.06.2009
 von Lukas Fischer
 | 0 Kommentare

Create a Facebook Connect Button without XFBML

17.06.2009
 von Pascal
 | 0 Kommentare

Use this piece of code for an html button if you don't want to use the XFBML fb:login-button tag.

<?php
function fbconnect_render_button() {
  
$button '
&lt;a href="#"
onclick="FB.Connect.requireSession(facebook_onlogin_ready); return false;" &gt;
 &lt;img id="fb_login_image" 
src="http://static.ak.fbcdn.net/images/fbconnect/login-buttons/connect_white_medium_long.gif
height="15" alt="Connect"/&gt;
 &lt;/a&gt;'
;
  return 
$button;
}
?>

Erstes Drupal Media Camp - ein Erfolg

11.05.2009
 von Lukas Fischer
 | 0 Kommentare

netnode am DrupalMediaCamp

28.04.2009
 von Lukas Fischer
 | 0 Kommentare

Select or preselect an option with jQuery

27.04.2009
 von Pascal
 | 0 Kommentare

What I want is not to get the selected value of a select field which is quite easy.

<?php
$('#select_id').val();
?>

I want to set a value of a select dropdown. I didn't found any useful function so I made my own.

<?php
/**
* @param string select_id The Id of the select element you want to set
* @param string value The value you what to select
*/
function _select_option(select_idvalue) {
    
//if value exists
    
var value_exists false;
    $(
"#"+select_id+" option").each(
        function(
valhtmlelement) {
            if ($(
this).val() == value) {
                
value_exists true;
            }
?>

Drupal access callback explained

27.04.2009
 von Lukas Fischer
 | 0 Kommentare

Whenever you have to write your own access function for a menu entry - here is the short explenation how to do this:

The menu entry should have a "access callback" definition. This defines the function which checks the access and returns true or false. You cann pass arguments via the 'access arguments' definition.

<?php
$items
['whatever/%/edit'] = array(
      
'title' => t('Edit'),
        
'page callback' => 'dosomething_edit',
        
'page arguments' => array(1),
    
'access callback' => 'check_edit',
    
'access arguments' => array(1),
    
'weight' => 1,
    
'type' => MENU_LOCAL_TASK,
);
?>

E-Mail Adressen filtern (netnode labs)

10.02.2009
 von Lukas Fischer
 | 0 Kommentare

Unter dem Label netnode labs entwickeln wir Prototypen um neue Technologien auszuprobieren. Oft kommt es vor, dass sich dadurch einfache Dienste herauskristalisieren. Das neuste Tool ist ein "E-Mail Adressen Filter" welches alle E-Mail Adressen einer beliebigen Webseite filtern kann. Nützlich, denn damit kann man die Sicht von Suchmaschinen oder Spam-Crawlern nachvollziehen.

http://labs.netnode.ch/crawler

Amazee Facebook Applikation

19.01.2009
 von Lukas Fischer
 | 0 Kommentare
Inhalt abgleichen