Invite (registration through invitation)

Started by Sarke, March 03, 2007, 02:47:51 PM

Previous topic - Next topic

Lord Anubis

Thanks for the block code works like a charm!

Sarke

1.10 is out, with stats.


I also included the top inviter code in a function, so it's now easier to implement as block code and change.  Here's the new block code:


global $sourcedir;
require_once($sourcedir . '/Invite.php');
$top_inviters = top_inviters(5);

echo '
<table cellspacing="0" cellpadding="0" border="0" style="width: 100%;">';

foreach ($top_inviters as $id => $inviter)
echo '
<tr>
<td>', $inviter['name'], '</td>
<td align="right">', $inviter['invitees'], '</a></td>
</tr>';

echo '
</table>';

My MODs          Please don't PM me for support, post in the appropriate topic.

texasflats

Man I had JUST installed 1.9 five minutes before you posted 1.10, I was on my way to say thanks for a great mod and found 1.10

So, THANKS! I love it.

I'm assuming that's a php block for TP? Please excuse my ignorance.

Sarke

Quote from: texasflats on March 10, 2007, 08:47:37 PM
So, THANKS! I love it.

You're welcome! :D


Quote from: texasflats on March 10, 2007, 08:47:37 PM
I'm assuming that's a php block for TP? Please excuse my ignorance.

Correct, but it can also be used in other situations (like SSI pages, etc).

My MODs          Please don't PM me for support, post in the appropriate topic.

choloman05

Yeah, you're really on a role w/this thing. Nice job.  

RoarinRow

Sorry Sarke I've got this error with version 1.10 on the default theme:

2: arsort() expects parameter 1 to be array, null given
File: /forum/Sources/Invite.php
Line: 476

SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

Sarke

Quote from: RoarinRow on March 10, 2007, 10:08:00 PM
Sorry Sarke I've got this error with version 1.10 on the default theme:

2: arsort() expects parameter 1 to be array, null given
File: /forum/Sources/Invite.php
Line: 476

Ah crap, I pulled the old "forgot to initialise the array in case it's empty" routine... I'll have a fix up in a bit.

P.S. 300 is awesome.

My MODs          Please don't PM me for support, post in the appropriate topic.

Sarke

Ok, 1.11 is up, with the only change being the fix (hopefully :P) for what RoarinRow posted.  I included an upgrade, so you don't need to uninstall 1.10 but you can just install right on top of it.

My MODs          Please don't PM me for support, post in the appropriate topic.

RoarinRow

Quote from: Sarke on March 11, 2007, 12:44:42 AM
Ok, 1.11 is up, with the only change being the fix (hopefully :P) for what RoarinRow posted.  I included an upgrade, so you don't need to uninstall 1.10 but you can just install right on top of it.

ok sweet, i'll test it out.  FYI - we'll be watching '300' tomorrow on IMAX.   8)

SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

RoarinRow

ok it fixed that error, thanks.  but even in 1.10 i could not see the who invited the member in the user's profile template or in the member's list.  i checked the codes and it's there in profile.tempate.php and memberlist.php, but it's not there when i got to those pages.  any idea?

SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

Sarke

Judging by the error you got (empty array), you don't have any invited members yet.  This will only show up in the profile if there is any info to show.

My MODs          Please don't PM me for support, post in the appropriate topic.

Lord Anubis

One thing I noticed with the block code is that if you register someone and delete them it still shows that up that they invited someone...Where is the database for this at so I can manually delete these entries.  Also, the profile and the member list aren't showing any links for invitees, even when the person's account has invitees...Any idea why this might be?  In 1.08 it worked ???

Sarke

Quote from: Lord Anubis on March 11, 2007, 01:47:19 AM
One thing I noticed with the block code is that if you register someone and delete them it still shows that up that they invited someone...Where is the database for this at so I can manually delete these entries. 

Yes, it does count deleted members (but doesn't try to display them).  Some will want this (e.g. they should still get credit for the invite, even though the member was eventually deleted), and some will not.  It was done this way because of the work (both programming and server processing) required to filter out the deleted members.  In a future version I'll probably include an option for it.

To delete these, find and delete the rows in the smf_invite table where the ID_REGISTRATION are that of the deleted members.

I also noticed that I forgot to sort the block code.  This will be fixed in the next version.


Quote from: Lord Anubis on March 11, 2007, 01:47:19 AM
Also, the profile and the member list aren't showing any links for invitees, even when the person's account has invitees...Any idea why this might be?  In 1.08 it worked ???

Not sure why this is.  Does your theme have a custom Profile.template.php?  If not, can you send me your Profile.template.php?

You can still reach the member list of invitees by clicking on the number in the block code.

My MODs          Please don't PM me for support, post in the appropriate topic.

Lord Anubis

No the theme doesn't have a custom Profile.template.php it uses the default...

Attached is the profile.template.php

Sarke

Haha, sorry but I have to laugh (not at you, just the cause and solution being so simple).  I've been trying to figure out what could possibly be wrong but this sure explains it:  you've commented out the part of the code. 

I looks like you made a copy of parts of the code and made changes to it (the karma part) while leaving the original commented out.  So the changes the mod made were applied but they were inside the commented area and weren't being run.

Here, try using this:

My MODs          Please don't PM me for support, post in the appropriate topic.

Lord Anubis

#135
Works now thanks  ;)

3mrhythm

installed 1.09 lol and installed 1.11 amazing!  no issues love the new stats! lol works great no errors on the install or anything.. flawless!
www.nhfragswap.com
www.yariscentral.com

Sarke

Good to hear!

I figured the admins keeping score for the top members could use the invitees' posts stat.  The only reason I came up with that though was because it would look wierd having an empty box in the stats page.  :P

My MODs          Please don't PM me for support, post in the appropriate topic.

RoarinRow

Cool Sarke!  I copied the code from your attached profile.template.php and put it into my modified file and now everything shows as it should.

Thanks for all your hard work!   8)

SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

MinasC

Quote from: Sarke on March 11, 2007, 12:44:42 AM
Ok, 1.11 is up, with the only change being the fix (hopefully :P) for what RoarinRow posted.  I included an upgrade, so you don't need to uninstall 1.10 but you can just install right on top of it.

i have 1.05 installed ! do i have to uninstall it or the upgrade works with 1.05 too ? can i install right on top of it ?

Advertisement: