Wiki

Clone wiki

q2a-profile-customizer-public / Home

PC - Profile Customizer

Table of contents:

Description

PC is a Question2Answer plugin that allows the customization of the profile page by adding additional features not present in the core.

Features

  • Display a reputation graph
    • Shows the points and the events that generated point changes
    • Allows hiding votes given to other users
    • Allows customizing amount of days to display
    • Provides RTL graph support
  • Display when the user was last seen, i.e., when the user has last accessed the site
  • Display the amount of total visits to the site and the latest consecutive ones
  • Display a field with the total profile views the user has received
  • Display the amount of helpful flags the user has submitted
  • Automatically assign points for helpful flags
  • Display a field with the age of the user, taken from a customizable field in the account section
  • Any user is able to add a custom donation link to their profile
  • Ability to hide fields of the profile and account sections (e.g.: hiding the Type or Extra privileges fields)
  • Admin can reorder the sections in the user profile (Profile information, Activity, Wall and the Points Chart section)
  • Full internationalization support: Every piece of text the plugin uses can be customized. Spanish translation included
  • CSS customization of the delete as helpful button and image: It is possible to change the button so that it looks similar to the other action buttons. A separate CSS file is provided to do so with a sample image
  • Almost all HTML is output by means of a simple template system
  • Very simple installation
  • Upgrade system support: The plugin will be able to properly upgrade from previous versions. If you're updating from v1.x make sure to initialize the database again

Requirements

  • Q2A core version 1.7.*, 1.8.*

Limitations

  • This plugin does not support external users, including WordPress
  • Changes to CSS might be required depending on the theme. Some CSS changes for popular open source themes are already included in the Theme hacks section. Take a close look at it before buying the plugin

Installation steps

  1. Copy the pupi-pc and the pupi-pr directories into the qa-plugin directory (replace any already existing directory).
  2. If you are using a Q2A core version greater or equal to 1.8.*, then navigate to admin/plugins and enable the Profile Customizer and the Point Recalculator plugins.
  3. Perform a database initialization by navigating to admin/plugins and following the steps, if prompted.

Sample usage and screenshots

The motivation of this plugin is to encourage users to be active, visit the site often and help the admins by properly flagging posts.

A sample user profile page using the Snow Flat theme looks like this:

User profile section

This is what the admin section looks like:

Admin section

Admin section

