Adapting the [CODE] box from proSilver to any style (solved)

For support and discussion related to templates, themes, and imagesets in phpBB 3.0.
Scam Warning
User avatar
Linda Carter
Registered User
Posts: 514
Joined: Fri Feb 15, 2008 6:45 am

Adapting the [CODE] box from proSilver to any style (solved)

Post by Linda Carter »

I noticed phpBB.com is not using any MODs (and is based on the "default package", but the [ CODE ] function is different (and better in my opinion). Is there a way to modify the [ CODE ] adding the "select all" hyperlink?

phpBB.com

Image

My board:

Image

No, this is not a MOD request, I thought phpBB.com didn't changed anything at all, that's why I am asking if my instalation files are wrong, because they don't look like the first photo. :)
Last edited by Linda Carter on Mon Sep 15, 2008 1:26 am, edited 3 times in total.
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."
User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: Question about the [CODE] function

Post by Erik Frèrejean »

The select all link is default for prosilver. If you want to add it to your theme you can try the following:
Open styles/{your style}/template/bbcode.html, Find:

Code: Select all

{L_CODE}: 
After-add:

Code: Select all

<a href="#" onclick="selectCode(this); return false;">{L_SELECT_ALL_CODE}</a>
Maybe the find isn't there but I don't know which style you are using :).
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)
User avatar
Linda Carter
Registered User
Posts: 514
Joined: Fri Feb 15, 2008 6:45 am

Re: Question about the [CODE] function

Post by Linda Carter »

Actually that line on the FIND is there on all styles. I am using subSilver 2 and fisubice2. Despite the fact the hyperlink is added, it's not working. When you click on "SELECT ALL", the code is not selecting anything. If you want to check that, go to styles/subSilver2/template/bbcode.html and try to do the same edition.

Like you said, it's working on proSilver, not on any other styles. When you click on "SELECT ALL", subSilver is just adding the character # to the URL of your thread, on the navigation bar:

:arrow: http://www.phpbb.com/community/posting. ... &t=1155835# :?:
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."
User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: Question about the [CODE] function

Post by Erik Frèrejean »

I see. I assumed that subSilver2 would have this feature, but it isn't possible to just use the prosilver code on a subsilver2 based theme.
I think that the best place to ask this will be in the styles development forum. I think that there will be some people who know how to fix this.
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)
User avatar
Linda Carter
Registered User
Posts: 514
Joined: Fri Feb 15, 2008 6:45 am

Re: Question about the [CODE] function

Post by Linda Carter »

Oh, boy... :cry:

This is the correct modification:

Open styles/FISUBICE2/bbcode.html, Find:

Code: Select all

<!-- BEGIN code_open -->
<div class="codetitle"><b>{L_CODE}:</b></div><div class="codecontent">
<!-- END code_open -->

<!-- BEGIN code_close -->
</div>
<!-- END code_close -->
REPLACE WITH:

Code: Select all

<!-- BEGIN code_open --><dl class="codebox"><dt>{L_CODE}: <a href="#" onclick="selectCode(this); return false;">{L_SELECT_ALL_CODE}</a></dt><dd><code><!-- END code_open -->
<!-- BEGIN code_close --></code></dd></dl><!-- END code_close -->
Now I have more problems... :cry:

I can select the whole text, but the scrollbars are missing! That means if your code is very large, you are going to waste a lot of screen space. The proSilver template have the scrollbars.

And that's not all - the code above, taken from the proSilver template, is not working on subSilver. The "select all" hyperlink still doesn't work.

Another problem is the size of the text on the code box. It's too small.

I am going to ask for someone please move this thread, if this is not the correct area. Is there a support forum for styles? :)
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."
User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: Question about the [CODE] function

Post by Erik Frèrejean »

No there is no styles support. But the [3.0.x] Styles Development & Discussion will do.
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)
User avatar
Linda Carter
Registered User
Posts: 514
Joined: Fri Feb 15, 2008 6:45 am

Re: Adapting the [CODE] box from proSilver for other styles

Post by Linda Carter »

Thank you for the help. :)

For those who are willing to check this out, the SubSilver 2 style, as you know, is already available on phpBB 3. The FIsubice2 style I am using is located on this thread. :geek:
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."
User avatar
Raimon
Former Team Member
Posts: 12088
Joined: Tue May 30, 2006 5:31 pm
Location: Netherlands
Name: Raimon Meuldijk
Contact:

