1

Topic: Invitation 1.1.1

I just released the new version.
I tested it to work on 1.2.7 and it contains some new features, like

- default amount of invitations given to each new user, adjustable by user group
- custom invitation text to be set by the admin. This will be appended to the user definable invitation text.

Download through punres.org

or here for the Win** folks
Mod_Invitation_1_1_1.zip

or here for the **nix folks
Mod_Invitation_1_1_1.tgz

I'll add some instruction here how to mod the 1.1 version so you won't have to install it all over again wink

The German PunBB Site:
PunBB-forum.de

2

Re: Invitation 1.1.1

Short instructions on how to mod the Mod version 1.1

1. with mphp MyAdmin or on the commandline, go to your pun DB and enter

INSERT INTO PREFIXconfig values('o_invitation_message','---------------')

Make sure to replace PREFIX with your prefix...

2. Open include/mod_invitation.php and go to line 29.
Replace there

     $mtext = $form['invitation_text'] . "\n".$lang_invitation['Forum Link'].$act_link;

with

     $mtext = $form['invitation_text'] . "\n".$lang_invitation['Forum Link'] . "\n" . $act_link . "\n" . $pun_config['o_invitation_message'];

3. Open admin_options.php and go to line 642.
After

                  <th scope="row">Rules</th>
                  <td>
                    <textarea name="form[rules_message]" rows="10" cols="55"><?php echo pun_htmlspecialchars($pun_config['o_rules_message']) ?></textarea>
                    <span>Here you can enter any rules or other information that the user must review and accept when registering. If you enabled rules above you have to enter something here, otherwise it will be disabled. This text will not be parsed like regular posts and thus may contain HTML.</span>
                  </td>
                </tr>

, add

<!-- MOD INVITATION  -->
                <tr>
                  <th scope="row">Invitation Message</th>
                  <td>
                    <textarea name="form[invitation_message]" rows="10" cols="55"><?php echo pun_htmlspecialchars($pun_config['o_invitation_message']) ?></textarea>
                    <span>Here you can enter a message that users will get along with their invitation.<br />
                    It will be added to the text that the inviter writes</span>
                  </td>
                </tr>
<!-- //MOD INVITATION  -->

For those who installed version 1.1. this should do the trick.

All others should either replace the files and revise the readme.txt of the new version - or do it totally from scratch smile

The German PunBB Site:
PunBB-forum.de

3 (edited by af3 2005-09-09 17:55)

Re: Invitation 1.1.1

Tobi -- great!

How to automatically add number of invitations to a newly registered user i.e. default invitation number without being manually added?
Otherwise, if the invitation section in the profile would show just blank and some of my users think this could be an error.

or -- put a msg to tell the user that their invitation section is yet to be activated by admin?

cheers.

Re: Invitation 1.1.1

hey if i am havin 1.0.1 already installed what do i do

5

Re: Invitation 1.1.1

af3 wrote:

How to automatically add number of invitations to a newly registered user i.e. default invitation number without being manually added?

This is done in the user group administration.
If a new user registers into one of these groups he will get the number of invitatios that you define there.

The German PunBB Site:
PunBB-forum.de

6

Re: Invitation 1.1.1

mastiland wrote:

hey if i am havin 1.0.1 already installed what do i do

I think you should install 1.1.1 form scratch. An update would be a bit complicated.
If you think you can deal with it, just take the old and the new readme.txt, find the difference and apply them to your board.
Don't forget to change the database because there are also two changes there.

The German PunBB Site:
PunBB-forum.de

7

Re: Invitation 1.1.1

Tobi: I get this when in group admin i tried to set 50 invitation for "All groups". No error if doen individually for each group.

Warning: ob_start(): output handler 'ob_gzhandler' cannot be used twice in /data/4/0/51/132/214947/user/218384/htdocs/kadus/include/functions.php on line 945

An error was encountered
Error: Unable to fetch user information..

line 945 is within the error() function.

8

Re: Invitation 1.1.1