These are the plugin settings and a description of each of them.

  • Plugin enabled: Enables or disabled the plugin.

  • Visits count feature enabled: Controls whether counting the users visits should take place and be displayed in the user profile section. Visits are counted once per day. It is possible to display the total amount of unique days the user has visited the site and the total amount of unique and consecutive days the user has visited the site up to their last visit. What information is displayed can be controlled through the language file

  • Last seen feature enabled: Controls whether users' last access to the site should be tracked and displayed in the user profile section. Each time the users access the site, the date and time in which that happens is saved. If this setting is enabled, when looking at a user's profile, the last seen field will display how much time has passed since the latest user's visit. If a user has never been to the site since the plugin was installed then this field will not be displayed.

  • Last seen minimal update: Allows the configuration of how often the last seen feature data should be stored in the database. For instance, if this setting is configured as 15 minutes and then the user accesses the site the information is updated. Then, if 5 minutes pass and the user acceses the site again the database is not updated as the 15 minute window from the last update has not passed yet. The intention of this field is not to overload the database with too many updates. Running a database update once each 15 minutes per user is considerably relaxed and should not affect the performance at all. The only drawback of long time windows is that the field is less frequently updated which might result in the field stating the user has been seen 14 minutes ago even if the user is navigating the site in that moment. It all depends on how fresh is the data needed.

  • Profile views feature enabled: Controls whether counting unique profile views should be enabled and displayed in the user profile section. Profile views are incremented in a similar way as questions view counts are.

  • Helpful flags enabled: Controls whether it will be possible for the admin to mark flags as helpful as well as the display of the amount of those flags in the user profile page. The helpful flags feature tackles the issue that users who properly flag posts do not get any karma from doing so. The core allows to automatically hide posts after a certain amount of flags are assigned to it and also it allows to manually hide them.

    However, when an admin deletes the hidden post it also takes with it who have flagged it. This feature displays the admin a new button in the question view page and in the admin/hidden section which allows them to assign a helpful flag to the users who have flagged that post before deleting them. This button will only be displayed when the post can be deleted and when it also has at least one flag. Note it will still be possible to perform the usual deletion of the post.

    Here is a screenshot of the question view for a flagged and hidden question that can be deleted. In this case, the delete as helpful button is displayed.

    Question that can be deleted as helpful

    Here is a screenshot of the admin/hidden section which is used to delete all posts. Note it is not possible to add the delete button in an answer or in a comment in the question view. However, those two types of posts can be deleted as helpful from the admin/hidden menu, as can be seen in this screenshot:

    Hidden posts list

    As it is expected, whenever more than one user flags a post that is deleted as helpful, all the flagging users get their helpful flags incremented. After that, the post is deleted as usual.

    Note the only thing that modifies the look and feel of the plugin is the green trash bin. It will look that way on the Snow Flat theme but might look differently in other themes. If it doesn't look good in your theme you can remove it by removing the pupi_pc_styles.css file or you can edit it to look the way you want, if you know some basic CSS.

  • Points per helpful flag: Amount of points a user earns when their helpful flag count is incremented. It can be set to zero. After changing this value it is needed to recalculate points by means of the Point Recalculator plugin.

  • Reputation chart enabled: Controls whether the reputation chart is displayed or not. This chart displays the latest reputation changes from a user per day. For each day, a detail of those changes are displayed as a tooltip which contains the amount of reputation involved in the event, the event itself and the post associated to it. Here is an example of that tooltip:

    Reputation chart tooltip

    As themes handle how the UI is created, the display of this chart differs from theme to theme. You can see the supported themes list with the appropriate CSS changes in the Theme hacks section. Of course, you can also adapt any custom theme yourself if you know CSS.

    Actions that trigger point changes can only be saved (for later use in the chart) at the time they happen. This setting also controls whether those actions should be saved or not. If a point change is triggered (for example, the result of an upvote) and this setting is disabled, the total points change will happen in the core but the graph will not display the point change event ever. This also means that all the point changes history (triggered by votes, posts, answer selections, etc) that had been generated when this checkbox was disabled (including when the plugin was not yet installed) will not be displayed in the graph ever as that information is already lost. Note missing information does not affect at all the existing information.

    Changing the amount of points per action (upvoting, posting, selecting an answer, etc) in the core will result in the graph properly displaying the points. This means the plugin is smart enough to adapt to the new point changes.

    The library used to display the chart is fetched from a CDN. If you want to add it locally, you can download it from here. Just make sure you name the file charts.js and place it in the resources directory.

    In order to make the chart RTL look for file pupi_pc_profile.js and replace both opposite: false with opposite: true.

    • Amount of days back to show in the chart: This is the amount of days that the chart will display. There is no limit set to this value but the higher it is, the smaller the columns will be

    • Show to other users reputation earned by voting: Controls whether reputation earned by giving upvotes and downvotes is displayed. Note that reputation earned or lost by receiving upvotes or downvotes will always be displayed. This setting helps to avoid the situation in which users see in other users' profiles downvotes or upvotes to posts they own.

      Consider the following scenario. User A posts a question. User B answers it. User A downvotes the answer of user B. User B sees in user A's profile that he had performed a dowvote to user's B answer. User B decides to downvote the question in a way of taking revenge. This setting would not allow user B to see the downvote user A performed to user B's answer.

  • Date of birth (age) enabled: The core allows admins to add extra fields that are displayed in the user profile (e.g.: website, location, etc). However, this fields do not allow for any kind of calculation, i.e., they are displayed the same way the user enters them. So if the admin wants to add a date of birth field then it will be displayed as such when the user inputs the field in the account or registration pages and when the user's profile is displayed.

    This feature, allows the admin to make one of the user fields to be considered as a date when being input in the account or registration pages, and to be calculated as an age when being displayed in the profile page. So in order to do so it is necessary to:

    1. Create a user field using the existent features in the core by navigating to the admin/users page. Make sure the Content type is set to Single line of text. Take into account that this field will be displayed in the account and registration pages with the label you set in here so chose something like Date of birth instead of Age
    2. Go to the plugin options and set the User field used to hold the date of birth setting to the field created in the previous step
    3. Optionally configure what you want the year, month and date placeholders to be for your language by modifying the language files under the lang directory

    In the following screenshot it is displayed the result of performing the previous steps and navigating to the account page:

    Account page with the date of birth feature enabled

    The next screenshot shows the profile page after setting a date to the date of birth field in the account page. The Date of birth label is turned into an Age label, which can be customized in the language files. Then, instead of showing the value the user input in the account page it displays the age of the user:

    Profile page with the date of birth feature enabled

    • User field used to hold the date of birth: Controls which user field will be used to calculate the age of the user. It must have been already created as stated in the explanation of the Date of birth (age) enabled setting.
  • Donate link enabled: In a similar way to how the Date of birth (age) enabled field works, this donate link allows users to configure a donation link in their profile. The text of the link they enter when editing their profiles will be turned into an image with a link when displaying their profile. This means users will edit their profile in this way:

    Account page with the donate link feature enabled

    The next screenshot shows the profile page after setting a link to the donate link field in the account page. The Donate link label is turned into a Say thanks label, which can be customized in the language files. Then, instead of showing the value the user input in the account page it displays an an image with a link:

    Profile page with the donate link feature enabled

    Note the image can be customized too. The screenshot just shows the default one. In order to change it, just change the image located in resources/donate-button.png.

    In order to setup this field it is needed to:

    1. Create a user field using the existent features in the core by navigating to the admin/users page. Make sure the Content type is set to Single line of text. Take into account that this field will be displayed in the account and registration pages with the label you set in here so chose something like Donate link instead of Say thanks
    2. Go to the plugin options and set the User field used to hold the donate link setting to the field created in the previous step

    Bear in mind this setting does not interact with PayPal or any payment system at all. It just displays a link in a nicer (and more tempting to click) way. You can find more information on how to create these links (provided your payment system supports them) on your payment system documentation. This is a sample of a PayPal donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Y7LUM6ML4UV9L

    • User field used to hold the donate link: Controls which user field will be used to enter the donate link. It must have been already created as stated in the explanation of the Donate link enabled setting.
  • Show <field>: All of these checkboxes control whether the corresponding fields are displayed in the profile or account page. It's worth mentioning that the fields are not just hidden using CSS but rather they are not sent to the user in the HTTP response.

  • Show user type field in profile page: This checkbox behaves a bit differently than the others as the Type also contains a link to send private messages in the same field, if private messaging is enabled. So if private messaging is disabled unchecking this checkbox hides the whole field. However, if private messaging is enabled, this checkbox only removes the user type and leaves the send private message link intact. It is also possible to change the label from the language file when this checkbox is disabled and private messaging is enabled so that instead of being displayed as Type it can be displayed as something else, like Messaging.

  • Show wall in profile page: This checkbox requires a small clarification. The wall submenu item is always displayed. This checkbox only controls whether the small wall is displayed in the user profile page.

  • Do not hide information from these user levels: Controls which user levels will always see all the fields that the checkboxes hide. If it is set to Administrators they will be the only ones who will see all fields while the rest of the users will not see the hidden ones. This also controls which user levels can see the votes hidden by the Show to other users reputation earned by voting setting.

  • Section order in profile enabled: The user profile has the Profile information, Activity and Wall sections. The core outputs them in a secuential order (3 consecutive HTML divs). Then, some themes leave them in that one column secuential order, others create a 2-column layout by moving the Profile information section to the left and other perform even more advanced changes.

    This setting changes the order in which the HTML divs of the sections (including the Points chart) is output. The result of performing these changes heavily depends on each theme. Usually, the best results will be for the one column themes but, in general, minor and custom CSS changes might be needed to be performed.

    So there is no guarantee that this feature will work for your theme nor what the output will be. For example, for two column themes they might only take into consideration changing the column in the right, but the one in the left will remain fixed.

    If the output is not the expected one this option should be disabled.

