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: 195,994
  • Total Topics: 21,325
  • Online today: 304
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 253
  • Total: 253

Latest shout block

Started by Lesmond, October 15, 2005, 10:18:11 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

resurgence

may i ask for an update/walkthrough on how to use this?

i would like to display the last shout in a center block in this format:

"[italic last shout goes here]" ~[bold username]

with quotes and all. any help?

Crip

i guess you could do that resurgence, but myself wouldn't know how to go about it..
I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



resurgence

i couldn't even get the orgiinal block to work :( so yeah. i have no idea.

bloc

Quote from: resurgence on May 07, 2006, 11:31:38 PM
may i ask for an update/walkthrough on how to use this?

i would like to display the last shout in a center block in this format:

"[italic last shout goes here]" ~[bold username]

with quotes and all. any help?

global $settings;

$tp_prefix = $settings['tp_prefix'];
   
   $request = db_query("SELECT * FROM {$tp_prefix}variables WHERE type='shoutbox'  ORDER BY value2 DESC LIMIT 1", __FILE__, __LINE__);
if (mysql_num_rows($request) > 0)
{
  $shouts='';
  while($row = mysql_fetch_assoc($request)){
  $shouts .= '"[<i>'.doUBBC($row['value1'],true).'</i>]"';
  $shouts .='~[<b>'.$row['value3'].'</b>]';
  }
  echo $shouts;
  mysql_free_result($request);
}


Something like that maybe?

Also notice the changed code in original block. The tp_doUBBC is replaced by just doUBBC.

resurgence

#24
does it go in a phpblock? or a java/html block?

nvm i got it. :) and thanks!! it works great!

i'll edit it just a bit since i wanted it to display as:

"last shout"
                               ~member




perfect! here's my code now.

global $settings;

$tp_prefix = $settings['tp_prefix'];
   
   $request = db_query("SELECT * FROM {$tp_prefix}variables WHERE type='shoutbox'  ORDER BY value2 DESC LIMIT 1", __FILE__, __LINE__);
if (mysql_num_rows($request) > 0)
{
  $shouts='';
  while($row = mysql_fetch_assoc($request)){
  $shouts .= '<i><span style="font-size: 11pt;">"'.doUBBC($row['value1'],true).'"</span></i>';
  $shouts .='<br /><span style="position:relative; left: 200px;">~<b>'.$row['value3'].'</b></span>';
  }
  echo $shouts;
  mysql_free_result($request);
}

resurgence

and 1 more thing. is there a way for the shoutbox to not recognize useless line breaks?

for example. one can typ in a single word and press enter 11 times. (creating 11 line breaks) and all of that would be posted/parsed onto the shout box. if it was the latest shout, it would enlarge the box by 11 line breaks.

quite abusive.

Phoenixoverlord

Bloc, I saw that here you have added a link underneath the shoutbox that shows the last 50 shouts in the main block. For that you use http://www.tinyportal.net/smf/index.php?action=tpmod;sa=shoutbox;shouts=50

But if I try that at my site (obviously replacing with my link :P) it only returns the last 20 (which is set in the admin panel). However, I see that your number is set to 10 in the shoutbox, so how does that work?

And also where would you add this code? In TPmodules.template.php?

G6Cad

Thats a future of the next TP release :)

Phoenixoverlord


bloc

Quote from: resurgence on May 08, 2006, 11:22:57 AM
and 1 more thing. is there a way for the shoutbox to not recognize useless line breaks?

for example. one can typ in a single word and press enter 11 times. (creating 11 line breaks) and all of that would be posted/parsed onto the shout box. if it was the latest shout, it would enlarge the box by 11 line breaks.

quite abusive.

Well..you could filter it by searching for a break ..but then all breaks would be gone :P And searching for 2 breaks will only work on exactly 2 breaks.

This website is proudly hosted on Crocweb Cloud Website Hosting.