Photo + Profiles Hack V2 for 2.0.13.2

Date 2005/6/21 20:20:00 | Topic: Hacks

This is an update from my previous hack. there isn't much difference than before in looks or usage except for now the users can enter their date of birth on registration (it is set to be *required*) and on user profile page, instead of showing date of birth it displays the users age.

exisiting members from before the hack was installed, will not have a date of birth, so the next time they visit their profile page, they will have the option of setting it :) after setting their date of birth, the option to edit the dob is removed, essentially, once it's set it can only be changed by admin.

a few new form classes were created with this hack, that may benefit other developers too..

regards

M0nty
-----------------------------------------------


The photo upload section utilises the same function as the Avatar section but they are both seperate.
This means that the photo settings can be customised in exactly the same way as
the Avatars are, an extra menu has been added to the system menu in admin which
works exactly the same as the avatar manager.

Photo's can also be controlled by admin in the user settings similar to the way avatars are.

you can control image size, image width, image height, user post (how many posts are needed
before users are allowed to upload) this is done in system / preferences / user info settings.

The Profile Fields section adds extra fields to the user profile page and registration page.
Date Of Birth input is *required* during registration (this can be changed by removing 'true' from register.php for the birth element) it's not perfect but it works, if you can think of a better method, let me know. existing users will have the option to change date of birth once only as they will not have a birth value inputted when you apply the hack. after they have set their date once, the option will be removed for them to change it again.. Admin can still edit their date of birth tho via the admin edit user screen.

Installation (fresh install)

you can either upload and overwrite existing files with the ones in this pack, or alternatively manually edit the files on the server.. you can find the edit points by opening up the files in this hack and searching for the name m0nty (all edits have been commented so searching the file for the name m0nty will take you to where the edits are, you should be able to work out then where to edit your own files)

once uploaded, you need to run the mysql.sql file in phpmyadmin or whatever sql tool you use.

be sure to change the default prefix of the mysql file if you changed your xoops from default (xoops_)

once that is done, you need to update your system module in xoops admin. by going to admin > system > modules and clicking the update button. if you have custom templates, then you will need to edit those aswell.. (only 1 template is edited > system_userinfo.html)

Upgrading from previous hack

copy all files to the server overwriting existing. DO NOT run mysql.sql query as you don't need to.
run the update.sql file in phpmyadmin or whatever tool you use. this will change the old user_age table to user_birth and set the column type to DATE.

be sure to change the default prefix of the mysql file if you changed your xoops from default (xoops_)

NOTE:

IF YOU HAVE X-IPB (INVISIONBOARD), X-PHPBB (PHPBB) OR MULTILINGUAL HACK INSTALLED THEN DO NOT USE THE FILES FROM THIS HACK AS THEY WILL BREAK YOUR SITE. INSTEAD YOU WILL HAVE TO DO THE EDITS MANUALLY BY EDITING EACH FILE. BE WARNED!!

ALWAYS BE SURE TO BACKUP ALL FILES AND DATABASE BEFORE ATTEMPTING ANY HACK, I AM NOT RESPONSIBLE FOR DAMAGE TO YOUR SITE FROM USING THIS HACK OR IF YOU FAIL TO INSTALL IT CORRECTLY. HAVING A BACKUP IS ALWAYS A GOOD IDEA ANYWAY!!


Also remember this is a hack, use at your own risk, if you are not sure what you are doing then be careful or don't use it!! upgrading your xoops site will break the hack and you will have to wait for updated version.


Files Added:

root/class/xoopsform/formselectgender.php
root/class/xoopsform/formselectzodiac.php
root/class/xoopsform/formselectdateofbirth.php < added in V2

root/include/dobcalendarjs.php < added in V2
root/include/dobcalendar.js < added in V2

root/language/english/gender.php
root/language/english/zodiac.php

root/kernel/photo.php

modules/system/admin/photos/
modules/system/admin/photos/main.php
modules/system/admin/photos/xoops_version.php

modules/system/language/admin/photos.php


Files Changed:

root/edituser.php
root/userinfo.php
root/misc.php
root/register.php

root/include/functions.php < changed in V2 only
root/include/registerform.php < changed in V2 only

root/class/xoopsformloader.php
root/class/xoopslists.php

root/kernel/user.php

root/language/english/user.php
root/language/english/global.php
root/language/english/misc.php

root/modules/system/menu.php
root/modules/system/constants.php

root/modules/system/admin/users/main.php
root/modules/system/admin/users/users.php
root/modules/system/admin/users/userform.php

root/modules/system/language/english/modinfo.php
root/modules/system/language/english/admin.php

root/modules/system/language/english/admin/preferences.php
root/modules/system/language/english/admin/users.php

root/modules/system/templates/system_userinfo.html

you can download the hack HERE

2.0.9.3, 2.0.10, 2.0.14 & 2.0.15 version also available on site



This article comes from XOOPS Web Application System
https://xoops.org

The URL for this story is:
https://xoops.org/modules/news/article.php?storyid=2353