Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=1197)
nCode Image Resizer
Original Author: m3talc0re
Previous Authors: Nibigo, live627 (http://www.simplemachines.org/community/index.php?action=profile;u=154736)
SMF Version: 2.0.X
Description:
o nCode Image Resizer for posted images.
o The user can then click on a bar above the image to see the full image in either the same window, a new window or inside the forum itself (the normal "enlarge" method)
o You can set the max width and height.
o Simple edit for custom themes
Thanks to: Original creators of the nCode Image Resizer plugin for vBulletin http://www.ncode.nl/ (http://www.ncode.nl/)
Changelog:
3.0 Update!
Added support to SMF 2.0.17 thanks to Deaks
Works better on all themes for SMF 2.0.x!
Version 2.0
+Added support for SMF 2.0.14
+Added support for SMF 1.1.x
Taken over by vbgamer45
Version 1.4
- Taken over by Runic
- Updated for 2.0.x
- Removed Support for 1.1
Version 1.3.1
* Updated for SMF 2.0 RC3
Version 1.3
- Added Support for SMF 2.0 RC2.
- Added Support for SMF 1.1.11.
- Code optimized (Now the css data is added to the /Theme/css/index.css instead of the index.template.php).
- Changed the format of the mod from .mod to .xml
Version 1.2
- Added Support for SMF 2.0 RC1 & 1.1.8
- Now all the themes load the same .js file
- NIBOGO take over the nCode Image Resizer Mod
Version 1.0
- Modification Release
Why Not Visit:
http://www.smfhacks.com (http://www.smfhacks.com)
Great stuff, I've been needing something like this for a while.
Unfortunately I use a custom theme, and don't know how to make it work in this one!
Any help appreciated.
Okay, it works!
To enable this mod you must do this:
1) At > Features and Options > Basic Features > Leave 0 for Max width and Max height
2) At >" " > Layout and Options> Edit Resize Mode and width and lenght.
For example I placed 615 in the width field only.
The bad thing is that if you used image resize before, all the old posts would be already resized.
This mod only works for new posts.
translate Portuguese and brazilian
thank you
<edit file>
$languagedir/Modifications.portuguese.php
</edit file>
<search for>
?>
</search for>
<add before>
// --- Begin added code - Advanced Visual Verification ---
$txt['ncode_imageresizer_warning_small'] = 'Clique para ver a barra esta imagem completa.';
$txt['ncode_imageresizer_warning_filesize'] = 'Esta imagem foi redimensionada. Clique para ver a barra esta imagem completa. A imagem original é calibrada% sx% 1 $ 2 $ s% 3 $ e pesa SKB.';
$txt['ncode_imageresizer_warning_no_filesize'] = 'Esta imagem foi redimensionada. Clique para ver a barra esta imagem completa. A imagem original é calibrada% sx% 1 $ 2 $ s.';
$txt['ncode_imageresizer_warning_fullsize'] = 'Clique para ver a barra esta pequena imagem.';
$txt['ncode_imageresizer_mode'] = 'Modo Reajustar';
$txt['ncode_imageresizer_original'] = 'Manter tamanho original';
$txt['ncode_imageresizer_enlarge_same'] = 'Aumentar no mesmo documento';
$txt['ncode_imageresizer_open_same'] = 'Abrir na mesma janela';
$txt['ncode_imageresizer_open_new'] = 'Abrir em uma nova janela';
$txt['ncode_imageresizer_max_width'] = 'Largura máxima';
$txt['ncode_imageresizer_max_height'] = 'Altura máxima<br /><span class="smalltext">Deixe em branco para não altura max.</span>';
// --- End added code ---
</add before>
<edit file>
$languagedir/Modifications.brazilian.php
</edit file>
<search for>
?>
</search for>
<add before>
// --- Begin added code - Advanced Visual Verification ---
$txt['ncode_imageresizer_warning_small'] = 'Clique para ver a barra esta imagem completa.';
$txt['ncode_imageresizer_warning_filesize'] = 'Esta imagem foi redimensionada. Clique para ver a barra esta imagem completa. A imagem original é calibrada% sx% 1 $ 2 $ s% 3 $ e pesa SKB.';
$txt['ncode_imageresizer_warning_no_filesize'] = 'Esta imagem foi redimensionada. Clique para ver a barra esta imagem completa. A imagem original é calibrada% sx% 1 $ 2 $ s.';
$txt['ncode_imageresizer_warning_fullsize'] = 'Clique para ver a barra esta pequena imagem.';
$txt['ncode_imageresizer_mode'] = 'Modo Reajustar';
$txt['ncode_imageresizer_original'] = 'Manter tamanho original';
$txt['ncode_imageresizer_enlarge_same'] = 'Aumentar no mesmo documento';
$txt['ncode_imageresizer_open_same'] = 'Abrir na mesma janela';
$txt['ncode_imageresizer_open_new'] = 'Abrir em uma nova janela';
$txt['ncode_imageresizer_max_width'] = 'Largura máxima';
$txt['ncode_imageresizer_max_height'] = 'Altura máxima<br /><span class="smalltext">Deixe em branco para não altura max.</span>';
// --- End added code ---
</add before>
Translate to Turkish:
<edit file>
$languagedir/Modifications.turkish.php
</edit file>
<search for>
?>
</search for>
<add before>
// --- Begin added code - Advanced Visual Verification ---
$txt['ncode_imageresizer_warning_small'] = 'Resmin gerçek boyutunu görmek için bu çubuğa tıklayın.';
$txt['ncode_imageresizer_warning_filesize'] = 'Bu resim yeniden boyutlandırıldı. Resmin gerçek boyutunu görmek için bu çubuğa tıklayın. Resimin orjinal ölçüleri %1$sx%2$s ve boyutu %3$sKB.';
$txt['ncode_imageresizer_warning_no_filesize'] = 'Bu resim yeniden boyutlandırıldı. Resmin gerçek boyutunu görmek için bu çubuğa tıklayın. Resimin orjinal ölçüleri %1$sx%2$s.';
$txt['ncode_imageresizer_warning_fullsize'] = 'Resmin küçük boyutunu görmek için bu çubuğa tıklayın.';
$txt['ncode_imageresizer_mode'] = 'Yeniden Boyutlandırma Modu';
$txt['ncode_imageresizer_original'] = 'Orjinal ölçüleri koru';
$txt['ncode_imageresizer_enlarge_same'] = 'Aynı sayfada genişlet';
$txt['ncode_imageresizer_open_same'] = 'Aynı pencerede aç';
$txt['ncode_imageresizer_open_new'] = 'Yeni pencerede aç';
$txt['ncode_imageresizer_max_width'] = 'Maksimum genişlik';
$txt['ncode_imageresizer_max_height'] = 'Maksimum yükseklik<br /><span class="smalltext">Yüksekliğe sınır koymamak için boş bırakın.</span>';
// --- End added code ---
</add before>
thanks..
Great mod!!!
Translate to Spanish (the file is Modifications.spanish_es.php for Spain or Modifications.spanish.php for South America).
</add before>
<edit file>
$languagedir/Modifications.spanish_es.php
</edit file>
<search for>
?>
</search for>
<add before>
// --- Begin added code - Advanced Visual Verification ---
$txt['ncode_imageresizer_warning_small'] = 'Pincha en esta barra para ver la imagen en su tamaño original.';
$txt['ncode_imageresizer_warning_filesize'] = 'Esta imagen ha sido redimensionada. Pincha en la barra para verla en su tamaño original (%1$sx%2$s px y pesa %3$sKB).';
$txt['ncode_imageresizer_warning_no_filesize'] = 'Esta imagen ha sido redimensionada. Pincha en la barra para verla en su tamaño original (%1$sx%2$s px).';
$txt['ncode_imageresizer_warning_fullsize'] = 'Pincha en la barra para ver la imagen en pequeño.';
$txt['ncode_imageresizer_mode'] = 'Mod redimensionador';
$txt['ncode_imageresizer_original'] = 'Mantener el tamaño original';
$txt['ncode_imageresizer_enlarge_same'] = 'Aumentar sobre la misma ventana';
$txt['ncode_imageresizer_open_same'] = 'Abrir en la misma ventana';
$txt['ncode_imageresizer_open_new'] = 'Abrir en una nueva ventana';
$txt['ncode_imageresizer_max_width'] = 'Anchura máxima';
$txt['ncode_imageresizer_max_height'] = 'Peso máximo<br /><span class="smalltext">Dejar en blanco para que no haya peso máximo.</span>';
// --- End added code ---
</add before>
Thanks for the mod ;D
Regards!
I installed this nCode, but dont work..
i have this image (http://www.wallpaper.cz/primo/old_ir/warcraft3nightelfs2--c1600xc1200.jpg) in my forum, but dont show bar above the image and no resize... :(
im using smf 1.1.5
Any chance of making this compatible with smf 2.0 beta 3.1?
It only works for
[img]http://...[/img]
but not images that have already been sized by smf.
[img width="100" height="100"]http://...[/img]
Yes I am using 1.1.15 also and this isn't working for me either. I am using the Alienation theme and when I add the line to the index template.php file I get a syntax error.
Quote from: ruckstande on May 19, 2008, 01:39:44 PM
Yes I am using 1.1.15 also and this isn't working for me either. I am using the Alienation theme and when I add the line to the index template.php file I get a syntax error.
Although I still havn't got it to work for my forum, make sure you copy the .js file over to your themes directory too, as that could cause an error I imagine.
Thanks, it works perfectly! You just have to edit index.template and i copyd the .js file also to the theme i use now. But thanks for this great mod! Really needed it!
Quote from: IsraelSKA on May 19, 2008, 01:02:33 AM
I installed this nCode, but dont work..
i have this image (http://www.wallpaper.cz/primo/old_ir/warcraft3nightelfs2--c1600xc1200.jpg) in my forum, but dont show bar above the image and no resize... :(
im using smf 1.1.5
Well im using 1.1.5 to and it seems to work ok for me, you must make sure that for all custom templates that you extract the "ncode_imageresizer.js" file from the mod zip and place it inside your custom themes directory (i.e. where all your themes template files are such as index.template.php and the others). I tested it without having the .js file in the directory and no error occurred for me, its just that the resize never happened and the bar never appeared.
Quote from: ruckstande on May 19, 2008, 01:39:44 PM
Yes I am using 1.1.15 also and this isn't working for me either. I am using the Alienation theme and when I add the line to the index template.php file I get a syntax error.
The syntax error sounds to me like maybe either something in the code didnt get copied or something else like that. Make sure that you place the code JUST BEFORE the closing </head> tag in your index.template.php and that its not maybe inside another code, which i have done sometimes on accident. Also, if you just copy/pasted the code from SMF's manual install instructions....dont. Its a nice tool to have but at least for ME when i paste it all the code is mashed together. So if thats the case for you then just go into the mod zip and open the "install.mod" and copy/paste the index.template.php code from there.
You may also need to echo the added code on it's own. The code on its own searches for </head> and that's it. If you have something like echo ' </head>'; then you will need to either put the code like this: echo ' *code here* </head>'; or just echo ' *the code for the mod* '; Either way should work.
Ahah! I've got it working on my forum now.
It turns out I had double </head>s.
I had included the </head> from the default code, but didn't notice the original </head> was still there.
Awesome! This is a great mod and the more it gets working for people the better :P
im not able to make it work in default theme some solution ?
this is what iam looking for man u solved my problem this mod resizes the images even that images brought to the TP frontpage
guess what it works with rt to left forum
thanx bro i will put the arabic Translation soon
Quote from: Violat3r on May 19, 2008, 03:03:03 PM
Quote from: IsraelSKA on May 19, 2008, 01:02:33 AM
I installed this nCode, but dont work..
i have this image (http://www.wallpaper.cz/primo/old_ir/warcraft3nightelfs2--c1600xc1200.jpg) in my forum, but dont show bar above the image and no resize... :(
im using smf 1.1.5
Well im using 1.1.5 to and it seems to work ok for me, you must make sure that for all custom templates that you extract the "ncode_imageresizer.js" file from the mod zip and place it inside your custom themes directory (i.e. where all your themes template files are such as index.template.php and the others). I tested it without having the .js file in the directory and no error occurred for me, its just that the resize never happened and the bar never appeared.
Im using default theme..
Im checked the code but don't work ncode.. :(
Works great. I wanted something like this months ago and I'm glad I just happen to check the mod section today.
Im using 1.1.5
Default template
Quote from: IsraelSKA on May 20, 2008, 11:10:32 AM
Im using default theme..
Im checked the code but don't work ncode.. :(
Just to clarify, have you made sure that you set image max size parameters in: "Features and Options > Layout and Options"? Its at the bottom and the first option is a drop-box asking what resize mode you want, then the 2nd option asks for the maximum size before it starts to resize the image. Its default is nothing, so you MUST first enter a max size before it will work.
Quote from: Violat3r on May 19, 2008, 03:03:03 PM
Quote from: IsraelSKA on May 19, 2008, 01:02:33 AM
I installed this nCode, but dont work..
i have this image (http://www.wallpaper.cz/primo/old_ir/warcraft3nightelfs2--c1600xc1200.jpg) in my forum, but dont show bar above the image and no resize... :(
im using smf 1.1.5
Well im using 1.1.5 to and it seems to work ok for me, you must make sure that for all custom templates that you extract the "ncode_imageresizer.js" file from the mod zip and place it inside your custom themes directory (i.e. where all your themes template files are such as index.template.php and the others). I tested it without having the .js file in the directory and no error occurred for me, its just that the resize never happened and the bar never appeared.
Quote from: ruckstande on May 19, 2008, 01:39:44 PM
Yes I am using 1.1.15 also and this isn't working for me either. I am using the Alienation theme and when I add the line to the index template.php file I get a syntax error.
The syntax error sounds to me like maybe either something in the code didnt get copied or something else like that. Make sure that you place the code JUST BEFORE the closing </head> tag in your index.template.php and that its not maybe inside another code, which i have done sometimes on accident. Also, if you just copy/pasted the code from SMF's manual install instructions....dont. Its a nice tool to have but at least for ME when i paste it all the code is mashed together. So if thats the case for you then just go into the mod zip and open the "install.mod" and copy/paste the index.template.php code from there.
Thanks, I'll try that because that is exactly what I did. I'll give it another shot
Quote from: Violat3r on May 20, 2008, 03:03:16 PM
Quote from: IsraelSKA on May 20, 2008, 11:10:32 AM
Im using default theme..
Im checked the code but don't work ncode.. :(
Just to clarify, have you made sure that you set image max size parameters in: "Features and Options > Layout and Options"? Its at the bottom and the first option is a drop-box asking what resize mode you want, then the 2nd option asks for the maximum size before it starts to resize the image. Its default is nothing, so you MUST first enter a max size before it will work.
I did...
Quote from: Violat3r on May 19, 2008, 03:03:03 PM
The syntax error sounds to me like maybe either something in the code didnt get copied or something else like that. Make sure that you place the code JUST BEFORE the closing </head> tag in your index.template.php and that its not maybe inside another code, which i have done sometimes on accident. Also, if you just copy/pasted the code from SMF's manual install instructions....dont. Its a nice tool to have but at least for ME when i paste it all the code is mashed together. So if thats the case for you then just go into the mod zip and open the "install.mod" and copy/paste the index.template.php code from there.
Yes!
nCode work in my forum...
Thanks ;)
lol awesome and no problem!
hi m3talc0re if you want i made some change and your version work for smf 2 beta 3.1 too ;)
http://rapidshare.com/files/116468172/ncode_imageresizer_smf_231.zip.html
Quote from: m3talc0re on May 19, 2008, 07:24:59 PM
You may also need to echo the added code on it's own. The code on its own searches for </head> and that's it. If you have something like echo ' </head>'; then you will need to either put the code like this: echo ' *code here* </head>'; or just echo ' *the code for the mod* '; Either way should work.
I soooo don't understand. I tried copying and pasting from the .mod file and it didn't work and I had to restore the index file from a template.
works great, thanks
Quote from: ruckstande on May 21, 2008, 12:51:06 PM
Quote from: m3talc0re on May 19, 2008, 07:24:59 PM
You may also need to echo the added code on it's own. The code on its own searches for </head> and that's it. If you have something like echo ' </head>'; then you will need to either put the code like this: echo ' *code here* </head>'; or just echo ' *the code for the mod* '; Either way should work.
I soooo don't understand. I tried copying and pasting from the .mod file and it didn't work and I had to restore the index file from a template.
Would you mind posting your current index.template.php (the one with the added code for this mod) so maybe we can see visually what may be wrong.
Quote from: ruckstande on May 21, 2008, 12:51:06 PM
Quote from: m3talc0re on May 19, 2008, 07:24:59 PM
You may also need to echo the added code on it's own. The code on its own searches for </head> and that's it. If you have something like echo ' </head>'; then you will need to either put the code like this: echo ' *code here* </head>'; or just echo ' *the code for the mod* '; Either way should work.
I soooo don't understand. I tried copying and pasting from the .mod file and it didn't work and I had to restore the index file from a template.
I copied the replacement code from install.mod instead and it worked well
Great Mod Core! ;D
for any of you that have the Resample Big Attached Images Mod also
the Resample Big Attached Images Mod relies on the input in the max height and width of posts setting
since you have to set the settings to 0 for this mod to work, they obviously can't work together
sooooo
what I did was change the Post.php file in sources (the file Resample Big Attached Images Mod adds its code to)
and find the line that Resample Big Attached Images Mod added
$maxWidth = $modSettings['max_image_width'];
$maxHeight = $modSettings['max_image_height'];
and replace it with
$maxWidth = $modSettings['ncode_imageresizer_max_width'];
$maxHeight = $modSettings['ncode_imageresizer_max_height'];
which will then also (pertinently) resize attachments as well as images in the post to what ever you chose in the admin setting for this mod
worked great for me in 1.1.5 :D
I liked this, but I'd like to be able to change the border colour to black. Since the text colour of my forum is white, it's unreadable on the border!
Are you talking about that bar at the top where it displays the text? You want that box to be black? If so, find this line in your index.template.php:
table.ncode_imageresizer_warning, table.ncode_imageresizer_warning td
{
background-color: #fefee1; /* the bgcolor behind the text and image */
Now change the hex code that is #fefee1 to #000000 if you want completely black or any other darker shade or w/e color you want, but it must be a hex color code. Although if your interested, i made my own modification for my forum and your welcome to try it out; find that same line and change the part to:
background-image:url(', $settings['images_url'], '/imageresizeback.gif); background-repeat:repeat-x; /* the bgcolor behind the text and image */
Then place the attached image in your themes image folder. The other attached image is an example of what mine looks like:
Aha, it's CSS. Brilliant, thank you for your instructions and supplying me with the image :) really good of you to go out of your way to do that! :)
meh, it was a simple copy/paste of my already existing code lol. Not really much work involved, but thank you anyway! =D
Hello,
I initially installed ncode_image resizer mod.
Then i decided to uninstall it .
After editing the files, these errors started appearing on my forum error log from all angles..
8: Undefined index: ncode_imageresizer_warning_filesize
File: /home/afrowall/public_html/Themes/default/languages/ModSettings.english-utf8.php (main_above sub template - eval?)
Line: 320
==
8: Undefined index: ncode_imageresizer_warning_fullsize
File: /home/afrowall/public_html/Themes/default/Admin.template.php (main_above sub template - eval?)
Line: 322
==
8: Undefined index: ncode_imageresizer_warning_no_filesize
File: /home/afrowall/public_html/Themes/dilbermc/BoardIndex.template.php (main_above sub template - eval?)
Line: 321
.There are more but all of them seems to be connected to
8: Undefined index: ncode_imageresizer_warning_no_filesize.
and ((main_above sub template - eval?))
please what am i supposed to do about that?
Did you get any errors at all when you clicked the uninstall button? Or did it just say "Test Successful" for all of them?
I did not install this mod properly in the first place.
that was why i decided to remove it.
I was very inexperienced when i installed it but i know better now.
I dont use the default theme, so i always have to modify some more files with each mod i install.
I will have to go to the mod again and see the files it execute.the try to work on them and see what happens. i will be back with my results.
ok, i have fixed it now,..thanks to ye all.
index.template.php:
background-color: #fefee1; /* the bgcolor behind the text and image */
background-image:url(', $settings['images_url'], '/imageresizeback.gif); background-repeat:repeat-x; /* the bgcolor behind the text and image */
thanks for this! perfect!
Hi, i ve one problem with this mod:
I already install the mod manually but i cant see the text over the pop-up window.... im using Black_red theme. When iam using default theme the text is ok but when i m using my theme it disappears.
Also i modified index.template.php from my folder theme and default too.
What can be happening?
hahaah i am n00b, nevermind, the colour of font and background is the same XD
Quote from: Dante_Arg on June 29, 2008, 09:17:44 PM
Hi, i ve one problem with this mod:
I already install the mod manually but i cant see the text over the pop-up window.... im using Black_red theme. When iam using default theme the text is ok but when i m using my theme it disappears.
Also i modified index.template.php from my folder theme and default too.
What can be happening?
hahaah i am n00b, nevermind, the colour of font and background is the same XD
dont feel bad.. i did that same thing with a different mod, took me like two days to figure it out! but we just keep on learnin! hehe..
I installed this mod but don't have any new options under Layout and Options? ::)
Hi... I'm having the same problem everyone else had... except I couldn't solve it... I can't get the tab that opens orignal size to appear can some please take a look at my index.template.php and see what the problem might be thank you :P oh... bye the way I am also using the orange template
for manuel setup
phpmyadmin; setup table code 's :-\
Does anyone have a site with this mod installed that I can look at ?
Is there any chance of getting a new option to show the image ? I'm looking for Lightbox !
Anyone able to do this ?
Quote from: locau on August 12, 2008, 10:11:27 AM
Is there any chance of getting a new option to show the image ? I'm looking for Lightbox !
Anyone able to do this ?
Hi.. this should be a good mod for you.. however.. know that once you have installed the lightbox.. when you click on that image.. it is going to open in de mode of this mod and it's opening in the lightbox...
So.. my question is... can the link to open it in it's original size be disabled in this mod, so that it only can open in the lightbox??
Quote from: MoreBloodWine on August 05, 2008, 06:49:41 PM
Does anyone have a site with this mod installed that I can look at ?
Heres the script in action.
http://www.links4jeeps.com/forum/index.php?topic=8371.msg62440#msg62440
wow...it sure works on the link u gave kizer...... im using the theme Classic-FS which i downloaded from the SMF theme site..... It doesnt have the language folder..im not able to see the image wen i installed it.....sure i did the theme index modification alright....any ideas?
I'm using the DarkWoW theme on SMF 1.1.5, the mod installed fine. However when I go to the Layout and Options at the bottom it shows a drop box and 2 edit boxes that are both blank with no text beside them. Also the mod doesn't work at all no changes to any images, for editting the index.template.php are you suppose to just copy the ncode part from the default index.template.php ? That is what I did and it still didnt work.
Attatched is a screenshot of the layout and options page.
nevermind..ive got it working on my forum now...superb mod btw
Quote from: axodious on August 15, 2008, 06:36:08 PM
I'm using the DarkWoW theme on SMF 1.1.5, the mod installed fine. However when I go to the Layout and Options at the bottom it shows a drop box and 2 edit boxes that are both blank with no text beside them. Also the mod doesn't work at all no changes to any images, for editting the index.template.php are you suppose to just copy the ncode part from the default index.template.php ? That is what I did and it still didnt work.
Attatched is a screenshot of the layout and options page.
Anyone got a fix for this issue yet?
Hello i tried to translate to Greek, but my site doesnt recognise the language..
my site is in Greek, i have installed the greek package!
I open with dreamweaver the install.mod and change in greek,but as you see at the photo my site doesnt recognise Greek!
Do you know why?
I got this to work but I cant see any text in the bar above the image.. it just has the little icon and the tan bar without any words...
(http://img528.imageshack.us/img528/5346/blahblahxu6.png) (http://imageshack.us)
(http://img528.imageshack.us/img528/5346/blahblahxu6.34b9bbead3.jpg) (http://g.imageshack.us/g.php?h=528&i=blahblahxu6.png)
Thanks for this Mod! it's great! I modified it in my custom theme index.template.php.
1st I had problems because I was copying & pasting from SMF Manual install instructions & a error would occur. So I read this topic and found out that sometimes copying from SMF would mess up the code.. So I did what was said, take the code from install.mod file. My issue was that file was a AVI file!!! so when I tried to open it, it would open in windows media player (nothing played of course).. So I decided to Open With notepad and the codes were hard to read!!! They didn't look like the normal codes... SOOOO after maybe an hour of trying to figure it out! I said let me try and copy & paste it to MS Word and don't you know the code came out clear as day and after pasting into index.template, IT FINALLY WORKED!! phew!! this manual install is a killer! But I'm loving my theme so I gotta do it!
Just letting you guys know in case someone has the same issues as I did!!
Thanks again for this great mod!
This is a great mod. Thank you for sharing this with us.
I have translated this mode into to Simple Chinese.
Find Edit (if you are using a custom theme, you should change :Modifications.chinese-simplified-utf8.php" in the "languages" folder of that theme.)
./$languagesdir/Modifications.chinese-simplified-utf8.php
Find
?>
Add Before:
<add before>
// --- Begin added code - Advanced Visual Verification ---
$txt['ncode_imageresizer_warning_small'] = '点击这里看原图';
$txt['ncode_imageresizer_warning_filesize'] = '此图片大小已经自动更改,点击这里看原图. 图片原始大小为 %1$sx%2$s x %3$sKB.';
$txt['ncode_imageresizer_warning_no_filesize'] = '此图片大小已经自动更改,点击这里看原图. 图片原始大小为%1$sx%2$s.';
$txt['ncode_imageresizer_warning_fullsize'] = '点击这里看小图';
$txt['ncode_imageresizer_mode'] = '图片大小自动更改模式';
$txt['ncode_imageresizer_original'] = '保持原本大小';
$txt['ncode_imageresizer_enlarge_same'] = '在同一文件中变大';
$txt['ncode_imageresizer_open_same'] = '用同一窗口显示';
$txt['ncode_imageresizer_open_new'] = '用新窗口显示';
$txt['ncode_imageresizer_max_width'] = '最大宽度';
$txt['ncode_imageresizer_max_height'] = '最大高度<br />
<span class="smalltext">不填入数字则不会设定最大高度</span>';
// --- End added code ---
</add before>
Any update for SMF 2.0??
Thanks
Everyone having issues with not seeing the writing on the bar, and or Admin panel for this mod, go to your Themes/default/languages/Modifications.english.php template, and make sure this code is installed
// --- Begin added code - Advanced Visual Verification ---
$txt['ncode_imageresizer_warning_small'] = 'Click this bar to view the full image.';
$txt['ncode_imageresizer_warning_filesize'] = 'This image has been resized. Click this bar to view the full image. The original image is sized %1$sx%2$s and weighs %3$sKB.';
$txt['ncode_imageresizer_warning_no_filesize'] = 'This image has been resized. Click this bar to view the full image. The original image is sized %1$sx%2$s.';
$txt['ncode_imageresizer_warning_fullsize'] = 'Click this bar to view the small image.';
$txt['ncode_imageresizer_mode'] = 'Resize Mode'; $txt['ncode_imageresizer_original'] = 'Keep original size';
$txt['ncode_imageresizer_enlarge_same'] = 'Enlarge in same document';
$txt['ncode_imageresizer_open_same'] = 'Open in same window';
$txt['ncode_imageresizer_open_new'] = 'Open in new window';
$txt['ncode_imageresizer_max_width'] = 'Maximum width';
$txt['ncode_imageresizer_max_height'] = 'Maximum height<br /><span class="smalltext">Leave blank for no max height.</span>';
// --- End added code ---
If youre using UTF8, then you will have to do the manual installation to that language file.
Not working for me yet. I have not touched my Themes from the default install. I installed the mod and set it up as follows;
1) At > Features and Options > Basic Features > Leave 0 for Max width and Max height
2) At >" " > Layout and Options> Edit Resize Mode and width and lenght.
I have confirmed that the javascript is in my theme folder
There are no more exceedingly large images for me!
Great job you done!
Quote from: export! on September 27, 2008, 01:49:48 PM
Not working for me yet. I have not touched my Themes from the default install. I installed the mod and set it up as follows;
1) At > Features and Options > Basic Features > Leave 0 for Max width and Max height
2) At >" " > Layout and Options> Edit Resize Mode and width and lenght.
I have confirmed that the javascript is in my theme folder
Also for me, this mod don't work correctly...
Mine appeared to install properly without any complaints but it has no effect on large image attachments. I'm still seeing huge attachments with postings.
Wondering if there's a way to tweak this mod so that the 'header bar' above the images does not appear, and instead the thumbnailed image itself becomes the link to the full-size image.
Would like everything else to operate as it does now... just 'move' the link from the header bar to the image itself, and then get rid of the header bar.
Works fine but the header that says it has been resized is not aligned with the image any workaround to this...
(http://www.divshare.com/img/5574180-43b.JPG)
How can we solve this xhtml error?
there is no attribute "onload"
Any help would be great.
Thanks..
I uploaded the package and installed succsesfully but images are still large I'm using smf 1.1.6 help me please
Quote from: albpower on October 14, 2008, 11:23:36 AM
I uploaded the package and installed succsesfully but images are still large I'm using smf 1.1.6 help me please
you should change the settings in the admin panel
Quote from: MothMan on October 08, 2008, 11:31:40 PM
Wondering if there's a way to tweak this mod so that the 'header bar' above the images does not appear, and instead the thumbnailed image itself becomes the link to the full-size image.
Would like everything else to operate as it does now... just 'move' the link from the header bar to the image itself, and then get rid of the header bar.
Bump?
I am using a custom theme, but
> Enlarge in same document - Enlarges the image inside of the forum.
> Enlarge in same window - will take the user to the full sized image in the same window.
> Enlarge in new window - will show the full sized image in a new window.
Don't show up in my options... the size does however.
I also moved and followed the correct edits to the files but no luck S:
help would be greatly appreciated.
Make sure the language strings were inserted into your modifications.english.php in your default theme, and your custom theme if it has its own language folder/dir with that template
If you are using UTF8, then you will need to add that code to your modifications-UTF8.english.php <~~it will be something like that with UTF8 in it
add this to either template
// --- Begin added code - Advanced Visual Verification ---
$txt['ncode_imageresizer_warning_small'] = 'Click this bar to view the full image.';
$txt['ncode_imageresizer_warning_filesize'] = 'This image has been resized. Click this bar to view the full image. The original image is sized %1$sx%2$s and weighs %3$sKB.';
$txt['ncode_imageresizer_warning_no_filesize'] = 'This image has been resized. Click this bar to view the full image. The original image is sized %1$sx%2$s.';
$txt['ncode_imageresizer_warning_fullsize'] = 'Click this bar to view the small image.';
$txt['ncode_imageresizer_mode'] = 'Resize Mode';
$txt['ncode_imageresizer_original'] = 'Keep original size';
$txt['ncode_imageresizer_enlarge_same'] = 'Enlarge in same document';
$txt['ncode_imageresizer_open_same'] = 'Open in same window';
$txt['ncode_imageresizer_open_new'] = 'Open in new window';
$txt['ncode_imageresizer_max_width'] = 'Maximum width';
$txt['ncode_imageresizer_max_height'] = 'Maximum height<br /><span class="smalltext">Leave blank for no max height.</span>';
// --- End added code ---
Quote from: Sabre™ on November 09, 2008, 01:18:20 AM
Make sure the language strings were inserted into your modifications.english.php in your default theme, and your custom theme if it has its own language folder/dir with that template
If you are using UTF8, then you will need to add that code to your modifications-UTF8.english.php <~~it will be something like that with UTF8 in it
add this to either template
// --- Begin added code - Advanced Visual Verification ---
$txt['ncode_imageresizer_warning_small'] = 'Click this bar to view the full image.';
$txt['ncode_imageresizer_warning_filesize'] = 'This image has been resized. Click this bar to view the full image. The original image is sized %1$sx%2$s and weighs %3$sKB.';
$txt['ncode_imageresizer_warning_no_filesize'] = 'This image has been resized. Click this bar to view the full image. The original image is sized %1$sx%2$s.';
$txt['ncode_imageresizer_warning_fullsize'] = 'Click this bar to view the small image.';
$txt['ncode_imageresizer_mode'] = 'Resize Mode';
$txt['ncode_imageresizer_original'] = 'Keep original size';
$txt['ncode_imageresizer_enlarge_same'] = 'Enlarge in same document';
$txt['ncode_imageresizer_open_same'] = 'Open in same window';
$txt['ncode_imageresizer_open_new'] = 'Open in new window';
$txt['ncode_imageresizer_max_width'] = 'Maximum width';
$txt['ncode_imageresizer_max_height'] = 'Maximum height<br /><span class="smalltext">Leave blank for no max height.</span>';
// --- End added code ---
At the time of your reply, it was already included. So that can't be the source :S however my custom theme does not have any language folder. Also using Tinyportal modification if that makes any difference.
No, if your custom theme has no lang folder, then it will grab the file from the default theme.
And you are not using UTF8 lang files?
Can you post a link to your site?
www.thekots.com
I am not 100% sure that they aren't UTF8 files and I haven't seen any UTF8 named files... but I did have the modifications.english.php file so... I would assume not.
When you ask for assistance, you need to provide as much info as you can buddy. :)
Your board is not even SMF, and since I am learning as I walk, I dont have the knowledge to assist you.
I dont see why your lang strings aren't showing, but then again I have no experience whatsoever with phpBB and its layout/structure.
If you see no UTF8 named files, then your board wont be using them.
Someone with more knowledge maybe better suited to your question.
Sorry I couldnt be of assistance, and good luck :)
EDIT
hmmm whats up with that site? It switches back n forth or something.
Are you running both boards?
You should be redirected to www.thekots.com/king after the splash page. I redid it all yesterday -- and yes the forums I am currently using or rather SWITCHING to is SMF.
I am not sure why the index would be switching other than cookies, but I'll have a look at that as well.
Just out of a stroke of hope, I'll post my modifications.english.php;
<?php
// --- Begin added code - Advanced Visual Verification ---
$txt['ncode_imageresizer_warning_small'] = 'Click this bar to view the full image.';
$txt['ncode_imageresizer_warning_filesize'] = 'This image has been resized. Click this bar to view the full image. The original image is sized %1$sx%2$s and weighs %3$sKB.';
$txt['ncode_imageresizer_warning_no_filesize'] = 'This image has been resized. Click this bar to view the full image. The original image is sized %1$sx%2$s.';
$txt['ncode_imageresizer_warning_fullsize'] = 'Click this bar to view the small image.';
$txt['ncode_imageresizer_mode'] = 'Resize Mode';
$txt['ncode_imageresizer_original'] = 'Keep original size';
$txt['ncode_imageresizer_enlarge_same'] = 'Enlarge in same document';
$txt['ncode_imageresizer_open_same'] = 'Open in same window';
$txt['ncode_imageresizer_open_new'] = 'Open in new window';
$txt['ncode_imageresizer_max_width'] = 'Maximum width';
$txt['ncode_imageresizer_max_height'] = 'Maximum height<br /><span class="smalltext">Leave blank for no max height.</span>';
// --- End added code ---
?>
The theme is based on http://custom.simplemachines.org/themes/index.php?lemma=107 (http://custom.simplemachines.org/themes/index.php?lemma=107) Aa New Damage by m3talcore; if that helps as well.
the .js is uploaded to both default and theme folders, and I double checked my edits based on the instructions found http://custom.simplemachines.org/mods/index.php?mod=1197 (http://custom.simplemachines.org/mods/index.php?mod=1197)
I am not sure what else to give you. The only option that shows up is under Admin --> Features and Options; Max width of posted pictures (0 = disable) - Set to 800
Max height of posted pictures (0 = disable) - Set to 600
Layout and Options --> Edit Resize Mode and width and length DOES NOT show up.
Since you want more information; here is my index.template from my DEFAULT folder.
<?php
// Version: 1.1.5; index
/* This template is, perhaps, the most important template in the theme. It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below. It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.
The init sub template should load any data and set any hardcoded options.
The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.
The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.
The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.
The menu sub template should display all the relevant buttons the user
wants and or needs.
For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/
// Initialize the template... mainly little settings.
function template_init()
{
global $context, $settings, $options, $txt;
/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';
/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';
/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '1.1';
/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = true;
/* Use plain buttons - as oppossed to text buttons? */
$settings['use_buttons'] = true;
/* Show sticky and lock status seperate from topic icons? */
$settings['seperate_sticky_lock'] = true;
}
// The main sub template above the content.
function template_main_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
<meta name="description" content="', $context['page_title'], '" />', empty($context['robot_no_index']) ? '' : '
<meta name="robots" content="noindex" />', '
<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js?fin11"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "', $settings['theme_url'], '";
var smf_images_url = "', $settings['images_url'], '";
var smf_scripturl = "', $scripturl, '";
var smf_iso_case_folding = ', $context['server']['iso_case_folding'] ? 'true' : 'false', ';
var smf_charset = "', $context['character_set'], '";
// ]]></script>
<title>', $context['page_title'], '</title>';
// The ?fin11 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?fin11" />
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?fin11" media="print" />';
/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />';
// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="', $scripturl, '?action=help" target="_blank" />
<link rel="search" href="' . $scripturl . '?action=search" />
<link rel="contents" href="', $scripturl, '" />';
// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']))
echo '
<link rel="alternate" type="application/rss+xml" title="', $context['forum_name'], ' - RSS" href="', $scripturl, '?type=rss;action=.xml" />';
// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=next" />';
// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="' . $scripturl . '?board=' . $context['current_board'] . '.0" />';
// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
{
$options['collapse_header'] = !empty($_COOKIE['upshrink']);
$options['collapse_header_ic'] = !empty($_COOKIE['upshrinkIC']);
}
// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header = ', empty($options['collapse_header']) ? 'false' : 'true', ';
function shrinkHeader(mode)
{';
// Guests don't have theme options!!
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrink=" + (mode ? 1 : 0);';
else
echo '
smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "', $context['session_id'], '");';
echo '
document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");
document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";
current_header = mode;
}
// ]]></script>';
// the routine for the info center upshrink
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header_ic = ', empty($options['collapse_header_ic']) ? 'false' : 'true', ';
function shrinkHeaderIC(mode)
{';
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrinkIC=" + (mode ? 1 : 0);';
else
echo '
smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "', $context['session_id'], '");';
echo '
document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");
document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";
current_header_ic = mode;
}
// ]]></script>
<!-- nCode Image Resizer -->
<script type="text/javascript" src="', $settings['theme_url'], '/ncode_imageresizer.js"></script>
<style type="text/css">
<!--
table.ncode_imageresizer_warning, table.ncode_imageresizer_warning td
{
background-color: #fefee1; /* the bgcolor behind the text and image */
}
table.ncode_imageresizer_warning {
color: #000000; /* the font color */
border: 1px solid #CCCDCD; /* the border around the whole thing */
cursor: pointer;
}
table.ncode_imageresizer_warning td {
font-size: 10px;
vertical-align: middle;
text-decoration: none;
}
table.ncode_imageresizer_warning td.td1 {
padding: 5px;
}
-->
</style>';
// What is the mode?
if (isset($modSettings['ncode_imageresizer_mode']))
{
if ($modSettings['ncode_imageresizer_mode'] == 1)
$mode = 'enlarge';
elseif ($modSettings['ncode_imageresizer_mode'] == 2)
$mode = 'samewindow';
elseif ($modSettings['ncode_imageresizer_mode'] == 3)
$mode = 'newwindow';
else
$mode = 'none';
}
else
$mode = 'none';
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
NcodeImageResizer.BBURL = "', $settings['images_url'], '";
NcodeImageResizer.MODE = "', $mode, '";
NcodeImageResizer.MAXWIDTH = "', empty($modSettings['ncode_imageresizer_max_width']) ? 0 : (int) $modSettings['ncode_imageresizer_max_width'], '";
NcodeImageResizer.MAXHEIGHT = "', empty($modSettings['ncode_imageresizer_max_height']) ? 0 : (int) $modSettings['ncode_imageresizer_max_height'], '";
vbphrase = new Array();
vbphrase[\'ncode_imageresizer_warning_small\'] = \'', $txt['ncode_imageresizer_warning_small'], '\';
vbphrase[\'ncode_imageresizer_warning_filesize\'] = \'', $txt['ncode_imageresizer_warning_filesize'], '\';
vbphrase[\'ncode_imageresizer_warning_no_filesize\'] = \'', $txt['ncode_imageresizer_warning_no_filesize'], '\';
vbphrase[\'ncode_imageresizer_warning_fullsize\'] = \'', $txt['ncode_imageresizer_warning_fullsize'], '\';
// ]]></script>
</head>
<body>';
echo '
<div class="tborder" ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' style="width: 100%;"' : '', '>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="catbg" height="32">';
if (empty($settings['header_logo_url']))
echo '
<span style="font-family: Verdana, sans-serif; font-size: 140%; ">', $context['forum_name'], '</span>';
else
echo '
<img src="', $settings['header_logo_url'], '" style="margin: 4px;" alt="', $context['forum_name'], '" />';
echo '
</td>
<td align="right" class="catbg">
<img src="', $settings['images_url'], '/smflogo.gif" style="margin: 2px;" alt="" />
</td>
</tr>
</table>';
// display user name
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0" >
<tr>';
if($context['user']['is_logged'])
echo '
<td class="titlebg2" height="32">
<span style="font-size: 130%;"> ', $txt['hello_member_ndt'], ' <b>', $context['user']['name'] , '</b></span>
</td>';
// display the time
echo '
<td class="titlebg2" height="32" align="right">
<span class="smalltext">' , $context['current_time'], '</span>';
// this is the upshrink button for the user info section
echo '
<a href="#" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="', $settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" align="bottom" style="margin: 0 1ex;" /></a>
</td>
</tr>
<tr id="upshrinkHeader"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
<td valign="top" colspan="2">
<table width="100%" class="bordercolor" cellpadding="8" cellspacing="1" border="0" style="margin-top: 1px;">
<tr>';
if (!empty($context['user']['avatar']))
echo '
<td class="windowbg" valign="middle">', $context['user']['avatar']['image'], '</td>';
echo '
<td colspan="2" width="100%" valign="top" class="windowbg2"><span class="middletext">';
// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a> <br />
<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />';
}
// Otherwise they're a guest - send them a lovely greeting...
else
echo $txt['welcome_guest'];
// Now, onto our second set of info, are they logged in again?
if ($context['user']['is_logged'])
{
// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
<b>', $txt[616], '</b><br />';
// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '
', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '<br />';
// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']))
{
echo '
', $txt['totalTimeLogged1'];
// If days is just zero, don't bother to show it.
if ($context['user']['total_time_logged_in']['days'] > 0)
echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];
// Same with hours - only show it if it's above zero.
if ($context['user']['total_time_logged_in']['hours'] > 0)
echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];
// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
}
echo ' </span>';
}
// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
else
{
echo ' </span>
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/sha1.js"></script>
<form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" class="middletext" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
<select name="cookielength">
<option value="60">', $txt['smf53'], '</option>
<option value="1440">', $txt['smf47'], '</option>
<option value="10080">', $txt['smf48'], '</option>
<option value="43200">', $txt['smf49'], '</option>
<option value="-1" selected="selected">', $txt['smf50'], '</option>
</select>
<input type="submit" value="', $txt[34], '" /><br />
<span class="middletext">', $txt['smf52'], '</span>
<input type="hidden" name="hash_passwrd" value="" />
</form>';
}
echo '
</td>
</tr>
</table>
</td>
</tr>
</table>';
echo '
<table id="upshrinkHeader2"', empty($options['collapse_header']) ? '' : ' style="display: none;"', ' width="100%" cellpadding="4" cellspacing="0" border="0">
<tr>';
// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<td width="90%" class="titlebg2">
<span class="smalltext"><b>', $txt[102], '</b>: ', $context['random_news_line'], '</span>
</td>';
echo '
<td class="titlebg2" align="right" nowrap="nowrap" valign="top">
<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
<a href="', $scripturl, '?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0 1ex;" alt="" /></a>
<input type="text" name="search" value="" style="width: 190px;" />
<input type="submit" name="submit" value="', $txt[182], '" style="width: 11ex;" />
<input type="hidden" name="advanced" value="0" />';
// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />';
// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
echo '
</form>
</td>
</tr>
</table>
</div>';
// Show the menu here, according to the menu sub template.
template_menu();
// The main content should go here.
echo '
<div id="bodyarea" style="padding: 1ex 0px 2ex 0px;">';
}
function template_main_below()
{
global $context, $settings, $options, $scripturl, $txt;
echo '
</div>';
// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '
<div id="footerarea" style="text-align: center; padding-bottom: 1ex;', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' : '', '">
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function smfFooterHighlight(element, value)
{
element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
}
// ]]></script>
<table cellspacing="0" cellpadding="3" border="0" align="center" width="100%">
<tr>
<td width="28%" valign="middle" align="', !$context['right_to_left'] ? 'right' : 'left', '">
<a href="http://www.mysql.com/" target="_blank"><img id="powered-mysql" src="', $settings['images_url'], '/powered-mysql.gif" alt="', $txt['powered_by_mysql'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://www.php.net/" target="_blank"><img id="powered-php" src="', $settings['images_url'], '/powered-php.gif" alt="', $txt['powered_by_php'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
<td valign="middle" align="center" style="white-space: nowrap;">
', theme_copyright(), '
</td>
<td width="28%" valign="middle" align="', !$context['right_to_left'] ? 'left' : 'right', '">
<a href="http://validator.w3.org/check/referer" target="_blank"><img id="valid-xhtml10" src="', $settings['images_url'], '/valid-xhtml10.gif" alt="', $txt['valid_xhtml'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img id="valid-css" src="', $settings['images_url'], '/valid-css.gif" alt="', $txt['valid_css'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
</tr>
</table>';
// Show the load time?
if ($context['show_load_time'])
echo '
<span class="smalltext">', $txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';
// This is an interesting bug in Internet Explorer AND Safari. Rather annoying, it makes overflows just not tall enough.
if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'] || $context['browser']['is_firefox'])
{
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[';
// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");
for (var i = 0; i < codeFix.length; i++)
{
if ((codeFix[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}';
elseif ($context['browser']['is_firefox'])
echo '
window.addEventListener("load", smf_codeFix, false);
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");
for (var i = 0; i < codeFix.length; i++)
{
if (codeFix[i].className == "code" && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
codeFix[i].style.overflow = "scroll";
}
}';
else
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");
for (var i = codeFix.length - 1; i > 0; i--)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0 || codeFix[i].className == "code"))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}
if (window_oldOnload)
{
window_oldOnload();
window_oldOnload = null;
}
}';
echo '
// ]]></script>';
}
echo '
</div>';
// The following will be used to let the user know that some AJAX process is running
echo '
<div id="ajax_in_progress" style="display: none;', $context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' : '', '">', $txt['ajax_in_progress'], '</div>
</body></html>';
}
// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
global $context, $settings, $options;
echo '<div class="nav" style="font-size: smaller; margin-bottom: 2ex; margin-top: 2ex;">';
// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];
// Show the link, including a URL if it should have one.
echo '<b>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav">' . $tree['name'] . '</a>' : $tree['name'], '</b>';
// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];
// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo ' > ';
}
echo '</div>';
}
// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;
// Work out where we currently are.
$current_action = 'home';
if (in_array($context['current_action'], array('admin', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
$current_action = 'admin';
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'forum', 'tpadmin')))
$current_action = $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action = 'search';
if (isset($_GET['dl']))
$current_action = 'dlmanager';
if (isset($_GET['board']) || isset($_GET['topic']) || $context['current_action']=='forum')
$current_action = 'forum';
if ($context['current_action']=='tpadmin')
$current_action = 'admin';
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';
// Are we using right-to-left orientation?
if ($context['right_to_left'])
{
$first = 'last';
$last = 'first';
}
else
{
$first = 'first';
$last = 'last';
}
// Show the start of the tab section.
echo '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
<tr>
<td class="maintab_' , $first , '"> </td>';
// Show the [home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '">' , $txt[103] , '</a>
</td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
if($settings['TPortal_front_type']!='boardindex')
// Show the [forum] button.
echo ($current_action=='forum' || $context['browser']['is_ie4']) ? '<td class="maintab_active_first"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action=='forum' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=forum">'.$txt['tp-forum'].'</a>
</td>' , $current_action=='forum' ? '<td class="maintab_active_last"> </td>' : '';
// Show the [help] button.
echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'help' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=help">' , $txt[119] , '</a>
</td>' , $current_action == 'help' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
// How about the [search] button?
if ($context['allow_search'])
echo ($current_action == 'search' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'search' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=search">' , $txt[182] , '</a>
</td>' , $current_action == 'search' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo ($current_action == 'admin' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'admin' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=admin">' , $txt[2] , '</a>
</td>' , $current_action == 'admin' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo ($current_action == 'profile' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'profile' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=profile">' , $txt[79] , '</a>
</td>' , $current_action == 'profile' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'pm' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a>
</td>' , $current_action == 'pm' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
// The [calendar]!
if ($context['allow_calendar'])
echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'calendar' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a>
</td>' , $current_action == 'calendar' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
// the [member] list button
if ($context['allow_memberlist'])
echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'mlist' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a>
</td>' , $current_action == 'mlist' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo ($current_action == 'login' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'login' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=login">' , $txt[34] , '</a>
</td>' , $current_action == 'login' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'register' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=register">' , $txt[97] , '</a>
</td>' , $current_action == 'register' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'logout' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>
</td>' , $current_action == 'logout' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
// The end of tab section.
echo '
<td class="maintab_' , $last , '"> </td>
';
// TinyPortal
if($context['TPortal']['leftbar'])
echo '<td style="padding-left: 1ex;"><a href="javascript:void(0);" onclick="shrinkHeaderLeftbar(!current_leftbar); return false;"><img id="upshrinkLeftbar" src="', $settings['images_url'], '/', empty($options['collapse_leftbar']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTempLeftbar" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 0ex;" /></td>';
if($context['TPortal']['rightbar'])
echo '<td style="padding-left: 1ex;"><a href="javascript:void(0);" onclick="shrinkHeaderRightbar(!current_rightbar); return false;"><img id="upshrinkRightbar" src="', $settings['images_url'], '/', empty($options['collapse_rightbar']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTempRightbar" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 0ex;" /></td>';
// TinyPortal end
echo '
</tr>
</table>';
}
// Generate a strip of buttons.
function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = '')
{
global $settings, $buttons, $context, $txt, $scripturl;
// Create the buttons...
foreach ($button_strip as $key => $value)
{
if (isset($value['test']) && empty($context[$value['test']]))
{
unset($button_strip[$key]);
continue;
}
elseif (!isset($buttons[$key]) || $force_reset)
$buttons[$key] = '<a href="' . $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>';
$button_strip[$key] = $buttons[$key];
}
if (empty($button_strip))
return '<td> </td>';
echo '
<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'last' : 'first' , '"> </td>
<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_back">', implode(' | ', $button_strip) , '</td>
<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'first' : 'last' , '"> </td>';
}
?>
Here is the index.template from my THEME folder;
<?php
// Version: 1.1; index
/* This template is, perhaps, the most important template in the theme. It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below. It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.
The init sub template should load any data and set any hardcoded options.
The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.
The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.
The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.
The menu sub template should display all the relevant buttons the user
wants and or needs.
For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/
// Initialize the template... mainly little settings.
function template_init()
{
global $context, $settings, $options, $txt;
/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';
/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';
/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '1.1';
/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = true;
/* Use plain buttons - as oppossed to text buttons? */
$settings['use_buttons'] = true;
/* Show sticky and lock status seperate from topic icons? */
$settings['seperate_sticky_lock'] = true;
}
// The main sub template above the content.
function template_main_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
<meta name="description" content="', $context['page_title'], '" />', empty($context['robot_no_index']) ? '' : '
<meta name="robots" content="noindex" />', '
<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js?fin11"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "', $settings['theme_url'], '";
var smf_images_url = "', $settings['images_url'], '";
var smf_scripturl = "', $scripturl, '";
var smf_iso_case_folding = ', $context['server']['iso_case_folding'] ? 'true' : 'false', ';
var smf_charset = "', $context['character_set'], '";
// ]]></script>
<title>', $context['page_title'], '</title>';
// The ?fin11 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?fin11" />
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?fin11" media="print" />';
/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />';
// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="', $scripturl, '?action=help" target="_blank" />
<link rel="search" href="' . $scripturl . '?action=search" />
<link rel="contents" href="', $scripturl, '" />';
// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']))
echo '
<link rel="alternate" type="application/rss+xml" title="', $context['forum_name'], ' - RSS" href="', $scripturl, '?type=rss;action=.xml" />';
// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=next" />';
// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="' . $scripturl . '?board=' . $context['current_board'] . '.0" />';
// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
$options['collapse_header'] = !empty($_COOKIE['upshrink']);
// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header = ', empty($options['collapse_header']) ? 'false' : 'true', ';
function shrinkHeader(mode)
{';
// Guests don't have theme options!!
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrink=" + (mode ? 1 : 0);';
else
echo '
smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "', $context['session_id'], '");';
echo '
document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");
document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";
current_header = mode;
}
// ]]></script>';
// the routine for the info center upshrink
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header_ic = ', empty($options['collapse_header_ic']) ? 'false' : 'true', ';
function shrinkHeaderIC(mode)
{';
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrinkIC=" + (mode ? 1 : 0);';
else
echo '
smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "', $context['session_id'], '");';
echo '
document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");
document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";
current_header_ic = mode;
}
// ]]></script>
<script language="javascript" type="text/javascript" src="', $settings['images_url'], '/preloader.js"></script>
<!-- nCode Image Resizer -->
<script type="text/javascript" src="', $settings['theme_url'], '/ncode_imageresizer.js"></script>
<style type="text/css">
<!--
table.ncode_imageresizer_warning, table.ncode_imageresizer_warning td
{
background-color: #fefee1; /* the bgcolor behind the text and image */
}
table.ncode_imageresizer_warning {
color: #000000; /* the font color */
border: 1px solid #CCCDCD; /* the border around the whole thing */
cursor: pointer;
}
table.ncode_imageresizer_warning td {
font-size: 10px;
vertical-align: middle;
text-decoration: none;
}
table.ncode_imageresizer_warning td.td1 {
padding: 5px;
}
-->
</style>';
// What is the mode?
if (isset($modSettings['ncode_imageresizer_mode']))
{
if ($modSettings['ncode_imageresizer_mode'] == 1)
$mode = 'enlarge';
elseif ($modSettings['ncode_imageresizer_mode'] == 2)
$mode = 'samewindow';
elseif ($modSettings['ncode_imageresizer_mode'] == 3)
$mode = 'newwindow';
else
$mode = 'none';
}
else
$mode = 'none';
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
NcodeImageResizer.BBURL = "', $settings['images_url'], '";
NcodeImageResizer.MODE = "', $mode, '";
NcodeImageResizer.MAXWIDTH = "', empty($modSettings['ncode_imageresizer_max_width']) ? 0 : (int) $modSettings['ncode_imageresizer_max_width'], '";
NcodeImageResizer.MAXHEIGHT = "', empty($modSettings['ncode_imageresizer_max_height']) ? 0 : (int) $modSettings['ncode_imageresizer_max_height'], '";
vbphrase = new Array();
vbphrase[\'ncode_imageresizer_warning_small\'] = \'', $txt['ncode_imageresizer_warning_small'], '\';
vbphrase[\'ncode_imageresizer_warning_filesize\'] = \'', $txt['ncode_imageresizer_warning_filesize'], '\';
vbphrase[\'ncode_imageresizer_warning_no_filesize\'] = \'', $txt['ncode_imageresizer_warning_no_filesize'], '\';
vbphrase[\'ncode_imageresizer_warning_fullsize\'] = \'', $txt['ncode_imageresizer_warning_fullsize'], '\';
// ]]></script>
</head>
<body>';
// header goes below here
echo '
<!-- Added Header -->
<a name="top"></a>
<div align="center">
<table width="1000" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="', $settings['images_url'], '/forum_body_01.gif" alt="" /></td>
<td width="1000" height="192" align="left" valign="top">
<table width="1000" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="1000" height="198" background="', $settings['images_url'], '/forum_body_02.jpg" align="center" valign="bottom">
</td>
</tr>
<tr>
<td width="1000" height="18" align="center" valign="middle" background="', $settings['images_url'], '/forum_body_04.jpg">
'; template_menu();
echo '
</td>
</tr>
<tr>
<td width="1000" background="http://thekots.com/king/Themes/NewDamage/images/forum_body_05.jpg" "height="35"><a href="http://www.thekots.com/king/dkp"><div align="center"><a href="http://www.thekots.com/king/dkp"><img src="http://thekots.com/king/Themes/NewDamage/images/DKP.gif" border="0"></a>
</div></td>
</tr>
</table>
</td>
<td><img src="', $settings['images_url'], '/forum_body_01.gif" alt="" /></td>
</tr>
</table>
<!-- END header -->
<!-- BEGIN content sections -->
<table width="1000" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="1000" align="center" valign="top" class="content-bg">
<!-- End added header -->
<table width="1000" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="1000" align="left" valign="top">
<div class="tborder" ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' style="width: 100%;"' : '', '>';
// display user name
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0" >
<tr>';
if($context['user']['is_logged'])
echo '
<td class="titlebg2" height="32">
<span style="font-size: 130%;"> ', $txt['hello_member_ndt'], ' <b>', $context['user']['name'] , '</b></span>
</td>';
// display the time
echo '
<td class="titlebg2" height="32" align="right">
<span class="smalltext">' , $context['current_time'], '</span>';
// this is the upshrink button for the user info section
echo '
<a href="#" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="', $settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" align="bottom" style="margin: 0 1ex;" /></a>
</td>
</tr>
<tr id="upshrinkHeader"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
<td valign="top" colspan="2">
<table width="100%" class="bordercolor" cellpadding="8" cellspacing="1" border="0" style="margin-top: 1px;">
<tr>';
if (!empty($context['user']['avatar']))
echo '
<td class="windowbg" valign="middle">', $context['user']['avatar']['image'], '</td>';
echo '
<td colspan="2" width="100%" valign="top" class="windowbg2"><span class="middletext">';
// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a> <br />
<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />';
}
// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
{
echo ((isset($current_action) && $curent_action == 'pm') || $context['browser']['is_ie4']) ? '' : '' , '
<span class="smalltext"><a href="', $scripturl, '?action=pm">Private Messages</a>: ', $context['user']['unread_messages'], ' Unread, ', $context['user']['messages'], ' Total.</span><br />';
}
// Otherwise they're a guest - send them a lovely greating...
else
echo $txt['welcome_guest'];
// Now, onto our second set of info, are they logged in again?
if ($context['user']['is_logged'])
{
// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
<b>', $txt[616], '</b><br />';
// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '
', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '<br />';
// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']))
{
echo '
', $txt['totalTimeLogged1'];
// If days is just zero, don't bother to show it.
if ($context['user']['total_time_logged_in']['days'] > 0)
echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];
// Same with hours - only show it if it's above zero.
if ($context['user']['total_time_logged_in']['hours'] > 0)
echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];
// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
}
echo ' </span>';
}
// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
else
{
echo ' </span>
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/sha1.js"></script>
<form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" class="middletext" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
<input type="text" name="user" class="input1" value="Username" onBlur="if(this.value==\'\') this.value=\'Username\';" onFocus="if(this.value==\'Username\') this.value=\'\';" /> <input type="password" name="passwrd" class="input1" value="password" onBlur="if(this.value==\'\') this.value=\'password\';" onFocus="if(this.value==\'password\') this.value=\'\';" />
<select name="cookielength" class="input1">
<option value="60">', $txt['smf53'], '</option>
<option value="1440">', $txt['smf47'], '</option>
<option value="10080">', $txt['smf48'], '</option>
<option value="43200">', $txt['smf49'], '</option>
<option value="-1" selected="selected">', $txt['smf50'], '</option>
</select>
<input class="button" type="submit" value="', $txt[34], '" /><br />
<span class="middletext">', $txt['smf52'], '</span>
<input type="hidden" name="hash_passwrd" value="" />
</form>';
}
echo '
</td>
</tr>
</table>
</td>
</tr>
</table>';
echo '
<table id="upshrinkHeader2"', empty($options['collapse_header']) ? '' : ' style="display: none;"', ' width="100%" cellpadding="4" cellspacing="0" border="0">
<tr>';
// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<td width="90%" class="titlebg2">
<span class="smalltext"><b>', $txt[102], '</b>: ', $context['random_news_line'], '</span>
</td>';
echo '
<td class="titlebg2" align="right" nowrap="nowrap" valign="top">
<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
<a href="', $scripturl, '?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0 1ex;" alt="" /></a>
<input class="input1" type="text" name="search" onBlur="if(this.value==\'\') this.value=\'Search...\';" onFocus="if(this.value==\'Search...\') this.value=\'\';" value="Search..." style="width: 190px;" />
<input class="button" type="submit" name="submit" value="', $txt[182], '" style="width: 11ex;" />
<input type="hidden" name="advanced" value="0" />';
// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />';
// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
echo '
</form>
</td>
</tr>
</table>
</div>';
// The main content should go here.
echo '
<div id="bodyarea" style="padding: 1ex 0px 2ex 0px;">';
}
function template_main_below()
{
global $context, $settings, $options, $scripturl, $txt;
echo '
</div>';
// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '
<div id="footerarea" style="text-align: center; padding-bottom: 1ex;', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' : '', '">
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function smfFooterHighlight(element, value)
{
element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
}
// ]]></script>
<table cellspacing="0" cellpadding="3" border="0" align="center" width="100%">
<tr>
<td width="28%" valign="middle" align="left">
Theme by <a href="http://www.m3talc0re.com/" target="_blank" style="font-size:10px;">m3talc0re</a>.
</td>
<td valign="middle" align="center" style="white-space: nowrap;">
', theme_copyright(), '
</td>
<td width="28%" valign="middle" align="right">
<a href="http://www.mysql.com/" target="_blank" style="font-size:10px;">MySQL</a> | <a href="http://www.php.net/" target="_blank" style="font-size:10px;">PHP</a> | <a href="http://validator.w3.org/check/referer" target="_blank" style="font-size:10px;">XHTML</a> | <a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank" style="font-size:10px;">CSS</a>
</td>
</tr>
</table>';
// Show the load time?
if ($context['show_load_time'])
echo '
<span class="smalltext">', $txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';
// This is an interesting bug in Internet Explorer AND Safari. Rather annoying, it makes overflows just not tall enough.
if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'] || $context['browser']['is_firefox'])
{
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[';
// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");
for (var i = 0; i < codeFix.length; i++)
{
if ((codeFix[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}';
elseif ($context['browser']['is_firefox'])
echo '
window.addEventListener("load", smf_codeFix, false);
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");
for (var i = 0; i < codeFix.length; i++)
{
if (codeFix[i].className == "code" && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
codeFix[i].style.overflow = "scroll";
}
}';
else
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");
for (var i = codeFix.length - 1; i > 0; i--)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0 || codeFix[i].className == "code"))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}
if (window_oldOnload)
{
window_oldOnload();
window_oldOnload = null;
}
}';
echo '
// ]]></script>';
}
echo '
</div>
<!-- Added footer -->
</td>
</tr>
</table>
<table width="900" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="855" height="25" align="left" valign="middle" id="copyright-text">
</td>
<td rowspan="2" width="45" height="50" align="right" valign="top">
</td>
</tr>
<tr>
<td width="855" height="20" align="left" valign="middle" id="legal-text">
</td>
</tr>
</table>
<!-- END Legal -->
</td>
</tr>
</table>
<!-- END content sections -->
<!-- BEGIN footer -->
<table width="1000" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="500" height="81" align="left" valign="top">
<img src="', $settings['images_url'], '/header_11.jpg" width="500" height="81" alt="" /></td>
<td width="500" height="81" align="left" valign="top">
<img src="', $settings['images_url'], '/header_12.jpg" width="500" height="81" alt="" /></td>
</tr>
</table>
<!-- END footer -->
</div>';
// The following will be used to let the user know that some AJAX process is running
echo '
<div id="ajax_in_progress" style="display: none;', $context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' : '', '">', $txt['ajax_in_progress'], '</div>
</body></html>';
}
// Footer goes above here
// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
global $context, $settings, $options;
echo '<div class="nav" style="font-size: smaller; margin-bottom: 2ex; margin-top: 2ex; padding-left:8px; padding-right:8px;">';
// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];
// Show the link, including a URL if it should have one.
echo '<b>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav">' . $tree['name'] . '</a>' : $tree['name'], '</b>';
// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];
// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo ' » ';
}
echo '</div>';
}
// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;
// Work out where we currently are.
$current_action = 'home';
if (in_array($context['current_action'], array('admin', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
$current_action = 'admin';
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
$current_action = $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action = 'search';
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';
// Are we using right-to-left orientation?
if ($context['right_to_left'])
{
$first = 'last';
$last = 'first';
}
else
{
$first = 'first';
$last = 'last';
}
// Show the start of the tab section.
echo '
<ul class="main-navigation">';
// Show the [home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '' : '' , '
<li class="mainNav-home"><a href="', $scripturl, '">' , $txt[103] , '</a></li>' , $current_action == 'home' ? '' : '';
// Show the [help] button.
echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '' : '' , '
<li class="mainNav-help"><a href="', $scripturl, '?action=forum">' , $txt[119] , '</a></li>' , $current_action == 'forum' ? '' : '';
// How about the [search] button?
if ($context['allow_search'])
echo ($current_action == 'search' || $context['browser']['is_ie4']) ? '' : '' , '
<li class="mainNav-search"><a href="', $scripturl, '?action=search">' , $txt[182] , '</a></li>' , $current_action == 'search' ? '' : '';
// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo ($current_action == 'admin' || $context['browser']['is_ie4']) ? '' : '' , '
<li class="mainNav-admin"><a href="', $scripturl, '?action=admin">' , $txt[2] , '</a></li>' , $current_action == 'admin' ? '' : '';
// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo ($current_action == 'profile' || $context['browser']['is_ie4']) ? '' : '' , '
<li class="mainNav-profile"><a href="', $scripturl, '?action=profile">' , $txt[79] , '</a></li>' , $current_action == 'profile' ? '' : '';
// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '' : '' , '
<li class="mainNav-messages"><a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a></li>' , $current_action == 'pm' ? '' : '';
// The [calendar]!
if ($context['allow_calendar'])
echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '' : '' , '
<li class="mainNav-calendar"><a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a></li>' , $current_action == 'calendar' ? '' : '';
// the [member] list button
if ($context['allow_memberlist'])
echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '' : '' , '
<li class="mainNav-members"><a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a></li>' , $current_action == 'mlist' ? '' : '';
// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo ($current_action == 'login' || $context['browser']['is_ie4']) ? '' : '' , '
<li class="mainNav-login"><a href="', $scripturl, '?action=login">' , $txt[34] , '</a></li>' , $current_action == 'login' ? '' : '';
// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '' : '' , '
<li class="mainNav-register"><a href="', $scripturl, '?action=register">' , $txt[97] , '</a></li>' , $current_action == 'register' ? '' : '';
// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '' : '' , '
<li class="mainNav-logout"><a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a></li>' , $current_action == 'logout' ? '' : '';
// The end of tab section.
echo '</ul>';
}
// Generate a strip of buttons.
function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = '')
{
global $settings, $buttons, $context, $txt, $scripturl;
// Create the buttons...
foreach ($button_strip as $key => $value)
{
if (isset($value['test']) && empty($context[$value['test']]))
{
unset($button_strip[$key]);
continue;
}
elseif (!isset($buttons[$key]) || $force_reset)
$buttons[$key] = '<a href="' . $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>';
$button_strip[$key] = $buttons[$key];
}
if (empty($button_strip))
return '<td> </td>';
echo '
<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'last' : 'first' , '"> </td>
<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_back">', implode(' | ', $button_strip) , '</td>
<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'first' : 'last' , '"> </td>';
}
?>
This is the board I see
(http://img227.imageshack.us/img227/3881/59153046dv0.png)
Right click and view image for larger view
phpbb ?? Your SMF one is there also.
It is an easy solution, and you'll see it soon ;)
The above information should suffice when someone comes to assist you.
Good luck
Whoops :o
Fixed that -- or at least it SHOULD be fixed now.
The PHP one is using lytebox -- but that's not the website I want to use. It's still up there just for reference and I haven't gotten around to deleting the files or databases yet.
The website should be redirecting to www.thekots.com/king (http://www.thekots.com/king) where the SMF is installed. That is where my problem lies with not having the nCode image resizer work. So JUST worry about thekots.com/king
Quote from: *erhan on October 14, 2008, 06:31:57 AM
How can we solve this xhtml error?
there is no attribute "onload"
Any help would be great.
Thanks..
bump...
Thanks a lot! Working on 1.1.7!
I create a new version of this mod for SMF 2.0 , tested and works great , also if you are not using the default theme with this package you dont have to upload the js file to the theme directory
SMF 2.0 ONLY
hai its work fine for me,but it working in default themes only,aim using dreakbreak theme need to work for the theme also
Quote from: xmusic on December 10, 2008, 11:47:43 PM
hai its work fine for me,but it working in default themes only,aim using dreakbreak theme need to work for the theme also
You need to uplaod the .js file to the theme directory
working great thank u some much
Thanks Nibogo for the updated version!
This isn't working for me on 1.1.7 with the More Style theme. Any ideas? It's installed fine but is totally ineffective in practice.
If you are using other theme than the default-core then you need to manually add the codes its only the index.template.php that needs edit.
I managed it, thanks.
Thanks NBG!!! Working great :)
Serbian translation:
// --- Begin added code - nCode Image Resizer ---
$txt['ncode_imageresizer_warning_small'] = 'Kliknite na ovaj bar da vidite sliku u punoj veličini.';
$txt['ncode_imageresizer_warning_filesize'] = 'Ovoj slici su smanjene dimenzije. Klknite na ovaj bar da je vidite u punoj veličini. Orginalna slika je dimenzija %1$sx%2$s i teška je %3$sKB.';
$txt['ncode_imageresizer_warning_no_filesize'] = 'Ovoj slici su smanjene dimenzije. Klknite na ovaj bar da je vidite u punoj veličini. Orginalna slika je dimenzija %1$sx%2$s.';
$txt['ncode_imageresizer_warning_fullsize'] = 'Kliknite na ovaj bar da vidite umanjeni prikaz.';
$txt['ncode_imageresizer_mode'] = 'Način promene dimenzija';
$txt['ncode_imageresizer_original'] = 'Zadrži originalnu veličinu';
$txt['ncode_imageresizer_enlarge_same'] = 'Povećaj u istom prozoru';
$txt['ncode_imageresizer_open_same'] = 'Otvori u istom prozoru';
$txt['ncode_imageresizer_open_new'] = 'Otvori u novom prozoru';
$txt['ncode_imageresizer_max_width'] = 'Maksimalna dužina';
$txt['ncode_imageresizer_max_height'] = 'Maksimalna širina<br /><span class="smalltext">Ostavite prazno da ne menja dimenzije po širini.</span>';
// --- End added code ---
just installed into 2.0RC1... went right in. can't wait to try it out.
Quote from: karlbenson on May 19, 2008, 10:01:37 AM
It only works for
[img]http://...[/img]
but not images that have already been sized by smf.
[img width="100" height="100"]http://...[/img]
does that mean this mod does not work on attachments? only hotlinked images?
i have only been able to get it to work with hotlinked images. SMF2.0RC1
great mod ! works great on default theme 2.0 R1. But I try to add it to babylon theme and is not working.
i uploaded the file ncode_imageresizer.js to theme directory (/public_html/forum/Themes/babylon) but is not working. Then I tried to add the ncode_imageresizer.js to /public_html/forum/Themes/babylon/scripts did not work either ? What do i do wrong ? Where to copy ?
Add the index.template edit on your file
thanks for the tip... in the end i figured it out. I opened index.template.php from default theme, and copy pasted the code found there to my index.template from babylon theme. I added the code before </head> ... seems to work :D I did correctly ?
echo '<!-- nCode Image Resizer -->
<script type="text/javascript" src="', $settings['default_theme_url'], '/ncode_imageresizer.js"></script>
<style type="text/css">
<!--
table.ncode_imageresizer_warning, table.ncode_imageresizer_warning td
{
background-color: #fefee1; /* the bgcolor behind the text and image */
}
table.ncode_imageresizer_warning {
color: #000000; /* the font color */
border: 1px solid #CCCDCD; /* the border around the whole thing */
cursor: pointer;
}
table.ncode_imageresizer_warning td {
font-size: 10px;
vertical-align: middle;
text-decoration: none;
}
table.ncode_imageresizer_warning td.td1 {
padding: 5px;
}
-->
</style>';
// What is the mode?
if (isset($modSettings['ncode_imageresizer_mode']))
{
if ($modSettings['ncode_imageresizer_mode'] == 1)
$mode = 'enlarge';
elseif ($modSettings['ncode_imageresizer_mode'] == 2)
$mode = 'samewindow';
elseif ($modSettings['ncode_imageresizer_mode'] == 3)
$mode = 'newwindow';
else
$mode = 'none';
}
else
$mode = 'none';
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
NcodeImageResizer.BBURL = "', $settings['images_url'], '";
NcodeImageResizer.MODE = "', $mode, '";
NcodeImageResizer.MAXWIDTH = "', empty($modSettings['ncode_imageresizer_max_width']) ? 0 : (int) $modSettings['ncode_imageresizer_max_width'], '";
NcodeImageResizer.MAXHEIGHT = "', empty($modSettings['ncode_imageresizer_max_height']) ? 0 : (int) $modSettings['ncode_imageresizer_max_height'], '";
vbphrase = new Array();
vbphrase[\'ncode_imageresizer_warning_small\'] = \'', $txt['ncode_imageresizer_warning_small'], '\';
vbphrase[\'ncode_imageresizer_warning_filesize\'] = \'', $txt['ncode_imageresizer_warning_filesize'], '\';
vbphrase[\'ncode_imageresizer_warning_no_filesize\'] = \'', $txt['ncode_imageresizer_warning_no_filesize'], '\';
vbphrase[\'ncode_imageresizer_warning_fullsize\'] = \'', $txt['ncode_imageresizer_warning_fullsize'], '\';
// ]]></script>';
// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
// Create the main header object.
var mainHeader = new smfToggle("upshrink", ', empty($options['collapse_header']) ? 'false' : 'true', ');
mainHeader.useCookie(', $context['user']['is_guest'] ? 1 : 0, ');
mainHeader.setOptions("collapse_header", "', $context['session_id'], '");
mainHeader.addToggleImage("upshrink", "/upshrink.gif", "/upshrink2.gif");
mainHeader.addTogglePanel("user_section");
mainHeader.addTogglePanel("news_section");
// ]]></script>';
echo '
Quote from: nikku on February 22, 2009, 01:59:09 PM
what index template to what file ? i do not understand what to do :(
../themes/default/index.template.php
Quote from: timned88 on February 17, 2009, 10:38:03 PM
Quote from: karlbenson on May 19, 2008, 10:01:37 AM
It only works for
[img]http://...[/img]
but not images that have already been sized by smf.
[img width="100" height="100"]http://...[/img]
does that mean this mod does not work on attachments? only hotlinked images?
i have only been able to get it to work with hotlinked images. SMF2.0RC1
BUMP!
It's designed to work only for linked images.
no worries... i found a way via hard code and back-end to make it work for attachments. not as elegant but it works.
could there be a future version that works for attachments as well?
Metalcore allows me to take over this mod so I sent a PM to SleePy and I hope to be the developer of this mod today or tomorrow.
:)
NIBOGO
I hope you solve xhtml problem =) (onload .. http://www.simplemachines.org/community/index.php?topic=240057.msg1751682#msg1751682)
IS there already an updated version of this MOD for RC1?
http://www.simplemachines.org/community/index.php?action=dlattach;topic=240057.0;attach=78111
Thanks Özgür´
Quote from: Özgür´ on March 08, 2009, 10:35:29 PM
NIBOGO
I hope you solve xhtml problem =) (onload .. http://www.simplemachines.org/community/index.php?topic=240057.msg1751682#msg1751682)
I will try to fix all the bugs and update the mod ^^
Changelogs:
Version 1.2 - March 09, 2009
- Added Support for SMF 2.0 RC1 & 1.1.8
- Now all the themes load the same .js file
- NIBOGO take over the nCode Image Resizer Mod
Version 1.0 - May 16, 2008
- Modification Release
Thanks for the modification and the Spanish translation
hi :) this mod is also resizing images in signatures :( any way to disable this ?
thanx :)
Quote from: problemwt2.0 on March 10, 2009, 09:31:53 AM
hi :) this mod is also resizing images in signatures :( any way to disable this ?
thanx :)
I don't think of this is necessary , because if you don't want big images in post you don't want big images on signatures ;)
Bravo nibogo another good mod to check ;) i use this by time and work ok
Hey! Great mod!
but right now if you click a large image it totally flows over to the right, as seen in my attachments images, the first one is good, but the 2nd one shows what I mean.
is there any way you can make it centralise itself, instead of just overflowing to the right? much alike with a lightbox, like just centralise itself.
(( its a bit different in the default theme, but its about the same, you need to scroll at the bottom))
I did a minor sketch in paint on how I mean, making it expand both to the left and the right, instead of just to the right.
or, have the option, to maybe set the absolute maximum size of images, like, max 700px when minimized, and up to 1600px when you click the maximize, even tho the picture might be 1900px, to prevent overflow. even tho i'd rather just have it go centralised instead ;)
Quote from: DegJ on March 12, 2009, 12:04:44 AM
Hey! Great mod!
but right now if you click a large image it totally flows over to the right, as seen in my attachments images, the first one is good, but the 2nd one shows what I mean.
is there any way you can make it centralise itself, instead of just overflowing to the right? much alike with a lightbox, like just centralise itself.
(( its a bit different in the default theme, but its about the same, you need to scroll at the bottom))
I did a minor sketch in paint on how I mean, making it expand both to the left and the right, instead of just to the right.
or, have the option, to maybe set the absolute maximum size of images, like, max 700px when minimized, and up to 1600px when you click the maximize, even tho the picture might be 1900px, to prevent overflow. even tho i'd rather just have it go centralised instead ;)
Anyway if you put the image in the center you will have the same problem because the image will enlarge the left part of the wndow , the best option is open the image in a new window if you have images with a size bigger than 1600 px
I have a problem, I installed everything perfectly, I reviewed the files manually, translated it into Spanish, copied ncode_imageresizer.js to / Themes / default and configured it in Themes and Design, but not working, what happens?
Thanks! ;)
ncode_imageresizer.js copy your own theme
Quote from: -!¦[·ÃNÐ¥·]¦!- on April 01, 2009, 01:59:08 PM
I have a problem, I installed everything perfectly, I reviewed the files manually, translated it into Spanish, copied ncode_imageresizer.js to / Themes / default and configured it in Themes and Design, but not working, what happens?
Thanks! ;)
Do you have to enable this mod in the admin panel and set the maximun width and height
hi bro :)
i juss wan to ask u 1 question :)
this mod is resizing every image
nd if only want this mod to resize image which are bigger than 700x800 nt resize any image which is smaller than that res :) please tell me how to do so if possible :)
thanx :)
edit : i'm using 2.0 RC1
You set the maximun height and width, If any image is bigger than that parameters will be resized but not the other images
Quote from: NIBOGO on April 01, 2009, 07:14:03 PM
You set the maximun height and width, If any image is bigger than that parameters will be resized but not the other images
tried nt working :(
Features and Options/General/Max width/hight of posted pictures
i set it b not working please help me :-[
Did you edit your Theme??
The mod only works on SMF Theme Default, you have to make the manual edit for your theme
Quote from: NIBOGO on April 02, 2009, 03:41:46 PM
Did you edit your Theme??
The mod only works on SMF Theme Default, you have to make the manual edit for your theme
well i'm using this theme on custom theme bro :P any other suggestion ?
Quote from: NIBOGO on April 01, 2009, 05:39:27 PM
Quote from: -!¦[·ÃNÐ¥·]¦!- on April 01, 2009, 01:59:08 PM
I have a problem, I installed everything perfectly, I reviewed the files manually, translated it into Spanish, copied ncode_imageresizer.js to / Themes / default and configured it in Themes and Design, but not working, what happens?
Thanks! ;)
Do you have to enable this mod in the admin panel and set the maximun width and height
I edit manually my own theme and copy ncode_imageresizer.js there, also in the admin panel, I selected 'Enlarge in same document' and 650width, but it doesn't work :(
check the Subs.php edit also if your site is loading the .js script
Thanks for your help! But, how do I do that? Here is Subs.php
Max width of posted pictures (0 = disable)
Max height of posted pictures (0 = disable)
will be 0
It works now! Thanks! :D
no problem ;D
I have a problem with this mod, when i post an image it is resized yes but nowhare i can see a button that on lick it will show me the full image size i think on hte discription of the mod was mentioned that it includes a button to restore the original size on click right?
Quote from: d0brin on April 21, 2009, 03:42:54 PM
I have a problem with this mod, when i post an image it is resized yes but nowhare i can see a button that on lick it will show me the full image size i think on hte discription of the mod was mentioned that it includes a button to restore the original size on click right?
Nop, you have a bar in the top of the image to restore the original size of the image if you select the option in the admin panel
NIBOGO we still have a xhtml error.
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.rockayseri.net%2Frk%2Fhaberler%2Fthe-revolution-day-rock-metal-festivali-(kayseri)%2F&charset=(detect+automatically)&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.654
:(
subs.php
array(
'tag' => 'img',
'type' => 'unparsed_content',
'parameters' => array(
'alt' => array('optional' => true),
'width' => array('optional' => true, 'value' => ' width="$1"', 'match' => '(\d+)'),
'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'),
),
'content' => '<img src="$1" alt="{alt}"{width}{height} border="0" onload="NcodeImageResizer.createOn(this);" class="bbc_img" />',
'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
'disabled_content' => '($1)',
),
replace
array(
'tag' => 'img',
'type' => 'unparsed_content',
'parameters' => array(
'alt' => array('optional' => true),
'width' => array('optional' => true, 'value' => ' width="$1"', 'match' => '(\d+)'),
'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'),
),
'content' => '<img src="$1" alt="{alt}"{width}{height} class="bbc_img" />',
'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
'disabled_content' => '($1)',
),
u do it but now it works only [ img] [ /img]
not work [ img width=xx height=xx] [ /img]
Not working here. :(
I'm using SMF 1.1.8 + TP with SMF default theme.
It says everything is installed successfully and I also manually checked all the modified files.
Themes/default/index.template.php has the nCode script section before the </head> tag so it's ok.
Sources/Subs.php also has the correct code I think.
Sources/ModSettings.php also ok. :(
Under Features and Options - Basic Features, Max width and Max height are 0 like suggested before.
What could be the problem?
EDIT
Ok, I found what's the problem (???).
If I translate Modifications.english.php nCode doesn't work. :-\
Here's my translated file Modifications.italian-utf8.php, what's wrong with it?
<?php
// Version: 1.1; Modifications
// --- Begin added code - Advanced Visual Verification ---
$txt['ncode_imageresizer_warning_small'] = 'Clicca su questa barra per vedere l\'immagine ingrandita.';
$txt['ncode_imageresizer_warning_filesize'] = 'L\'immagine è stata ridimensionata. Clicca su questa barra per ingrandirla. L\'immagine originale è grande %1$sx%2$s e pesa %3$sKB.';
$txt['ncode_imageresizer_warning_no_filesize'] = 'L\'immagine è stata ridimensionata. Clicca su questa barra per ingrandirla. L\'immagine originale è grande %1$sx%2$s.';
$txt['ncode_imageresizer_warning_fullsize'] = 'Clicca su questa barra per vedere l\'immagine ridimensionata.';
$txt['ncode_imageresizer_mode'] = 'Modalità ridimensionamento';
$txt['ncode_imageresizer_original'] = 'Mantieni le dimensioni originali';
$txt['ncode_imageresizer_enlarge_same'] = 'Apri nella stessa pagina';
$txt['ncode_imageresizer_open_same'] = 'Apri nella stessa finestra';
$txt['ncode_imageresizer_open_new'] = 'Apri in una nuova finestra';
$txt['ncode_imageresizer_max_width'] = 'Larghezza massima';
$txt['ncode_imageresizer_max_height'] = 'Altezza massima<br /><span class="smalltext">Lascia vuoto per nessun limite.</span>';
// --- End added code ---
?>
EDIT 2
If I remove all the backslash (\') in my translation it starts to work again...
Thank you for making this MOD available. I had issues with it but have sorted them out. I use a custom theme and it took me 15 mins to figure out what I had to do. I am not so well at the moment and all the words on screen have a little haze for me due to the flu :(
I did figure it out though and I am so pleased with the end result. :)
Thank you , very good mod ,
Arabic translation :
// --- Begin added code - Advanced Visual Verification ---
$txt['ncode_imageresizer_warning_small'] = 'إضغط هنا لمشاهدة الصورة بحجمها الطبيعى.';
$txt['ncode_imageresizer_warning_filesize'] = 'هذه الصورة تم إعداة تحجيمها. إضغط على هذا الشريط لمشاهدتها بحجمها الاصلى. الحجم الاصلى للصورة هو %1$sx%2$s و حجم الملف هو %3$sKB.';
$txt['ncode_imageresizer_warning_no_filesize'] = 'هذه الصورة تم إعداة تحجيمها. إضغط على هذا الشريط لمشاهدتها بحجمها الاصلى. الحجم الاصلى للصورة هو %1$sx%2$s.';
$txt['ncode_imageresizer_warning_fullsize'] = 'إغط هنا لتصغير الصورة.';
$txt['ncode_imageresizer_mode'] = 'مود إعدادة تحجيم الصور';
$txt['ncode_imageresizer_original'] = 'الاحتفاظ بالحجم الطبيعى';
$txt['ncode_imageresizer_enlarge_same'] = 'تكبير فى نفس الصفحة';
$txt['ncode_imageresizer_open_same'] = 'فتح فى نفس النافذة';
$txt['ncode_imageresizer_open_new'] = 'فتح فى نافذة جديدة';
$txt['ncode_imageresizer_max_width'] = 'أقصى عرض';
$txt['ncode_imageresizer_max_height'] = 'أقصى إرتفاع<br /><span class="smalltext">اتركها فارغة اذا لم تكن تريد حد أقصى للارتفاع.</span>';
// --- End added code ---
please before put the translation in the file be sure that the file encode is UTF-8
Thanks for the italian and arabic translation, I will include that languages in the next release
How do I make this work? Everything seems to be in order except for the index.template.php
Quote from: Mack450 on May 17, 2009, 07:47:46 PM
How do I make this work? Everything seems to be in order except for the index.template.php
Edit your index.template.php adding the nCode code for that file
Hi,
Congratulations for this nice mode. ;)
One question,
How can I make the alert box smaller ?
JW
Hi.. love this mod!! here is the dutch translation:
// --- Begin added code - Advanced Visual Verification ---
$txt['ncode_imageresizer_warning_small'] = 'Klik deze titelbar om de volledige afbeeld te bekijken.';
$txt['ncode_imageresizer_warning_filesize'] = 'Deze afbeelding is verkleint. Klik de titelbar om de volledige afbeelding te zien. De originele afbeelding heeft een formaat van %1$sx%2$s and groote %3$sKB.';
$txt['ncode_imageresizer_warning_no_filesize'] = 'Deze afbeelding is verkleint. Klik de titelbar om de volledige afbeelding te zien. De originele afbeelding heeft een formaat van %1$sx%2$s.';
$txt['ncode_imageresizer_warning_fullsize'] = 'Klik deze titelbar om de kleine afbeelding te bekijken.';
$txt['ncode_imageresizer_mode'] = 'Resize Mode';
$txt['ncode_imageresizer_original'] = 'Behoud orignele grootte';
$txt['ncode_imageresizer_enlarge_same'] = 'Vergroot in het zelfde document';
$txt['ncode_imageresizer_open_same'] = 'Open in de zelfde venster';
$txt['ncode_imageresizer_open_new'] = 'Open in een nieuwe window';
$txt['ncode_imageresizer_max_width'] = 'Maximum breedte';
$txt['ncode_imageresizer_max_height'] = 'Maximum hoogte<br /><span class="smalltext">Laat leeg voor geen maximum hoogte.</span>';
// --- End added code ---
thanks I will add dutch for the next release
Quote from: NIBOGO on March 10, 2009, 03:06:43 PM
Quote from: problemwt2.0 on March 10, 2009, 09:31:53 AM
hi :) this mod is also resizing images in signatures :( any way to disable this ?
thanx :)
I quote that.
I use your mod to resize images bigger than 400px of width because of my SimplePortal MOD installed (so the home page don't get scrambled), but unfortunately most of my members signatures are a little bigger than this size.
If there's a way of desactivating this mod just for signatures, it would be awesome.
Meanwhile, here's the
Modifications.portuguese_brazilian-utf8 translation:
// --- Begin added code - nCode Image Resizer ---
$txt['ncode_imageresizer_warning_small'] = 'Clique para ver em tamanho normal.';
$txt['ncode_imageresizer_warning_filesize'] = 'Imagem redimensionada. Clique para ver em tamanho normal. Imagem %1$sx%2$s com %3$sKB.';
$txt['ncode_imageresizer_warning_no_filesize'] = 'Imagem redimensionada. Clique para ver em tamanho normal. Imagem %1$sx%2$s.';
$txt['ncode_imageresizer_warning_fullsize'] = 'Clique para ver em tamanho reduzido.';
$txt['ncode_imageresizer_mode'] = 'Modo de redimensionamento';
$txt['ncode_imageresizer_original'] = 'Manter tamanho original';
$txt['ncode_imageresizer_enlarge_same'] = 'Aumentar na mesma janela';
$txt['ncode_imageresizer_open_same'] = 'Abrir na mesma janela';
$txt['ncode_imageresizer_open_new'] = 'Abrir em nova janela';
$txt['ncode_imageresizer_max_width'] = 'Largura máxima';
$txt['ncode_imageresizer_max_height'] = 'Altura máxima<br /><span class="smalltext">Deixe em branco para manter a largura.</span>';
// --- End added code ---
Hi.. i was wondering if it is possible to make an exeption for the admin. This because i have images on my frontpage that are 800 px width... and now i have to turn it into a flash in order to prefend a resize... Maybe by enabling it or something for the ones who don't want this feature?
Hi, I just installed this mod and it's a GREAT addition to my forum. Thank You!!
... but I have one suggestion, It would be easier for the end user if you put the CSS code in the style.css file instead of index.template.php
This way the end user can find the css attributes all in one place when they change the colors and layout of their forum.
OK, I moved the CSS code to style.css and noticed that the font color was not responding to my changes. In fact, it wasn't responding even before I moved it.
A simple move of
"color: #000000;"
from "table.ncode_imageresizer_warning"
to "table.ncode_imageresizer_warning td"
made it work without issue.
Just figured I'd pass that info on to anyone else that might have had that issue.
I'm using SMF 1.1.9
TinyPortal 0.9.8
w/ a heavily modified custom theme
Hello...
This MOD working great in my forum...but, how to disaffect this mod function to any images at user signature??
Please come and visit my forum at http://www.vitanouva.net
Thanks for your help ;)
Ok, I might have a solution to disable this MOD for signatures. Not sure if works, I haven't tested because I use SMF 2.0 RC1-1.
For those using SMF 1.1.x, try to install Signature Settings Mod and allow signatures being the width you need.
http://custom.simplemachines.org/mods/index.php?mod=528
I looked into the support topic for that mod and it seems as if they are having an error issue with it at this time.
i used SMF 2.0 RC1-1 version too
Quote from: harisx on June 08, 2009, 07:18:51 AM
i used SMF 2.0 RC1-1 version too
I don't have any code for that yet, you are more than free to create it but I wont do that
Kind of work but the text wont appear anywhere :(
(http://data.fuskbugg.se/skalman01/--settings.PNG)
hi i've installed this mod today on my 2.1RC1-1 forum
it's working fine on default theme, but not on any other themes i have
i've uploaded the ncode_imageresizer.js to themes dir
here is my index.template.php
<?php
// Version: 2.0 Beta 4; index
/* This template is, perhaps, the most important template in the theme. It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below. It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.
The init sub template should load any data and set any hardcoded options.
The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.
The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.
The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.
The menu sub template should display all the relevant buttons the user
wants and or needs.
For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/
// Initialize the template... mainly little settings.
function template_init()
{
global $context, $settings, $options, $txt;
/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';
/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';
/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '2.0 Beta 4';
/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = true;
/* Use plain buttons - as oppossed to text buttons? */
$settings['use_buttons'] = true;
/* Show sticky and lock status separate from topic icons? */
$settings['separate_sticky_lock'] = true;
/* Does this theme use the strict doctype? */
$settings['strict_doctype'] = false;
/* Does this theme use post previews on the message index? */
$settings['message_index_preview'] = false;
}
// The main sub template above the content.
function template_html_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
<meta name="description" content="', $context['page_title_html_safe'], '" />
<meta name="keywords" content="', $context['meta_keywords'], '" />
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/scripts/script.js?b4"></script>
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/scripts/theme.js?b4"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "', $settings['theme_url'], '";
var smf_default_theme_url = "', $settings['default_theme_url'], '";
var smf_images_url = "', $settings['images_url'], '";
var smf_scripturl = "', $scripturl, '";
var smf_iso_case_folding = ', $context['server']['iso_case_folding'] ? 'true' : 'false', ';
var smf_charset = "', $context['character_set'], '";', $context['show_pm_popup'] ? '
if (confirm("' . $txt['show_personal_messages'] . '"))
window.open("' . $scripturl . '?action=pm");' : '', '
var ajax_notification_text = "', $txt['ajax_in_progress'], '";
var ajax_notification_cancel_text = "', $txt['modify_cancel'], '";
// ]]></script>
<title>', $context['page_title_html_safe'], '</title>';
// Please don't index these Mr Robot.
if (!empty($context['robot_no_index']))
echo '
<meta name="robots" content="noindex" />';
// The ?b4 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style', $context['theme_variant'], '.css?b4" />';
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/css/print.css?b4" media="print" />';
// IE7 needs some fixes for styles.
if ($context['browser']['is_ie7'])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/css/ie7.css" />';
// ..and IE6!
elseif ($context['browser']['is_ie6'])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/css/ie6.css" />';
// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="', $scripturl, '?action=help" />
<link rel="search" href="' . $scripturl . '?action=search" />
<link rel="contents" href="', $scripturl, '" />';
// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']))
echo '
<link rel="alternate" type="application/rss+xml" title="', $context['forum_name_html_safe'], ' - RSS" href="', $scripturl, '?type=rss;action=.xml" />';
// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=next" />';
// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="', $scripturl, '?board=', $context['current_board'], '.0" />';
// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
{
$options['collapse_header'] = !empty($_COOKIE['upshrink']);
$options['collapse_header_ic'] = !empty($_COOKIE['upshrinkIC']);
}
// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
// Create the main header object.
var mainHeader = new smfToggle("upshrink", ', empty($options['collapse_header']) ? 'false' : 'true', ');
mainHeader.useCookie(', $context['user']['is_guest'] ? 1 : 0, ');
mainHeader.setOptions("collapse_header", "', $context['session_id'], '");
mainHeader.addToggleImage("upshrink", "/upshrink.gif", "/upshrink2.gif");
mainHeader.addTogglePanel("user_section");
mainHeader.addTogglePanel("news_section");
// ]]></script>
<!-- google analytics -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-3420549-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<!-- google analytics -->
';
echo '
<script src="http://www.pequenasnotaveis.com.br/script/swfobject_modified.js" type="text/javascript"></script>
</head>
<body>';
}
function template_body_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
echo '
<div id="wrapper">
<!-- Top flash -->
<div id="topflash">
<!-- fla -->
<object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="262">
<param name="movie" value="', $settings['images_url'], '/topo.swf" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="7.0.70.0" />
<!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don't want users to see the prompt. -->
<param name="expressinstall" value="http://www.pequenasnotaveiscom.br/script/expressInstall.swf" />
<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="', $settings['images_url'], '/topo.swf" width="100%" height="262">
<!--<![endif]-->
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="7.0.70.0" />
<param name="expressinstall" value="http://www.pequenasnotaveis.com.br/script/expressInstall.swf" />
<!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
<div>
<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
</div>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
<script type="text/javascript">
<!--
swfobject.registerObject("FlashID");
//-->
</script>
<!-- fla -->
</div>
<!-- Top flash -->
<div id="header">
<!-- <div id="logo">
<a href="'.$scripturl.'" title=""></a>
</div> -->';
if (!empty($settings['enable_news']))
echo '
<div id="news"><p>', $context['random_news_line'], '</p></div>';
echo '</div>
<div id="toolbar">
<div id="nav">
',template_menu(),'
</div>
</div>
<div id="userinfo">
<b>', $context['common_stats']['total_posts'], '</b> ', $txt['posts'], ' ', $txt['in'], ' <b>', $context['common_stats']['total_topics'], '</b> ', $txt['topics'], '- ', $txt['by'], ' <span style="white-space: nowrap;"><b>', $context['common_stats']['total_members'], '</b> ', $txt['members'], '</span> -
', $txt['latest_member'], ': <b> ', $context['common_stats']['latest_member']['link'], '</b>';
echo '</div>
<div id="searchfield">
<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
<a href="', $scripturl, '?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0 1ex;" alt="" /></a>
<input class="biginput" type="text" name="search" value="', $txt['search'], '..." onfocus="this.value = \'\';" onblur="if(this.value==\'\') this.value=\'', $txt['search'], '...\';" style="width: 170px;" /> ';
// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />';
// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
echo '
</form><br />
</div>';
echo '
<div id="mainarea">
<div id="adsense">
<script type="text/javascript"><!--
google_ad_client = "pub-6717987246331038";
/* 728x90, criado 23/02/08 */
google_ad_slot = "8353186740";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
';
// Show the navigation tree.
theme_linktree();
}
function template_body_below()
{
global $context, $settings, $options, $scripturl, $txt;
echo '
</div>
';
// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '
<div id="footer">
', theme_copyright(), '
<br />Theme by <a href="http://www.cybercreations.com.br">Cyber</a>';
// Show the load time?
if ($context['show_load_time'])
echo '<br />';
echo '
</div>';
}
function template_html_below()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
echo '
</div>
</body></html>';
}
// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree($force_show = false)
{
global $context, $settings, $options, $shown_linktree;
// If linktree is empty, just return - also allow an override.
if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show))
return;
//!!! Temporarily don't do it twice.
if (!empty($shown_linktree))
return;
$shown_linktree = true;
echo '
<ul id="linktree">';
// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
echo '
<li', ($link_num == count($context['linktree']) - 1) ? ' class="last"' : '', '>';
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];
// Show the link, including a URL if it should have one.
echo $settings['linktree_link'] && isset($tree['url']) ? '
<a href="' . $tree['url'] . '"><span>' . $tree['name'] . '</span></a>' : '<span>' . $tree['name'] .'</span>';
// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];
// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo ' >';
echo '
</li>';
}
echo '
</ul>';
}
// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;
echo '
<ul>';
foreach ($context['menu_buttons'] as $act => $button)
echo '<li><a ', $button['active_button'] ? ' class="current"' : '' , ' href="', $button['href'], '"><span>', $button['title'], '</span></a></li>';
// The end of tab section.
echo '
</ul>';
}
// Generate a strip of buttons.
function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = '')
{
global $settings, $context, $txt, $scripturl;
// Create the buttons...
$buttons = array();
foreach ($button_strip as $key => $value)
{
if (!isset($value['test']) || !empty($context[$value['test']]))
$buttons[] = '<a href="' . $value['url'] . '" ' . (isset($value['custom']) ? $value['custom'] : '') . '><span>' . $txt[$value['text']] . '</span></a>';
}
if (empty($buttons))
return '';
// Make the last one, as easy as possible.
$buttons[count($buttons) - 1] = str_replace('<span>', '<span class="last">', $buttons[count($buttons) - 1]);
echo '
<div class="buttonlist', $direction != 'top' ? '_bottom' : '', '">
<ul class="clearfix">
<li>', implode('</li><li>', $buttons), '</li>
</ul>
</div>';
}
?>
@ baioslaio
Check that the language strings were inserted into your Modifications.english.php.
If youre using UTF8 language file, then copy the strings into your Modifications.english-utf8.php.
The same applies if youre using a language file other than english. eg. Modifications.Klingon.php
Hope that helps :)
@ silverf0x
Try this
<?php
// Version: 2.0 Beta 4; index
/* This template is, perhaps, the most important template in the theme. It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below. It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.
The init sub template should load any data and set any hardcoded options.
The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.
The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.
The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.
The menu sub template should display all the relevant buttons the user
wants and or needs.
For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/
// Initialize the template... mainly little settings.
function template_init()
{
global $context, $settings, $options, $txt;
/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';
/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';
/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '2.0 Beta 4';
/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = true;
/* Use plain buttons - as oppossed to text buttons? */
$settings['use_buttons'] = true;
/* Show sticky and lock status separate from topic icons? */
$settings['separate_sticky_lock'] = true;
/* Does this theme use the strict doctype? */
$settings['strict_doctype'] = false;
/* Does this theme use post previews on the message index? */
$settings['message_index_preview'] = false;
}
// The main sub template above the content.
function template_html_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
<meta name="description" content="', $context['page_title_html_safe'], '" />
<meta name="keywords" content="', $context['meta_keywords'], '" />
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/scripts/script.js?b4"></script>
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/scripts/theme.js?b4"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "', $settings['theme_url'], '";
var smf_default_theme_url = "', $settings['default_theme_url'], '";
var smf_images_url = "', $settings['images_url'], '";
var smf_scripturl = "', $scripturl, '";
var smf_iso_case_folding = ', $context['server']['iso_case_folding'] ? 'true' : 'false', ';
var smf_charset = "', $context['character_set'], '";', $context['show_pm_popup'] ? '
if (confirm("' . $txt['show_personal_messages'] . '"))
window.open("' . $scripturl . '?action=pm");' : '', '
var ajax_notification_text = "', $txt['ajax_in_progress'], '";
var ajax_notification_cancel_text = "', $txt['modify_cancel'], '";
// ]]></script>
<title>', $context['page_title_html_safe'], '</title>';
// Please don't index these Mr Robot.
if (!empty($context['robot_no_index']))
echo '
<meta name="robots" content="noindex" />';
// The ?b4 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style', $context['theme_variant'], '.css?b4" />';
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/css/print.css?b4" media="print" />';
// IE7 needs some fixes for styles.
if ($context['browser']['is_ie7'])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/css/ie7.css" />';
// ..and IE6!
elseif ($context['browser']['is_ie6'])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/css/ie6.css" />';
// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="', $scripturl, '?action=help" />
<link rel="search" href="' . $scripturl . '?action=search" />
<link rel="contents" href="', $scripturl, '" />';
// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']))
echo '
<link rel="alternate" type="application/rss+xml" title="', $context['forum_name_html_safe'], ' - RSS" href="', $scripturl, '?type=rss;action=.xml" />';
// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=next" />';
// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="', $scripturl, '?board=', $context['current_board'], '.0" />';
// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
{
$options['collapse_header'] = !empty($_COOKIE['upshrink']);
$options['collapse_header_ic'] = !empty($_COOKIE['upshrinkIC']);
}
echo '<!-- nCode Image Resizer -->
<script type="text/javascript" src="', $settings['default_theme_url'], '/ncode_imageresizer.js"></script>
<style type="text/css">
<!--
table.ncode_imageresizer_warning, table.ncode_imageresizer_warning td
{
background-color: #fefee1; /* the bgcolor behind the text and image */
}
table.ncode_imageresizer_warning {
color: #000000; /* the font color */
border: 1px solid #CCCDCD; /* the border around the whole thing */
cursor: pointer;
}
table.ncode_imageresizer_warning td {
font-size: 10px;
vertical-align: middle;
text-decoration: none;
}
table.ncode_imageresizer_warning td.td1 {
padding: 5px;
}
-->
</style>';
// What is the mode?
if (isset($modSettings['ncode_imageresizer_mode']))
{
if ($modSettings['ncode_imageresizer_mode'] == 1)
$mode = 'enlarge';
elseif ($modSettings['ncode_imageresizer_mode'] == 2)
$mode = 'samewindow';
elseif ($modSettings['ncode_imageresizer_mode'] == 3)
$mode = 'newwindow';
else
$mode = 'none';
}
else
$mode = 'none';
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
NcodeImageResizer.BBURL = "', $settings['images_url'], '";
NcodeImageResizer.MODE = "', $mode, '";
NcodeImageResizer.MAXWIDTH = "', empty($modSettings['ncode_imageresizer_max_width']) ? 0 : (int) $modSettings['ncode_imageresizer_max_width'], '";
NcodeImageResizer.MAXHEIGHT = "', empty($modSettings['ncode_imageresizer_max_height']) ? 0 : (int) $modSettings['ncode_imageresizer_max_height'], '";
vbphrase = new Array();
vbphrase[\'ncode_imageresizer_warning_small\'] = \'', $txt['ncode_imageresizer_warning_small'], '\';
vbphrase[\'ncode_imageresizer_warning_filesize\'] = \'', $txt['ncode_imageresizer_warning_filesize'], '\';
vbphrase[\'ncode_imageresizer_warning_no_filesize\'] = \'', $txt['ncode_imageresizer_warning_no_filesize'], '\';
vbphrase[\'ncode_imageresizer_warning_fullsize\'] = \'', $txt['ncode_imageresizer_warning_fullsize'], '\';
// ]]></script>';
// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
// Create the main header object.
var mainHeader = new smfToggle("upshrink", ', empty($options['collapse_header']) ? 'false' : 'true', ');
mainHeader.useCookie(', $context['user']['is_guest'] ? 1 : 0, ');
mainHeader.setOptions("collapse_header", "', $context['session_id'], '");
mainHeader.addToggleImage("upshrink", "/upshrink.gif", "/upshrink2.gif");
mainHeader.addTogglePanel("user_section");
mainHeader.addTogglePanel("news_section");
// ]]></script>
<!-- google analytics -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-3420549-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<!-- google analytics -->
';
echo '
<script src="http://www.pequenasnotaveis.com.br/script/swfobject_modified.js" type="text/javascript"></script>
</head>
<body>';
}
function template_body_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
echo '
<div id="wrapper">
<!-- Top flash -->
<div id="topflash">
<!-- fla -->
<object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="262">
<param name="movie" value="', $settings['images_url'], '/topo.swf" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="7.0.70.0" />
<!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don't want users to see the prompt. -->
<param name="expressinstall" value="http://www.pequenasnotaveiscom.br/script/expressInstall.swf" />
<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="', $settings['images_url'], '/topo.swf" width="100%" height="262">
<!--<![endif]-->
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="7.0.70.0" />
<param name="expressinstall" value="http://www.pequenasnotaveis.com.br/script/expressInstall.swf" />
<!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
<div>
<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
</div>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
<script type="text/javascript">
<!--
swfobject.registerObject("FlashID");
//-->
</script>
<!-- fla -->
</div>
<!-- Top flash -->
<div id="header">
<!-- <div id="logo">
<a href="'.$scripturl.'" title=""></a>
</div> -->';
if (!empty($settings['enable_news']))
echo '
<div id="news"><p>', $context['random_news_line'], '</p></div>';
echo '</div>
<div id="toolbar">
<div id="nav">
',template_menu(),'
</div>
</div>
<div id="userinfo">
<b>', $context['common_stats']['total_posts'], '</b> ', $txt['posts'], ' ', $txt['in'], ' <b>', $context['common_stats']['total_topics'], '</b> ', $txt['topics'], '- ', $txt['by'], ' <span style="white-space: nowrap;"><b>', $context['common_stats']['total_members'], '</b> ', $txt['members'], '</span> -
', $txt['latest_member'], ': <b> ', $context['common_stats']['latest_member']['link'], '</b>';
echo '</div>
<div id="searchfield">
<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
<a href="', $scripturl, '?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0 1ex;" alt="" /></a>
<input class="biginput" type="text" name="search" value="', $txt['search'], '..." onfocus="this.value = \'\';" onblur="if(this.value==\'\') this.value=\'', $txt['search'], '...\';" style="width: 170px;" /> ';
// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />';
// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
echo '
</form><br />
</div>';
echo '
<div id="mainarea">
<div id="adsense">
<script type="text/javascript"><!--
google_ad_client = "pub-6717987246331038";
/* 728x90, criado 23/02/08 */
google_ad_slot = "8353186740";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
';
// Show the navigation tree.
theme_linktree();
}
function template_body_below()
{
global $context, $settings, $options, $scripturl, $txt;
echo '
</div>
';
// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '
<div id="footer">
', theme_copyright(), '
<br />Theme by <a href="http://www.cybercreations.com.br">Cyber</a>';
// Show the load time?
if ($context['show_load_time'])
echo '<br />';
echo '
</div>';
}
function template_html_below()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
echo '
</div>
</body></html>';
}
// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree($force_show = false)
{
global $context, $settings, $options, $shown_linktree;
// If linktree is empty, just return - also allow an override.
if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show))
return;
//!!! Temporarily don't do it twice.
if (!empty($shown_linktree))
return;
$shown_linktree = true;
echo '
<ul id="linktree">';
// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
echo '
<li', ($link_num == count($context['linktree']) - 1) ? ' class="last"' : '', '>';
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];
// Show the link, including a URL if it should have one.
echo $settings['linktree_link'] && isset($tree['url']) ? '
<a href="' . $tree['url'] . '"><span>' . $tree['name'] . '</span></a>' : '<span>' . $tree['name'] .'</span>';
// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];
// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo ' >';
echo '
</li>';
}
echo '
</ul>';
}
// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;
echo '
<ul>';
foreach ($context['menu_buttons'] as $act => $button)
echo '<li><a ', $button['active_button'] ? ' class="current"' : '' , ' href="', $button['href'], '"><span>', $button['title'], '</span></a></li>';
// The end of tab section.
echo '
</ul>';
}
// Generate a strip of buttons.
function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = '')
{
global $settings, $context, $txt, $scripturl;
// Create the buttons...
$buttons = array();
foreach ($button_strip as $key => $value)
{
if (!isset($value['test']) || !empty($context[$value['test']]))
$buttons[] = '<a href="' . $value['url'] . '" ' . (isset($value['custom']) ? $value['custom'] : '') . '><span>' . $txt[$value['text']] . '</span></a>';
}
if (empty($buttons))
return '';
// Make the last one, as easy as possible.
$buttons[count($buttons) - 1] = str_replace('<span>', '<span class="last">', $buttons[count($buttons) - 1]);
echo '
<div class="buttonlist', $direction != 'top' ? '_bottom' : '', '">
<ul class="clearfix">
<li>', implode('</li><li>', $buttons), '</li>
</ul>
</div>';
}
?>
P.S
Are you aware that for every custom theme which contains its own index.template.php file, you will need to make the edits for them?
@ Sabre™
thanks a lot, it's working now! :D
what u've edited?
My pleasure buddy :)
When you download a mod, on that download page beneath the mod([THIS] (http://custom.simplemachines.org/mods/index.php?mod=1197) mod for example), you will see this text
'Manual Install Instructions for SMF'
You select your version of SMF, then press the 'Parse' button.
The next page will show you what code to add, where to add it, and what templates to add them to.
Happy learning mate :)
Quote from: Sabre™ on June 09, 2009, 12:00:31 PM
@ baioslaio
Check that the language strings were inserted into your Modifications.english.php.
If youre using UTF8 language file, then copy the strings into your Modifications.english-utf8.php.
The same applies if youre using a language file other than english. eg. Modifications.Klingon.php
Hope that helps :)
@ silverf0x
Try this
<?php
// Version: 2.0 Beta 4; index
/* This template is, perhaps, the most important template in the theme. It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below. It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.
The init sub template should load any data and set any hardcoded options.
The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.
The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.
The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.
The menu sub template should display all the relevant buttons the user
wants and or needs.
For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/
// Initialize the template... mainly little settings.
function template_init()
{
global $context, $settings, $options, $txt;
/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';
/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';
/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '2.0 Beta 4';
/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = true;
/* Use plain buttons - as oppossed to text buttons? */
$settings['use_buttons'] = true;
/* Show sticky and lock status separate from topic icons? */
$settings['separate_sticky_lock'] = true;
/* Does this theme use the strict doctype? */
$settings['strict_doctype'] = false;
/* Does this theme use post previews on the message index? */
$settings['message_index_preview'] = false;
}
// The main sub template above the content.
function template_html_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
<meta name="description" content="', $context['page_title_html_safe'], '" />
<meta name="keywords" content="', $context['meta_keywords'], '" />
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/scripts/script.js?b4"></script>
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/scripts/theme.js?b4"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "', $settings['theme_url'], '";
var smf_default_theme_url = "', $settings['default_theme_url'], '";
var smf_images_url = "', $settings['images_url'], '";
var smf_scripturl = "', $scripturl, '";
var smf_iso_case_folding = ', $context['server']['iso_case_folding'] ? 'true' : 'false', ';
var smf_charset = "', $context['character_set'], '";', $context['show_pm_popup'] ? '
if (confirm("' . $txt['show_personal_messages'] . '"))
window.open("' . $scripturl . '?action=pm");' : '', '
var ajax_notification_text = "', $txt['ajax_in_progress'], '";
var ajax_notification_cancel_text = "', $txt['modify_cancel'], '";
// ]]></script>
<title>', $context['page_title_html_safe'], '</title>';
// Please don't index these Mr Robot.
if (!empty($context['robot_no_index']))
echo '
<meta name="robots" content="noindex" />';
// The ?b4 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style', $context['theme_variant'], '.css?b4" />';
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/css/print.css?b4" media="print" />';
// IE7 needs some fixes for styles.
if ($context['browser']['is_ie7'])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/css/ie7.css" />';
// ..and IE6!
elseif ($context['browser']['is_ie6'])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/css/ie6.css" />';
// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="', $scripturl, '?action=help" />
<link rel="search" href="' . $scripturl . '?action=search" />
<link rel="contents" href="', $scripturl, '" />';
// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']))
echo '
<link rel="alternate" type="application/rss+xml" title="', $context['forum_name_html_safe'], ' - RSS" href="', $scripturl, '?type=rss;action=.xml" />';
// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=next" />';
// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="', $scripturl, '?board=', $context['current_board'], '.0" />';
// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
{
$options['collapse_header'] = !empty($_COOKIE['upshrink']);
$options['collapse_header_ic'] = !empty($_COOKIE['upshrinkIC']);
}
echo '<!-- nCode Image Resizer -->
<script type="text/javascript" src="', $settings['default_theme_url'], '/ncode_imageresizer.js"></script>
<style type="text/css">
<!--
table.ncode_imageresizer_warning, table.ncode_imageresizer_warning td
{
background-color: #fefee1; /* the bgcolor behind the text and image */
}
table.ncode_imageresizer_warning {
color: #000000; /* the font color */
border: 1px solid #CCCDCD; /* the border around the whole thing */
cursor: pointer;
}
table.ncode_imageresizer_warning td {
font-size: 10px;
vertical-align: middle;
text-decoration: none;
}
table.ncode_imageresizer_warning td.td1 {
padding: 5px;
}
-->
</style>';
// What is the mode?
if (isset($modSettings['ncode_imageresizer_mode']))
{
if ($modSettings['ncode_imageresizer_mode'] == 1)
$mode = 'enlarge';
elseif ($modSettings['ncode_imageresizer_mode'] == 2)
$mode = 'samewindow';
elseif ($modSettings['ncode_imageresizer_mode'] == 3)
$mode = 'newwindow';
else
$mode = 'none';
}
else
$mode = 'none';
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
NcodeImageResizer.BBURL = "', $settings['images_url'], '";
NcodeImageResizer.MODE = "', $mode, '";
NcodeImageResizer.MAXWIDTH = "', empty($modSettings['ncode_imageresizer_max_width']) ? 0 : (int) $modSettings['ncode_imageresizer_max_width'], '";
NcodeImageResizer.MAXHEIGHT = "', empty($modSettings['ncode_imageresizer_max_height']) ? 0 : (int) $modSettings['ncode_imageresizer_max_height'], '";
vbphrase = new Array();
vbphrase[\'ncode_imageresizer_warning_small\'] = \'', $txt['ncode_imageresizer_warning_small'], '\';
vbphrase[\'ncode_imageresizer_warning_filesize\'] = \'', $txt['ncode_imageresizer_warning_filesize'], '\';
vbphrase[\'ncode_imageresizer_warning_no_filesize\'] = \'', $txt['ncode_imageresizer_warning_no_filesize'], '\';
vbphrase[\'ncode_imageresizer_warning_fullsize\'] = \'', $txt['ncode_imageresizer_warning_fullsize'], '\';
// ]]></script>';
// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
// Create the main header object.
var mainHeader = new smfToggle("upshrink", ', empty($options['collapse_header']) ? 'false' : 'true', ');
mainHeader.useCookie(', $context['user']['is_guest'] ? 1 : 0, ');
mainHeader.setOptions("collapse_header", "', $context['session_id'], '");
mainHeader.addToggleImage("upshrink", "/upshrink.gif", "/upshrink2.gif");
mainHeader.addTogglePanel("user_section");
mainHeader.addTogglePanel("news_section");
// ]]></script>
<!-- google analytics -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-3420549-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<!-- google analytics -->
';
echo '
<script src="http://www.pequenasnotaveis.com.br/script/swfobject_modified.js" type="text/javascript"></script>
</head>
<body>';
}
function template_body_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
echo '
<div id="wrapper">
<!-- Top flash -->
<div id="topflash">
<!-- fla -->
<object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="262">
<param name="movie" value="', $settings['images_url'], '/topo.swf" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="7.0.70.0" />
<!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don't want users to see the prompt. -->
<param name="expressinstall" value="http://www.pequenasnotaveiscom.br/script/expressInstall.swf" />
<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="', $settings['images_url'], '/topo.swf" width="100%" height="262">
<!--<![endif]-->
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="7.0.70.0" />
<param name="expressinstall" value="http://www.pequenasnotaveis.com.br/script/expressInstall.swf" />
<!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
<div>
<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
</div>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
<script type="text/javascript">
<!--
swfobject.registerObject("FlashID");
//-->
</script>
<!-- fla -->
</div>
<!-- Top flash -->
<div id="header">
<!-- <div id="logo">
<a href="'.$scripturl.'" title=""></a>
</div> -->';
if (!empty($settings['enable_news']))
echo '
<div id="news"><p>', $context['random_news_line'], '</p></div>';
echo '</div>
<div id="toolbar">
<div id="nav">
',template_menu(),'
</div>
</div>
<div id="userinfo">
<b>', $context['common_stats']['total_posts'], '</b> ', $txt['posts'], ' ', $txt['in'], ' <b>', $context['common_stats']['total_topics'], '</b> ', $txt['topics'], '- ', $txt['by'], ' <span style="white-space: nowrap;"><b>', $context['common_stats']['total_members'], '</b> ', $txt['members'], '</span> -
', $txt['latest_member'], ': <b> ', $context['common_stats']['latest_member']['link'], '</b>';
echo '</div>
<div id="searchfield">
<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
<a href="', $scripturl, '?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0 1ex;" alt="" /></a>
<input class="biginput" type="text" name="search" value="', $txt['search'], '..." onfocus="this.value = \'\';" onblur="if(this.value==\'\') this.value=\'', $txt['search'], '...\';" style="width: 170px;" /> ';
// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />';
// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
echo '
</form><br />
</div>';
echo '
<div id="mainarea">
<div id="adsense">
<script type="text/javascript"><!--
google_ad_client = "pub-6717987246331038";
/* 728x90, criado 23/02/08 */
google_ad_slot = "8353186740";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
';
// Show the navigation tree.
theme_linktree();
}
function template_body_below()
{
global $context, $settings, $options, $scripturl, $txt;
echo '
</div>
';
// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '
<div id="footer">
', theme_copyright(), '
<br />Theme by <a href="http://www.cybercreations.com.br">Cyber</a>';
// Show the load time?
if ($context['show_load_time'])
echo '<br />';
echo '
</div>';
}
function template_html_below()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
echo '
</div>
</body></html>';
}
// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree($force_show = false)
{
global $context, $settings, $options, $shown_linktree;
// If linktree is empty, just return - also allow an override.
if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show))
return;
//!!! Temporarily don't do it twice.
if (!empty($shown_linktree))
return;
$shown_linktree = true;
echo '
<ul id="linktree">';
// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
echo '
<li', ($link_num == count($context['linktree']) - 1) ? ' class="last"' : '', '>';
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];
// Show the link, including a URL if it should have one.
echo $settings['linktree_link'] && isset($tree['url']) ? '
<a href="' . $tree['url'] . '"><span>' . $tree['name'] . '</span></a>' : '<span>' . $tree['name'] .'</span>';
// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];
// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo ' >';
echo '
</li>';
}
echo '
</ul>';
}
// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;
echo '
<ul>';
foreach ($context['menu_buttons'] as $act => $button)
echo '<li><a ', $button['active_button'] ? ' class="current"' : '' , ' href="', $button['href'], '"><span>', $button['title'], '</span></a></li>';
// The end of tab section.
echo '
</ul>';
}
// Generate a strip of buttons.
function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = '')
{
global $settings, $context, $txt, $scripturl;
// Create the buttons...
$buttons = array();
foreach ($button_strip as $key => $value)
{
if (!isset($value['test']) || !empty($context[$value['test']]))
$buttons[] = '<a href="' . $value['url'] . '" ' . (isset($value['custom']) ? $value['custom'] : '') . '><span>' . $txt[$value['text']] . '</span></a>';
}
if (empty($buttons))
return '';
// Make the last one, as easy as possible.
$buttons[count($buttons) - 1] = str_replace('<span>', '<span class="last">', $buttons[count($buttons) - 1]);
echo '
<div class="buttonlist', $direction != 'top' ? '_bottom' : '', '">
<ul class="clearfix">
<li>', implode('</li><li>', $buttons), '</li>
</ul>
</div>';
}
?>
P.S
Are you aware that for every custom theme which contains its own index.template.php file, you will need to make the edits for them?
Thanks :)
Changing in the utf8 fix'd it!
Wonderful mod...thank you very much !
Quote from: lonrot on May 18, 2008, 08:28:37 PM
Okay, it works!
To enable this mod you must do this:
1) At > Features and Options > Basic Features > Leave 0 for Max width and Max height
2) At >" " > Layout and Options> Edit Resize Mode and width and lenght.
For example I placed 615 in the width field only.
The bad thing is that if you used image resize before, all the old posts would be already resized.
This mod only works for new posts.
Dont work for my :S
Since you haven't explained what the exact problem is, [This Link] (http://docs.simplemachines.org/index.php?topic=494) will help others to help you.
Thank You :)
Hello!
When I replace the 2 lines:
$txt['ncode_imageresizer_warning_filesize'] = 'This image has been resized. Click this bar to view the full image. The original image is sized %1$sx%2$s and weighs %3$sKB.';
$txt['ncode_imageresizer_warning_no_filesize'] = 'This image has been resized. Click this bar to view the full image. The original image is sized %1$sx%2$s.';
with:
$txt['ncode_imageresizer_warning_filesize'] = 'Cette image a été redimensionnée. Cliquez sur cette barre pour afficher l\'image complète. L\'image originale est de taille %1$sx%2$s et pèse %3$sKB.';
$txt['ncode_imageresizer_warning_no_filesize'] = 'Cette image a été redimensionnée. Cliquez sur cette barre pour afficher l\'image complète. L\'image originale est de taille %1$sx%2$s.';
The images are not resized
You can't use characters like "é" you must put just e
This does not work :(
Quote$txt['ncode_imageresizer_warning_filesize'] = 'Cette image a ete redimensionnee. Cliquez sur cette barre pour afficher l\'image complete. L\'image originale est de taille %1$sx%2$s et pese %3$sKB.';
$txt['ncode_imageresizer_warning_no_filesize'] = 'Cette image a ete redimensionnee. Cliquez sur cette barre pour afficher l\'image complete. L\'image originale est de taille %1$sx%2$s.';
Login: invite
Passe: 123456
http://www.scooter-chinois-4t.com/documentations/(tutoriel)-le-secret-de-la-transmission-kymco/
Try without the "L\'image originale est de taille %1$sx%2$s et pese %3$sKB" and "\'i"
If I remove the "\ 'i" not a bug, why?
The mod is not compatible UTF8?
Hi, great mod, really useful, but just one single detail, is it possible to make it not resize the images from signatures?
Regards!
This is a fantastic mod and is saving me from having to follow along behind posters who seem to ignore the image constraints on our forum and constantly fill the threads with ugly scrollbars created by images that are too large. :)
I do have, though, an odd request and, considering the nature of it, if you want to tell me to go fly a kite, NIBOGO, I quite understand. You see, I'm also using another mod on my site found HERE (http://custom.simplemachines.org/mods/index.php?mod=1477) called Bakers Dozen Pages. (The support thread suggests that the author is no longer supporting it.) This mod gives you a "blank page" that you can design the way you wish and doesn't have the same size limits that the forum's posting pages have. You may use the entire page for one image, if you wish. We were, in fact. We had a full-sized map that was visible with you clicked the button that mod created on the front page. The map has been resized, now.
Is there any sort of "exception" that could be added to Image Resizer's code that would stop it from resizing images added to Bakers Dozen Pages?
If not, then no worries; it's such a much-needed mod that I can live with this issue.
Thanks!
i dont see top bar with text even on my default theme. :(
Quote from: miregrobar on July 09, 2009, 05:48:18 AM
i dont see top bar with text even on my default theme. :(
You must set the settings in the admin panel, add the strings to your language and verify if your site is loading the ncode_imagersizer.js file
Ok ive uploaded the .zip now what do i do? Ive read the ReadMe but it tells me nothing?
grate mod ...... thank you :)
Translation to brazilian
Modifications.portuguese_brazilian.php
// --- Begin added code - Advanced Visual Verification --- translated by Costa at simplemachines.org
$txt['ncode_imageresizer_warning_small'] = 'Clique nesta barra para visualizar a imagem no tamanho original.';
$txt['ncode_imageresizer_warning_filesize'] = 'Esta imagem foi redimensionada. Clique nesta barra para visualizar a imagem no tamanho original. A imagem original tem %1$sx%2$s e %3$sKB.';
$txt['ncode_imageresizer_warning_no_filesize'] = 'Esta imagem foi redimensionada. Clique nesta barra para visualizar a imagem no tamanho original. A imagem original tem %1$sx%2$s.';
$txt['ncode_imageresizer_warning_fullsize'] = 'Clique nesta barra para visualizar a imagem pequena.';
$txt['ncode_imageresizer_mode'] = 'Modo de redimensionamento';
$txt['ncode_imageresizer_original'] = 'Mantenha o tamanho original';
$txt['ncode_imageresizer_enlarge_same'] = 'Aumente no mesmo documento';
$txt['ncode_imageresizer_open_same'] = 'Abrir na mesma janela';
$txt['ncode_imageresizer_open_new'] = 'Abrir em uma nova janela';
$txt['ncode_imageresizer_max_width'] = 'Largura Máxima';
$txt['ncode_imageresizer_max_height'] = 'Altura máxima<br /><span class="smalltext">Deixe em branco para não haver altura máxima.</span>';
// --- End added code ---
Modifications.portuguese_brazilian-utf-8.php
// --- Begin added code - Advanced Visual Verification --- translated by Costa at simplemachines.org
$txt['ncode_imageresizer_warning_small'] = 'Clique nesta barra para visualizar a imagem no tamanho original.';
$txt['ncode_imageresizer_warning_filesize'] = 'Esta imagem foi redimensionada. Clique nesta barra para visualizar a imagem no tamanho original. A imagem original tem %1$sx%2$s e %3$sKB.';
$txt['ncode_imageresizer_warning_no_filesize'] = 'Esta imagem foi redimensionada. Clique nesta barra para visualizar a imagem no tamanho original. A imagem original tem %1$sx%2$s.';
$txt['ncode_imageresizer_warning_fullsize'] = 'Clique nesta barra para visualizar a imagem pequena.';
$txt['ncode_imageresizer_mode'] = 'Modo de redimensionamento';
$txt['ncode_imageresizer_original'] = 'Mantenha o tamanho original';
$txt['ncode_imageresizer_enlarge_same'] = 'Aumente no mesmo documento';
$txt['ncode_imageresizer_open_same'] = 'Abrir na mesma janela';
$txt['ncode_imageresizer_open_new'] = 'Abrir em uma nova janela';
$txt['ncode_imageresizer_max_width'] = 'Largura máxima';
$txt['ncode_imageresizer_max_height'] = 'Altura máxima<br /><span class="smalltext">Deixe em branco para não haver altura máxima.</span>';
// --- End added code ---
To Portuguese
Modification.portuguese_pt.php
[/]// --- Begin added code - Advanced Visual Verification --- translated by Costa at simplemachines.org
$txt['ncode_imageresizer_warning_small'] = 'Clique nesta barra para visualizar a imagem no tamanho original.';
$txt['ncode_imageresizer_warning_filesize'] = 'Esta imagem foi redimensionada. Clique nesta barra para visualizar a imagem no tamanho original. A imagem original tem %1$sx%2$s e %3$sKB.';
$txt['ncode_imageresizer_warning_no_filesize'] = 'Esta imagem foi redimensionada. Clique nesta barra para visualizar a imagem no tamanho original. A imagem original tem %1$sx%2$s.';
$txt['ncode_imageresizer_warning_fullsize'] = 'Clique nesta barra para visualizar a imagem pequena.';
$txt['ncode_imageresizer_mode'] = 'Modo de redimensionamento';
$txt['ncode_imageresizer_original'] = 'Mantenha o tamanho original';
$txt['ncode_imageresizer_enlarge_same'] = 'Aumente no mesmo documento';
$txt['ncode_imageresizer_open_same'] = 'Abrir na mesma janela';
$txt['ncode_imageresizer_open_new'] = 'Abrir em uma nova janela';
$txt['ncode_imageresizer_max_width'] = 'Largura Máxima';
$txt['ncode_imageresizer_max_height'] = 'Altura máxima<br /><span class="smalltext">Deixe em branco para não haver altura máxima.</span>';
// --- End added code ---
[]
Modifications.portuguese_pt-utf8.php
[/]// --- Begin added code - Advanced Visual Verification --- translated by Costa at simplemachines.org
$txt['ncode_imageresizer_warning_small'] = 'Clique nesta barra para visualizar a imagem no tamanho original.';
$txt['ncode_imageresizer_warning_filesize'] = 'Esta imagem foi redimensionada. Clique nesta barra para visualizar a imagem no tamanho original. A imagem original tem %1$sx%2$s e %3$sKB.';
$txt['ncode_imageresizer_warning_no_filesize'] = 'Esta imagem foi redimensionada. Clique nesta barra para visualizar a imagem no tamanho original. A imagem original tem %1$sx%2$s.';
$txt['ncode_imageresizer_warning_fullsize'] = 'Clique nesta barra para visualizar a imagem pequena.';
$txt['ncode_imageresizer_mode'] = 'Modo de redimensionamento';
$txt['ncode_imageresizer_original'] = 'Mantenha o tamanho original';
$txt['ncode_imageresizer_enlarge_same'] = 'Aumente no mesmo documento';
$txt['ncode_imageresizer_open_same'] = 'Abrir na mesma janela';
$txt['ncode_imageresizer_open_new'] = 'Abrir em uma nova janela';
$txt['ncode_imageresizer_max_width'] = 'Largura máxima';
$txt['ncode_imageresizer_max_height'] = 'Altura máxima<br /><span class="smalltext">Deixe em branco para não haver altura máxima.</span>';
// --- End added code ---
[]
Farewell[/]
Thanks costa :)
be my guest NIBOGO ;)
Great Mod! Thanks!
I can see the drop down menu and all the size boxes. And i left the boxes in "Basic Options" 0 and the ones in "Layout and options" 200 and i selected an option from the dropdown menu.
However, I tried posting an image, but it doe not get resized. How can i fix it? Thanks a bunch
-Xye
hi . i have 1.1.10 and i installed this MOD but its not resizing the images .. i have changed the settings in layout and options .. and in features and options the settings are set on 0 , 0 ... everything is set ok .. but its not working for me .. please please helpp
Guys my problem is solved ..
New members of this mod .. read this post carefully ...
if u are using a custom theme not Default and u installed this mod and its not resizing your pics then do the index.template.php file's changes from Default theme to ur custom theme .. then it will work :) and delete the codes that this mod added to your default theme's index.template file
Wow working great for me now... Thanks mates.... Really nice mod..Heads off...
hey i am having a really big problem after using this mod .. please see this topic and please solve it
http://www.simplemachines.org/community/index.php?topic=329423
hey the problem is solved .. the problem is not in ur mod .. its our mistake ..
Quote from: NIBOGO on July 09, 2009, 10:51:31 AM
Quote from: miregrobar on July 09, 2009, 05:48:18 AM
i dont see top bar with text even on my default theme. :(
You must set the settings in the admin panel, add the strings to your language and verify if your site is loading the ncode_imagersizer.js file
how do i know if its loading that file?
i instaled all files without errors but the pictures dont get resized :S
i already configured to keep original size
Maximum width 500
do not configure that for keep original size .. select resize in same window
OK, installed the mod in my SMF 2.0 RC1, no problems.
Set Admin > Features & Options > General > Max Width & Max Height from "640x480" to "0x0".
Set Admin > Features & Options > Layout > Resize Mode to "Enlarge in Same Doc" & Max Width & Max Height to "200x200".
Old linked Images are resizing correctly with clickable bar at top of pictures, many thanks, now controls the size of images that members link to!
What doesn't seem to be working is that attached images, even new ones are displayed at old 640x480 and no click here bar at top. When I click on the image, it does open full size in my forum and when I click again it closes, but no menubar to click and the image is clickable.
Any advice appreciated, thanks John.
Are there any errors in your error log?
Good question, never looked before.
Went to Admin > Log which opened a new browser window called "Error Log" eek ! ! ! It says:
Apply filter of type: All errors (182787) | General (62) | Undefined (182632) | User (93)
See attached screen shot, looks like I have bigger problems which I should post in a different thread, correct?
Before you do remind me the smf version you use.
Please make a note of what is said in my sig regarding the error log.
@ Cheese Head
those errors are to do with the chat mod you have installed.
I would also suggest removing your image/attachment, as it has details that (if in the wrong hands) could be used against you.
@TheListener: SMF 2.0 RC1
@Sabre™: Done, removed, thanks!
Quote from: Cheese Head on September 07, 2009, 12:00:22 AM
@TheListener: SMF 2.0 RC1
@Sabre™: Done, removed, thanks!
This mod will help you say bye to some errors.
QuoteThis mod will help you say bye to some errors.
??
OK, hope so, I'll post problems with my Error Log in a separate thread tomorrow, thanks, John.
Pm me if you want help to eradicate the errors and I will do the best i can.
Post those errors in the chat mods support thread John.
They will be better handled there as the mods author and users which utilise that mod will see them.
Than in a new separate thread I mean ;)
regards
@TheListener: Thanks very much for offer, but it's almost midnight here and I need to go to bed.
@Sabre™: I think that is better plan, will do tomorrow.
Many thanks both, goodnight!
Almost 6am here
I have noticed images posted from within our SMF Media Gallery do not get resized, example http://gwgoodolddays.net/forums/index.php?topic=1570.0 . SMG is a very popular mod so I am wondering if there is a known work around?
i checked the topic u provided .. i see the image is resizing .. everything seems fine
Quote from: timned88 on February 22, 2009, 03:53:12 PM
no worries... i found a way via hard code and back-end to make it work for attachments. not as elegant but it works.
could there be a future version that works for attachments as well?
I'm looking for the same thing.
Is there a way to make this mod work for attachments too?
This would make image resizing more standardized around the forum.
SMF Already resize the big attachments
Quote from: NIBOGO on September 10, 2009, 03:04:57 PM
SMF Already resize the big attachments
Yes, with the GD module. I understand that.
But that makes it where there are two different ways images are resized.
I would like to have the forum more standardized when it comes to image resizing.
...and nCode Image Resizer is my top choice for this job.
Quote from: Rohan_ on September 09, 2009, 01:57:33 AM
i checked the topic u provided .. i see the image is resizing .. everything seems fine
I edited the post and it seems that the user used the html code from the gallery instead of IMG tags.. so I fixed it. There is no way that it could auto resize html images could it?
This isn't working for me.
I'm running 2.0 RC 1.2
I set my max width & height in:
admin>features and options>general (800X600)
&
admin>features and options>layout (enlarge in same document 800X600)
please advise
Quote from: andrewjs18 on September 10, 2009, 11:17:56 PM
This isn't working for me.
I'm running 2.0 RC 1.2
I set my max width & height in:
admin>features and options>general (800X600)
&
admin>features and options>layout (enlarge in same document 800X600)
please advise
are you using a custom theme ? if yes them made the changes of index.template file to your theme's file manually :)
I've been going thorough my site validating the XHTML and eliminating errors.
Thats when i found an error that nCode Image Resizer is creating.
The short version is that the attribute "onload" is invalid for XHTML 1.0 Transitional.
Here's what the W3.org validator (http://validator.w3.org) says about this error...
Doctype: XHTML 1.0 Transitional
Quote
Validation Output: 1 Error
there is no attribute X
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).
This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.
How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.
Line 683, column 173: Attribute "onload" exists, but can not be used for this element.
...etal2.png" alt="" border="0" onload="NcodeImageResizer.createOn(this);" /></a>
The above quoted error is from a div tag located in a users sig, below is the full tag. But this same error happens on every pic that nCode resizes on the page. For some reason "onload" is not a correct attribute to use with XHTML 1.0 Transitional, which SMF uses.
<div class="signature"><a href="http://redneckfabrication.com" target="_blank"><img src="http://redneckfabrication.com/images/RFmetal2.png" alt="" border="0" onload="NcodeImageResizer.createOn(this);" /></a></div>
So what do I use instead of onload?
How do we get around this and get correct with XHTML 1.0 Transitional?
not working on my custom theme
a) for some reason my smf is resizing images already, even tho i have no image limits, is this normal?
b) after instaling (and modifying my index.template), there is no bar over the user images. I even tested creating a new post, still nothing.
any feedback?
Copy the .js file to your custom theme.
See if that helps.
Quote from: MissyNL on May 19, 2009, 03:27:38 PM
Hi.. love this mod!! here is the dutch translation:
// --- Begin added code - Advanced Visual Verification ---
$txt['ncode_imageresizer_warning_small'] = 'Klik deze titelbar om de volledige afbeeld te bekijken.';
$txt['ncode_imageresizer_warning_filesize'] = 'Deze afbeelding is verkleint. Klik de titelbar om de volledige afbeelding te zien. De originele afbeelding heeft een formaat van %1$sx%2$s and groote %3$sKB.';
$txt['ncode_imageresizer_warning_no_filesize'] = 'Deze afbeelding is verkleint. Klik de titelbar om de volledige afbeelding te zien. De originele afbeelding heeft een formaat van %1$sx%2$s.';
$txt['ncode_imageresizer_warning_fullsize'] = 'Klik deze titelbar om de kleine afbeelding te bekijken.';
$txt['ncode_imageresizer_mode'] = 'Resize Mode';
$txt['ncode_imageresizer_original'] = 'Behoud orignele grootte';
$txt['ncode_imageresizer_enlarge_same'] = 'Vergroot in het zelfde document';
$txt['ncode_imageresizer_open_same'] = 'Open in de zelfde venster';
$txt['ncode_imageresizer_open_new'] = 'Open in een nieuwe window';
$txt['ncode_imageresizer_max_width'] = 'Maximum breedte';
$txt['ncode_imageresizer_max_height'] = 'Maximum hoogte<br /><span class="smalltext">Laat leeg voor geen maximum hoogte.</span>';
// --- End added code ---
Heya, I don't want to be rude or anything, but the spelling is not really great...below the correct translation:
// --- Begin added code - Advanced Visual Verification ---
$txt['ncode_imageresizer_warning_small'] = 'Klik hier om het volledige formaat te zien.';
$txt['ncode_imageresizer_warning_filesize'] = 'Deze afbeelding is verkleind. Klik hier om het volledige formaat te zien. Het formaat van het origineel is %1$sx%2$s en is %3$sKB.';
$txt['ncode_imageresizer_warning_no_filesize'] = 'Deze afbeelding is verkleind. Klik hier om het volledige formaat te zien. Het formaat van het origineel is %1$sx%2$s.';
$txt['ncode_imageresizer_warning_fullsize'] = 'Klik hier om de kleinere afbeelding te zien.';
$txt['ncode_imageresizer_mode'] = 'Schalingsmodus';
$txt['ncode_imageresizer_original'] = 'Behoud originele grootte';
$txt['ncode_imageresizer_enlarge_same'] = 'Vergroot in hetzelfde venster';
$txt['ncode_imageresizer_open_same'] = 'Open in hetzelfde venster';
$txt['ncode_imageresizer_open_new'] = 'Open in nieuw venster';
$txt['ncode_imageresizer_max_width'] = 'Maximum breedte';
$txt['ncode_imageresizer_max_height'] = 'Maximum hoogte<br /><span class="smalltext">Laat leeg voor geen maximum.</span>';
// --- End added code ---
Quote from: Sabre™ on October 14, 2009, 12:50:42 PM
Copy the .js file to your custom theme.
See if that helps.
still nothing. images are getting resized and all, but no link to open in new window.
I was getting a lot of errors when installing this mod, finally after several uninstall / re-installs I think what fixed it was modding the template file of my theme PRIOR to installing the package - I have no idea why this worked, but it did. No errors in the logs.
However it seems that my default langauge folder/file doesnt get picked up in this mod - I must have to edit one of the files to point it correctly, I guess if I was told which file points to this and where in the file it does so I would be able to fix it.
Here is an example:
http://newenglandjeepz.org/forum/technical-discussion/extreme-hardkore-appliance-tech/msg74062/#new
Look at the picture and notice the "information" bar at the top of the pic, this is what I need to fix.
Thanks!
Have you tried placing an exact copy of Modifications.english.php (including this mod's edits) in your Theme's language folder (as well as in default's language folder)?
That would make sense, since I did created the language file in my theme and only added the nCode mode to it and it worked for the images, but messed everything else up (so I backtracked and deleted it).
the only thing about doing it that way is if I am no longer the admin for this board, It kind of leaves a gray area for anyone taking my place. Would rather just change the pointing link within the mod. If it can be done.
Any idea on 2.0 RC2 compatibility? When?
we waiting this mod to work with rc2...it not working with IE 5 or 6 ... :'( [/]
Hi NIBOGO,
Could you please let us know if this mod will be available in 2.0 RC2 in the near future? As I administrate an photography forum this is a very important mod for me. I really love it and I am waiting to go to RC2 as soon as this mod is available.
So, your work is really appreciated.
Kindest,
Pentaxian
Quote from: Pentaxian on November 12, 2009, 11:08:20 AM
Hi NIBOGO,
Could you please let us know if this mod will be available in 2.0 RC2 in the near future? As I administrate an photography forum this is a very important mod for me. I really love it and I am waiting to go to RC2 as soon as this mod is available.
So, your work is really appreciated.
Kindest,
Pentaxian
When I have time to do it, actually I am finishing my school
Well, first things first! All the best with finishing your school!
oh, good luck NIBOGO
waiting....
please update your mod for smf version 1.1.11
thanks guy!
Can you please update your SMF MOD to SMF Version 1.1.11
Thank you very much.
Quote from: Dark Proxy on December 03, 2009, 08:55:50 PM
Can you please update your SMF MOD to SMF Version 1.1.11
Thank you very much.
It works fine for me in 1.1.11, after finding, in Subs.php
'content' => '<img src="$1" alt="" border="0" onload="NcodeImageResizer.createOn(this);" />',
'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
.....and replacing it with
'content' => '<img src="$1" alt="" border="0" onload="NcodeImageResizer.createOn(this);" />',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
The upgrade to 1.1.11 did overwrite the "Find" (first) code above and I had to manually keep the nCode Image Resizer code in place when manually upgrading. It would be the section just
after:
'),
'disabled_content' => '($1)',
),
array(
'tag' => 'img',
'type' => 'unparsed_content',
that you would replace with the second code.
for 2.0.RC2 ?
could you please Redo the package for SMF 2.0 RC2 thank you =].
RC2 Also! 8)
2.0.RC2 Paketini dört gözle bekliyoruz.
Quote from: gbsothere on December 04, 2009, 08:01:37 AM
It works fine for me in 1.1.11, after finding, in Subs.php
'content' => '<img src="$1" alt="" border="0" onload="NcodeImageResizer.createOn(this);" />',
'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
.....and replacing it with
'content' => '<img src="$1" alt="" border="0" onload="NcodeImageResizer.createOn(this);" />',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
The upgrade to 1.1.11 did overwrite the "Find" (first) code above and I had to manually keep the nCode Image Resizer code in place when manually upgrading. It would be the section just after:
'),
'disabled_content' => '($1)',
),
array(
'tag' => 'img',
'type' => 'unparsed_content',
that you would replace with the second code.
Does not work for me.
The code (Subs.php):
array(
'tag' => 'img',
'type' => 'unparsed_content',
'content' => '<img src="$1" alt="" border="0" onload="NcodeImageResizer.createOn(this);" />',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
'disabled_content' => '($1)',
'parameters' => array(
'alt' => array('optional' => true),
'width' => array('optional' => true, 'value' => ' width="$1"', 'match' => '(\d+)'),
'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'),
),
'content' => '<img src="$1" alt="{alt}"{width}{height} border="0" />',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
'disabled_content' => '($1)',
),
Already thank you.
Quote from: [T]uGa [M]aSter on December 06, 2009, 05:44:28 PM
Does not work for me.
The code (Subs.php):
array(
'tag' => 'img',
'type' => 'unparsed_content',
'content' => '<img src="$1" alt="" border="0" onload="NcodeImageResizer.createOn(this);" />',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
'disabled_content' => '($1)',
'parameters' => array(
'alt' => array('optional' => true),
'width' => array('optional' => true, 'value' => ' width="$1"', 'match' => '(\d+)'),
'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'),
),
'content' => '<img src="$1" alt="{alt}"{width}{height} border="0" />',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
'disabled_content' => '($1)',
),
Already thank you.
Can you attach your entire Subs.php?
Attached...
[T]uGa [M]aSter, your Subs.php has a lot of duplicate code in it and also a lot of the code that should have been replaced by the upgrade is still there. (You did upgrade to 1.1.11, didn't you?)
If you did upgrade, then can you give me a list of all your mods? The file will have to be parsed from scratch.
Quote from: gbsothere on December 06, 2009, 06:09:51 PM
[T]uGa [M]aSter, your Subs.php has a lot of duplicate code in it and also a lot of the code that should have been replaced by the upgrade is still there. (You did upgrade to 1.1.11, didn't you?)
If you did upgrade, then can you give me a list of all your mods? The file will have to be parsed from scratch.
O.o
I did the update and everything went well.
MODs:
Member Color Link 3.0.7
Advanced XFire Field 2.0a
Aeva ~ Auto-Embed Video & Audio 7.0
Ad Management 2.3.1
Hide SMF Version 1.0.5
The Rules 1.2
nCode Image Resizer 1.2
1.3.3 Related Topics
Shared Forum Mod 0.2.5.4
SMF 1.0.19 / 1.1.11 Update 1.0
The other files have the same error?
Quote from: [T]uGa [M]aSter on December 06, 2009, 06:15:01 PM
O.o
I did the update and everything went well.
MODs:
Member Color Link 3.0.7
Advanced XFire Field 2.0a
Aeva ~ Auto-Embed Video & Audio 7.0
Ad Management 2.3.1
Hide SMF Version 1.0.5
The Rules 1.2
nCode Image Resizer 1.2
1.3.3 Related Topics
Shared Forum Mod 0.2.5.4
SMF 1.0.19 / 1.1.11 Update 1.0
The other files have the same error?
Let me just check all the mods from this list that edit Subs.php and see if I can clean it up. It'll take me a few minutes.
[T]uGa [M]aSter, try the attached Subs.php.
I need to tell you, though, that I can't find where you found Shared Forum Mod 0.2.5.4 for 1.1.x here, so I can't check to see if it parses Subs.php. If it does and you have the parsing instructions, you'll need to add it to this file.
You may need to clear your cache and refresh after uploading this file.
Quote from: gbsothere on December 06, 2009, 06:40:55 PM
[T]uGa [M]aSter, try the attached Subs.php.
I need to tell you, though, that I can't find where you found Shared Forum Mod 0.2.5.4 for 1.1.x here, so I can't check to see if it parses Subs.php. If it does and you have the parsing instructions, you'll need to add it to this file.
You may need to clear your cache and refresh after uploading this file.
Works!
Here is the Shared Forum Mod 0.2.5.4 for 1.1.x (http://www.simplemachines.org/community/index.php?topic=158330.0)
Thank You Very Much! :D
Quote from: [T]uGa [M]aSter on December 06, 2009, 07:03:59 PM
Works!
Here is the Shared Forum Mod 0.2.5.4 for 1.1.x (http://www.simplemachines.org/community/index.php?topic=158330.0)
Thank You Very Much! :D
I have to register on Sarge's site to download the zip and I'm waiting on a confirmation email. When it comes, I'll download it and check the parsing. If it edits Subs.php, I'll post again with a new attachment and PM you a "heads up" to look for it.
:)
Quote from: gbsothere on December 06, 2009, 07:13:42 PM
Quote from: [T]uGa [M]aSter on December 06, 2009, 07:03:59 PM
Works!
Here is the Shared Forum Mod 0.2.5.4 for 1.1.x (http://www.simplemachines.org/community/index.php?topic=158330.0)
Thank You Very Much! :D
I have to register on Sarge's site to download the zip and I'm waiting on a confirmation email. When it comes, I'll download it and check the parsing. If it edits Subs.php, I'll post again with a new attachment and PM you a "heads up" to look for it.
:)
Thanks :D
Quote from: [T]uGa [M]aSter on December 07, 2009, 03:47:54 AM
Thanks :D
I still don't have the confirmation email to register, [T]uGa [M]aSter, but if you have a zip of that mod, open it and find the install.xml file. All the files the mod edits will be in there and if Subs.php is listed, then its edits will be there. If it's not listed, then you don't have anything to worry about.
If you have difficulty finding it, let me know and I'll PM you an email address to send the zip to.
:)
Quote from: gbsothere on December 07, 2009, 08:02:54 AM
I still don't have the confirmation email to register, [T]uGa [M]aSter, but if you have a zip of that mod, open it and find the install.xml file. All the files the mod edits will be in there and if Subs.php is listed, then its edits will be there. If it's not listed, then you don't have anything to worry about.
If you have difficulty finding it, let me know and I'll PM you an email address to send the zip to.
:)
I found nothing related to the Subs.php.
Thank you very much!
Quote from: [T]uGa [M]aSter on December 07, 2009, 08:33:01 AM
I found nothing related to the Subs.php.
Thank you very much!
That's good news.
(http://whereitestmystuff.com/images/thumb.gif)
this is for 2.0 RC2
the attachment...
update
---------
removing the zip (a request from NIBOGO)
Quote from: infyquest on December 08, 2009, 03:51:30 PM
this is for 2.0 RC2
the attachment...
Remove the package I don't give you the permission to distribute a new version
Then update it asap
This mod is great and it solves a big issue for us. I do however have one big problem with it, it works fine for the deault theme but not att al for our "Oxygene" theme. I have moved the "ncode_imageresizer.js" to the ./Themes/oxygene/ aswell as edited the ./Themes/oxygene/index.template.php according to the instructions but I still don't get it to work with that template. The images just show up large size without the bar at the top like before I installed the mod.
There is no "Modifications.english.php" file for this theme to be edited...
Oh, and we're running 1.1.8!
Any suggestions?
U
this is for 2.0 RC2 için ne zaman güncelleyeceksiniz?
Quote from: NIBOGO on December 08, 2009, 09:00:12 PM
Quote from: infyquest on December 08, 2009, 03:51:30 PM
this is for 2.0 RC2
the attachment...
Remove the package I don't give you the permission to distribute a new version
Are you waiting until people want to pay you for (a new version of) this mod?
People are busy and do have lives outside of smf... give the author sometime to get to it. Keep in mind he doesnt have to update if he doesnt feel like it and comments like that wont make him want to get to it any faster.
Quote from: Pentaxian on December 11, 2009, 03:49:46 PM
Are you waiting until people want to pay you for (a new version of) this mod?
No, I just want to keep the credits for create this mod so a official 2.0 RC2 will come when I have time to do it ;)
Quote from: Spoogs on December 11, 2009, 03:53:36 PM
People are busy and do have lives outside of smf... give the author sometime to get to it. Keep in mind he doesnt have to update if he doesnt feel like it and comments like that wont make him want to get to it any faster.
Thanks Spoogs, Nice explanation :)
:) great mod, thank you
ne zaman 2.0.RC2 için yayınlayacaksınız?
Quote from: uffepuffe on December 11, 2009, 03:36:07 AM
This mod is great and it solves a big issue for us. I do however have one big problem with it, it works fine for the deault theme but not att al for our "Oxygene" theme. I have moved the "ncode_imageresizer.js" to the ./Themes/oxygene/ aswell as edited the ./Themes/oxygene/index.template.php according to the instructions but I still don't get it to work with that template. The images just show up large size without the bar at the top like before I installed the mod.
There is no "Modifications.english.php" file for this theme to be edited...
Oh, and we're running 1.1.8!
Any suggestions?
U
*bump*
Folks, somewhere a few posts ago, the mod author explained that he is finishing his schooling and will get to the updates when he has time - his schooling is a lot more important - give him time and have patience.
Quote from: uffepuffe on December 14, 2009, 08:57:04 AM
Quote from: uffepuffe on December 11, 2009, 03:36:07 AM
This mod is great and it solves a big issue for us. I do however have one big problem with it, it works fine for the deault theme but not att al for our "Oxygene" theme. I have moved the "ncode_imageresizer.js" to the ./Themes/oxygene/ aswell as edited the ./Themes/oxygene/index.template.php according to the instructions but I still don't get it to work with that template. The images just show up large size without the bar at the top like before I installed the mod.
There is no "Modifications.english.php" file for this theme to be edited...
Oh, and we're running 1.1.8!
Any suggestions?
U
*bump*
Just a thought: try moving a copy of the Modifications.english.php that is on your server (Themes/default/languages) into your custom theme's language folder, as well (Themes/oxygene/languages). Worth a try.
And, as always, make sure that the language setting in your forum matches the extension of the language file you're using (if you're using utf8, for example).
Quote from: ElectricSquid on September 13, 2009, 10:30:30 PM
I've been going thorough my site validating the XHTML and eliminating errors.
Thats when i found an error that nCode Image Resizer is creating.
The short version is that the attribute "onload" is invalid for XHTML 1.0 Transitional.
Here's what the W3.org validator (http://validator.w3.org) says about this error...
Doctype: XHTML 1.0 Transitional
Quote
Validation Output: 1 Error
there is no attribute X
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).
This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.
How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.
Line 683, column 173: Attribute "onload" exists, but can not be used for this element.
...etal2.png" alt="" border="0" onload="NcodeImageResizer.createOn(this);" /></a>
The above quoted error is from a div tag located in a users sig, below is the full tag. But this same error happens on every pic that nCode resizes on the page. For some reason "onload" is not a correct attribute to use with XHTML 1.0 Transitional, which SMF uses.
<div class="signature"><a href="http://redneckfabrication.com" target="_blank"><img src="http://redneckfabrication.com/images/RFmetal2.png" alt="" border="0" onload="NcodeImageResizer.createOn(this);" /></a></div>
So what do I use instead of onload?
How do we get around this and get correct with XHTML 1.0 Transitional?
AND?
any solution?, thankz.SOLVED! :)
2.0 RC2 ne zaman yayınlanacak? Bekliyoruz :)
Quote from: NIBOGO on December 08, 2009, 09:00:12 PM
Quote from: infyquest on December 08, 2009, 03:51:30 PM
this is for 2.0 RC2
the attachment...
Remove the package I don't give you the permission to distribute a new version
Can he release instructions on how to manually alter your existing package to work with RC2 opposed to redistributing the package?
helo this mod also effect to my forum signature
how can this mod working without bugging the signature?
Bug time at SMF 1.1.11
./Sources/Subs.php
Find:
'content' => '<img src="$1" alt="" border="0" />',
But now at the new version is:
'content' => '<div class="codeheader">' . $txt['smf238'] . ':</div><div class="code">' . ($context['browser']['is_gecko'] ? '<pre style="margin-top: 0; display: inline;">$1</pre>' : '$1') . '</div>',
How should I to do for put this line at Subs if the line is diferent?
onload="NcodeImageResizer.createOn(this);" />',
Greetings
actually that is the wrong lines...to fix it 1.1.11 (i have a lot of mods...dunno if an unmodded site has this issue...) but find this
array(
'tag' => 'img',
'type' => 'unparsed_content',
'content' => '<img src="$1" alt="{alt}"{width}{height} border="0" />',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
'disabled_content' => '($1)',
),
and replace it with this
array(
'tag' => 'img',
'type' => 'unparsed_content',
'content' => '<img src="$1" alt="{alt}"{width}{height} border="0" onload="NcodeImageResizer.createOn(this);"/>',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
'disabled_content' => '($1)',
),
Those of you asking for this to be updated for RC2 - I just installed this on my RC2 forum and it worked fine; you just need to emulate "SMF 2.0" in the package manager to install.
When you switch back to RC2 do all your other mods show and work OK, Link?
This mod looks a must as even though I can set a maximum picture size for normal [ img] type links when the gigapixel brigade get to work using url anything can happen!
As far as I know, emulating the version in the package manager just makes it so it will override your current version info temporarily, so the mod installer doesn't stop because it's told that it's not supported for your version yet. Emulating a previous version doesn't actually remove or enable other features, nor does it make all mods work with it.
Alternatively, you could just modify package-info.xml in the mod package, but that's more work. :P
If your site is in RC2.0 you don't need to and cannot emulate RC2.0 You need to emulate an older version!
But in doing that I got:The package you are trying to download or install is either corrupt or not compatible with this version of SMF.
So...
Funciona para 2.0 RC2??
work in 2.0 RC2?
Quote from: marko_andres on February 01, 2010, 07:58:11 PM
Funciona para 2.0 RC2??
work in 2.0 RC2?
http://www.simplemachines.org/community/index.php?topic=240057.msg2461462#msg2461462
Work perfect in rc2 !! ;) Thanks!
Its not working on my RC2 at least
I upload the mod and when I click install it says "there are no actions defined for the install"
Quote from: tbk22 on February 06, 2010, 07:41:25 AM
Its not working on my RC2 at least
I upload the mod and when I click install it says "there are no actions defined for the install"
any help on this?
Changelog:
Version 1.3 - Feb 13, 2010
- Added Support for SMF 2.0 RC2.
- Added Support for SMF 1.1.11.
- Added Portuguese_pt, Portuguese_brazilian, Turkish, Arabic, Dutch, Spanish, Spanish_latin and Spanish_es with and without UTF8.
- Code optimized (Now the css data is added to the /Theme/css/index.css instead of the index.template.php).
- Changed the format of the mod from .mod to .xml
thank you NIBOGO
I have v1.1.11 and I did to work your old version 1.2. I have installed new version now and i think there is error in istall-smf1.xml at line 51
<add><![CDATA[echo '<!-- nCode Image Resizer -->
I deleted #echo'# and so work fine
This is Italian translation to put in Modifications.italian.php file
$txt['ncode_imageresizer_warning_small'] = 'Click su questa barra per vederla intera.';
$txt['ncode_imageresizer_warning_filesize'] = 'Questa immagine è stata ridimensionata. Quella originale è di %1$sx%2$s e %3$sKB, clicca qui per visualizzarla.';
$txt['ncode_imageresizer_warning_no_filesize'] = 'Questa immagine è stata ridimensionata. Originale di %1$sx%2$s.';
$txt['ncode_imageresizer_warning_fullsize'] = 'Click su questa barra per vederla ridotta.';
$txt['ncode_imageresizer_mode'] = 'Opzioni di ridimensionamento';
$txt['ncode_imageresizer_original'] = 'Mantieni dimensioni originali';
$txt['ncode_imageresizer_enlarge_same'] = 'Ingrandisci nello stesso documento';
$txt['ncode_imageresizer_open_same'] = 'Apri nella stessa finestra';
$txt['ncode_imageresizer_open_new'] = 'Apri in una nuova finestra';
$txt['ncode_imageresizer_max_width'] = 'Larghezza massima';
$txt['ncode_imageresizer_max_height'] = 'Altezza massima<br /><span class="smalltext">Lascia vuoto per non ridimensionare.</span>';
NIBOGO I installed the mod on my RC 2 forum and it simply does nothing... Images are still bigger than what I wanted
Quote from: tbk22 on February 14, 2010, 06:56:49 AM
NIBOGO I installed the mod on my RC 2 forum and it simply does nothing... Images are still bigger than what I wanted
You must configure the mod in the admin panel
Quote from: NIBOGO on February 14, 2010, 08:01:50 PM
Quote from: tbk22 on February 14, 2010, 06:56:49 AM
NIBOGO I installed the mod on my RC 2 forum and it simply does nothing... Images are still bigger than what I wanted
You must configure the mod in the admin panel
I know... I have it like this
(http://o.imm.io/4c8.png)
And it does nothing
Its in Portuguese but I think you can get the picture
1. Execute Modification ./Sources/ModSettings.php Test successful
2. Execute Modification ./Sources/Subs.php Test failed
3. Execute Modification ./Themes/default/index.template.php Test successful
My Version is 1.1.11
Checked that file its permission is 777
:(
Quote from: tbk22 on February 15, 2010, 12:48:42 PM
Quote from: NIBOGO on February 14, 2010, 08:01:50 PM
Quote from: tbk22 on February 14, 2010, 06:56:49 AM
NIBOGO I installed the mod on my RC 2 forum and it simply does nothing... Images are still bigger than what I wanted
You must configure the mod in the admin panel
I know... I have it like this
(http://o.imm.io/4c8.png)
And it does nothing
Its in Portuguese but I think you can get the picture
And I tested on Internet Explorer and It foes this
(http://img237.imageshack.us/img237/2818/51451317.jpg)
Quote from: XxDrAg0nxX on February 16, 2010, 08:35:04 AM
1. Execute Modification ./Sources/ModSettings.php Test successful
2. Execute Modification ./Sources/Subs.php Test failed
3. Execute Modification ./Themes/default/index.template.php Test successful
My Version is 1.1.11
Checked that file its permission is 777
:(
I said it, it has a bug. someone can fix it? It is not possible to install in 1.1.11
I dont think we have the right to demand anyone to fix it, just have to wait patiently for NIBOGO to fix the problem
btw I downgraded to 1.1.10 the problem still exists :(
Arkino e XxDrAg0nxX, the mod is working in SMF 1.1.11
You have to consult the mod parser and make the changes to Subs.php manually.
I've installed this Mod and the same error came up:
QuoteExecute Modification ./Sources/Subs.php Test failed
So followed FragaCampos advise and now all my images are gone can't see any...
SMF 1.1.11
The mods work great on SMF 1.1.11 Fresh Install if you can't have it working just do the manual edit
I can't get it to work anyhow. >:(
What a shame.
Quote from: NIBOGO on February 18, 2010, 02:03:04 PM
The mods work great on SMF 1.1.11 Fresh Install if you can't have it working just do the manual edit
So I just run the package install and it will auto skip modifying that sub file?
Template Parse Error!
There was a problem loading the /Themes/default/index.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.
You may want to try to refresh this page or use the default theme.
Parse error: syntax error, unexpected T_STRING, expecting T_PAAMAYIM_NEKUDOTAYIM in .../Themes/default/index.template.php on line 173
164:
165: echo '
166: document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");
167:
168: document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";
169:
170: current_header_ic = mode;
171: }
172: // ]]></script>
173: echo '<!-- nCode Image Resizer -->
174: <script type="text/javascript" src="', $settings['default_theme_url'], '/ncode_imageresizer.js"></script>';
175:
176: // What is the mode?
177: $mode = 'none';
I had to remove the echo'
Quote from: tbk22 on February 16, 2010, 09:24:46 PM
Quote from: tbk22 on February 15, 2010, 12:48:42 PM
Quote from: NIBOGO on February 14, 2010, 08:01:50 PM
Quote from: tbk22 on February 14, 2010, 06:56:49 AM
NIBOGO I installed the mod on my RC 2 forum and it simply does nothing... Images are still bigger than what I wanted
You must configure the mod in the admin panel
I know... I have it like this
(http://o.imm.io/4c8.png)
And it does nothing
Its in Portuguese but I think you can get the picture
And I tested on Internet Explorer and It does this
(http://img237.imageshack.us/img237/2818/51451317.jpg)
Any help with this?
The day before the new version came out, I tried the mod on 1.1.11 and had to make a small adjustment to make it work.
It works great but.... now some members prefer thumbnails, others a medium resize and yet another group would like to see it just "as is".
This is why I thought that it might be useful to have a version that is adjustable by the individual member.
Off course compatible with 1.1.11
Does anyone have any ideas how to do this?
Quote from: motomaniacs on January 03, 2010, 05:12:14 AM
helo this mod also effect to my forum signature
how can this mod working without bugging the signature?
All images can be made immune to the mod by using a small adjustment.
affected image:
[img][/img]
non-affected image:
[img width=850][/img]
De mod will not shrink the image when it has an intended width. You can use any width, 850 is just an example.
This adjustment is not for the php-files!!!
Anyone can use it in his/her signature or post.
arabic ....
// --- Begin added code - nCode Image Resizer ---
$txt['ncode_imageresizer_warning_small'] = 'إضغط على هذا الإطار لمشاهدة الصورة بحجمها الأصلي.';
$txt['ncode_imageresizer_warning_filesize'] = 'انقر على هذا شريط لعرض الصورة الكاملة. الحجم الاصلي للصورة هو %1$sx%2$s.';
$txt['ncode_imageresizer_warning_no_filesize'] = 'انقر على هذا شريط لعرض الصورة الكاملة. الحجم الاصلي للصورة هو %1$sx%2$s';
$txt['ncode_imageresizer_warning_fullsize'] = 'انقر هنا لمشاهدة الصورة المصغرة.';
$txt['ncode_imageresizer_mode'] = 'مود تغيير حجم الصور';
$txt['ncode_imageresizer_original'] = 'الحفاظ على الحجم الأصلي للصورة';
$txt['ncode_imageresizer_enlarge_same'] = 'التكبير في نفس المكان';
$txt['ncode_imageresizer_open_same'] = 'فتح الصورة في نفس النافذة';
$txt['ncode_imageresizer_open_new'] = 'فتح الصورة في نافذة جديدة';
$txt['ncode_imageresizer_max_width'] = 'الحد الأقصى للعرض';
$txt['ncode_imageresizer_max_height'] = 'الحد الأقصى للطول<br /><span class="smalltext">أتركه فارغ لعدم تحديد الحد الأقصى لطول.</span>';
// --- End added code ---
Small problem with 2.0 RC2 on custom theme. The bar above the image is not showing up correctly. It's working fine with the default template. I have attached image. Anyone know what is causing the problem?
Thanks :)
hola Nibogo!
antes que nada te comento que me parece fantastico el mod! nos es muy útil en el foro...
ahora el asunto de este mensaje... se me ocurrió pasar validación xhtml al sitio y veo que el script tuyo la rompe... y creo que es por lo que sigue:
<script language="JavaScript" type="text/javascript"><!-- // -->
NcodeImageResizer.BBURL = "', $settings['images_url'], '";
NcodeImageResizer.MODE = "', $mode, '";
NcodeImageResizer.MAXWIDTH = "', empty($modSettings['ncode_imageresizer_max_width']) ? 0 : (int) $modSettings['ncode_imageresizer_max_width'], '";
NcodeImageResizer.MAXHEIGHT = "', empty($modSettings['ncode_imageresizer_max_height']) ? 0 : (int) $modSettings['ncode_imageresizer_max_height'], '";
vbphrase = new Array();
vbphrase[\'ncode_imageresizer_warning_small\'] = \'', $txt['ncode_imageresizer_warning_small'], '\';
vbphrase[\'ncode_imageresizer_warning_filesize\'] = \'', $txt['ncode_imageresizer_warning_filesize'], '\';
vbphrase[\'ncode_imageresizer_warning_no_filesize\'] = \'', $txt['ncode_imageresizer_warning_no_filesize'], '\';
vbphrase[\'ncode_imageresizer_warning_fullsize\'] = \'', $txt['ncode_imageresizer_warning_fullsize'], '\';
// ]]></script>';
los ]] son de un CDATA, que no está definido arriba
debería ser entonces:
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
saludos y mil gracias por el mod!
Quote from: motomaniacs on January 03, 2010, 05:12:14 AM
helo this mod also effect to my forum signature
how can this mod working without bugging the signature?
Did u manage to solve the problem?
I am on 1.1.11
Just figured out that it was the image resizer affecting signature pics.
Style.css
.signature { max-height: 100px;
Does not affect the pics anymore, instead the full image is shown in a scroller window
i just cant get the image to fit the exact screen, it show up so small and when click it resize too big
i hav installed nCode Image Resizer on my foum and the image id not been resized,,,,,,,,,,,,
i am using smf 1.1.11
the resize bar is not been displayed on the resized pic......
plz tell me what to do...............
my forum is: http://www.palaceforum.co.cc
here is my index.template.php file
Very nice ! Thanks.
@NIBOGO
I was checking my W3 validation and found 3 errors regarding this mod, I already fix one deleting 3 characters in index.template.php.
The normal code is something like:
Quote from: Replace Withecho '<!-- nCode Image Resizer -->
<script type="text/javascript" src="', $settings['default_theme_url'], '/ncode_imageresizer.js"></script>';
// What is the mode?
$mode = 'none';
if (isset($modSettings['ncode_imageresizer_mode']))
{
if ($modSettings['ncode_imageresizer_mode'] == 1)
$mode = 'enlarge';
elseif ($modSettings['ncode_imageresizer_mode'] == 2)
$mode = 'samewindow';
elseif ($modSettings['ncode_imageresizer_mode'] == 3)
$mode = 'newwindow';
}
echo '
<script language="JavaScript" type="text/javascript"><!-- // -->
NcodeImageResizer.BBURL = "', $settings['images_url'], '";
NcodeImageResizer.MODE = "', $mode, '";
NcodeImageResizer.MAXWIDTH = "', empty($modSettings['ncode_imageresizer_max_width']) ? 0 : (int) $modSettings['ncode_imageresizer_max_width'], '";
NcodeImageResizer.MAXHEIGHT = "', empty($modSettings['ncode_imageresizer_max_height']) ? 0 : (int) $modSettings['ncode_imageresizer_max_height'], '";
vbphrase = new Array();
vbphrase[\'ncode_imageresizer_warning_small\'] = \'', $txt['ncode_imageresizer_warning_small'], '\';
vbphrase[\'ncode_imageresizer_warning_filesize\'] = \'', $txt['ncode_imageresizer_warning_filesize'], '\';
vbphrase[\'ncode_imageresizer_warning_no_filesize\'] = \'', $txt['ncode_imageresizer_warning_no_filesize'], '\';
vbphrase[\'ncode_imageresizer_warning_fullsize\'] = \'', $txt['ncode_imageresizer_warning_fullsize'], '\';
// ]]></script>';
// Output any remaining HTML headers. (from mods, maybe?)
I deleted that part ( ]]> ) and the w3 validator past ok, the mod is working fine (at least looks like). (
http://www.simplemachines.org/community/index.php?topic=368581.msg2521811#msg2521811)
This part that I deleted has a special function?
pd: I know, my English sucks U_U
that is related with this post http://www.simplemachines.org/community/index.php?topic=240057.msg2512691#msg2512691
(sorry I posted it in spanish...)
the first line should be
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
Really 2 there are two errors with nCODE and W3 validation (at least for me), the other one I can't found where to fix it.
says :
Quote
Line 277, Column 141: there is no attribute "onload"
.../114197.jpg" alt="" border="0" onload="NcodeImageResizer.createOn(this);" clas...
That " is the problem says W3.
mmm, I am trying with xhtml transitional and it says
Line 158, Column 328: there is no attribute "onload"
like, "look man, it shoul not be onload code/atributes in xhtml transitional"
?
Thanks for this mod but can anyone tell me how to fix this problem:
(http://www.shrani.si/f/41/Wu/3XIWNLYk/this.jpg)
To its not colored where picture is on custom theme
Quote from: Storek on March 06, 2010, 10:21:33 AM
Thanks for this mod but can anyone tell me how to fix this problem:
To its not colored where picture is on custom theme
You must add this code to the end of your index.css file of your theme:
table.ncode_imageresizer_warning, table.ncode_imageresizer_warning td
{
background-color: #fefee1; /* the bgcolor behind the text and image */
}
table.ncode_imageresizer_warning {
color: #000000; /* the font color */
border: 1px solid #CCCDCD; /* the border around the whole thing */
cursor: pointer;
}
table.ncode_imageresizer_warning td {
font-size: 10px;
vertical-align: middle;
text-decoration: none;
}
table.ncode_imageresizer_warning td.td1 {
padding: 5px;
}
Quote from: Storek on March 06, 2010, 10:21:33 AM
Thanks for this mod but can anyone tell me how to fix this problem:
(http://www.shrani.si/f/41/Wu/3XIWNLYk/this.jpg)
To its not colored where picture is on custom theme
Try CTRL+F5
Quote from: NIBOGO on February 18, 2010, 02:03:04 PM
The mods work great on SMF 1.1.11 Fresh Install if you can't have it working just do the manual edit
What's the manual edit??
I'm getting the below error as well:
1. Execute Modification ./Sources/ModSettings.php Test successful
2. Execute Modification ./Sources/Subs.php Test failed
3. Execute Modification ./Themes/default/index.template.php Test successful
My Version is 1.1.11
Checked that file its permission is 777
I don't think I'm going to continue the development of this mod, currently SMF 2.0 RC3 integrate a toggle for resized images to their original size just like attachments.
The current version works great on SMF 2.0 RC2 & 1.1.11 so I don't think we need additional updates plus it should work on 2.0 RC3 in case that someone wants to use it
Quote from: gallitin on March 08, 2010, 12:14:12 PM
2. Execute Modification ./Sources/Subs.php Test failed
Check the difference between the original file and your current file.
Then rewrite the part of the mod which concerns that file.
Quote from: NIBOGO on March 08, 2010, 10:17:29 PM
I don't think I'm going to continue the development of this mod
Quote from: www.filippijnen.org on February 21, 2010, 06:38:18 PM
It works great but.... now some members prefer thumbnails, others a medium resize and yet another group would like to see it just "as is".
This is why I thought that it might be useful to have a version that is adjustable by the individual member.
Off course compatible with 1.1.11
Maybe an idea for a new version???
Quote from: www.filippijnen.org on March 09, 2010, 08:32:28 AM
Quote from: NIBOGO on March 08, 2010, 10:17:29 PM
I don't think I'm going to continue the development of this mod
Quote from: www.filippijnen.org on February 21, 2010, 06:38:18 PM
It works great but.... now some members prefer thumbnails, others a medium resize and yet another group would like to see it just "as is".
This is why I thought that it might be useful to have a version that is adjustable by the individual member.
Off course compatible with 1.1.11
Maybe an idea for a new version???
No
Quote from: NIBOGO on March 06, 2010, 10:42:32 AM
Quote from: Storek on March 06, 2010, 10:21:33 AM
Thanks for this mod but can anyone tell me how to fix this problem:
To its not colored where picture is on custom theme
You must add this code to the end of your index.css file of your theme:
table.ncode_imageresizer_warning, table.ncode_imageresizer_warning td
{
background-color: #fefee1; /* the bgcolor behind the text and image */
}
table.ncode_imageresizer_warning {
color: #000000; /* the font color */
border: 1px solid #CCCDCD; /* the border around the whole thing */
cursor: pointer;
}
table.ncode_imageresizer_warning td {
font-size: 10px;
vertical-align: middle;
text-decoration: none;
}
table.ncode_imageresizer_warning td.td1 {
padding: 5px;
}
This does not work. Simply, for some reason, the mod doesn't work with any custom themes. Well, I haven't managed to get it to work. I'd be interested to know if anyone has.
it works in custom themes... I am using actualism by crip, and it works great
btw, Im sad because the no more updates nibogo's choice... :(
its a nice mod
Quote from: drav on March 11, 2010, 05:20:07 PM
This does not work. Simply, for some reason, the mod doesn't work with any custom themes. Well, I haven't managed to get it to work. I'd be interested to know if anyone has.
drav, did you add this mod's parsing to your custom theme's index.template.php? That must be done in order for it to properly work for a custom theme. If you installed via package manager, it only edited the default theme's template.
The instructions are on the mod's page, just use the pull-down to find the edits for your SMF version's index.template.php.
:)
Quote from: luuuciano on March 11, 2010, 05:29:16 PM
it works in custom themes... I am using actualism by crip, and it works great
btw, Im sad because the no more updates nibogo's choice... :(
its a nice mod
I'm only maintaining mods that I use on my website, I was using the nCode Mod but the toggle for big images integrated in SMF 2.0 RC3 is pretty cool and I don't need to load any additional css and js code so I'm going to use it. Anyway it should work on SMF 2.0 RC3 so I don't need we need updates
But, can you see the big images in new windows using the new rc3 toggle?
That is nice, because you do not need to scroll the post slider to see the big image (like it happens in this forum, for example), it gets worse if you have more than 1 image...
(I have not upgraded to rc3 yet)
Quote from: luuuciano on March 11, 2010, 06:06:54 PM
But, can you see the big images in new windows using the new rc3 toggle?
That is nice, because you do not need to scroll the post slider to see the big image (like it happens in this forum, for example), it gets worse if you have more than 1 image...
(I have not upgraded to rc3 yet)
I don't think that open images is the best option I find it annoying for every single image that I want to see, I only used this mod in the View in Same Window mode as the toggle do it I don't need it anymore
please update rc3 please :)
Quote from: meko me on March 12, 2010, 03:51:49 AM
please update rc3 please :)
Quote from: NIBOGO on March 08, 2010, 10:17:29 PM
I don't think I'm going to continue the development of this mod, currently SMF 2.0 RC3 integrate a toggle for resized images to their original size just like attachments.
The current version works great on SMF 2.0 RC2 & 1.1.11 so I don't think we need additional updates plus it should work on 2.0 RC3 in case that someone wants to use it
Quote from: gbsothere on March 11, 2010, 05:32:57 PM
Quote from: drav on March 11, 2010, 05:20:07 PM
This does not work. Simply, for some reason, the mod doesn't work with any custom themes. Well, I haven't managed to get it to work. I'd be interested to know if anyone has.
drav, did you add this mod's parsing to your custom theme's index.template.php? That must be done in order for it to properly work for a custom theme. If you installed via package manager, it only edited the default theme's template.
The instructions are on the mod's page, just use the pull-down to find the edits for your SMF version's index.template.php.
:)
Yep, I installed it [correctly] manually on two custom themes. It caused major issues for me. Over a few days the error log generated 3000 errors. I have manually installed mods more complicated than this one, like flash chat for example, and I've never had any problems with any of them. Don't get me wrong, I'm open to the idea that I myself made some sort of mistake, but it's unlikely since I attempted several installs from backups and none of them worked. It's something of a mystery. And now I have residual error issues so I guess I have to re-edit my custom themes' index templates to completely solve the problem. I don't understand why it didn't work...I had the same problem as another member mentioned. To be honest I don't want to know. I'm just going to purge all traces of this mod from my forum and forget about it.
Nice Mod
Please update it for SMF 2.0RC3 ;)
Thanks
hi NIBOGO alright i installed this manually on RC3 mod is not working properly
images are nt getting resized to fit the forum they are getting resized though :s please kindly help me
for example please kindly see the s.s
http://i44.tinypic.com/332ur9w.jpg
Quote from: Eclipse16V on March 15, 2010, 02:18:56 AM
Nice Mod
Please update it for SMF 2.0RC3 ;)
Thanks
it's working on rc3 :)
please reply NIBOGO
Quote from: gallitin on March 08, 2010, 12:14:12 PM
Quote from: NIBOGO on February 18, 2010, 02:03:04 PM
The mods work great on SMF 1.1.11 Fresh Install if you can't have it working just do the manual edit
What's the manual edit??
I'm getting the below error as well:
1. Execute Modification ./Sources/ModSettings.php Test successful
2. Execute Modification ./Sources/Subs.php Test failed
3. Execute Modification ./Themes/default/index.template.php Test successful
My Version is 1.1.11
Checked that file its permission is 777
Like this guy, I can't get it to work and have the SAME failure in the subs.php. The text that is supposed to be there to replace just isn't there and, if I do the edit on what LOOKS right in the subs file, I lose the ability to link images :(
This mod worked extra well on my site before I did the upgrade to version 1.1.11. I removed the instance of nCode that was on there before and removed the old file from my server but it still won't work, ANY insight would be good :D
THANKS...
Bump
plese upgrade to rc 3
:-[
Quote from: poomkupz on March 22, 2010, 02:38:52 PM
plese upgrade to rc 3
:-[
You should read before ask:
http://www.simplemachines.org/community/index.php?topic=240057.msg2535719#msg2535719
btw, the new toggle in rc3... is active by default? have to be activated?
I can not find it... and images are just showed at 100%
Quote from: luuuciano on March 23, 2010, 02:21:09 AM
btw, the new toggle in rc3... is active by default? have to be activated?
I can not find it... and images are just showed at 100%
It's you just need to set a maximun width and height for posted images
As I said it's working for me pretty well :)
mmm, thats is odd... I had it in 0, but then changed it to 600 width, and 600 height...
but things like this: http://cbabikes.com.ar/foros/index.php/topic,1028.0.html
just shows the pictures at 100%...
I have tried changing to default, core themes... and the same (and deleted the file cache, just in case)
that rc3 toggle works with external images too?
You should ask for support in the support board
I will ask this again. I would like to know how I can fix the problem I now have with this Mod and version 1.1.11.
1. Execute Modification ./Sources/ModSettings.php Test successful
2. Execute Modification ./Sources/Subs.php Test failed
3. Execute Modification ./Themes/default/index.template.php Test successful
install it
go here
http://custom.simplemachines.org/mods/index.php?mod=1197
do a parse to 1.1.11... do the changes to subs.php by yourself
upload the file
at least I would do that... no idea if there is a better way to go
or better, before install it check the parse, subs.php file and study what is ahppening, why it fails to do the change...
Quote from: luuuciano on March 27, 2010, 11:00:33 AM
install it
go here
http://custom.simplemachines.org/mods/index.php?mod=1197
do a parse to 1.1.11... do the changes to subs.php by yourself
upload the file
at least I would do that... no idea if there is a better way to go
or better, before install it check the parse, subs.php file and study what is happening, why it fails to do the change...
I did that but, the text that is supposed to be there just isn't. It's hard to replace something that isn't there.
All of that code is missing from my Subs.psp :(
Thanks for trying though. :)
array(
'tag' => 'img',
'type' => 'unparsed_content',
'content' => '<img src="$1" alt="" border="0" />',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 || strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
'disabled_content' => '($1)',
),
upload your Subs.php here
Thanks very much luuciano. :)
your code from lines 1348 through 1352 have changed... you may search that lines in a full install 1.1.11 Subs.php file, replace them in your Subs.php, upload it and try to install the mod...
as always, do a backup first
If i replace the v.1.2 for the v.1.3, will have a problem?
i use the 1.1.11 SMF version
Quote from: ElectricSquid on September 13, 2009, 10:30:30 PM
I've been going thorough my site validating the XHTML and eliminating errors.
Thats when i found an error that nCode Image Resizer is creating.
The short version is that the attribute "onload" is invalid for XHTML 1.0 Transitional.
Here's what the W3.org validator (http://validator.w3.org) says about this error...
Doctype: XHTML 1.0 Transitional
Quote
Validation Output: 1 Error
there is no attribute X
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).
This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.
How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.
Line 683, column 173: Attribute "onload" exists, but can not be used for this element.
...etal2.png" alt="" border="0" onload="NcodeImageResizer.createOn(this);" /></a>
The above quoted error is from a div tag located in a users sig, below is the full tag. But this same error happens on every pic that nCode resizes on the page. For some reason "onload" is not a correct attribute to use with XHTML 1.0 Transitional, which SMF uses.
<div class="signature"><a href="http://redneckfabrication.com" target="_blank"><img src="http://redneckfabrication.com/images/RFmetal2.png" alt="" border="0" onload="NcodeImageResizer.createOn(this);" /></a></div>
So what do I use instead of onload?
How do we get around this and get correct with XHTML 1.0 Transitional?
Any solutions on this?
1. Execute Modification ./Sources/ManageSettings.php Test failed
2. Execute Modification ./Sources/Subs.php Test failed
On clean install of 2rc3.
Miasma, did you try "Emulate version SMF 2.0 RC2"?
http://www.simplemachines.org/community/index.php?topic=49410.msg2584095#msg2584095
I am not currently using nCode Image Resizer, but I remember that I could install it on RC3. It it doesn't work, I can check it again and help you.
btw... weeks ago an NCIR user uploaded here a version that worked and was packed to be used against rc3...
that file/post was deleted?
It was a package that was deleted for 2.0 RC2 and as I said before I don't allow redistributions of my mods in any way
Hello Brother.!!
I am installed ur nCode Image Resizer mod.
But a msg is showing all image's top
"This image has been resized. click this bar.................."
I want to remove that msg tag. is it possible ? plss tell me how ?
Powered by SMF 1.1.11
(http://i44.tinypic.com/1zchdl2.jpg)
what version of SMF?
My version is SMF 1.1.11
This doesn't work on RC3, any advice?
I have it installed on rc3, it works
I want to delete the yellow box with the message at the top of each resized image.
My version is 2.0 RC2, how can I do this ?
Thank You
echo '<!-- nCode Image Resizer -->
<script type="text/javascript" src="', $settings['default_theme_url'], '/ncode_imageresizer.js"></script>';
// What is the mode?
$mode = 'none';
if (isset($modSettings['ncode_imageresizer_mode']))
{
if ($modSettings['ncode_imageresizer_mode'] == 1)
$mode = 'enlarge';
elseif ($modSettings['ncode_imageresizer_mode'] == 2)
$mode = 'samewindow';
elseif ($modSettings['ncode_imageresizer_mode'] == 3)
$mode = 'newwindow';
}
echo '
<script language="JavaScript" type="text/javascript"><!-- // -->
NcodeImageResizer.BBURL = "', $settings['images_url'], '";
NcodeImageResizer.MODE = "', $mode, '";
NcodeImageResizer.MAXWIDTH = "', empty($modSettings['ncode_imageresizer_max_width']) ? 0 : (int) $modSettings['ncode_imageresizer_max_width'], '";
NcodeImageResizer.MAXHEIGHT = "', empty($modSettings['ncode_imageresizer_max_height']) ? 0 : (int) $modSettings['ncode_imageresizer_max_height'], '";
vbphrase = new Array();
vbphrase[\'ncode_imageresizer_warning_small\'] = \'', $txt['ncode_imageresizer_warning_small'], '\';
vbphrase[\'ncode_imageresizer_warning_filesize\'] = \'', $txt['ncode_imageresizer_warning_filesize'], '\';
vbphrase[\'ncode_imageresizer_warning_no_filesize\'] = \'', $txt['ncode_imageresizer_warning_no_filesize'], '\';
vbphrase[\'ncode_imageresizer_warning_fullsize\'] = \'', $txt['ncode_imageresizer_warning_fullsize'], '\';
// ]]></script>';
// Output any remaining HTML headers. (from mods, maybe?)
In this code on index.template.php , this line
// ]]></script>';
produces error on W3C validation
i made it to
// ></script>';
n it worked properly.
NIBOGO bro can u give a look to this also .
Sid2varun,
Does this mod completely pass W3C validation now?
for me after making the change it passed the validation for my site
else on W3C was site was not getting valid for XHTML due to above mentioned piece of code