Jump to content


[Module] MKPProfile Module 1.0.1 06.06.2006


5 replies to this topic

#1 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 13 May 2006 - 05:12 PM

MKPProfile Module 1.0.1 06.06.2006
by visiblesoul
for Mkportal M1.1 Rc1
Download: http://www.visiblesoul.net/resources/downl...ils.php?file=68

Posted Image


Version 1.0.1 is available in the downloads section. There are many bugs in previous versions. The module is really not functional in versions previous to rc4. You should upgrade to 1.0.1. Upgrade instructions are included in download package. The upgrade is easy. :)

This is a basic profile module for MKPortal. It's kind of a pain to install but most MKPortal modules are. ;) A "Latest Profiles" block is included.

Quote

USAGE:


Customization: Most customization of the module for various uses can be done simply by editing the language entires. For example, if you want to use the module as an "Featured Artists" module replace "Member" with "Artist" etc. Language entries for this module are in the following locations:

* /mkportal/lang/*/lang_profile.php
* /mkportal/lang/*/lang_global.php
* /mkportal/lang/*/lang_admin.php


-------------------------
There are 3 modes for profile creation/editing/deleting.


1. Forum Admin mode:

Forum Admin can create profiles for other users. The "Submit Profile" link is always available to Forum Admin. In addition Forum Admin sees a "My Profile" link that links to their own personal profile if one has been created.

Forum Admin has additional "Member" and "Member ID" input boxes in the "Submit Profile" screen (index.php?ind=profile&op=submit_file1). To create a profile for a forum user simply type the username (must be exact username) in the "Member" box. If you want the username to link to the forum profile page enter the userid in the optional "Member ID" box. It is also possible to create profiles for people (or things) who are not registered users on your forum. Simply leave the "Member ID" box blank and the "Member" name will not be a link.

Forum Admin can edit and delete all profiles.

Note that if Forum Admin creates a profile for an existing forum user then that user WILL be able to edit or delete his profile if he has "Can Moderate Profiles?" permissions. If you do not want a user to be able to edit his/her own profile then either make sure that he/she does not have "Can Moderate Profiles?" permissions or DO NOT enter a userid in the "Member ID" box (or enter "0"). A user can only edit their own profile if the MKPProfile username AND userid match their forum username AND userid.

Also note that it is possible for Forum Admins to create duplicate profiles for a User. This is not recommended. It is not possible for non-Admins to create duplicate profiles.

-----
2. Portal Admin Mode:

"Portal Admin" is defined as any usergroup who has "Can Manage MKPortal?" permissions which are set in the Portal CP Permissions management but does NOT have forum Admin permissions. Portal Admins can NOT create profiles for other users. The "Submit Profile" link is available to Portal Admins until they create their profile. After the profile is created the "Submit Profile" link is replaced by a "My Profile" link that links to their own personal profile.

Portal Admins may only create one profile. They may only create their own profile. The "Member" input box in the "Submit Profile" screen (index.php?ind=profile&op=submit_file1) and "edit_file" screen (index.php?ind=profile&op=edit_file&iden=*) is readonly for Portal Admins so they cannot edit usernames. The "Member ID" input box is not available for Portal Admins so they cannot edit userid numbers.

Portal Admins can edit and delete all profiles but they can only create their own profiles.

-----
3. User mode:

The "Submit Profile" link is available to registered users who have "Can Submit Profiles?" permissions set in the Portal CP until they create their profile. After the profile is created the "Submit Profile" link is replaced by a "My Profile" link that links to their own personal profile. In profile entry_view the user can edit or delete their own profile only if they have "Can Moderate Profiles?" permissions set in the Portal CP.

Registered Users may only create one profile. They may only create their own profile. The "Member" input box in the "Submit Profile" screen (index.php?ind=profile&op=submit_file1) is readonly for registered users. The "Member ID" input box is not available for registered users because the module will use the user's forum id to create the link to their forum profile.

-------------------------
Profile Photo:
Users can upload a profile photo. The module will display the user's forum avatar if they do not upload a profile image (avatar feature works in IPB 2.x only - other boards can be added). If no profile image or avatar is available it will display a "No Photo" image. Images cannot currently be edited within the module. If a user wants to change their photo they must delete their profile and create a new profile with their new photo and profile info. I may add an "change image" option in a future version.

-------------------------
Profile Fields:
Required fields are username, description, and bio. Required fields are marked with an asterisk (*). Other fields can be added in the Portal CP. Optional Fields 1- 6 will parse URL links that begin with http:// so you can use them for homepage links or anything else you want. Of course these fields can also be plain text. Optional Field 7 will not parse links.

-------------------------
Profiles List: The list of member profiles in section_view is sorted by Member Name by default.

-------------------------
Administration:
The module is based on the MKPReviews module so you will be able to figure it out pretty easily.

-------------------------
Module Credits: As is the case with all of my recent modules, some credits information is visible only to Admin. The version number is always hidden from non-Admins. Please do not remove my credits page. It is the primary reason that I am willing to create modules like this one that I do not personally need. Feel free to add your own credits to the page if you do modifications. If you absolutely need to remove the credits page from the module please contact me and I will probably allow it but I won't like it.
--------------------------
CHANGELOG:
--------------------------

1.0.1 (06.06.2006):
-added 1 database query - mkp_stats (bug report by Neuroitc)
-fixed Delete Comment bug (bug report by alpujarra)
-fixed image resize bug for servers with hotlink protection (bug report by stefano8663)
-fixed image resize bug in Latest Profiles block
-fixed edit description input field bug (bug report by stefroy)
-changed "prof_nodelcomm" language entry (English & Italian only)

Changed files:
1. /mkportal/modules/profile/index.php
2. /mkportal/blocks/latest_profiles.php
3. /mkportal/lang/English/lang_profile.php
3. /mkportal/lang/Italiano/lang_profile.php
--------------------------
1.0a (27.05.2006):
-Added Italian translation by stefano8663
-Added French translation by stefroy
-Added Random Profile block by stefroy
--------------------------
1.0 Final (25.05.2006):
-fixed bug with avatar display (IPB 2.1.x only)
-fixed html output to be valid xhtml 1.0 transitional
-added Latest Profiles block

Changed files:
1. /mkportal/modules/profile/index.php

Added files:
1. /mkportal/blocks/latest_profiles.php (used for Latest Profiles block)
2. /mkportal/modules/profile/classes/prof_share.inc.php (used for Latest Profiles block)

--------------------------
1.0 RC4a (22.05.2006):
-Removed nophoto.gif image link (bug report by blu)

Changed files:
1. /mkportal/modules/profile/index.php
--------------------------
1.0 RC4 (22.05.2006):
-Added CHMOD step to install instructions in readme.txt (bug report by
Patrick_D)
-Fixed ad_profile "prof_sec_page" and "prof_file_page" bugs that did not allow
global config setting to be saved (bug report by craver)
-Fixed multiple Admin permission bugs in /profiles/index.php that did not
allow Forum Admins full create, edit and delete perms (bug report by stefroy
and craver)
-Fixed uploaded avatar display issue with IPB 2.1.x
-Added 'prof_noedexist' entry in lang_profile.php
-Added error message if user tries to edit a profile before creating one
-Added Spanish readme, upgrade and lang file by cur

Changed files:
1. /mkportal/modules/profile/index.php
2. /mkportal/admin/ad_profile.php
3. /mkportal/lang/*/lang_profile.php
--------------------------
1.0 RC3 (17.05.2006):
-Updated Read Me for clarity. Added more Usage info.
-Fixed bug that allowed users to access function "submit_file1" bypassing
function "submit_file" (bug report by stefroy)
-Fixed bug that did not allow Forum Admins and Portal Admins to edit/delete
other users' profiles (bug report by stefroy)
-Fixed page title bug that displayed html code in title (bug report by Nexus)
-Edited "prof_nodel" entry in lang_profile.php

