PortalParts.com Site

Extending the User Profile

The plugin offers you the ability to add a quick link to add a user to your buddy list to make it easier to send a member a private message. If the user is already on your buddy list, the link will be Remove Buddy.

profile.jpg

You need to modify one template and using the default professional theme as our example, modify the layout\professional\users\profile.thtml template file. You will be need to add new rows to the table in the template and the new lines are noted by the comments. The recommended location is to add the new lines just after the row that displays the member registration information.

glmessenger.txt · Last modified: 2009/03/12 22:18 by Blaine
Back to top

Geeklog glMessenger plugin

Author: Blaine Lang blaine@portalparts.com
Date: April 8, 2007
Version: 1.8

snapshot.jpg
This latest version 1.8 requires your site is using Geeklog version 1.4 and version 1.4.1 is recommended.

  • The plugins template have been updated for GL 1.4.1 and default CSS styles
  • Directions to integrate the user account privacy options have been updated for the new GL 1.4.1 templates

Overview

This Geeklog plugin provides Private Messaging Functionality for your site members. New messages are received into your inbox and users are sent a email notification to alert them. User can optionally set their preferences to disable notifications. Site Administrators can also send out a broadcast message using the plugin.

Summary of features:

  • Enables site members to easily send other site members messages
  • Integrates seamlessly with the Forum Plugin to provide a 1-click feature to contact the posting member
  • Provides an online Smilie adminitration feature for the site admin which is also intergrated with the Forum plugin so you can easily extend and personalize the smilies emoticons available for private messages and forum posts
  • Online Budddy Admin tool so members can easily contact their favorite site members
  • Ability to archive messages and view messages sent to other site members
  • Site Admin can send out a broadcast private message but also members can enable the option to block broadcast messages
  • Integration with your member account profile

Sending a Private Message

newpm.jpg

Plugin Installation

  • Step 1 - Restore the plugin Archive

Uncompress the archive files into your <geeklog_dir>/plugins directory. It will create a messenger subdirectory for the files.

  • Step 2 - Create the required plugin directories for the program files

Create a directory called messenger under your public_html/admin/plugins directory Create a directory called messenger under your public_html directory

  • Step 3 - Copy the the required plugin files

You will be copying the files from the restored plugin files to the new directories you just created. Copy the files (contents) from the new plugin’s admin directory to the messenger directory you just created under your sites main public_html/admin/plugins directory Copy the files (contents) from the new plugin’s public_html directory to the messenger directory you just created under your sites main public_html directory

  • Step 4 - Copy the the required theme files

Copy the directory called messenger and contents from the new plugin’s themefiles directory to your sites theme’s directory. Assuming your site is running the professional theme this would be public_html/layout/professional directory where you would copy the messenger template theme files - creating the new messenger folder under public_html/layout/professional

  • Step 5 - Update your theme’s style.css file

Add the css styles from the file additional-messenger.css that is located under the plugin archive themefiles directory. Add the new styles to the end of your site theme’s style.css file. Assuming your site is running the professional theme this would be public_html/layout/professional/style.cssfile.

  • Step 6 - Install the smilie images

The Plugin Install will create a default definition for twenty-five (25) smilie or emoticon definitions. You will need to copy the smilie images that have been provided with the plugin archive to your public_html/images directory. Copy the directory called smilies and contents from the new plugin’s directory to your sites public_html/images directory.

  • Step 7 - Update or copy the lib-portalparts.php file

The plugins from portalparts use a number of common functions that are placed in the lib-portalparts.php file. Copy the file from the plugin archive to your system folder where there are other lib-xxxxx.php files

  • Step 8 - Run the plugin install

Logged in as ‘admin’ you can access the installer from the plugin editor [admin → plugins] If the files have been copied correctly in step 2 and 3, you will see the new plugin to be installed

  • Congratulations - The plugin is now installed and you should see Private Messages link in the users menu block
    • Review the plugin config.php settings

Upgrading the plugin

There are no database changes from earlier versions - just program file and template changes

  • Step 1 - Restore the plugin Archive
    • Before restoring the archive, you may want to backup or rename the plugins config.php so it is not over-written. You can then compare it after the update and re-apply your personal settings if you have changed them from the defaults
    • Uncompress the archive files into your <geeklog_dir>/plugins directory. You will need to replace all the files
  • Step 2 - Restore the plugin Archive
    • Suggest you delete current files and copy over the new files
    • Update all your sites main public_html/messenger files.
    • Update all your sites main public_html/admin/plugins/messenger files.
    • Update all your sites main public_html/layout/{theme}/messenger files.
  • Step 3 - Update or copy the lib-portalparts.php file
    • The plugins from portalparts use a number of common functions that are placed in the lib-portalparts.php file. Copy the file from the plugin archive to your system folder where there are other lib-xxxxx.php files
  • Step 4 - Run the plugin update
    • Access the plugin update from the Plugin Editor. The plugin listing will show version 1.x is installed and that an update is recommended. Using the Edit link by the plugin record, access the edit screen where there will now be an update button. Pressing [Update] will update the plugin to the latest version
  • Congratulations - The plugin is now updated
    • Review the plugins config.php settings

Extending the User Preferences

The plugin provides user preference options so the user can control the automatic email notifications sent out by the plugin when you receive a new private message (PM) . By default, all users that are sent a PM will receive a email notification and this includes broadcast messages. Users may not want to receive email notifications and these settings provide your users options to control the notification settings.

privacyprefs.jpg

The options are:

  • Disable email notifications for Broadcast Messages sent by the site administrator
  • Enable email notifications for new messages (default is enabled)
  • Other plugins can optionally be setup to check this option and send you a PM vs a email notification. The Forum plugin does this for example and lets you consolidate your notifications.

GL 1.4.1 Based Theme Changes

These directions are for a GL 1.4.1+ based theme where the User Account settings and Account Preferences were combined into a single My Account page. The settings will be added to the Privacy tab.

There are two steps

  • Update the preferences\privacyblock.thtml
  • Applying a 1 line fix to the file usersettings.php

Step 1

Using the default professional theme as our example, modify the layout\professional\preferences\privacyblock.thtml template file. You will be adding three new rows to the table in the template.

  • Note: An updated copy of the template is included in the archive under the themefiles\preferences folder

{lang_privacy_title}

{lang_privacy_help_title}

{lang_privacy_help}
   {lang_messengerhelp1}
  {lang_messengerhelp2}
  {lang_messengerhelp3}

Step 2

You now need to make one fix to a core GL program - this code change will not be required in GL versions after GL 1.4.1 and was only noticed after trying to apply these changes. No other plugin at this time that I am aware provides optional user privacy settings. Anyway you need to make one (1) small change to the program file usersettings.php located under your sites public_html folder (webroot folder). At approx line 571 in the file usersettings.php add the following line

    PLG_profileVariablesEdit ($_USER['uid'], $preferences);

Just above the following line

    $preferences->parse ('privacy_block', 'privacy', true);

If you do not make these changes, the labels for the new options will not appear. You can always hard code the labels in the template instead of using the {variables} in the template.

Extending Pre GL-1.4.1 Themes

Themes which have not been updated for GL 1.4.1 will use a single template for the user preferences. You can add the new options to the preferences\profile.thtml file.

Add the three new rows to the profile template file - recommended location is after the BIO or PGP related rows. Just make sure they are placed inside the table like the other rows.

   {lang_messengerhelp1}
  {lang_messengerhelp2}
  {lang_messengerhelp3}
{lang_membersince}: {user_regdate}
{LANG_favorites} {favorites_link}