Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 12000
Latest: Suz
New This Month: 12
New This Week: 1
New Today: 1
Stats
Total Posts: 38201
Total Topics: 6731
Most Online Today: 76
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 46
Total: 46

Author Topic: Code Tag Does Not Use Scrollbars In Gallery  (Read 167 times)

0 Members and 1 Guest are viewing this topic.

Offline Sockratease

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Fractal Forums
Code Tag Does Not Use Scrollbars In Gallery
« on: September 06, 2017, 04:32:25 am »
Hi.

Me again with another annoying question I hope you can help resolve.

As you may recall, our site is about Fractals - Art generated by Mathematical Formulas.

We often display the code used to generate our images, but it can involve numbers with many, many, decimal places.

The code tag is the obvious way to do that since it condenses that sort of thing in a box with scrollbars.

Here's an example of what we are getting when this is done:

https://fractalforums.org/gallery/?sa=view;id=29

The code box does not open scrollbars in the gallery, but does open them in the forum thread generated by the gallery  ( https://fractalforums.org/fractal-image-gallery/wiggly-fungus-spores-glitch/msg1141/#msg1141 ).  Without scrollbars in the code box, the page stretches out to be extremely wide.

This was not an issue on our old site, but that admin was good with php, and sadly I am not.

Do you have any advice on how we can correct this?
Life Is Complex - It Has Real And Imaginary Components

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 14158
    • View Profile
Re: Code Tag Does Not Use Scrollbars In Gallery
« Reply #1 on: September 06, 2017, 08:30:29 am »
Hmm I wonder if you have a mod that is changing it the default smf code doesn't seem to have that option.

A quick fix would be to modify

Sources/Subs.php

Find
Code: [Select]
'content' => '<div class="codeheader">' . $txt['code'] . ': ($2) <a href="#" onclick="return smfSelectText(this);" class="codeoperation">' . $txt['code_select'] . '</a></div>' . ($context['browser']['is_gecko'] || $context['browser']['is_opera'] ? '<pre style="margin: 0; padding: 0;">' : '') . '<code class="bbc_code">$1</code>' . ($context['browser']['is_gecko'] || $context['browser']['is_opera'] ? '</pre>' : ''),
Change to
Code: [Select]
'content' => '<div class="codeheader">' . $txt['code'] . ': ($2) <a href="#" onclick="return smfSelectText(this);" class="codeoperation">' . $txt['code_select'] . '</a></div>' . ($context['browser']['is_gecko'] || $context['browser']['is_opera'] ? '<pre style="margin: 0; padding: 0;">' : '') . '<code class="bbc_code" style="overflow: scroll;">$1</code>' . ($context['browser']['is_gecko'] || $context['browser']['is_opera'] ? '</pre>' : ''),
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others! Also contests/promotions for verified sites.

Offline Sockratease

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Fractal Forums
Re: Code Tag Does Not Use Scrollbars In Gallery
« Reply #2 on: September 06, 2017, 02:40:05 pm »
Hmm I wonder if you have a mod that is changing it the default smf code doesn't seem to have that option.

A quick fix would be to modify

Sources/Subs.php

Find
Code: [Select]
'content' => '<div class="codeheader">' . $txt['code'] . ': ($2) <a href="#" onclick="return smfSelectText(this);" class="codeoperation">' . $txt['code_select'] . '</a></div>' . ($context['browser']['is_gecko'] || $context['browser']['is_opera'] ? '<pre style="margin: 0; padding: 0;">' : '') . '<code class="bbc_code">$1</code>' . ($context['browser']['is_gecko'] || $context['browser']['is_opera'] ? '</pre>' : ''),
Change to
Code: [Select]
'content' => '<div class="codeheader">' . $txt['code'] . ': ($2) <a href="#" onclick="return smfSelectText(this);" class="codeoperation">' . $txt['code_select'] . '</a></div>' . ($context['browser']['is_gecko'] || $context['browser']['is_opera'] ? '<pre style="margin: 0; padding: 0;">' : '') . '<code class="bbc_code" style="overflow: scroll;">$1</code>' . ($context['browser']['is_gecko'] || $context['browser']['is_opera'] ? '</pre>' : ''),

Thanks, I'll try that!

We have limited the number of mods we install intentionally.  Probably only 5 to 10.  I can post the list if you like.

But did you notice that your own code box is not using scrollbars?  The page here is doing the same thing that happened in our gallery.

That is strange   :o
Life Is Complex - It Has Real And Imaginary Components

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 14158
    • View Profile
Re: Code Tag Does Not Use Scrollbars In Gallery
« Reply #3 on: September 06, 2017, 02:45:26 pm »
Yeah doesn't seem like it is built into SMF by default.

Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others! Also contests/promotions for verified sites.

Offline Sockratease

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Fractal Forums
Re: Code Tag Does Not Use Scrollbars In Gallery
« Reply #4 on: September 06, 2017, 02:55:16 pm »
That's a shame.

I just tried it, and no change   :'(

It is odd that the scrollbars do appear in the forum post generated by the gallery, but not in the gallery itself.  So it is in there by default someplace.  But it didn't work in your post, so ...  ????

Now I'm even more confused.

Especially since I had to increase the number of characters a post can have from 20,000 to 50,000 since a member complained that his 28,500 digit coordinates were above the character limit for a post   ::)

If I find an answer, or if the previous admin answers me when I ask again  (no reply from him about a few things) I will post here with the solution so you can know what did it.

Meanwhile, if you have any other ideas, I would love to try them!

Life Is Complex - It Has Real And Imaginary Components

 

Related Topics

  Subject / Started by Replies Last post
1 Replies
3251 Views
Last post April 02, 2008, 07:55:20 pm
by SMFHacks
0 Replies
2004 Views
Last post January 29, 2009, 06:15:54 am
by cepsi
2 Replies
3832 Views
Last post May 19, 2009, 10:01:04 pm
by william777
1 Replies
2953 Views
Last post July 26, 2009, 08:58:55 am
by SMFHacks
4 Replies
309 Views
Last post August 11, 2017, 10:12:59 am
by ted245

+- Recent Topics

Purchase Notification Email to Store Admins by scso1502
September 19, 2017, 06:00:12 pm

Can't save ad code and errors in log. by SMFHacks
September 15, 2017, 12:40:15 pm

After migrating from http to https I started getting these errors by ApplianceJunk
September 14, 2017, 10:58:38 pm

SMF Gallery and https green padlock? by ApplianceJunk
September 14, 2017, 10:02:46 pm

AudioVideoEmbedder: attached files by SMFHacks
September 14, 2017, 10:58:51 am

Contact Page Version 4.0 by Binkie
September 10, 2017, 11:26:19 am

Can Generated Threads Display The Thumbnail Instead Of The Full Size Image? by Sockratease
September 09, 2017, 06:40:12 pm

Double purchase membergroup fix by SMFHacks
September 09, 2017, 12:30:06 pm

How do I prevent "moved" topic notifications on bulk movement of topics? by shuban
September 09, 2017, 11:25:25 am

[Theme] Dark Default Theme by fussilet
September 06, 2017, 06:49:06 pm

Powered by EzPortal