Changed files:
1. /mkportal/modules/profile/index.php
2. /mkportal/modules/profile/tpl_profile.php
3. /mkportal/lang/*/lang_profile.php
--------------------------
1.0 RC2 (16.05.2006):
-Install instructions modified for /mkportal/admin/ad_perms.php to eliminate an
ambiguity.
-Added upgrade.txt
-Fixed Perms bug in /mkportal/admin/ad_perms.php (function perms_show) edits.
One additional edit required. (bug report by gonny)
-Fixed php short tags bugs
-Added Turkish readme and lang file by cyberjack
-Added changelog.txt
--------------------------
1.0 RC1 (13.05.2006):
-First module release
--------------------------


Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard

#2 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 14 May 2006 - 11:27 AM

I do not want to add any features until I release a final bug-free version 1.0. Then I will add some features for a new version.

Some features so far that I will consider adding:


Choose module layout from Admin CP (photo: side/top; bio: side/bottom)
Latest Profiles block with Admin (like the default news block)
Use member avatar if no photo (this works for IPB2.1 now)
Interaction with board profile (location, post count, registered date, time zone, etc.)
Portal Admins can add profiles (yes/no)
BBcode enabled in Optional Field 7


Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard

#3 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 23 May 2006 - 09:51 AM

By default optional fields 1-6 will parse links starting with "http:". optional field 7 will not parse links by deafult.

If you want to show URLs in field 7 then the easiest (and best) way to do it is to allow BBcode in field 7. Here's how to do it...

---------------------
Parse BBcode in Optional Field 7:
FIND in/mkportal/modules/profile/index.php (function entry_view):
		if ($rowt['field7']) {
			$prof_field7 = $row['field7'];
ADD BELOW:
			$prof_field7 = $mklib->decode_bb($prof_field7); // parse bbcode
FIND in function submit_file1:
			<td width="5%">{$row['field7']}</td>
REPLACE WITH:
			<td width="5%">{$row['field7']}{$mklib->lang['prof_bbenabled']}</td>
FIND in function edit_file:
			<td width="5%">{$rowt['field7']}</td>
REPLACE WITH:
			<td width="5%">{$rowt['field7']}{$mklib->lang['prof_bbenabled']}</td>
ADD this language entry in /mkportal/lang/*/lang_profile.php:
$langmk['prof_bbenabled'] = "
<i>(BBCode enabled)</i>";
Now you can use BBcode in field 7 and you will be able to add clickable links.



