Firefox PHP

Module: Terms of Service

Posted by Oliver Riesen 
All files from this thread

File Name File Size   Posted by Date  
terms_of_service-2.4.2.zip 16.8 KB open | download Oliver Riesen 09/08/2009 Read message
Module: Terms of Service
April 09, 2008 03:58PM
Module: Terms of Service
Author: Oliver Riesen <oliver@riesen.org>

Adds a Terms of Service (TOS) agreement to the register and posting page and links to a separate page to display the Terms of Service.

Design for emerald template.

Tested on version 5.2.10


License:

Free to use, modify, or redistribute this code so long as I am given credit for the original development somewhere. This code comes with absolutely no warranty.


Installation:

1. Unpack the archive.

2. Move the directory "terms_of_service" to the directory "mods" within your Phorum installation. Don't change the directory name!

3. Move terms-of-service.php to your phorum-directory. Rename the file if you want to use a localized file name (in this case you have to change later the file name also in the settings).

4. Move the terms_of_service.tpl to your template-directory. You'll find a appropriate file for the various templates in /mods/terms-of-service/templates/.

5. You will want to copy or edit lang/english.php in this mod's dir and alter the TOS to be legal and appropriate for your site.

6. To show a link to the TOS on the index page, edit header.tpl. Add the following line just before the closing "div id=user-info" tag:

{IF URL->TOS}<a class="icon exclamation" href="{URL->TOS}">{LANG->TOS->Header}</a>{/IF}

7. Login as administrator in Phorum's administrative interface and go to the "Modules" section.

8. Enable the module "Terms of Service Module".

9. At the first time that this module is run (by visiting the forum), the module will automatically create a custom profiles field for storing the acceptance date of the TOS. You should be able to see the field in the admin interface under "Custom Profiles":

Field name: mod_tos
Field length: 8
Disable HTML: yes


Module settings:

1. Date of last change to the Terms of Service

Set the date of the last change to the Terms of Service. This date is used to force users to re-accept the Terms of Services after modifications. It's recommended to use a date in the future.

The default value is the date of enabling the module.

2. Default value for the accept-checkbox

Define the default value for the accept-checkbox on the posting-form. If you use "unchecked" the user have to mark the checkbox for each post.

The default value is "unchecked"

3. File name of the Terms of Service page

Change the file name if you want to use a localized name. Don't add the file extension ".php". Take care that you have to change also the file name in the file system!

The default value is "terms-of-service".


Language support:

This module supports multiple languages.

The following languages are included:

- English
- Estonian
- German (Sie)
- German (Du) male
- German (Du) female

If you want to translate the module to a new language, you'll have to do the following:

Copy lang/english.php to lang/yourlang.php (yourlang.php must have the same name as Phorum's main language file that you use). After this, translate the strings in lang/yourlang.php.

If you have created a translation for this module, please post a zip file containing lang/yourlang.php in the module thread at phorum.org, so the translation can be added to the module package.


Sanity Checks:

If you have problems with this module login as administrator in Phorum's administrative interface and go to the "System Sanity Checks" section. Check for warnings or errors for the Terms of Service Module.


Todo:

- Extend sanity checks: Check if template file exists also in templates used by forum settings. For the moment it is only checked if the template exists in the default forum template.
- Use template file for extending register and posting page. For the moment the HTML code is included in terms_of_service.php.


Changelog:

[older changelogs removed]

2008/04/09 version 2.3.0 by Oliver Riesen (oliver@riesen.org)
- Rewrite for Phorum 5.2

2008/04/10 version 2.3.1 by Oliver Riesen (oliver@riesen.org)
- Estonian language file thanks to Träm
- Using now phorum_date function and format mask from language file for formatting dates. Particular date format removed from module language file.
- Image folder removed since image is already included in emerald template.

2008/04/11 version 2.3.2 by Oliver Riesen (oliver@riesen.org)
- Fix for undefined index.

2008/05/12 version 2.4.0 by Oliver Riesen (oliver@riesen.org)
- German language files renamed according to structuring the language file and charset support.
- Added german language files with UTF-8 charset.

2009/09/04 version 2.4.1 by Oliver Riesen (oliver@riesen.org)
- Bug fix in German language files causing sanity checks to fail; thanks to Ryan.

2009/09/08 version 2.4.2 by Oliver Riesen (oliver@riesen.org)
- Bug fix in template file causing undefined index; thanks to Ryan.


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.19)
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.




Edited 6 time(s). Last edit at 09/08/2009 09:55AM by Oliver Riesen.
Attachments:
open | download - terms_of_service-2.4.2.zip (16.8 KB)
Re: Module: Terms of Service
April 09, 2008 11:08PM
First, I post language file for Estonian. And thank you very much for updating the module!

Anyway, I have some remarks on last version...

I think terms-of-service.php should use phorum_date instead of strftime and include_once('./include/format_functions.php'); for doing this. Pure strftime in that place didn't make it for my locale. Also date format from forum language file could be used instead of defining different date format in TOS language file.

TOS icon must probably be also defined in css.tpl something like this (maybe it would be better to copy it under the template):

.exclamation {
    background-image: url('mods/terms_of_service/images/exclamation.png');
}

