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>";
Change-
<table>
To-
<table class="smalltext">
Or you can change it to-
<table style="font-size: 10px;">
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
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 ::)
that didnt work either, didnt error just kept the same size
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 -> '
Thank you
Your welcome. :D