Unlike the Optional Fields #1-6 that parse links automatically, Optional Field 7 requires that you use BBcode to post clickable links. And of course the bbcode will only work after you install the mod above.

[url=http://www.yourlink.com/]yourlink[/url]
or

[url]http://www.yourlink.com/[/url]



Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard

#4 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 23 May 2006 - 09:52 AM

How to position profile image on top of text instead of on the left:
FIND in /profile/index.php (function entry_view):
					$image = "
					<tr>
			<td class="modulecell" valign="top" align="center"><a href="$mklib->mkurl/modules/profile/images/$image" target="_blank"/><img src="mkportal/modules/profile/images/$image" width="$thumb_mes[0]" height="$thumb_mes[1]" align="middle" border="0" alt="" /></a></td>
					";
REPLACE WITH:
					$image = "
					<tr>
			<td class="modulecell" valign="top" align="center" colspan="2"><a href="$mklib->mkurl/modules/profile/images/$image" target="_blank"/><img src="mkportal/modules/profile/images/$image" width="$thumb_mes[0]" height="$thumb_mes[1]" align="middle" border="0" alt="" /></a></td>
			</tr>
					";
FIND:
			$image = "
			<tr>
			<td class="modulecell" valign="top" align="center">$avatar_img</td>
			";
REPLACE WITH:
			$image = "
			<tr>
			<td class="modulecell" valign="top" align="center" colspan="2">$avatar_img</td>
			</tr>
			";
FIND:
				  $image = "
			<tr>
			<td class="modulecell" valign="top" align="center"><a href="$mklib->mkurl/modules/profile/images/$image" target="_blank"/><img src="mkportal/modules/profile/images/nophoto.gif" align="middle" border="0" alt="" /></a></td>
		";
REPLACE WITH:
				  $image = "
			<tr>
			<td class="modulecell" valign="top" align="center" colspan="2"><a href="$mklib->mkurl/modules/profile/images/$image" target="_blank"/><img src="mkportal/modules/profile/images/nophoto.gif" align="middle" border="0" alt="" /></a></td>
			</tr>
		";
FIND in /profile/tpl_profile.php (function row_entry):
return <<<EOF
			  {$image}

			<td class="modulecell" valign="top">
REPLACE WITH:
return <<<EOF
			  {$image}

			<tr>
			<td class="modulecell" valign="top" colspan="2">



Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard

#5 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 23 May 2006 - 09:53 AM

How to position the "Bio" under the profile photo and other fields:

FIND in /profile/tpl_profile.php:
				{$field7}
				<tr>
				  <td colspan="3" class="modulecell" align="left"><b>{$mklib->lang['prof_bio']}</b>
{$profile}</td>
				</tr>
				{$autore}
				  </table>
				</td>
			  </tr>
REPLACE WITH:
				{$field7}
				{$autore}
				  </table>
				</td>
			  </tr>
			  <tr>
				<td colspan="2" class="modulecell" align="left"><b>{$mklib->lang['prof_bio']}</b>
{$profile}				  </td>
			  </tr>



Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard

#6 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 26 May 2006 - 11:26 PM

akulion said:

suggestion 1: Users can make more than 1 profile (up to 10 or more)

why?

Because if admin create many category then this mod become even bigger in application:

Penpals - (1 profile here)

Classified Advert (selling / buying) - (1 or more profile here)

Address Book (for company info or contacts) - (1 or more profile can go in here)

Website Directory (can act like mkwebsites) - (1 or more profiles can go in here)
To allow users to create multiple profiles:

Edit /profile/index.php

FIND in function profile_show:
	$prof_myprof = $prof_exist['id'];

	// Display "submit profile" link only to Forum Admins and User with no existing profile
	if ( $mkportals->member['g_access_cp'] || ( $mklib->member['g_send_profile'] && !$prof_exist ) ) {
REPLACE WITH:
	//$prof_myprof = $prof_exist['id'];

	// Display "submit profile" link only to Forum Admins and User with no existing profile
	//if ( $mkportals->member['g_access_cp'] || ( $mklib->member['g_send_profile'] && !$prof_exist ) ) {
	if ( $mkportals->member['g_access_cp'] || ( $mklib->member['g_send_profile'] ) ) {
FIND in function profile_show:
	if ( ( $prof_exist && $mkportals->member['g_access_cp'] ) || ( $prof_exist && $mklib->member['g_send_profile'] ) ) {
		$submit .= "<a href="index.php?ind=profile&op=entry_view&iden=$prof_myprof">[ {$mklib->lang['prof_my']} ]</a>";
	}
REPLACE WITH:
	//if ( ( $prof_exist && $mkportals->member['g_access_cp'] ) || ( $prof_exist && $mklib->member['g_send_profile'] ) ) {
		//$submit .= "<a href="index.php?ind=profile&op=entry_view&iden=$prof_myprof">[ {$mklib->lang['prof_my']} ]</a>";
	//}
FIND in function section_view:
		$prof_myprof = $prof_exist['id'];

		// Display "submit profile" link only to Forum Admins and User with no existing profile
		if ( $mkportals->member['g_access_cp'] || ( $mklib->member['g_send_profile'] && !$prof_exist ) ) {
REPLACE WITH:
		//$prof_myprof = $prof_exist['id'];

		// Display "submit profile" link only to Forum Admins and User with no existing profile
		//if ( $mkportals->member['g_access_cp'] || ( $mklib->member['g_send_profile'] && !$prof_exist ) ) {
		if ( $mkportals->member['g_access_cp'] || ( $mklib->member['g_send_profile'] ) ) {
FIND in function section_view:
		if ( ( $prof_exist && $mkportals->member['g_access_cp'] ) || ( $prof_exist && $mklib->member['g_send_profile'] ) ) {
			$submit .= "<a href="index.php?ind=profile&op=entry_view&iden=$prof_myprof">[ {$mklib->lang['prof_my']} ]</a>";
		}
REPLACE WITH:
		//if ( ( $prof_exist && $mkportals->member['g_access_cp'] ) || ( $prof_exist && $mklib->member['g_send_profile'] ) ) {
			//$submit .= "<a href="index.php?ind=profile&op=entry_view&iden=$prof_myprof">[ {$mklib->lang['prof_my']} ]</a>";
		//}
FIND in function submit_file:
		if ( !$prof_idpage || $mkportals->member['g_access_cp'] ) {
REPLACE WITH:
		//if ( !$prof_idpage || $mkportals->member['g_access_cp'] ) {
FIND in function submit_file:
		}
		// If user is not Forum Admin or if user has an existing profile redirect to their profile edit page
		else {
			Header("Location: index.php?ind=profile&op=edit_file&iden=$prof_idpage");
		}
REPLACE WITH:
		//}
		// If user is not Forum Admin or if user has an existing profile redirect to their profile edit page
		//else {
			//Header("Location: index.php?ind=profile&op=edit_file&iden=$prof_idpage");
		//}
FIND in function submit_file1:
		if ( !$prof_idpage || $mkportals->member['g_access_cp'] ) {
REPLACE WITH:
		//if ( !$prof_idpage || $mkportals->member['g_access_cp'] ) {
FIND in function submit_file1:
		}
		// If user is not Forum Admin or if user has an existing profile redirect to their profile edit page
		else {
			Header("Location: index.php?ind=profile&op=edit_file&iden=$prof_idpage");
		}
REPLACE WITH:
		//}
		// If user is not Forum Admin or if user has an existing profile redirect to their profile edit page
		//else {
			//Header("Location: index.php?ind=profile&op=edit_file&iden=$prof_idpage");
		//}
Now your users should be able to submit multiple profiles but only edit their own profiles. There will not be a "My Profile" link because there is not one single profile to link to. If anyone uses this hack please let me know if my instructions worked for you.


Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users