Point Recalculator

This plugin is shipped with the Point Recalculator plugin. This is a support plugin that you should only use under any of these circumstances:

  • You have recalculated points in the admin/stats section
  • You changed the Points per helpful flag setting
  • You are upgrading from version 2.1.5 to 3.0.0 (in this case remember to first set the value for the Points per helpful flag setting and then recalculate the points)

Recalculating points this way will make sure all users have the points properly set.

Uninstall

If you need to uninstall this plugin all you need to do is:

  1. Remove the pupi-pc and the pupi-pr directories (unless the pupi-pr is needed by another plugin)
  2. Drop all tables starting with the ^pupi_pc_ prefix where ^ stands for your Q2A config.php settings (which is qa_ by default)
  3. Remove all rows from the ^options table that start with pupi_pc_

Support

Technical support must all go through the issues section on this site and be in English.

  • Bugs: if you find a bug or error in the plugin, create a bug issue detailing the steps needed to be performed in order to reproduce the issue. Provide the steps from scratch, i.e., starting just after a clean Q2A setup. Attaching screenshots might be useful too. Also include your PHP, MySQL, Q2A and plugin versions. Make sure you have no other plugin in the qa-plugin directory while reproducing it and that you are using the default Q2A theme.
  • New features: feel free to request features using the issues section. Select the enhancement kind in the combobox and explain in detail the feature and why you consider it would be useful to others.
  • Questions and other technical support: create a task issue explaining the situation in detail.

Administrative (all non-technical) issues should go through private message to my profile in the Q2A site. Make sure to provide your email address.

FAQ

  • Do you give refunds in case I end up not liking the plugin?

    No. The reason for this is that not only this wiki is quite descriptive but also the plugin can be seen and interacted with live in the demo site. You can fully test the plugin before buying so there are no refunds.

  • Will this plugin work in my theme?

    This is impossible to tell. If your theme only modifies CSS, moset likely, it will. However, you might need to make this plugin's CSS match your theme. No support will be given on that. This plugin works well with the SnowFlat theme released with Q2A 1.8.0.

  • Do the point changes affect in any way the ability to use bonus points?

    No. Bonus points can be used normally.

  • Are bug fixes charged separately?

    No. Bug fixes are already included in the price. New features, however, might not be free.

  • Would you mind doing some customizations to this plugin?

    Sure. Feel free to get in touch as explained in the Support section.

Get the plugin

Click here to navigate to the main plugin page. From there, you will be able to buy the plugin.

Updated