netnode IT services GmbH
Mythenstrasse 7
6003 Luzern
041 450 10 66
Kontaktformular
Newsletter [neu]
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')));
?>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);?>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 = '
<a href="#"
onclick="FB.Connect.requireSession(facebook_onlogin_ready); return false;" >
<img id="fb_login_image"
src="http://static.ak.fbcdn.net/images/fbconnect/login-buttons/connect_white_medium_long.gif"
height="15" alt="Connect"/>
</a>';
return $button;
}
?>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_id, value) {
//if value exists
var value_exists = false;
$("#"+select_id+" option").each(
function(val, htmlelement) {
if ($(this).val() == value) {
value_exists = true;
}?>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,
);?>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.