Re: Adapting the [CODE] box from proSilver to other styles

Post by Raimon »

You don't need to use dt tags on subsilver2 styles, follow the next edits ; http://www.phpbb.com/community/viewtopi ... 5#p5655675 .
Need phpBB installation, extenstions, Styles or integrate phpBB with you website?
Contact me for fair prices and good service!
User avatar
Linda Carter
Registered User
Posts: 514
Joined: Fri Feb 15, 2008 6:45 am

Re: Adapting the [CODE] box from proSilver to other styles

Post by Linda Carter »

Thank you Raimon, now we are able to select the CODE using the subSilver template. :)

But still remains the problem with the size of the text inside the CODE and the scrollbars. :|

Look at that:

On my Internet Explorer 6 (SP1), the text size is normal (?).

Image


On Firefox 2.0.0.16 the text size is small.

Image

Now look at the same box on Firefox 2.0.0.16 without your modifications. How's that possible???????????? :o

Image

Firefox 3.0.1 looks different? :shock:

Image

And now, look at the same CODE above on the proSilver template. You see the scrollbars?

Image

I am sorry, but that code won't do you any good if there's no way to fix those two problems. Texts inside QUOTE boxes don't need scrollbars. CODES are other thing, they are always wasting screen space. :cry:
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 51673
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Adapting the [CODE] box from proSilver to other styles

Post by stevemaury »

May we have a link to your board so we can examine the source code, please?
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
User avatar
Linda Carter
Registered User
Posts: 514
Joined: Fri Feb 15, 2008 6:45 am

Re: Adapting the [CODE] box from proSilver to other styles

Post by Linda Carter »

Now scrollbars are being showed on subSilver2 (perhaps a wrong edit from the last time?). :?:
stevemaury wrote:May we have a link to your board so we can examine the source code, please?
Here is the link.

As you can see, this board is using subSilver2 (phpBB 3.0.2) and I only did the changes recommended on this thread:

http://www.phpbb.com/community/viewtopi ... 5#p5655675

Try to open my board using:

Firefox 2.0.0.16
Firefox 3.0.1
Internet Explorer 6 (SP1)


And you will see different font sizes for the CODE box.

Not to mention the fact the second CODE box (see my thread) is not selecting anything! :cry:

It's a shame no one is looking to fix this issue with other styles. We always need to use proSilver to make this feature work in a decent manner. :|
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."
User avatar
Raimon
Former Team Member
Posts: 12088
Joined: Tue May 30, 2006 5:31 pm
Location: Netherlands
Name: Raimon Meuldijk
Contact:

Re: Adapting the [CODE] box from proSilver to other styles

Post by Raimon »

Linda Carter wrote:Now scrollbars are being showed on subSilver2 (perhaps a wrong edit from the last time?). :?:
Or you dint refresh your browser ?
Linda Carter wrote:And you will see different font sizes for the CODE box.
Open stylesheet.css

search:

Code: Select all

.codecontent {
    overflow: auto;
       display: block;
       height: auto;
       max-height: 200px;
       white-space: normal;
       margin: 0 5px 10px 5px;
       padding: 5px;
       border-color: #A9B8C2;
       border-width: 0 1px 1px 1px;
       border-style: solid;
       font-weight: normal;
       color: #006600;
       font-size: 0.85em;
       font-family: Monaco, 'Courier New', monospace;
       background-color: #FAFAFA;
    }
replace with:

Code: Select all

.codecontent code {
    overflow: auto;
       display: block;
       height: auto;
       max-height: 200px;
       white-space: normal;
       margin: 0 5px 10px 5px;
       padding: 5px;
       border-color: #A9B8C2;
       border-width: 0 1px 1px 1px;
       border-style: solid;
       font-weight: normal;
       color: #006600;
       font-size: 0.85em;
       font-family: Monaco, 'Courier New', monospace;
       background-color: #FAFAFA;
    }
Linda Carter wrote:Not to mention the fact the second CODE box (see my thread) is not selecting anything! :cry:
Open bbcodes.html

search:

Code: Select all

    <!-- BEGIN code_open -->
    <div class="codetitle"><b>{L_CODE}:</b> <a href="#" onclick="selectCode(this); return false;">{L_SELECT_ALL_CODE}</a></div><div class="codecontent"><code>
    <!-- END code_open -->

    <!-- BEGIN code_close -->
    </code></div>
    <!-- END code_close -->
replace with:

Code: Select all

