TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,966
  • Latest: safir45
Stats
  • Total Posts: 195,992
  • Total Topics: 21,323
  • Online today: 309
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 263
  • Total: 263

Restrict front page "promote to front page" by height

Started by Inge Jones, January 28, 2013, 12:31:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Inge Jones

I have a number of contributors to the front page who are leapfrogging over each other in front page space by posting increasingly large pictures and fonts, and I hate having to keep nag people about guidelines.

Can I assume there is no simple way to limit each promotion to a certain height rather than number of characters?   I am happy to edit some php if needs be.

IchBin

Hard to understand exactly what you are asking. When you say "promotion" what are you talking about? The topic displaying on the frontpage after someone clicks promote to frontpage?

So they are posting images that are too big? You could maybe put some javascript or css in there to resize images or something. But no PHP could be done to minimized this.

Inge Jones

Yes, I offer Sims game content on my site by various contributors.  They create a topic and decorate it with screenshots and upload their file.  Then I click Promote to Front Page  as a way of advertising the new content to users.  I have up to about 5 topics promoted at any one time and would like the user to see them all before their scroll finger drops off :D   I limit to about 300 characters, but when you're usign a size 24 font and a 800 high screenshot, that's more than a normal window already.

The other way I considered was to stop using promote to FP and instead create blocks of fixed size to take individual topics, but that would take a lot more housekeeping.

ZarPrime

SMF can limit the size of posted images.  Are the screenshots attachments or are they just posting them from somewhere else using the img bbc tags?

If they are attachments, go to YourSite/index.php?action=admin;area=manageattachments;sa=attachments and look for ...

Display image attachments as pictures under post
Resize images when showing under posts
Save thumbnails as PNG
Maximum width of thumbnails
Maximum height of thumbnails

If it's the latter, SMF can limit the size of posted images.  YourSite/index.php?action=admin;area=featuresettings;sa=layout look for ...

Max width of posted pictures (0 = disable)
Max height of posted pictures (0 = disable)

As far as the font size, there is not much you could do on that though you can turn off the editor so that people wouldn't see the font size buttons.  Rather than doing that though, I'd modify these topics for a month or so and remove the bbc for the size on the ones that are posting huge fonts.  Maybe after a month or so, the members doing this will get the message.  If they are still doing it after a month or so, threaten not to promote their topics to the FrontPage.

ZarPrime

Inge Jones

I wouldn't want to restrict how people present their work on a general basis, it really is only an issue for the front page, and their post only tends to be there two weeks at the most.   So far, yeah, I've been dealing with it by hassling them to get whatever appears in the first 300 characters to reasonable size before I promote.  But it seems like each day I'm having to remind someone...

Having ascertained there is no known simple way of changing the way it displays on front page, I'll have a look for more complex scripted ways sometime.  Maybe I can make a custom module.  It may be a project for a rainy weekend :)

IchBin

Quote from: Inge Jones on January 29, 2013, 09:22:52 AM
Having ascertained there is no known simple way of changing the way it displays on front page, I'll have a look for more complex scripted ways sometime.  Maybe I can make a custom module.  It may be a project for a rainy weekend :)

Did you not read what I said?

Quote from: IchBin™ on January 28, 2013, 07:43:28 PM
You could maybe put some javascript or css in there to resize images or something.

You could simply put something in CSS to limit the width of the images displayed in the articles.

And if you only wanted this to happen on the frontpage you could put this in your index.template.php file and do a check in PHP to see if you're on the frontpage:


if (!empty($context['TPortal']['is_frontpage'])) {
    echo '
    <style type="text/css">
        .article_inner img {
            max-width: 200px;
        }
    </style>';
}

Inge Jones

I did read what you said but understood you to be talking about limiting the size of images in posts in general, not just for front page articles.   Thanks for clarifying.

I'll give it a go, but I am not sure it will be a total solution - then there is the large font, the multiple images one below another etc etc.   The thing is, with being able to enforce a fixed height, the contributors will become self-regulating as no one will want to see their beautifully captured screenshot or dramatic 48px announcement cut in half :)

lurkalot

Quote from: Inge Jones on January 30, 2013, 08:11:11 AM
I did read what you said but understood you to be talking about limiting the size of images in posts in general, not just for front page articles.   Thanks for clarifying.

Quote from: IchBin™ on January 29, 2013, 04:54:45 PM

And if you only wanted this to happen on the frontpage you could put this in your index.template.php file and do a check in PHP to see if you're on the frontpage:


if (!empty($context['TPortal']['is_frontpage'])) {
    echo '
    <style type="text/css">
        .article_inner img {
            max-width: 200px;
        }
    </style>';
}


Inge Jones

#8
Yes, like I said, I understood better once he'd posted that followup and I intend to try that.

Later: Ok I understand the principle but I don't want to be doing it in that particular file as each theme has its own - it's a maintenance nightmare.  I'll see if I can adapt the idea.

Later again:
Image size is now addressed by putting this in tp-style.css which only resides in default theme:
div.article_inner img
{
max-height:400px;
max-width:600px;
}


May need to further refine so it doesn't affect other articles, but as we don't make extensive use of user articles on the site it's not urgent.

Final conclusion:  Setting max-height for .tp_container would do it, as this class doesn't appear to be used elsewhere on my site as I have it arranged, but the forum posts have a tendency to wreck the div ending meaning you can get several front page promotions sharing the same .tp_container class div

This website is proudly hosted on Crocweb Cloud Website Hosting.