We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] extra carriage return
Topic Started: Jul 26 2010, 04:45 AM (858 Views)
Zedboards-ZNR
Member Avatar
Member
[ *  * ]
Board Address: http://s1.zetaboards.com/cwgberlin/index/
Board Software: (ZetaBoards)
Description: I put the below code into my forum for more fonts and now the dropdown box in the reply area which says Font on it has an extra blank line in it. When I take the below code out, it goes back to just saying Font without the extra line. I posted privately to resolve this and also asked about it in the original topic where this code appears, but I haven't gotten any reply so far.

I don't know what a carriage return looks like in the code, so I don't know what to change to fix this myself. If anyone could show me, I would be grateful. Here's a screenshot so you can see what I'm talking about and below is the code. Thanks for any help!


Posted Image

Code:
 
<script type="text/javascript">
var FontFace = new Array(), w = 0;
FontFace[w++] = "Arial Black";
FontFace[w++] = "Arial Narrow";
FontFace[w++] = "Book Antiqua";
FontFace[w++] = "Century Gothic";
FontFace[w++] = "Comic Sans MS";
FontFace[w++] = "Courier New";
FontFace[w++] = "Fixedsys";
FontFace[w++] = "Franklin Gothic Medium";
FontFace[w++] = "Garamond";
FontFace[w++] = "Lucida Console";
FontFace[w++] = "Lucida Sans Unicode";
FontFace[w++] = "Microsoft Sans Serif";
FontFace[w++] = "Palatino Linotype";
FontFace[w++] = "System";
FontFace[w++] = "Tahoma";
FontFace[w++] = "Trebuchet MS";

//Created by Agent Moose
var b = document.getElementsByTagName("select");
for(y=0;y<b.length;y++){
if(b[y].name === "font"){
for(x=0;x<FontFace.length;x++){
b[y].options[b[y].options.length] = new Option(FontFace[x],FontFace[x]);
for(p=0;p<b[y].options.length;p++){ b[y].options[p].style.fontFamily = b[y].options[p].value; };
};};};
</script>


Offline Profile Goto Top
 
Roby-ZNR
Member Avatar
Efficacy
[ *  *  *  *  *  * ]
Are you talking about the code stretches the font drop down box? If so, it is because of the length of the words in the extra font inputs.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Quote:
 
select[name="font"] {
width: #px;
}
Offline Profile Goto Top
 
Zedboards-ZNR
Member Avatar
Member
[ *  * ]
Hi Cory,

Thanks for the code. I'm sorry, I wasn't sure what to do with it and tried a lot of things for several hours. Is it a piece of code for the board template or for the theme? I tried it in both places, but couldn't get it to both fix the error shown in the screenshot and also keep the added list of fonts.

I'm learning, but it's slow.
Thanks for your help.
:)
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
select[name="font"] {
width: #px;
Right now you have that in the script. Remove that and add the complete snippet posted above to the following destination, replacing the text highlighted in green with the number of pixels you want the drop menu to be (74px is a good size): Admin CP Posted Image Themes Posted Image Themes Posted Image Edit Theme Appearance
Offline Profile Goto Top
 
Zedboards-ZNR
Member Avatar
Member
[ *  * ]
Ah, it's more complicated than I hoped. I use a theme I got from the theme board and it doesn't have the piece of coding you posted. I looked at every piece of coding in the theme with the word select and that one doesn't appear.

I have two boards, one to try things and one as my real board, and I went through the whole theme for each board to look for differences between them. One board has the dropdown box called font but it doesn't show up at all on the other board. Neither of them has the piece of code you pointed out.

I tried simply putting your code into the theme, but it didn't do anything. Before I try to fix this, I think I need to go through the differences between the two boards, and make sure they are consistent and then compare them with the default ZB theme.

Thanks for your help. I will continue working on this. :)
Zed


Edited by Zedboards-ZNR, Jul 28 2010, 04:05 AM.
Offline Profile Goto Top
 
Roby-ZNR
Member Avatar
Efficacy
[ *  *  *  *  *  * ]
He just forgot the closing bracket. Add this to your CSS (edit the '#').
Code:
 
select[name="font"] {
width: #px;
}
Offline Profile Goto Top
 
Zedboards-ZNR
Member Avatar
Member
[ *  * ]
Thanks Krupa and Cory,
I have two boards and neither of them has this piece of coding. In one of the boards (not both), two buttons are missing, the Fonts button and the BG Color button. I don't know when they went missing, but they used to be there. As a test, I removed all the Below the Board coding and this didn't bring them back and I tried different themes and this didn't bring them back. I've started a support ticket to ask for help. Do you know if there's somewhere I can get a copy of the default theme for ZB without having to register a new board? I'm wondering if I put that in, if it might bring the buttons back.

Thanks for your help.
Offline Profile Goto Top
 
Lout-ZNR
Member Avatar
He came, he saw...
[ *  *  * ]
If the buttons for any BBCode are not showing then you need to check if they are enabled by navigating to Admin CP > Board Settings > BBCode and making sure the "Show Tag Button" is checked.
Offline Profile Goto Top
 
Roby-ZNR
Member Avatar
Efficacy
[ *  *  *  *  *  * ]
That snippet isn't something you're looking to edit - you need to add it.
Offline Profile Goto Top
 
Zedboards-ZNR
Member Avatar
Member
[ *  * ]
Lout - in one of my boards, that was the problem why the button was missing and now it's back. Thanks.

Cory and Krupa, after I turned on the button in the BB Code and then added Cory's code to the Theme, I could adjust the width, but you can see in the screenshot, that the Font button doesn't look like the other buttons and I'm not sure why. Is there a certain code in the them which defines the appearance of the buttons?

Thanks.
Zed


Posted Image

Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Change the strip you added to this:
Code:
 
select[name="font"] {
width: 65px;
height: 17px;
}
Offline Profile Goto Top
 
Zedboards-ZNR
Member Avatar
Member
[ *  * ]
Cory, thanks! I feel like I should have been able to figure that out myself, but I didn't. I really appreciate learning something new again!
:)
Offline Profile Goto Top
 
Roby-ZNR
Member Avatar
Efficacy
[ *  *  *  *  *  * ]
Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic