[BETA] Image resize for Smartor Gallery (mouse wheel)

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply
Alex Zuyev
Registered User
Posts: 32
Joined: Sun Dec 28, 2003 1:47 pm
Location: Moscow
Contact:

[BETA] Image resize for Smartor Gallery (mouse wheel)

Post by Alex Zuyev »

Hallo.
I have just made an image resize java-script for Smartor Gallery with mouse wheel.
Exaple here only for IE, you need to set a mouse at the picture and use its wheel to resize.

Code: Select all

############################################################## 
## MOD Title: image resize
## MOD Author: Alex (N/A) http://www.piercing.ru
## MOD Description: Resize images in Smartor Gallery with mouse wheel (IE only)
## MOD Version: 0.0.1
## 
## Installation Level: Easy
## Installation Time: ~5 Minutes 
## Files To Edit: album_page_body.tpl 
## Included Files: n/a
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
############################################################## 
## Author Notes: 
##
## demo board: http://www.piercing.ru/phpBB/album.php
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

# 
#-----[ OPEN ]------------------------------------------ 
# 

templates\subSilver\album_page_body.tpl

# 
#-----[ FIND ]------------------------------------------ 
# 

<table width="100%" cellspacing="2" cellpadding="2" border="0">

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 

// mod script image resize
<SCRIPT> 
var count = 10; 

function Picture() 
{ 
   count = Counting(count); 
   Resize(count); 
   return false; 
} 

function Counting(count){    
        if (event.wheelDelta >= 120) 
                count++; 
        else if (event.wheelDelta <= -120) 
                count--;    
   return count; 
} 
function Resize(count){ 
    
       wImage.style.zoom = count + '0%'; 
      oCounter.innerText = count + '0%';    
} 
</SCRIPT>

# 
#-----[ FIND ]------------------------------------------ 
# 

  <tr> 
   <td class="row1" align="center"><img src="{U_PIC}" border="0" vspace="10" alt="{PIC_TITLE}" title="{PIC_TITLE}" /></td> 
  </tr>

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 

// mod script image resize
  <tr> 
   <td class="row1" align="center"><span style="font-weight:normal">Picture size - <span id="oCounter" style="color:red;">100%</span></span> 
<br><font size=-2>For changing the picture's size set your mouse on the picture and roll the wheel</font><br> 
   <img src="{U_PIC}" border="0" vspace="10" alt="{PIC_TITLE}" title="{PIC_TITLE}"  id="wImage"  onmousewheel="return Picture();"/></td> 
  </tr>

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM
Last edited by Alex Zuyev on Wed Feb 01, 2006 12:20 am, edited 3 times in total.
Best wishes,
Alex

User avatar
jeevan25
Registered User
Posts: 388
Joined: Thu Dec 30, 2004 2:45 am

Post by jeevan25 »

give a proper prefix and use the MODing template. Most people wouldn't understand that. seems like a nice mod

User avatar
Bri
Registered User
Posts: 115
Joined: Wed Jul 02, 2003 7:27 am
Location: Who knows...

Post by Bri »

Wow, nice job matey - I'm with jeevan25 when he says, "use the MODing template".

Shame it only workins in IE... How does it 'fail' in other browsers such as Firefox? (just remastered so don't have it installed yet!).

Alex Zuyev
Registered User
Posts: 32
Joined: Sun Dec 28, 2003 1:47 pm
Location: Moscow
Contact:

Post by Alex Zuyev »

Thank you very much - this is my first mod submitting ;)
Best wishes,
Alex

User avatar
Bri
Registered User
Posts: 115
Joined: Wed Jul 02, 2003 7:27 am
Location: Who knows...

Post by Bri »

How does it 'fail' in other browsers such as Firefox?

User avatar
MHobbit
Former Team Member
Posts: 4761
Joined: Thu Mar 18, 2004 5:32 pm
Location: There and Back Again

Post by MHobbit »

Hello,

Please edit your topic title with a prefix as outlined in MOD Development forum rules, section 3.a. This will allow people to see the development status of your MOD at a glance.

Thank you,
The phpBB MOD Team
Former phpBB MOD Team member
No private support is offered.
"There’s too many things to get done, and I’m running out of days..."

taicomjp
Registered User
Posts: 9
Joined: Wed Jul 14, 2004 1:38 pm

Post by taicomjp »

It will error to show negative number
fix
function Resize(count){
if (wImage.style.zoom>0)
{
wImage.style.zoom = count + '0%';
oCounter.innerText = count + '0%';
}
}

Post Reply

Return to “[2.0.x] MODs in Development”