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,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,911
  • Total Topics: 21,307
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 401
  • Total: 401

Center block titles?

Started by lurkalot, April 22, 2010, 07:50:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lurkalot

In TP 0.9.8 you can center the block titles by using tags as below,

<center>My example block</center>

This doesn't work in TP 1.0b5.1  Is this by design, or a bug?  And is there a work around for this?

IchBin

You could always add some CSS to center your block titles. text-align: center; is what you'd use.

lurkalot

Thanks IchBin

Me being thick again, where would I add the css?

ZarPrime

How you do this depends on what version of SMF you are using.  In SMF 2.0 RC3, TP 1.0 beta 5-1 gives you a choice of 10 different styles for each block although they all use either the titlebg or the catbg and it's theme specific.  Some custom themes don't have all 10 of the styles available.  In RC3, the file to look at would be /Themes/default/css/index.css though it would be different for a custom theme.  In SMF 1.1.11, your only choice would be the titlebg (I think) and the file to edit would be the style.css in the theme.  The reason I'm not sure is because I've never used beta 5-1 yet on an SMF 1.1.11 Forum.

If you have FireFox, an add-on called Firebug would help you a lot to figure out what to change.

ZarPrime

lurkalot

Thanks ZarPrime.

This seems like a backward step to me.  This was so easy to do in 0.9.8  by entering the title wrapped in center tags directly in the blocks admin panel. 


IchBin

It's all part of cleaning the input. Bloc has taken extra steps (so has SMF) in cleaning all the data that goes into the database. It's just a side affect of making TP more secure IMO. It's not backwards as it has also moved all the design and layout to the templates/css. The same step that SMF has taken to make it easier to theme things. You can also change all the properties of the fonts at the same time. All in a single place, instead of having to do it for every block.

Simple add text-align:center; to the tp-style.css file where the .tp_half h3.catbg class is.

ZarPrime

#6
It may seem like a backward step but, as Ichbin says, streamlining the code and making it more efficient and secure were the priorities.

Another example that I was a little upset about at first was that the colors for Calendar Birthdays, Events, and Holidays was removed from the SMF Calendar settings and placed into the css file.  At first, I didn't like this, but after I figured out that it would be easier for theme authors to be able to change these settings when designing their theme, to fit the theme, it made sense to me.

I can almost guarantee that Bloc would never consider changing TP to allow html in the titles of blocks (that's a security risk), but if you made a feature request for a future version of TP to allow bbc code to be possible for block titles, this might just be something that he would consider. ;)

ZarPrime

Blue Steel

its also a security thing. If anyon e was abler to inject or change html code in the DB fields for say a forum area header or a block header then they could divert that page or block to where ever they want.

Unfurtunatly in todays works if you can do something for good reasons. others can abuse it.

I too miss this and other things similar and yes its a pain having to find other ways to achieve what we used to take for granted. but thats life :(

lurkalot

Quote from: BlueSteel on April 23, 2010, 04:07:02 AM
its also a security thing. If anyon e was abler to inject or change html code in the DB fields for say a forum area header or a block header then they could divert that page or block to where ever they want.

Unfurtunatly in todays works if you can do something for good reasons. others can abuse it.

I too miss this and other things similar and yes its a pain having to find other ways to achieve what we used to take for granted. but thats life :(


BlueSteel, thanks.  I did wonder if it was for security to be honest, hence my asking if it was by design.   I don't mind living with it for sake of security to be honest. ;)

lurkalot

ZarPrime, glad to see you've requested this as a feature in bugtracker. ;)

http://www.tinyportal.net/index.php?action=bugtracker;sa=bug576

This website is proudly hosted on Crocweb Cloud Website Hosting.