function m4music_imagecache_generate($presetname, $filepath) { if (!($preset = imagecache_preset_by_name($presetname))) { return; } $dst = imagecache_create_path($presetname, $filepath); if (!file_exists($dst)) { imagecache_build_derivative($preset['actions'], $filepath, $dst); } return $dst; }
* - $view: The view object * - $field: The field handler object that can process the input * - $row: The raw SQL result that can be used * - $output: The processed output that will normally be used. * * When fetching output from the $row, this construct should be used: * $data = $row->{$field->field_alias} * * The above will guarantee that you'll always get the correct data, * regardless of any changes in the aliasing that might happen if * the view is modified. */ // Shows the islamic posters image. global $base_url; $path= "sites/default/files/islamposters/". $output; $presetname = 'Islam_posters'; $preset = imagecache_preset_by_name($presetname); $src = $path; $dst = imagecache_create_path($presetname, $src); // Ensure existing derivative or try to create it on the fly if (file_exists($dst) || imagecache_build_derivative($preset['actions'], $src, $dst)) { } ?> <div style="width:600px;" align="center"> <a href="<?php print $base_url.'/'.$dst ?> " rel="lightbox"> <img src='<?=$base_url?>/sites/default/files/islamposters/<?php print $output;?>' height="312" width="211" align="absmiddle" border="0" /> </a> </div>
/** * Print logo. */ function jake_print_logo() { $settings = theme_get_settings('jake'); $name = check_plain(variable_get('site_name', 'Drupal')); if (!empty($settings['printlogo_path']) && file_exists($settings['printlogo_path']) && module_exists('imagecache') && imagecache_preset_by_name('logo_print')) { $url = imagecache_create_url('logo_print', $settings['printlogo_path']); $image = "<img src='{$url}' title='{$name}' class='logo'/>"; return l($image, '<front>', array('html' => TRUE, 'attributes' => array('class' => 'logo'))); } // Last resort, use just the name return l(t($name), '<front>'); }
function mni_chatroom_user_list($users, $node) { global $user; $is_admin = $user->uid == $node->uid || user_access('administer chats'); $html = '<div id="chatroom-user-list-wrapper"><ul id="chatroom-user-list">'; $preset = false; if (module_exists('imagecache') && $node->chat->imagecache_preset) { $preset = imagecache_preset_by_name($node->chat->imagecache_preset); } foreach ($users as $chat_user) { $class = 'chatroom-user' . ($chat_user->sid == session_id() ? ' chatroom-current-user' : ''); $id = 'chatroom_' . ($chat_user->uid ? "user_{$chat_user->uid}" : "guest_{$chat_user->guest_id}"); $html .= '<li id="' . $id . '" class="' . $class . '">'; if ($chat_user->uid && $node->chat->profile_picture && $chat_user->picture) { if ($preset) { $alt = t("@user's picture", array('@user' => $chat_user->name)); $chat_user->picture = theme('imagecache', $preset['presetname'], $chat_user->picture, $alt, $alt); $html .= $chat_user->picture . theme('username', $chat_user); } else { $html .= theme('user_picture', $chat_user); } } else { $html .= theme('username', $chat_user); } $html .= '</li>'; } $html .= '</ul></div>'; return $html; }