Language: 
To browser these website, it's necessary to store cookies on your computer.
The cookies contain no personal information, they are required for program control.
  the storage of cookies while browsing this website, on Login and Register.

User

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

Community



Stats

  • *Total Members: 4442
  • *Latest: Argon2

  • *Total Posts: 16406
  • *Total Topics: 2506
  • *Online Today: 14
  • *Most Online: 292
(12.11.16, 09:37:31)
  • *Users: 0
  • *Guests: 0
  • *Spiders: 4
  • *Total: 4

  • *Google
  • *Baidu (3)

Author Topic: [TIP] HighSlide for rescaled inline images  (Read 15626 times)

0 Members and 0 Guests are viewing this topic.

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 5786
  • Gender: Female
[TIP] HighSlide for rescaled inline images
« on: 29.12.11, 14:50:06 »
With two small changes you can use the PortaMx HighSlide for rescaled (smaller) inline images (img tags).
Step 1.. Open the file /Sources/Subs.php and find (~ Line 1269)
Code: [Select]
'content' => '<img src="$1" alt="{alt}"{width}{height} class="bbc_img resized" />',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),

Replace with:
Code: [Select]
'content' => '<a href="$1" class="highslide" title="Click to enlarge" onclick="return hs.expand(this, {align: \'center\', headingEval: \'this.thumb.alt\'})"><img src="$1" alt="{alt}"{width}{height} class="bbc_img resized" /></a>',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),

Step 2.. Open the file /Themes/default/scripts/theme.js and find (~ Line 39)
Code: [Select]
// Add a load event for the function above.
addLoadEvent(smc_toggleImageDimensions);

Replace with:
Code: [Select]
// Add a load event for the function above.
// addLoadEvent(smc_toggleImageDimensions);

Admin - Features and Options - Layout SettingsNow go to Admin - Features and Options - Layout:

Set Max width of posted pictures and Max height of posted pictures to a smaller value, as example 200

Now all NEW inserted images are resized to 200px and can expand in HighSlide with a click on the image.
For exiting images in topics, edit the topic and save it again (without any change).
Many are stubborn in relation to the path, a few in relation to the target.

Offline agent47

  • Newbie
  • *
  • Posts: 43
  • Gender: Male
    • Superhero Alliance
Re: [TIP] HighSlide for rescaled inline images
« Reply #1 on: 25.01.12, 15:15:30 »
This is pretty damn awesome! Love it! Thanks a load feline.

Offline zeum

  • Newbie
  • *
  • Posts: 8
  • Gender: Male
    • psxexclusive.net63.net
Re: [TIP] HighSlide for rescaled inline images
« Reply #2 on: 14.09.13, 06:06:57 »
How would i go about doing this... But for YouTube videos. The videos don't auto-fit themselves... So you cannot see the full video. I'd like to make the video Auto-Fit to the custom size of the Panel.