Page Index Toggle Pages: 1
Topic Tools
YaBB 25AE new post indicators (Read 2,477 times)
JonB
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 3,768
Location: Land of the Blazing Sun!

YaBB 2.6.0
Re: YaBB 25AE new post indicators
Reply #9 - Feb 2nd, 2012 at 7:44pm
Post Tools
Dandello is dead-on.

I will explain it in detail.  PNG and GIF files are totally different internally. Graphic files contain two types of data - metadata (often called 'header info') -- which describes the characteristics of the current file, things like color depth, dimensions, date, copyright, author info etc (EXIF is one metadata type for jpg & jpeg) and then the image data (the image itself).  They can't work without each other, and they are different for each file type (or else - think about it - the file types would be redundant)  Shocked

SO - a .gif that has been renamed to .png (or vice-versa) isn't what the rendering engine was looking for.  

There is a technology generally termed (after Apache's version) 'mime-magic' that "knows" what different headers look like (format). It makes its best guess, and tries to render the image as the 'second-guessed' file type.

Apache needs it because in Linux/Unix filesystems, files do not have to have an extension as is the general rule on NTFS, or CFS.  (Mac used a 'forked file system' which is unique to Apple stuff)  

The same technology is built into browsers to 'guess' what you mess up on.  Grin

When a new format comes along the mime-types, mime-magic and rendering engines all have to be updated. Servers can be manually updated in their configuration systems -- because servers don't have to render the files, just make the 'handler-type' association. (I have done that plenty of times).

SO - if some ne'er-do-well misnames the file extension, well, then we can rely on 'mime-magic' to read the headers and try to fix it.

OTAY everyone???

Cool
« Last Edit: Feb 2nd, 2012 at 8:47pm by JonB »  

I find your lack of faith disturbing.
Back to top
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,088
Location: Earth

YaBB 2.6.0
Re: YaBB 25AE new post indicators
Reply #8 - Jan 25th, 2012 at 4:07pm
Post Tools
Well, let's just say lots of things work because your OS and other software  is pretty good at guessing (or going through if/else and mime checks). But that slows things down.
  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
BloodyRue
Junior Member
**
Offline



Posts: 83

None
Re: YaBB 25AE new post indicators
Reply #7 - Jan 25th, 2012 at 7:54am
Post Tools
I have since then found I can convert jpg to png via the paint program. That is what I am doing now. I wasn't aware of that when I started with YaBB. And I also know how to adjust the files better now. but the renaming thing was working for me to start with.
  

   
Back to top
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,088
Location: Earth

YaBB 2.6.0
Re: YaBB 25AE new post indicators
Reply #6 - Jan 25th, 2012 at 3:55am
Post Tools
But the fact that the images loaded on your browser doesn't mean they will load properly for someone else, and if you"re using some of the more advanced png features, it may not load at all. It's always best to properly identify a file type so your browser knows which mime type it's look at. Making a computer guess is usually a bad idea.  Shocked
  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
BloodyRue
Junior Member
**
Offline



Posts: 83

None
Re: YaBB 25AE new post indicators
Reply #5 - Jan 25th, 2012 at 2:20am
Post Tools
not so sure on that. I changed the names of gif to png and png to gif and the images displayed fine.
  

   
Back to top
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,088
Location: Earth

YaBB 2.6.0
Re: YaBB 25AE new post indicators
Reply #4 - Jan 24th, 2012 at 4:21pm
Post Tools
Replying to my own post (not the first time)  Grin

If your new file is in a different format, you really have no choice but to hunt down those gifs and rename them.

BoardIndex.pl and ajax.js
« Last Edit: Jan 24th, 2012 at 4:22pm by Dandello »  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,088
Location: Earth

YaBB 2.6.0
Re: YaBB 25AE new post indicators
Reply #3 - Jan 24th, 2012 at 3:01pm
Post Tools
One of the other places those names are used is in ajax.js  (in function MarkFinished).

But it's usually easier just to change the graphic and keep the same names.
  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
JonB
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 3,768
Location: Land of the Blazing Sun!

YaBB 2.6.0
Re: YaBB 25AE new post indicators
Reply #2 - Jan 24th, 2012 at 3:00pm
Post Tools
Mine were png's - and - I wanted to 'find things out' for other reasons.

Cool

  

I find your lack of faith disturbing.
Back to top
IP Logged
 
BloodyRue
Junior Member
**
Offline



Posts: 83

None
Re: YaBB 25AE new post indicators
Reply #1 - Jan 24th, 2012 at 12:31pm
Post Tools
I just renamed the new graphics on.gif and removed off.gif
  

   
Back to top
IP Logged
 
JonB
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 3,768
Location: Land of the Blazing Sun!

YaBB 2.6.0
YaBB 25AE new post indicators
Jan 24th, 2012 at 4:07am
Post Tools
OK, I will admit it, I am stumped (again).

As far as I can tell, there are two times the 'on.gif'/'off.gif' icon files are used. I'm trying to use different graphic files instead -- on_led.png and off-led.png

One time is when the Boards are iterated to fill the Categories, and then again in the Button bar at the bottom of the Boards, and before the Info Center starts.

I tracked down where the button bar reference is in BoardIndex.template

Code (HTML)
Select All
<!-- Board Index Button Bar start -->
<table class="bordercolor" cellpadding="4" cellspacing="0" border="0" width="100%">
<tr>
	<td class="shadow" align="center">
		<div class="small" style="float: left; width: 49%; text-align: left;">
			<img src="$imagesdir/on_led.png" border="0" id="no_edit" alt="$boardindex_txt{'333'}" title="$boardindex_txt{'333'}" style="vertical-align: middle;" /> $boardindex_txt{'333'}&nbsp;&nbsp;
			<img src="$imagesdir/off_led.png" border="0" id="no_edit" alt="$boardindex_txt{'334'}" title="$boardindex_txt{'334'}" style="vertical-align: middle;" /> $boardindex_txt{'334'}
		</div>
		<div class="small" style="float: right; width: 49%; text-align: right;">
			{yabb boardhandellist}
		</div>
	</td>
</tr>
</table>  


"that works"

I 'thought' I had tracked down the other reference to ./Sources/BoardIndex.pl -- but no joy when logged in.

Edited:
OK I did -  they are used in two places - ~ line 296 & ~ line 400


thanks god for grepwin...  Wink
http://code.google.com/p/grepwin/

Posted to hopefully save someone else the task...

Cool
« Last Edit: Jan 24th, 2012 at 4:38am by JonB »  

I find your lack of faith disturbing.
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Topic Tools
 
  « Board Index ‹ Board  ^Top