Re: Terms of Service Module 2.0 (5.1 ready) August 29, 2006 08:57PM |
Admin Registered: 20 years ago Posts: 8,532 |
install.php for this package needs updating. The way in which the custom profile field is created isn't completely right. Here's a snippet of code that demonstrates the right way to add custom profile fields. Could you please update the module package for this, Oliver?
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
$FIELDS = $GLOBALS["PHORUM"]["PROFILE_FIELDS"];
... code for determining if the field doesn't already exist ...
$FIELDS["num_fields"]++;
$FIELDS[$FIELDS["num_fields"]] = array(
'name' => 'mod_topic_poll',
'length' => 65000, // since field is 65000+ in the database anyway
'html_disabled' => 0, // we need raw storage
);
num_fields sounds like a field that is used to determine the number of custom user profile fields in use, but actually it is treated as an autoincrement id for the PROFILE_FIELDS array.Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Terms of Service Module 2.0 (5.1 ready) August 30, 2006 02:13AM |
Admin Registered: 18 years ago Posts: 746 |
Hi Maurice,
Updated. See new version 2.0.2.
Regards
Oliver
Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Quote
mmakaay
install.php for this package needs updating.
Updated. See new version 2.0.2.
Regards
Oliver
Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: Terms of Service Module August 30, 2006 04:49PM |
Registered: 18 years ago Posts: 110 |
I'm attaching a modified version, I've done 2 things
the first was to use the nl2br instead of the substitute in the last line of mod_tos_common
The other one, is helpful for getting the status of the TOC for the user quickly without within other modules, or for other code which uses phorum. (I'm primarily using it in a picture gallery--people can post & save if their TOC is current)
again in mod_tos_common, I add:
I'm not sure where else to put the data other than: $PHORUM['user']['mod_tos_current'] -- if someone has a better spot, let me know.
I then substitute $PHORUM['user']['mod_tos_current'] in the other fnctions which do the same checking--which hopefully is faster than recomputing the ||'s multiple times.
What I havn't figured out yet, are 2 things.
One, in the terms_of_service.tpl would be a good place to check the users status and offer them an opportunity to agree to the terms at that time.
Two, I can check for the terms of service but it doesn't appear to have executed the tos after_header function, since the URL and such isn't there...so I'm not sure what needs to be done to give people the checkbox/accept option other than at the registration page or post message screen...
toughts?
EDIT: Updated the attached file, had a couple typos
EDIT: File removes since it's incorporated into the 2.1.1 (or newer) version Oliver is maintaining
Edited 2 time(s). Last edit at 09/01/2006 01:01AM by freedman.
the first was to use the nl2br instead of the substitute in the last line of mod_tos_common
The other one, is helpful for getting the status of the TOC for the user quickly without within other modules, or for other code which uses phorum. (I'm primarily using it in a picture gallery--people can post & save if their TOC is current)
again in mod_tos_common, I add:
$PHORUM['user']['mod_tos_current']=( !$PHORUM['DATA']['LOGGEDIN'] // for guests always || !isset($PHORUM['user']['mod_tos']) // reforce accept for registered user || !$PHORUM['user']['mod_tos'] || $PHORUM['user']['mod_tos'] < $PHORUM['mod_tos']['date_last_change'] )?false:true; // True if it's current, False if it's not
I'm not sure where else to put the data other than: $PHORUM['user']['mod_tos_current'] -- if someone has a better spot, let me know.
I then substitute $PHORUM['user']['mod_tos_current'] in the other fnctions which do the same checking--which hopefully is faster than recomputing the ||'s multiple times.
What I havn't figured out yet, are 2 things.
One, in the terms_of_service.tpl would be a good place to check the users status and offer them an opportunity to agree to the terms at that time.
Two, I can check for the terms of service but it doesn't appear to have executed the tos after_header function, since the URL and such isn't there...so I'm not sure what needs to be done to give people the checkbox/accept option other than at the registration page or post message screen...
toughts?
EDIT: Updated the attached file, had a couple typos
EDIT: File removes since it's incorporated into the 2.1.1 (or newer) version Oliver is maintaining
Edited 2 time(s). Last edit at 09/01/2006 01:01AM by freedman.
Re: Terms of Service Module August 31, 2006 04:28AM |
Admin Registered: 18 years ago Posts: 746 |
Hi Freedman,
thanks for your suggestions and modifications. I adopted them to my version.
Can you please remove your attached terms_of_service.php from your post. Thanks.
Done! See new version 2.1.0 in my original post.
Regards
Oliver
Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
thanks for your suggestions and modifications. I adopted them to my version.
Quote
freedman
I'm attaching a modified version
Can you please remove your attached terms_of_service.php from your post. Thanks.
Quote
freedman
One, in the terms_of_service.tpl would be a good place to check the users status and offer them an opportunity to agree to the terms at that time.
Done! See new version 2.1.0 in my original post.
Regards
Oliver
Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: Terms of Service Module August 31, 2006 06:22AM |
Registered: 18 years ago Posts: 35 |
Re: Terms of Service Module August 31, 2006 06:40AM |
Registered: 18 years ago Posts: 110 |
Quote
Netwalker
I installed everything as instructed in the readme. but it didn't create the custom field (did that now by hand) and it simply doesn't show up on the register page?
any suggestions?
Netwalker.
make the field by hand, and UNCHECK Disable HTML
I had this problem initially as well.
Re: Terms of Service Module August 31, 2006 06:43AM |
Registered: 18 years ago Posts: 110 |
Quote
Oliver Riesen
Hi Freedman,
thanks for your suggestions and modifications. I adopted them to my version.
Quote
freedman
I'm attaching a modified version
Can you please remove your attached terms_of_service.php from your post. Thanks.
Quote
freedman
One, in the terms_of_service.tpl would be a good place to check the users status and offer them an opportunity to agree to the terms at that time.
Done! See new version 2.1.0 in my original post.
Regards
Oliver
yeah, I just re-updated it, though, there was a typo.. when you've fixed yours I'll remove the file attachment:
the 2 places you see:
if ( empty($_POST['tos_accept']) // TOS not accepted && $PHORUM['user']['mod_tos_current'] // user accepted actual TOS?should read
if ( empty($_POST['tos_accept']) // TOS not accepted && !$PHORUM['user']['mod_tos_current'] // user accepted actual TOS?the ! was missing for some reason from the one I uploaded, meaning it would do the opposite than would be expected.
Re: Terms of Service Module August 31, 2006 06:46AM |
Registered: 18 years ago Posts: 35 |
Re: Terms of Service Module August 31, 2006 08:16AM |
Admin Registered: 18 years ago Posts: 746 |
Hi Netwalker,
You have to copy the (updated) terms-of-service.php and terms_of_service.tpl like explained in the installation instruction...
Regards
Oliver
Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Quote
Netwalker
did that...but still it doesn't show up ????
You have to copy the (updated) terms-of-service.php and terms_of_service.tpl like explained in the installation instruction...
Regards
Oliver
Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: Terms of Service Module August 31, 2006 08:22AM |
Admin Registered: 18 years ago Posts: 746 |
Hi Freedman,
Fixed in 2.1.1.
Regards
Oliver
Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Quote
freedman
yeah, I just re-updated it, though, there was a typo.. when you've fixed yours I'll remove the file attachment:
Fixed in 2.1.1.
Regards
Oliver
Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Sorry, only registered users may post in this forum.