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,020
  • Total Topics: 21,332
  • Online today: 926
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 219
  • Total: 220
  • @rjen

getting rid of all the buttons at top - challenge is mainly "logout" sesc info

Started by iowamf, November 13, 2005, 12:48:42 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

iowamf

I'd like to get rid of all the buttons at the top and replace the functionality with:

* links on the left in the CONTENT box and
* additional items in the "USER" box.

The "home", "forum", "help", "search", "calendar" buttons can easily be added to the CONTENT box of nav links.

The "profile" & "logout" links are more appropriate in the "user" box ... not in the general nav links.

The admin and tpadmin buttons are not 100% needed as those menus can be accessed via URL's.

The "login and register" options are also easily duplicated in blocks using TP's permissions - show the login & register option to guests only.

I can't figure out how to replicate the "logout" function as that adds a:

  * ";sesc=<nasty hex string>" to the end of action=logout. 

In summary:

* Is there a way to add links to "profile" and "logout" (with the nasty .sesc info) to the "User" box?
* What is the best way to whack the display of all the buttons along the top (of the default theme)?]
     I'd like to whack everything outside of the grey border (yes, I know I'd have to add the copyright back-in).

Thanks & Regards -

IchBin

I think to remove the top menu all you need to do is remove this:
template_menu();

bloc

For anytime you need a session check, like logout (profile links will work fine, if not allowed it will simply error out) , use like this:

;sesc='.$context['session_id'].'

The '. and .' is of course escaping to php. The session numbers is generated by server, and are unique each time, therefore you just use the reference variable to show them.

iowamf

Thank you both for those pearls of wisdom - I got it working ... not sure if I want to keep it ... but it's working.

Removing the "template_menu()" call from index.template.php does remove the buttons - removing some extra code above it (denoted by tiny portal start/stop) removes the two upshrink triangles as well.



iowamf

Yes indeed - thanks again.

I added logout functionality to the User Box in TPortalBlocks.template.php with this:

// hack: add the logout
               $mf_logout = "index.php?action=logout;sesc=";
               $mf_session_id = $context['session_id'];
               $mf_logout_string = $scripturl."/".$mf_logout.$mf_session_id;
               echo "<br />$bullet";
               echo "<a href=$mf_logout_string>logout</a>";
// hack: end


added right above:
               // Only tell them about their messages if they can read their messages!
                if ($context['allow_pm']){



bloc

You could make it shorter... ;)

echo '<br />'.$bullet.'<a href="index.php?action=logout;sesc='.$context['session_id'].'">logout</a>';

iowamf

I had to debug it one var at a time - still learning  :idiot2:

Is there a technical reason to do so?

bloc

Well, each time you declare a intermediate variable - to hold the info - its using memory. But both ways are good, and as you say, when you understand it, you will evenutally seek shortcuts. Like jumping in and out of a html codebit ina variable. ( the '.$bullet.' bit for example)

I too use rather much code - compared to experts. They can do with 3-4 lines where I use 10-15... ::)

This website is proudly hosted on Crocweb Cloud Website Hosting.