News:

Wondering if this will always be free?  See why free is better.

Main Menu

Image Thumbnail

Started by ***Teh GodFather***, January 23, 2008, 11:46:48 PM

Previous topic - Next topic

***Teh GodFather***

Quote from: lvzifer on March 22, 2008, 10:57:52 AM
is this modification to make thumbnail bigger ? it's to small ?? if not how could I do that ?
This modification adds new BBC, it is not editing any options...

I'll try to edit mod in next few days to improve it and fix some errors whic I found...

goldenboy48

Ok guys,

To keep the aspect ratio of the image while resizing it, I did this change to the mod.

<?xml version="1.0"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
   <name>Image Thumbnail BBCode</name>
   <id>Tomahawk:Image_Thumbnail_BBCode</id>
   <version>1.0</version>
   <homepage>http://tomahawk.110mb.com</homepage>
   <file name="$sourcedir/Subs.php">
      <operation>
         <search position="before"><![CDATA[
         array(
            'tag' => 'white',
            'before' => '<span style="color: white;">',
            'after' => '</span>',
         ),
]]></search>
         <add><![CDATA[
         array(
            'tag' => 'imgt',
            'type' => 'unparsed_content',
            'content' => '<a href="$1" target="_blank"><img src="$1" width="25%" height="25%" border="0" /></a>',
            'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
            'disabled_content' => '($1)',
         ),
]]></add>
      </operation>
</file>

<file name="$themedir/Post.template.php">
   <operation>
      <search position="before"><![CDATA[
         'flash' => array('code' => 'flash', 'before' => 'http://',%20'after'%20=>%20'', 'description' => $txt[433]),
]]></search>
   <add><![CDATA[
         'imgt' => array('code' => 'imgt', 'before' => '[imgt]', 'after' => '[/imgt]'),
]]></add>
   </operation>
</file>
</modification>

4b11l

Quote from: PanesarV on March 27, 2008, 11:46:09 PM
Ok guys,

To keep the aspect ratio of the image while resizing it, I did this change to the mod.

<?xml version="1.0"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
   <name>Image Thumbnail BBCode</name>
   <id>Tomahawk:Image_Thumbnail_BBCode</id>
   <version>1.0</version>
   <homepage>http://tomahawk.110mb.com</homepage>
   <file name="$sourcedir/Subs.php">
      <operation>
         <search position="before"><![CDATA[
         array(
            'tag' => 'white',
            'before' => '<span style="color: white;">',
            'after' => '</span>',
         ),
]]></search>
         <add><![CDATA[
         array(
            'tag' => 'imgt',
            'type' => 'unparsed_content',
            'content' => '<a href="$1" target="_blank"><img src="$1" width="25%" height="25%" border="0" /></a>',
            'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
            'disabled_content' => '($1)',
         ),
]]></add>
      </operation>
</file>

<file name="$themedir/Post.template.php">
   <operation>
      <search position="before"><![CDATA[
         'flash' => array('code' => 'flash', 'before' => 'http://',%20'after'%20=>%20'', 'description' => $txt[433]),
]]></search>
   <add><![CDATA[
         'imgt' => array('code' => 'imgt', 'before' => '[imgt]', 'after' => '[/imgt]'),
]]></add>
   </operation>
</file>
</modification>

Thanks a lot bro, that worked wonderfully.

***Teh GodFather***

I'm trying to make this with gd... I had some poblems, but i think that i got solution, i'll test it when i get home...

goldenboy48

GD Function would be great. Thanks.

Ikhsan4488

can i use this mod for smf 1.1.5?

Succubus Evaligan

Hi somebody can help me?
I have this mod and I want mix with this other mod.
http://custom.simplemachines.org/mods/index.php?mod=771

The problem is the Display.template file

