Changing Code Tag

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
Xennophontis
Registered User
Posts: 7
Joined: Sun Jan 13, 2008 11:29 pm

Changing Code Tag

Post by Xennophontis »

Hello.

I was wondering if it was possible to change the way Code tag appear.

I would really like to decrease it's font size, change the face to Trebuchet MS and make it a scrolling text area.

Is this possible?
User avatar
Noxwizard
Support Team Leader
Support Team Leader
Posts: 10551
Joined: Mon Jun 27, 2005 8:41 pm
Location: Texas, USA
Name: Patrick Webster
Contact:

Re: Changing Code Tag

Post by Noxwizard »

You will need to look in templates/{your_template}/bbcode.tpl and then from there make changes and see what CSS classes you need to modify.
[Support Template] - [Read Before Posting] - [phpBB Knowledge Base]
Do not contact me for private support, please share the question in our forums.
Xennophontis
Registered User
Posts: 7
Joined: Sun Jan 13, 2008 11:29 pm

Re: Changing Code Tag

Post by Xennophontis »

Okay. I have changed it correctly. Just wondering what changes I could do to this code to be able to make it a scrolling text area?

Code: Select all

.code { 
	font-family: {T_FONTFACE2}; font-size: 11px; color: #000000;
	background-color: {T_TD_COLOR1}; border: {T_TR_COLOR3}; border-style: solid;
	border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px
}
User avatar
Noxwizard
Support Team Leader
Support Team Leader
Posts: 10551
Joined: Mon Jun 27, 2005 8:41 pm
Location: Texas, USA
Name: Patrick Webster
Contact:

Re: Changing Code Tag

Post by Noxwizard »

Add this to it:

Code: Select all

height:100px;
overflow: auto;
Set the height to however big you want it, then overflow will add scroll bars when necessary.
[Support Template] - [Read Before Posting] - [phpBB Knowledge Base]
Do not contact me for private support, please share the question in our forums.
Xennophontis
Registered User
Posts: 7
Joined: Sun Jan 13, 2008 11:29 pm

Re: Changing Code Tag

Post by Xennophontis »

I added that code, but it made no difference. Any other suggestions?
User avatar
Noxwizard
Support Team Leader
Support Team Leader
Posts: 10551
Joined: Mon Jun 27, 2005 8:41 pm
Location: Texas, USA
Name: Patrick Webster
Contact:

Re: Changing Code Tag

Post by Noxwizard »

If you're using a style like subSilver, then it has the code inside a table, which won't work out the same. What you'll need to do is add this before the closing switch: (in bbcode.tpl)

Code: Select all

<div class="code">
and this after the opening switch of the code-close switch:

Code: Select all

</div>
Like this:

Code: Select all

<!-- BEGIN code_open --></span>
<table width="90%" cellspacing="1" cellpadding="3" border="0" align="center">
<tr> 
	  <td><span class="genmed"><b>{L_CODE}:</b></span></td>
	</tr>
	<tr>
	  <td><div class="code"><!-- END code_open -->
<!-- BEGIN code_close --></div></td>
	</tr>
</table>
<span class="postbody"><!-- END code_close -->
[Support Template] - [Read Before Posting] - [phpBB Knowledge Base]
Do not contact me for private support, please share the question in our forums.
Locked

Return to “2.0.x Support Forum”