<!-- BEGIN code_open -->
<div>
<div class="codetitle">
    <b>{L_CODE}:</b> <a href="#" onclick="selectCode(this); return false;">{L_SELECT_ALL_CODE}</a></div>
<div class="codecontent">
  <code>
<!-- END code_open -->
<!-- BEGIN code_close -->
    </code>
</div>
</div>
<!-- END code_close -->
after that refresh your template ( acp -> styles -> templates -> refresh ) .
Linda Carter wrote: It's a shame no one is looking to fix this issue with other styles. We always need to use proSilver to make this feature work in a decent manner. :|
Not really, if you following the codes i have posted above , it is working just fine.
And it is up to the style author if he want to add this feature to his style ;)
Need phpBB installation, extenstions, Styles or integrate phpBB with you website?
Contact me for fair prices and good service!
User avatar
Linda Carter
Registered User
Posts: 514
Joined: Fri Feb 15, 2008 6:45 am

Re: Adapting the [CODE] box from proSilver to other styles

Post by Linda Carter »

Raimon wrote:
Linda Carter wrote:Now scrollbars are being showed on subSilver2 (perhaps a wrong edit from the last time?). :?:
Or you dint refresh your browser ?
Actually, no. That was a wrong edit. The thread you quoted:

http://www.phpbb.com/community/viewtopi ... 5#p5655675

It's saying that you need to do that edit:

open styles/subsilver2/theme/stylesheet.css

search:

Code: Select all

    .codecontent {
       direction: ltr;
       margin: 0 5px 10px 5px;
       padding: 5px;
       border-color: #A9B8C2;
       border-width: 0 1px 1px 1px;
       border-style: solid;
       font-weight: normal;
       color: #006600;
       font-size: 0.85em;
       font-family: Monaco, 'Courier New', monospace;
       background-color: #FAFAFA;
    }
replace with:

.codecontent {

Code: Select all

    overflow: auto;
       display: block;
       height: auto;
       max-height: 200px;
       white-space: normal;
       margin: 0 5px 10px 5px;
       padding: 5px;
       border-color: #A9B8C2;
       border-width: 0 1px 1px 1px;
       border-style: solid;
       font-weight: normal;
       color: #006600;
       font-size: 0.85em;
       font-family: Monaco, 'Courier New', monospace;
       background-color: #FAFAFA;
    }
So, naturally I have replaced only the contents inside the CODE box above. But the correct replacement should be:

Code: Select all

.codecontent {
    overflow: auto;
       display: block;
       height: auto;
       max-height: 200px;
       white-space: normal;
       margin: 0 5px 10px 5px;
       padding: 5px;
       border-color: #A9B8C2;
       border-width: 0 1px 1px 1px;
       border-style: solid;
       font-weight: normal;
       color: #006600;
       font-size: 0.85em;
       font-family: Monaco, 'Courier New', monospace;
       background-color: #FAFAFA;
    }
As you can see, your post was what caused my mistake. You forgot to include the .codecontent { inside the box.
I will report later, thanks. :)
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."
User avatar
Linda Carter
Registered User
Posts: 514
Joined: Fri Feb 15, 2008 6:45 am

Re: Adapting the [CODE] box from proSilver to other styles

Post by Linda Carter »

Thank you, now the code is almost done. :)

- The font size looks normal on all browsers - Firefox 2, 3, IE 6, and Opera;
- The "select all" button is fixed, also for all browsers;
- Scrollbars being showed (see note below);

One last issue (I don't know if you can solve):

- Internet Explorer 6.0 (Windows XP, Service Pack 1) is the only browser that is not showing the scrollbars. And when you click on the Select button, IE is moving the cursor (instead of being static).

Please try to access my test forum using IE, and Firefox, you will see what I am talking about... :ugeek:
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."
User avatar
Linda Carter
Registered User
Posts: 514
Joined: Fri Feb 15, 2008 6:45 am

Re: Adapting the [CODE] box from proSilver to other styles

Post by Linda Carter »

Confirmed, the issue IE 6 is having is not happening on IE 7.0! :ugeek:

- The font size looks normal on all browsers - Firefox 2/3, IE 7, and Opera;
- The "select all" button is fixed, also for all browsers - Firefox 2/3, IE 7 and Opera;
- Scrollbars being showed for all of them, including IE 7.

Thank you, for all the help provided into this topic. :)
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."
Locked

Return to “[3.0.x] Styles Support & Discussion”