Drupal 7: Using Rate Widget in Blocks or Panels
<?php
if (arg(0) == 'node' && is_numeric(arg(1)) && ($node = node_load(arg(1)))) {
print rate_embed($node, 'NAME');
}
?>
Replace NAME by the widget’s machine readable name.
<?php
if (arg(0) == 'node' && is_numeric(arg(1)) && ($node = node_load(arg(1)))) {
print rate_embed($node, 'NAME');
}
?>
Replace NAME by the widget’s machine readable name.
<?php
$page_id = "123456xxxxxx";
$xml = @simplexml_load_file("http://api.facebook.com/restserver.php?method=facebook.fql.query&amp;amp;query=SELECT%20fan_count%20FROM%20page%20WHERE%20page_id=".$page_id."") or die ("a lot");
$fans = $xml->page->fan_count;
echo $fans;
?>
gefunden auf http://www.perun.net/
visibility rule type: PHP Code
$node = $contexts['argument_entity_id:node_1']->data;
if(count($node->field_fieldname) !=0
{
return TRUE;
}
<style type="text/css">
sup,
sub {
height: 0;
line-height: 1;
vertical-align: baseline;
_vertical-align: bottom;
position: relative;
}
sup {
bottom: 1ex;
}
sub {
top: .5ex;
}
</style>
You (in fact module) should include this code in page.tpl.php to work with IE. Do not remove other xml related things in html tag if exist, just add this two xmlns defs then.
<html xmlns:og="http://opengraphprotocol.org/schema/"
xmlns:fb="http://www.facebook.com/2008/fbml">
views-view-table.tpl.php
<?php
/**
* Product Table View customized so that any columns with no data are omitted from display.
*/
foreach ($rows as $count => $row):
foreach ($row as $field => $content):
if ($content) $column_has_content[ $field ] = true;
endforeach;
endforeach;
?>
<table class="<?php print $class; ?>">
<?php if (!empty($title)) : ?>
<caption><?php print $title; ?></caption>
<?php endif; ?>
<thead>
<tr>
<?php foreach ( $header as $field => $label ): ?>
<?php if ( $column_has_content[ $field ] ): ?>
<th class="views-field views-field-<?php print $fields[$field]; ?>">
<?php print $label; ?>
</th>
<?php endif;?>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php foreach ($rows as $count => $row): ?>
<tr class="<?php print implode(' ', $row_classes[$count]); ?>">
<?php foreach ($row as $field => $content): ?>
<?php if ( $column_has_content[ $field ] ): ?>
<td class="views-field views-field-<?php print $fields[$field]; ?>">
<?php print $content; ?>
</td>
<?php endif; ?>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
ODER
template.php
<?php
/**
* Removes column headers for columns that do not have content.
*/
function THEME-NAME_preprocess_views_view_table__VIEW-NAME(&$vars) {
$rows = $vars['rows'];
$column_has_content = array();
foreach ($rows as $count => $row) {
foreach ($row as $field => $content) {
if (!empty($content)) {
$column_has_content[$field] = TRUE;
}
}
}
$vars['column_has_content'] = $column_has_content;
}
?>
views-view-table–VIEW-NAME.tpl.php
<table class="<?php print $class; ?>">
<?php if (!empty($title)) : ?>
<caption><?php print $title; ?></caption>
<?php endif; ?>
<thead>
<tr>
<?php foreach ($header as $field => $label): ?>
<?php if ( $column_has_content[$field] ): ?>
<th class="views-field views-field-<?php print $fields[$field]; ?>">
<?php print $label; ?>
</th>
<?php endif; ?>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php foreach ($rows as $count => $row): ?>
<tr class="<?php print implode(' ', $row_classes[$count]); ?>">
<?php foreach ($row as $field => $content): ?>
<?php if ( $column_has_content[$field] ): ?>
<td class="views-field views-field-<?php print $fields[$field]; ?>">
<?php print $content; ?>
</td>
<?php endif; ?>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
entweder durch
img {display:block;}
oder
img {vertical-align:bottom;}
ini_set('memory_limit', '16M');
to your sites/default/settings.php file
php_value memory_limit 16M
to your .htaccess file in the Drupal root