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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,022
  • Total Topics: 21,332
  • Online today: 473
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 255
  • Total: 255

Dynamic Block Title

Started by Ruscon, October 02, 2008, 01:46:39 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ruscon

So I tried to search but couldn't find anything. Basically I have this userbox aka loginbox. The title is set to "User" in TP panel and I'd like to know if it's possible to somehow make it dynamic? So that if someone is logged out it says "Login" and if someone logs thier account it should change to "User". That'd be really cool  :buck2:

IchBin

Not possible with the way TP is built, unless you want to go on a major code vacation.

Ruscon

Quote from: IchBinâ,,¢ on October 02, 2008, 04:24:52 AM
Not possible with the way TP is built, unless you want to go on a major code vacation.

Well is it really major code vacation? After 1 day of looking at the SMF code I figured out how to make the title dynamic for that, is it really that hard to do it for TP?

<div>';
if ($context['user']['is_logged'])
{
echo '', $txt['hello_member'], ' ', $context['user']['name'],'!';
}

// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
else
{
echo 'Login';
}
echo '
</div>

IchBin

The blocks are output dynamically. How would you check to see that its the user block so you could change the title?



Ianedres

It isn't that is impossible, but it is a rather formidable task that involves altering several locations of the portal source code.

Thinking outside of the box, you may could turn off the use of the frame, then make your own title bar with div statements with the class specified based on a guest or member.

It all seems simple, until you start coding it, as it is not just a simple <title> tag modification.

I'm sure you can attempt something like that, in a day or two, after you keep getting better with the code.

I would like to see what you come up with, if you use the above suggestion.

ed_m2

can you have two blocks in the same location..... one set to viewable by loged in users only.. and the other guests only ?

clint

I know that you can with v1.0.5. It would save a lot of time lol.

IchBin

Of course you can. You just create both blocks in your panel. Select the permissions for each as you have suggested, and then it will only show for those member groups.

ed_m2

ah permissions.. thats what i meant :-)

This website is proudly hosted on Crocweb Cloud Website Hosting.