TinyPortal

Development => Block Codes => Topic started by: rumboogy on November 05, 2009, 11:09:47 PM

Title: Specific Online Today Block
Post by: rumboogy on November 05, 2009, 11:09:47 PM
OK...my site crashed and I had to re-upload my SMF files...which means I lost my mods.

I am looking (and I did search), for the same ONLINE TODAY mod I had. Actually, what it did in a block is list (vertically) the members online in order from the most recent online backwards...and you could configure it to show the last 10 people online or 15 people, whatever number you wanted to see.

As best I can remember...this is SIMILAR to what it looked like:

Arkiebiker
14:24

Zumomaster
14.20

Razorbiker
12:05

Willie Nelson
10:12

Englebert Humperdink
9:23

The member names were actually links to their profiles.

Does anyone remember seeing it on here?

I do have my OLD files, but where would (what file) I find block code snippets?

Thanks for any help.

Wally
Title: Re: Specific Online Today Block
Post by: Crip on November 05, 2009, 11:27:13 PM
Anything to do with [Actuality Theme] Wally?
Title: Re: Specific Online Today Block
Post by: rumboogy on November 05, 2009, 11:43:04 PM
Hey Crip...no it wasn't a theme issue. I think it was a server thing. I had 2 of my websites go bad at the same time...The Web Hoster said someone else had problems too.

I am still using that WONDERFUL Actualism theme...very nice. I still like it alot.

I got the site back...but really liked that RECENT MEMBERS ONLINE block.

Thanks.

Wally
Title: Re: Specific Online Today Block
Post by: Crip on November 05, 2009, 11:44:57 PM
OK .. just checking bro. ;)
Title: Re: Specific Online Today Block
Post by: rumboogy on November 05, 2009, 11:53:00 PM
Thank you sir. The theme has been perfect!! Thanks...although I may need you when I upgrade to 2.0 (in the future...not now). LOL


Wally
Title: Re: Specific Online Today Block
Post by: Crip on November 05, 2009, 11:58:15 PM
You know where i am bro. :) .. 2.0 RC2 is kinda fun thus Far,...
Title: Re: Specific Online Today Block
Post by: JPDeni on November 06, 2009, 12:40:37 AM
QuoteI do have my OLD files, but where would (what file) I find block code snippets?

They would be in the database, in the table named smf_tp_blocks. (Although the smf part could be something else.)
Title: Re: Specific Online Today Block
Post by: rumboogy on November 06, 2009, 01:04:25 AM
Thank you JP....you were absolutely CORRECT. I found it and it's working great. Thanks again.  ;D ;D ;D ;D

Wally
Title: Re: Specific Online Today Block
Post by: IchBin on November 06, 2009, 03:39:49 AM
Why'd you lose your mods? Didn't you have a backup of your site and database? If you did, all you have to do is restore everything.
Title: Re: Specific Online Today Block
Post by: rumboogy on November 06, 2009, 09:53:43 AM
 :o ;D :tickedoff:

Yes and no. My webhoster had a backup...but I jacked around trying to fix it without using the backup...dumb...I know. But that's how we learn...right?   :D

Wally
Title: Re: Specific Online Today Block
Post by: rumboogy on April 01, 2010, 10:58:08 PM
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
Title: Re: Specific Online Today Block
Post by: Crip on April 01, 2010, 11:02:46 PM
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 ..
Title: Re: Specific Online Today Block
Post by: ZarPrime on April 01, 2010, 11:12:58 PM
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
Title: Re: Specific Online Today Block
Post by: JPDeni on April 01, 2010, 11:14:19 PM
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.
Title: Re: Specific Online Today Block
Post by: rumboogy on April 01, 2010, 11:22:49 PM
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
Title: Re: Specific Online Today Block
Post by: JPDeni on April 01, 2010, 11:47:33 PM
LOL!!! Well, that would make a difference. Glad you got it figured out.