"Tos_accept" checkbox should probably contain html tag "small" to cohere with rest of Emerald design (this need also changes in terms_of_service.php).

Also it seems that agreeing TOS when forum had previously no TOS defined does not work. Result in my case was: An error occurred in the application. The error was logged to the Phorum event log. Event log reads: "PHP error: phorum_api_user_save(): Illegal field name used in user data: mod_tos. Function phorum_api_user_save called at {path to Phorum}/terms-of-service.php:25". The same for registering: "Function phorum_api_user_save called at {path to Phorum}/register.php:185"

Cheers
RÄMT



Edited 1 time(s). Last edit at 04/09/2008 11:31PM by Träm.
Re: Module: Terms of Service
April 10, 2008 07:49AM
Quote
Träm
Also it seems that agreeing TOS when forum had previously no TOS defined does not work.

Sorry, this applied to dev branch phorum. It seems to be fine with 5.2.7.
Re: Module: Terms of Service
April 10, 2008 09:51AM
Hi Träm,

thanks for your language file and your remarks. I just uploaded a new version.

Quote
Träm
I think terms-of-service.php should use phorum_date

Yes, you are right. I changed it.

Quote
Träm
TOS icon must probably be also defined in css.tpl something like this (maybe it would be better to copy it under the template):

Sorry, I removed the images subfolder now. The image an CSS is already included in the emerald template, so no need to add it to the module package.

Regards
Oliver


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.19)
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: Module: Terms of Service
April 11, 2008 11:26AM
New version:

2008/04/11 version 2.3.2 by Oliver Riesen (oliver@riesen.org)
- Fix for undefined index.


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.19)
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: Module: Terms of Service
September 04, 2009 09:29AM
Sorry I haven't posted before, but I use this module for two different phorums and love it!

There is something I noticed today though. I was browsing through the Admin links and clicked "System Sanity Checks" and found that it is reporting an error in the Terms of Service Module.

Quote

Sanity check failed
The following keys are missing in your custom language file german-informal-female.utf-8.php:
Agree
Content
ErrorPost
ErrorRegister
Header
LastAgree
Reforce
Version

Possible solution:

Please add these keys to this language file!

I considered doing it myself, but I don't know German.

-------------------------------------------

"Everything we see or seem, is but a dream within a dream." -Edgar Allan Poe
Re: Module: Terms of Service
September 04, 2009 10:18AM
Hi Ryan,

Quote
Ryan
The following keys are missing in your custom language file german-informal-female.utf-8.php:

If you don't use German language files you can ignore this message. Nevertheless I'll have a look at the module later.

Regards
Oliver


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.19)
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: Module: Terms of Service
September 04, 2009 10:42AM
Hi Ryan,

Quote
Ryan
The following keys are missing in your custom language file german-informal-female.utf-8.php:

For me it seems, that the files german.utf-8.php or german-informal-male.utf-8.php from my distribution are missing in your module language folder. So, if you don't use german delete all files starting with german from you module language folder.

Regards
Oliver


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.19)
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: Module: Terms of Service
September 04, 2009 10:51AM
I've got both of those files. I re-downloaded the mod, and found that I have the same German files as the module.

If it helps, these are the errors filling up the System Sanity Checks page:

Quote

Warning: include(/home/twilight/public_html/reptiletracks.com/mods/terms_of_service/lang/german-informal-male.UTF-8.php) [function.include]: failed to open stream: No such file or directory in /home/twilight/public_html/reptiletracks.com/mods/terms_of_service/lang/german-informal-female.utf-8.php on line 11

Warning: include() [function.include]: Failed opening '/home/twilight/public_html/reptiletracks.com/mods/terms_of_service/lang/german-informal-male.UTF-8.php' for inclusion (include_path='.:/usr/lib/php') in /home/twilight/public_html/reptiletracks.com/mods/terms_of_service/lang/german-informal-female.utf-8.php on line 11

Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/twilight/public_html/reptiletracks.com/mods/terms_of_service/terms_of_service.php on line 318

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/twilight/public_html/reptiletracks.com/mods/terms_of_service/terms_of_service.php on line 323

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/twilight/public_html/reptiletracks.com/mods/terms_of_service/terms_of_service.php on line 323

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/twilight/public_html/reptiletracks.com/mods/terms_of_service/terms_of_service.php on line 323

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/twilight/public_html/reptiletracks.com/mods/terms_of_service/terms_of_service.php on line 323

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/twilight/public_html/reptiletracks.com/mods/terms_of_service/terms_of_service.php on line 323

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/twilight/public_html/reptiletracks.com/mods/terms_of_service/terms_of_service.php on line 323

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/twilight/public_html/reptiletracks.com/mods/terms_of_service/terms_of_service.php on line 323

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/twilight/public_html/reptiletracks.com/mods/terms_of_service/terms_of_service.php on line 323

-------------------------------------------

"Everything we see or seem, is but a dream within a dream." -Edgar Allan Poe
Re: Module: Terms of Service
September 04, 2009 11:12AM
could it be that your ftp client is converting all uploads to lower-case filenames?


Thomas Seifert
Phorum Development Team / Mysnip-Solutions.de
Custom Phorum and general software development
worry-free Phorum Hosting
Sorry, only registered users may post in this forum.

Click here to login