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,004
  • Total Topics: 21,330
  • Online today: 115
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 101
  • Total: 101

smalltext for the following code snipet

Started by coldthunder, April 10, 2008, 12:51:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

coldthunder

I got the following code off of this area here and i like it, but the text shows up bigger than the others in my other blocks. How can i add the "smalltext" code into it so it displays it in small text?  thanksglobal $db_prefix, $scripturl;

$starttime = time() - (24 * 60 * 60);

$query = db_query(
    "SELECT realName, lastLogin
     FROM {$db_prefix}members
     WHERE lastLogin > $starttime
     ORDER BY lastLogin DESC", __FILE__, __LINE__);

echo "<table>";
while ($row = mysql_fetch_assoc($query))
{
  echo "<tr><td>";
  echo $row['realName'];
  echo "</td><td>";
  echo timeformat($row['lastLogin']);
  echo "</td></tr>";
}
echo "</table>";

Jpg

Change-
<table>

To-
<table class="smalltext">

Or you can change it to-

<table style="font-size: 10px;">

coldthunder

tried both of those and got the same error

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/thundazo/public_html/smf/Sources/Load.php(1735) : eval()'d code(35) : eval()'d code on line 11

i tried also change the </table> at end to match </table class> and </table sytle> and that didnt work either

ed_m2

it thinks the " around smalltext is the end of your echo command.

use something like:

echo '<table class="smalltext">';

or maybe the other way around... i forget  ::)

coldthunder

that didnt work either, didnt error just kept the same size

Jpg

I'm guessing you don't know php.
Well here's the code for you.

global $db_prefix, $scripturl;

$starttime = time() - (24 * 60 * 60);

$query = db_query(
    "SELECT realName, lastLogin
     FROM {$db_prefix}members
     WHERE lastLogin > $starttime
     ORDER BY lastLogin DESC", __FILE__, __LINE__);

echo '<table class="smalltext">';
while ($row = mysql_fetch_assoc($query))
{
  echo '<tr><td>';
  echo $row['realName'];
  echo '</td><td>';
  echo timeformat($row['lastLogin']);
  echo '</td></tr>';
}
echo '</table>';


You were using -> " instead of -> '


Jpg


This website is proudly hosted on Crocweb Cloud Website Hosting.