Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 12031
Latest: zainz
New This Month: 11
New This Week: 2
New Today: 1
Stats
Total Posts: 38315
Total Topics: 6751
Most Online Today: 72
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 54
Total: 54

Author Topic: Code Tag Does Not Use Scrollbars In Gallery  (Read 251 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: 14209
    • 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: 14209
    • 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
3271 Views
Last post April 02, 2008, 07:55:20 pm
by SMFHacks
0 Replies
2034 Views
Last post January 29, 2009, 06:15:54 am
by cepsi
2 Replies
3851 Views
Last post May 19, 2009, 10:01:04 pm
by william777
1 Replies
3024 Views
Last post July 26, 2009, 08:58:55 am
by SMFHacks
4 Replies
422 Views
Last post August 11, 2017, 10:12:59 am
by ted245

+- Recent Topics

Copyright Removal by Dalek
Today at 10:39:21 am

Bulk Uploads (Pro Edition) by SMFHacks
November 23, 2017, 08:20:02 pm

"Next make the gallery directory writable" by SMFHacks
November 23, 2017, 08:17:43 pm

How Can I Get Help? by SMFHacks
November 22, 2017, 04:53:10 pm

2.0.15 Update by SMFHacks
November 22, 2017, 08:12:38 am

Version 7.2.2 - Undefined Index Error Messages by eliot
November 21, 2017, 04:13:18 pm

SMFHacks Black Firday Sale 2018! by SMFHacks
November 20, 2017, 01:38:23 pm

Good Day SMFHacks by RedSkincaRe
November 16, 2017, 06:17:39 pm

Add in product description to Purchase Notification for Store Admins email by SMFHacks
November 15, 2017, 05:29:15 pm

Changing text in personal message sent when product is shipped. by KKOG
November 14, 2017, 10:57:08 pm

Powered by EzPortal