I got a different error but there is something wrong.
In file plugins/AP_invitations.php , change line 465

     if($group != '')  {

to

     if($group != 'all')  {

works fine with me now.
Sorry for the inconvenience

The German PunBB Site:
PunBB-forum.de

9

Re: Invitation 1.1.1

tobi -- new users registering are complaining tha they get this error when editing profile:
Unable to fetch group invitations?

when i manually add invitation number to their profile, this error disappears.

Is this because there is no default value for Invitation number for user when registering?

10

Re: Invitation 1.1.1

Did you update your database?
Does your table PREFIXgroups have the column g_invitations ?

The German PunBB Site:
PunBB-forum.de

11

Re: Invitation 1.1.1

Yes -- i have also changed the default value from 0 to 1 for g_invitations.

12

Re: Invitation 1.1.1

Can you enable PUN_DEBUG in common.php and tell me what exactly it says there?
Can't find a mistake....

The German PunBB Site:
PunBB-forum.de

13

Re: Invitation 1.1.1

tobi -- this is fixed. the debug led me to a line in profile.php! dumb me ** i put one of the invitation mods in profile.php in the wrong place ! duh!!!
thanks.

14

Re: Invitation 1.1.1

tobi -- how to get this invitation mod to auto import email address from my yahoo and hotmail, and do multiple invitations?
:-) lots of coding?

15

Re: Invitation 1.1.1

Auto import?
Can that be done?
Sorry, I am stupid when it comes to MSN or Yaho, I don't use them at all.
I figure you will have to be logged in there to access your email addresses, right?
I think it would be really complicated to implement..... sad

The German PunBB Site:
PunBB-forum.de

Re: Invitation 1.1.1

When setting group options, I get this error:

File: /mnt/web_g/d20/s22/a000skup/www/awesome/forum/admin_groups.php
Line: 271

PunBB reported: Unable to update group

Database reported: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE g_id=4' at line 1 (Errno: 1064)

I don't have time to set debug mode now but I'll do it later if you need me to.

Looking for a certain modification for your forum? Please take a look here before posting.

17

Re: Invitation 1.1.1

Are you really sure this has to do with the invitation mod?

The German PunBB Site:
PunBB-forum.de

Re: Invitation 1.1.1

Well, the error is coming from a line I copied from the readme. I'll investigate.

Looking for a certain modification for your forum? Please take a look here before posting.

19

Re: Invitation 1.1.1

OK, then can you send the complete statement?
When I run into a bug like that I usually just copy the whole SQl statement string into the error() part.
That way I see exactly what the sql statement looked like and then it's much easier to tell what went wrong.

The German PunBB Site:
PunBB-forum.de

Re: Invitation 1.1.1

$db->query('UPDATE '.$db->prefix.'groups SET g_title=\''.$db->escape($title).'\', g_user_title='.$user_title.', g_read_board='.$read_board.', g_post_replies='.$post_replies.', g_post_topics='.$post_topics.', g_edit_posts='.$edit_posts.', g_delete_posts='.$delete_posts.', g_delete_topics='.$delete_topics.', g_set_title='.$set_title.', g_search='.$search.', g_search_users='.$search_users.', g_edit_subjects_interval='.$edit_subjects_interval.', g_post_flood='.$post_flood.', g_search_flood='.$search_flood.' , g_invitations='.$invitations.' WHERE g_id='.$_POST['group_id'].') or error('Unable to update group', __FILE__, __LINE__, $db->error());

From step 39 in the readme.

Looking for a certain modification for your forum? Please take a look here before posting.

Re: Invitation 1.1.1

And when I try to change setting for my user groups the following messege occur:

"An error was encountered
Error: Unable to update group. "

I'm using PunBB 2.1.10

hej!

22 (edited by FredrikK 2006-01-16 19:00)

Re: Invitation 1.1.1

I have also located the problem to step 39 in the readme.txt.

#
#---------[ 38. FIND (line:261) ]-----------------------------------------------------
#

    $db->query('UPDATE '.$db->prefix.'groups SET g_title=\''.$db->escape($title).'\', g_user_title='.$user_title.', g_read_board='.$read_board.', g_post_replies='.$post_replies.', g_post_topics='.$post_topics.', g_edit_posts='.$edit_posts.', g_delete_posts='.$delete_posts.', g_delete_topics='.$delete_topics.', g_set_title='.$set_title.', g_search='.$search.', g_search_users='.$search_users.', g_edit_subjects_interval='.$edit_subjects_interval.', g_post_flood='.$post_flood.', g_search_flood='.$search_flood.' WHERE g_id='.$_POST['group_id']) or error('Unable to update group', __FILE__, __LINE__, $db->error());

#
#---------[ 39. REPLACE WITH ]-----------------------------------------------------
#

    $db->query('UPDATE '.$db->prefix.'groups SET g_title=\''.$db->escape($title).'\', g_user_title='.$user_title.', g_read_board='.$read_board.', g_post_replies='.$post_replies.', g_post_topics='.$post_topics.', g_edit_posts='.$edit_posts.', g_delete_posts='.$delete_posts.', g_delete_topics='.$delete_topics.', g_set_title='.$set_title.', g_search='.$search.', g_search_users='.$search_users.', g_edit_subjects_interval='.$edit_subjects_interval.', g_post_flood='.$post_flood.', g_search_flood='.$search_flood.' , g_invitations='.$invitations.' WHERE g_id='.$_POST['group_id']) or error('Unable to update group', __FILE__, __LINE__, $db->error());

hej!

23

Re: Invitation 1.1.1

This is quite strange.
I just installed the mod on a fresh punbb without problems.

I will need debug mode output to know what's going on.

The German PunBB Site:
PunBB-forum.de

Re: Invitation 1.1.1

What is debug mode output?

hej!

Re: Invitation 1.1.1

Fredrik: http://punbb.org/docs/faq.html#faq2_7

"Programming is like sex: one mistake and you have to support it for the rest of your life."