Weegee works for File fields. Although, note that at this time it doesn’t cache the thumbs. I could be persuaded to update it to so so through a donation :-)
There is also a forum thread about Weegee.
I get his error on sites once they hit the server: Warning: mkdir() [function.mkdir]: Permission denied in /home/website/dev/releases/xxxxxxxxxxxxxxx/system/extensions/ext.lg_image_preview_ext.php on line 334
It appears its having trouble getting permission to make the directory…I can’t figure out how to fix this beside 777 my entire assets/images directory, which doesn’t seem like the right thing to do 😊
Crazy to me how UI stuff always seems to be the most ignored with EE. I think LGThumb makes the edit screen so usable and the flexibility prior to fieldframe, it was just perfect. Wegee is on some weak sauce by comparison- only one field, no resizing etc. EE 2.0 probably has 3d animations of the articles or something else that is making ignoring this feature so easy.
I modified this extension a bit to work with nGen File Field (and other file extensions). It’s sort of a hack but whatever, can’t sit around waiting for this stuff to happen by itself. 😛
The issue is summed up like so…
file extension puts image name into database field and works out the path based on file upload setting where as LG Image Preview trying to read full path to work out thumbs and since no path info exist there is no thumb to create. hence the empty table cell
…so rather than try to work out the logic of what the person is using to store a file, I figure you could just ask for a /path/to/file and put it in if necessary.
'path_to_file' => 'Enter /path/to/file if necessary',
$DSP->body .= $DSP->td($class) . "<small>".$LANG->line('get_custom_field_from')."</small>" . $DSP->td_c();
$DSP->body .= $DSP->td($class) . "<select name='weblogs[{$row['weblog_id']}][custom_field_id]'>";
$DSP->body .= $DSP->input_select_option('', $LANG->line('no_image_custom_field'));
foreach ($fields->result as $field_data)
{
$selected = (
(isset($this->settings['weblogs'][$row['weblog_id']]['custom_field_id']) === TRUE)
&& $this->settings['weblogs'][$row['weblog_id']]['custom_field_id'] == $field_data['field_id']
) ? 1 : 0;
$DSP->body .= $DSP->input_select_option($field_data['field_id'], $field_data['field_label'], $selected);
}
$DSP->body .= $DSP->input_select_footer() . $DSP->td_c();
$DSP->body .= $DSP->tr_c();
…and add this code which will ask for the file path:
$DSP->body .= $DSP->td($class) . "<small>".$LANG->line('get_custom_field_from')."</small>" . $DSP->td_c();
$DSP->body .= $DSP->td($class) . "<select name='weblogs[{$row['weblog_id']}][custom_field_id]'>";
$DSP->body .= $DSP->input_select_option('', $LANG->line('no_image_custom_field'));
foreach ($fields->result as $field_data)
{
$selected = (
(isset($this->settings['weblogs'][$row['weblog_id']]['custom_field_id']) === TRUE)
&& $this->settings['weblogs'][$row['weblog_id']]['custom_field_id'] == $field_data['field_id']
) ? 1 : 0;
$DSP->body .= $DSP->input_select_option($field_data['field_id'], $field_data['field_label'], $selected);
}
$DSP->body .= $DSP->input_select_footer() . $DSP->td_c();
$DSP->body .= $DSP->tr_c();
// new code below
$DSP->body .= $DSP->tr()
. $DSP->td($class, '150px')
. "<small>".$LANG->line('path_to_file').":</small>"
. $DSP->td_c()
. $DSP->td($class)
. $DSP->input_text("weblogs[{$row['weblog_id']}][path_to_file]", $weblog_settings['path_to_file'])
. $DSP->td_c()
. $DSP->tr_c();
if(substr($url, 0, 7) != "http://")
{
preg_match("/<img\s*src\s?=\s?[\"'](.*)[\"']/", $url, $matches);
if(isset($matches[1]) === TRUE)
{
$url = $matches[1];
}
}
…and add this code which will see if you entered any path info; if you did it’ll prefix the URL with it:
if(substr($url, 0, 7) != "http://")
{
preg_match("/<img\s*src\s?=\s?[\"'](.*)[\"']/", $url, $matches);
if(isset($matches[1]) === TRUE)
{
$url = $matches[1];
}
}
// new code below
if(empty($this->settings['weblogs'][$row['weblog_id']]['path_to_file']) === FALSE)
{
$url = $this->settings['weblogs'][$row['weblog_id']]['path_to_file'] . $url;
}
Not as nice as automatically figuring out your custom field situation but it works. Hope that helps someone.
Man that’s really cool that you did all that work- this extension had been pissing me off with the lack of field frame support. Fortunately, Nicolas Bottari released the death knell for this extension:NB Custom Field Data basically the best extension for tweaking that page right now. It has thumbnails, or any other custom field data on the edit listing screen in EE
Nicolas Bottari released the death knell for this extension:NB Custom Field Data basically the best extension for tweaking that page right now. It has thumbnails, or any other custom field data on the edit listing screen in EE
I just tried out that extension and I think it’s cool and all but I don’t see it replacing lg image preview for me anytime soon. (Partly because it set off a string of errors.) It’s like using an aircraft carrier to pound in a nail. ;)
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.