We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

LG Image Preview - Offered by Hambo Development

Development and Programming

stinhambo's avatar
stinhambo
1,268 posts
16 years ago
stinhambo's avatar stinhambo

So you’re using the File Module to upload images?

Also, what is Clone?

       
gridonic's avatar
gridonic
231 posts
16 years ago
gridonic's avatar gridonic

Yes, I’m using the File extension to upload the images.

Clone belongs to the “Clone Entry” extension. I’ve tried disabling it, the problem persists.

       
Cem Meric's avatar
Cem Meric
210 posts
16 years ago
Cem Meric's avatar Cem Meric

same issue here, 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

😊

       
gridonic's avatar
gridonic
231 posts
16 years ago
gridonic's avatar gridonic

Any news on this? It’s a great extension, but without File support, I think for many users no usable.

       
stinhambo's avatar
stinhambo
1,268 posts
16 years ago
stinhambo's avatar stinhambo

Well for File users, Ryan Masuga created an extension for you 😊

       
Ryan M.'s avatar
Ryan M.
1,511 posts
16 years ago
Ryan M.'s avatar Ryan M.

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.

       
timkelty's avatar
timkelty
177 posts
16 years ago
timkelty's avatar timkelty

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 😊

       
eyevariety's avatar
eyevariety
158 posts
16 years ago
eyevariety's avatar eyevariety

This thing is hands down a more flexible elegant solution extension than Wegee.

Any possibility it will be updated to support FieldFrame and nGen File Upload?

       
Dane Thomas's avatar
Dane Thomas
139 posts
16 years ago
Dane Thomas's avatar Dane Thomas

Just adding my vote for adding support for FieldFrame / nGen File support.

       
Sean C. Smith's avatar
Sean C. Smith
3,818 posts
16 years ago
Sean C. Smith's avatar Sean C. Smith

Just coming in to say that this doesn’t work with nGen File Field and adding my vote for adding support to that.

       
lealea's avatar
lealea
202 posts
about 16 years ago
lealea's avatar lealea

Beep! Please add support for nGen File Field! :D

       
eyevariety's avatar
eyevariety
158 posts
about 16 years ago
eyevariety's avatar eyevariety

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.

       
rmedek's avatar
rmedek
131 posts
15 years ago
rmedek's avatar rmedek

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.

  1. Insert this into the array in /system/language/english/lang.lg_image_preview_ext.php:
'path_to_file' => 'Enter /path/to/file if necessary',
  1. Find this code somewhere around line 809 in /system/extensions/ext.lg_image_preview_ext.php:
$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();
  1. Find this code around line 194 in /system/extensions/ext.lg_image_preview_ext.php:
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.

       
eyevariety's avatar
eyevariety
158 posts
15 years ago
eyevariety's avatar eyevariety

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

NB Custom Field Data

       
rmedek's avatar
rmedek
131 posts
15 years ago
rmedek's avatar rmedek
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. ;)

       
1 2

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.