TinyPortal

Development => Support => Topic started by: darkspreader on March 24, 2010, 07:57:29 PM

Title: "User" block coding
Post by: darkspreader on March 24, 2010, 07:57:29 PM
I was wondering if someone could help me "reverse engineer" the user block available in Tinyportal. What I mean is that I want to build a custom PHP block and make it similar to the default TP User block, so I need the coding to the default block so I can add it in to my custom one. The only reason I am posting this is because I have no knowledge of the PHP language. However, I have been able to successfully reverse engineer parts of both SMF and TP's coding, and make a working custom User block.

Basically, I am interested in the coding for the TP User block. My main concern at this moment is the coding that will show "Awaiting Activation: x" on the default User block whenever there are un-activated members. I am also interested in the code for the total time logged in counter. I have been able to reverse engineer the rest of the links in the block fortunately.

Thanks.
Title: Re: "User" block coding
Post by: IchBin on March 24, 2010, 08:29:18 PM
The userbox block is in the TPSubs.template.php file. You'll find it by searching for "function TPortal_userbox()"
Title: Re: "User" block coding
Post by: darkspreader on March 24, 2010, 08:49:45 PM
Where is TPSubs.template.php located? I found TPSubs.php in the Sources folder, but it didn't contain the right info. I also looked in the default theme directory, but could not find it.

Edit: I think I found it in TPBlocks.template.php.

Edit: I got it all working. Thanks!
Title: Re: "User" block coding
Post by: Xarcell on March 25, 2010, 03:49:52 PM
FYI for future reference:

All files that have .template. in them are located in the Themes directory. Most likely the default.
Title: Re: "User" block coding
Post by: IchBin on March 25, 2010, 04:49:46 PM
Quote from: darkspreader on March 24, 2010, 08:49:45 PM
Where is TPSubs.template.php located? I found TPSubs.php in the Sources folder, but it didn't contain the right info. I also looked in the default theme directory, but could not find it.

Edit: I think I found it in TPBlocks.template.php.

Edit: I got it all working. Thanks!

Ah... well that code in beta 5 is moved to the file I mentioned. :) Just an FYI for the next version.
Title: Re: "User" block coding
Post by: ZarPrime on March 25, 2010, 07:07:24 PM
Is there a reason this topic is locked?  OP marked solved. O0

ZarPrime
Title: Re: "User" block coding
Post by: darkspreader on March 25, 2010, 08:02:15 PM
Oh sorry. I thought locking the topic was TP's form of solved, haha. I'm used to SMF's forum having a dedicated solved topic button.
Title: Re: "User" block coding
Post by: ZarPrime on March 25, 2010, 08:38:41 PM
Nah, to mark a topic solved we modify the icon on the original post to make it the green checkmark, or you can do it. ;)

ZarPrime
Title: Re: "User" block coding
Post by: darkspreader on March 25, 2010, 08:54:45 PM
I have to say, TP's support team is a lot more responsive than SMF's. I posted a problem with their phpbb3 to SMF converter, they said that they'll "take a look", but then just ended up saying "we didn't find anything." I had to figure out the problem myself, lol.
Title: Re: "User" block coding
Post by: IchBin on March 25, 2010, 09:03:15 PM
Yeah, SMF is going through a rough time right now. Hopefully they can pull out of it and get some more people on the team to help out.