Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.30.01 RN All Other Issues
Author Message
neralex
The Mouse Is Extension Of Arm


Joined: Aug 22, 2007
Posts: 1289
Location: Germany

PostPosted: Mon Feb 20, 2017 3:20 am Reply with quote

You have to find the parent container/class where the image is placed. Its differentely from theme to theme. Some older themes doesn't have classes. You can use the inspector tools in your browser to locate it. In Chrome press F12 or in Firefox press STRG+SHIFT+i.
 
View user's profile Send private message
Doulos
Life Cycles Becoming CPU Cycles


Joined: Jun 06, 2005
Posts: 621

PostPosted: Sun Feb 26, 2017 11:16 pm Reply with quote

I found a fix by comparing the files of a theme that did resize the attachments to one that did not. This is not my script - just copied from a theme that does resize images in attachments.

Edit /[the-theme]/forum/viewtopic_body.tpl

find:
Code:
<a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>

</tr>
</table>


add after:
Code:
<script> 

window.onload = resizeimg;
function resizeimg()
{
   if (document.getElementsByTagName)
   {
      for (i=0; i<document.getElementsByTagName('img').length; i++)
      {
         im = document.getElementsByTagName('img')[i];
         if (im.width > 600)
         {
            im.style.width = '800px';
            eval("pop" + String(i) + " = new Function(\"pop = window.open('" + im.src + " ','fullscale','width=400,height=400,scrollbars=1,resizable=1'); pop.focus();\")");
            eval("im.onclick = pop" + String(i) + ";");
            if (document.all) im.style.cursor = 'hand';
            if (!document.all) im.style.cursor = 'pointer';
            im.title = 'Click Here To See Image Full Size ';
         }
      }
   }
}

</script>


You can change the size of the image, of course.

For themes without their own forums add the same script to /modules/Forums/templates/subSilver/viewtopic_body.tpl
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.30.01 RN All Other Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©