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,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 211
  • Total: 212
  • @rjen

Specific Online Today Block

Started by rumboogy, November 05, 2009, 11:09:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rumboogy

Hey...when I updated my site to SMF 2.0 RC3 this mod will no longer work.

Here is my code...anyone have any idea what changed with RC3?


global $db_prefix, $scripturl;

// How many do you want to display?
$limit = 25;

// Adjustment to time -- If the time displayed is not correct, enter how many hours it needs to be adjusted by.
$time_adjust = 3;

$result = db_query("SELECT realName, ID_MEMBER, lastLogin
FROM {$db_prefix}members
ORDER BY lastLogin DESC
LIMIT $limit", __FILE__, __LINE__);

echo '<table>';
while ($row = mysql_fetch_assoc($result)){
$time = $row['lastLogin'] + ($time_adjust * 3600);
echo '
<tr>
<td><a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a></td>
<td>' . date('H:i',$time) . '</td>
</tr>';
}
echo '</table>';
mysql_free_result($result);


Thanks,

Wally

Crip

#11
needs updated wally , like the mini-calendar .. so much has change ... prolly still use online via ssi ?
..most of the old block codes/snippets will not even work on RC3 ..
I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



ZarPrime

Wally, yes, a lot of things changed.  Many (most) block codes that formerly worked with SMF 1.1.x will not work in SMF 2.0 RC3 because some (most) of the variables used in SMF 1.1.x were removed or renamed for the new version.

FWIW, finding a way to make every block code that worked great  with previous SMF versions work with SMF 2.0 will take a while.

Be patient.  One of our coders will try to look at this when they find the time.  In the meantime, can you try to find and post a link to the original block code topic for this code so that they will know what this code is supposed to do.

ZarPrime

JPDeni

There's no more db_query function in SMF. They've messed up changed a number of the functions.

I haven't tried this yet, but you might try changing


db_query


to


tp_query


At least I think that's what the problem is. It would help if we had a little more info than

Quote
this mod will no longer work.

Error messages? Blank page? Incorrect data?

Edited to add: They've also changed some of the field names. So just changing the function probably won't do it either. But it's a step in the right direction.

rumboogy

Hi JP...you're right...I should know better than that.

The tp_query did not work. But I know why...and I am embarrassed as to why. I had installed SP instead of TP because of  problem I had and have not switched back yet. My bad.

Disregard this post.

Wally

JPDeni

LOL!!! Well, that would make a difference. Glad you got it figured out.

This website is proudly hosted on Crocweb Cloud Website Hosting.