Jump to content


Tutorial info Visit support topic

  • Added on: Oct 27 2009 06:39 PM
  • Views: 1102
 


Add Thumb links

IP.Gallery add thumb nail links to the share option within the view image option.

Posted by Jenolan on Oct 27 2009 06:39 PM
This modification adds a BBCode & HTML link for embedding a thumbnail with a link to the main image in the 'Share' link block in IP.Gallery
Find:

<if test="showhotlinking:|:$this->settings['display_hotlinking'] == 1 AND $this->settings['gallery_web_accessible']=='yes' AND !$info['media']">
<h3 class='maintitle no-border'>{$this->lang->words['image_share']}</h3>
<div class='generic_bar'></div>
<ul class='image_info'>
<li class='row1'>
<strong>{$this->lang->words['gal_bbcode_pre']}</strong>
<input onclick="this.select();" type='text' size='40' readonly='readonly' name='bbcode1' value='[URL={$this->settings['board_url']}/index.php?app=gallery&amp;module=images&amp;img={$info['id']}][IMG]{$info['image_url']}[/IMG][/URL]' class='input_text' />
</li>
<li class='row2'>
<strong>{$this->lang->words['gal_html_pre']}</strong>
<input onclick="this.select();" type='text' size='40' readonly='readonly' name='html1' value='&lt;a href='{$this->settings['board_url']}/index.php?app=gallery&amp;module=images&amp;img={$info['id']}'&gt;&lt;img src='{$info['image_url']}' alt='<if test="set_cleancaption:|:$info['clean_caption'] = htmlspecialchars( $info['caption'], ENT_QUOTES )">{$info['clean_caption']}</if>' /&gt;&lt;/a&gt;' class='input_text'/>
</li>
<li class='row1'>
<strong>{$this->lang->words['gal_imgurl_pre']}</strong>
<input onclick="this.select();" type='text' size='40' readonly='readonly' name='link1' value='{$info['image_url']}' class='input_text' />
</li>
<li class='row2'>
<strong>{$this->lang->words['gal_pgurl_pre']}</strong>
<input onclick="this.select();" type='text' size='40' readonly='readonly' name='link2' value='{$this->settings['board_url']}/index.php?app=gallery&amp;module=images&amp;img={$info['id']}' class='input_text' />
</li>
<li class='row1'>
<strong>{$this->lang->words['gal_bbcode_pre_thumb']}</strong>
<input onclick="this.select();" type='text' size='40' readonly='readonly' name='bbcode1' value='[URL={$this->settings['board_url']}/index.php?app=gallery&amp;module=images&amp;img={$info['id']}][IMG]{$info['image_url_thumb']}[/IMG][/URL]' class='input_text' />
</li>
<li class='row2'>
<strong>{$this->lang->words['gal_html_pre_thumb']}</strong>
<input onclick="this.select();" type='text' size='40' readonly='readonly' name='html1' value='&lt;a href='{$this->settings['board_url']}/index.php?app=gallery&amp;module=images&amp;img={$info['id']}'&gt;&lt;img src='{$info['image_url_thumb']}' alt='<if test="set_cleancaption:|:$info['clean_caption'] = htmlspecialchars( $info['caption'], ENT_QUOTES )">{$info['clean_caption']}</if>' /&gt;&lt;/a&gt;' class='input_text'/>
</li>
</ul>
</if>


Before:

</ul>
</if>



Add:

<li class='row1'>
<strong>{$this->lang->words['gal_bbcode_pre_thumb']}</strong>
<input onclick="this.select();" type='text' size='40' readonly='readonly' name='bbcode1' value='[URL={$this->settings['board_url']}/index.php?app=gallery&amp;module=images&amp;img={$info['id']}][IMG]{$info['image_url_thumb']}[/IMG][/URL]' class='input_text' />
</li>
<li class='row2'>
<strong>{$this->lang->words['gal_html_pre_thumb']}</strong>
<input onclick="this.select();" type='text' size='40' readonly='readonly' name='html1' value='&lt;a href='{$this->settings['board_url']}/index.php?app=gallery&amp;module=images&amp;img={$info['id']}'&gt;&lt;img src='{$info['image_url_thumb']}' alt='<if test="set_cleancaption:|:$info['clean_caption'] = htmlspecialchars( $info['caption'], ENT_QUOTES )">{$info['clean_caption']}</if>' /&gt;&lt;/a&gt;' class='input_text'/>
</li>

 
ACP >> Look & Feel >> Manage Languages >> English (USA) >> Gallery >> Public Gallery
Add string
key = gal_bbcode_pre_thumb default text = BBCode (Thumb):
key = gal_html_pre_thumb text = HTML (Thumb):
 
Open {forum}/admin/applications_addon/ips/gallery/modules_public/images/viewimage.php
Find Line 554:

else
{
$this->data['image'] = $this->registry->glib->makeImageTag( $this->data, 0, 1 );
$this->data['image_url'] = $this->settings['gallery_images_url'] . '/' . $dir . $this->data['masked_file_name'];
}

Add before closing brace '}'

$this->data['image_url_thumb'] = $this->settings['gallery_images_url'] . '/' . $dir . 'tn_' . $this->data['masked_file_name'];


Find Line 723:

else
{
$this->data['image'] = $this->registry->glib->makeImageTag( $this->data, 0, 1 );
$this->data['image_url'] = $this->settings['gallery_images_url'] . '/' . $dir . $this->data['masked_file_name'];
}

Add before closing brace '}'

$this->data['image_url_thumb'] = $this->settings['gallery_images_url'] . '/' . $dir . 'tn_' . $this->data['masked_file_name'];

Powered by Tutorials 1.5.1 © 2013, by Michael McCune