<![CDATA[
<td colspan="2" class="smalltext" width="100%">';
if (!empty($message['attachment']))
{
echo' <div style="overflow: auto; width: 100%;" >
<fieldset>
<legend><b>', $txt['Attached_files'], '</b></legend>
';
//check if there are really images to show as thubmnails
$has_image = false;
$no_image = false;
foreach ($message['attachment'] as $attachment)
{
if ($attachment['is_image'])
$has_image = true;
if (!$attachment['is_image'])
$no_image = true;
//we know there is an image and a non-image. So we can exit
if ($no_image && $has_image)
break;
}

//show text for images
if ($has_image)
echo '<b>', $txt['Thumbnails'], ':</b><br />';

//show the images
foreach ($message['attachment'] as $attachment)
{
if ($attachment['is_image'])
{
if ($attachment['thumbnail']['has_thumb'])
{
echo '
                                    <a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" rel="lightbox"><img                       src="', $attachment['thumbnail']['href'], '" alt=""                id="thumb_', $attachment['id'], '" border="0" /></a>';
<a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '"  target="_blank"><img style="margin:5px;" src="', $attachment['thumbnail']['href'], '" align="middle" alt="" id="thumb_', $attachment['id'], '" border="0" /></a>';
}
else
{
echo '
<a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '"  target="_blank"><img  src="' . $attachment['href'] . ';image"  align="middle" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" border="0" /></a>';
}
}
}

//show text for other attached files
if ($no_image && $has_image)
echo '<br /><br /><b>', $txt['Other_attached_files'], ':</b><br />';

//show other attached files
foreach ($message['attachment'] as $attachment)
{
if (!($attachment['is_image']))
{
echo '
<br /><a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a> (', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)<br />';
}
}

echo '</fieldset>
</div>';
}
]]>

How I do that two mods working together at same time?
Yuri Goddess

RoRoo

I'm loving this mod to death...
But When I replace the IMG tags with the IMGT ones to make the default tags use IMGT functionality, it also resizes the images users place in their signature....

Is there a way around this??

TIA!!

Robert

TGB

thanks, I seen this mod and got to thinking I could try making one and here is my first version.
http://custom.simplemachines.org/mods/index.php?mod=1220

im anxious to see what you guys say is wrong with it  ;)
www.dreamcasthaven.com <----- Running SMF 1.1.16 & heavily modified
www.psxhaven.com <----- Running SMF 1.1.16 & heavily modified
www.romhaven.info <----- Running SMF 1.1.16 & heavily modified
www.bthaven.com <----- Running TT 2.06

***Teh GodFather***

Quote from: RoRoo on May 28, 2008, 08:42:37 AM
I'm loving this mod to death...
But When I replace the IMG tags with the IMGT ones to make the default tags use IMGT functionality, it also resizes the images users place in their signature....

Is there a way around this??

TIA!!

Robert

I don't think that you can do this because you are replacing tags...

58tbird

Quote from: Ikhsan4488 on May 01, 2008, 02:54:50 PM
can i use this mod for smf 1.1.5?
I just installed it on 1.1.5 and it seems to work fine.  However, is there supposed to be a description of the function when you hover over the button?  If so, maybe that fails in 1.1.5 because nothing happens when I hover over the new button.

58tbird

Hi!  Can anyone help me on this?  I'm getting this error message:

    8: Undefined index: description
    File: ...default/languages/Post.english.php (main sub template - eval?)
    Line: 982

I just installed the Thumbnail Image mod, so I imagine it has something to do with that.  What can I do about this error, and does it harm anything other than load up my Error Log?

Also, is there any way to add a description of the function when you hover over the button?

58tbird

In case anyone else needs this information...

I haven't gotten a response here, but I received some help on the 1.1.x board here.

The end result is that the mod works for the most part, but it seems to be missing some instructions to call up the description for the button.  So there's no description when you hover over the button, and I'm not sure but every time someone either uses the button or maybe simply logs in to your forum it generates an error in your error log.  I suppose if you don't get much traffic you could simply delete the errors every day or two but if you don't want to mess with that, don't install.

I like the mod, so I may keep it.  But it would be great if this little bug could be fixed though.


illmakeyouscream

Can I get some help on this with the image tag or something this is totally different then the other thumbnail topic right? has nothing to be done with attachments.

Advertisement: