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,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 366
  • Total: 366

Replace blocks TPcollapse/TPexpand buttons

Started by whoesa, April 12, 2008, 01:03:27 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

whoesa

Omg how could i miss that one.  ???  Is it possible to be drunk without drinking alcohol?

Anyway, thx for pointing it out.

Jpg

Lol, I don't think you can...hahaha...
And No problem Bikken. I'm here to help.

Gidget

Many thanks Bikken and Jpg for raising, and solving, the same problem that I had  ;D

Gidget

Jpg

Your welcome Gidget.

Bloc is going to have to fix that error in the future.

bloc

Yes, I do lol. So..after a quick read, what was the error actually? a typo?

whoesa

Well, to make them work properly in custom themes, it was needed to add this line in index.template file:

$settings['tp_images_url'] = $settings['images_url'] . '/tinyportal';

and change the image url in the script in TPBlocks.template file from:

document.getElementById( blockimage ).src = smf_images_url + (state ? "/collapse.gif" : "/expand.gif");

to:

document.getElementById( blockimage ).src = smf_images_url + (state ? "/tinyportal/TPcollapse.gif" : "/tinyportal/TPexpand.gif");

After these changes, everything works fine.   :D

Jpg

That would point to your theme directory Bikken not the default theme directory.
I'll look into this for a fix.

whoesa

Yea and that was the whole point of me starting this topic. I tried to find out how i could point a custom theme to it's own "tinyportal" folder and TPcollapse/TPexpand button instead of defaults one.

I did this fix in 4 custom themes and all are working error less. 

Jpg

#18
Okay I decided to take 5 minutes to fix this.

Here's the code needed to fix the bug forever-

In TPblocks.template.php:

Find-
document.getElementById( blockimage ).src = smf_images_url + (state ? "/collapse.gif" : "/expand.gif");

Replace with-

                  document.getElementById( blockimage ).src = "' .$settings['tp_images_url']. '" + (state ? "/TPcollapse.gif" : "/TPexpand.gif");


----

I guess all you have to do is add this code to your themes now Bikken for customization-
$settings['tp_images_url'] = $settings['images_url'] . '/tinyportal';

rand12om

Where exactly should I put the $settings['tp_images_url'] = $settings['images_url'] . '/tinyportal'; ?

Placing it in the index.template does fix the collapse button problem, but completely messes up the buttons in Articles adminpage and same for blocks. I mean, it displays text instead of buttons. What am I doing wrong?

This website is proudly hosted on Crocweb Cloud Website Hosting.