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,973
  • Latest: NonStop
Stats
  • Total Posts: 196,230
  • Total Topics: 21,353
  • Online today: 867
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 366
  • Total: 367
  • @rjen

Show More Shouts Link Near Shout Button

Started by stigmartyr, March 22, 2009, 04:21:15 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

stigmartyr

Hi folks,
Stumbled upon a dillema today while trying to modify my own TP 0.9.8 installed shoutbox.  I wanted it to look more like the newer TP versions where the 'Show 50 Latest' is rendered near the [Shout!] button.

Seems simple enough huh?  I searched around the site and while I didn't find any resolution, I did find some cool new snippets, so hooray for that.

In any case, you're probably asking: why dont he just upgrade to the newer TP?  Well in my package manager, TP 0.9.8 only has the [ List Files ] and [ Delete Files ] option.  :(

Rather than risking a site down, I'd rather just find out how to hack the shoutbox to display the way the newer ones do.  ATM on my site it renders the shouts, then a link to more shouts, the text box and the shout button.  I'd like it to look like this instead:

[Shout!] Show 50 Latest

I've tried editing TPmodules.php, TPortal.php, TPModules.template.php but I FAIL   :-\

Please help?


p.s. See my last post below where I solved my own issue.  Works great!

G6Cad

If you download the TP V098 package now from the downloads, and upload it to your package folder on the server, you will have the uninstall link in your list aswell. So try that and you will soon have a shoutbox like you want.
To get these options in TP V098 would requre a lot of changes in the code as TP V098 and TP V1 have changed a lot of things around.

stigmartyr

Thanks for responding G6.  Looks like I am able to run the uninstall after uploading the package to the server.

Only problem now is errors on 3 files to uninstall, so I'll have to do that manually..  Something to save for another day. :(

I guess I'll try to get a UAT server up..

stigmartyr

Hey G6 - I just decided to remove the 'Show Last x Posts' line by zeroing out that value in the shout admin.  Now its gone from the shout box display.

I've tried a number of ways to  hardcode a URL right next to the [ Shout ] button and it wont render.  Can you perhaps point me in the right direction?

I'm just going to make an <a href=""> that points to ?action=tpmod;sa=shoutbox;shouts=100

If I only knew were it goes so it shows up right besisde the shout button...

stigmartyr

Ok ok ok - I figured it out just shy of 3 am in the morning.

Go to: Themes/default/TPortalBlocks.template.php

Find:

echo '<input name="tp-shout-url" type="hidden" value="'.htmlspecialchars($tp_where).'"><input type="hidden" name="sc" value="', $context['session_id'], '" />
       </form>';


Replace:
echo '<a href="' , $scripturl , '?action=tpmod;sa=shoutbox;shouts=100">Show Last 100</a>
   <input name="tp-shout-url" type="hidden" value="'.htmlspecialchars($tp_where).'"><input type="hidden" name="sc" value="', $context['session_id'], '" />
       </form>';



Make sure you go to Shout Admin and set "show last" to zero so you dont get duplicate links.  Looks awesome now.

This website is proudly hosted on Crocweb Cloud Website Hosting.