User Control Panel ( User CP ) V3.0

Started by Alan S, April 28, 2007, 12:59:54 PM

Previous topic - Next topic

Alan S

Link To Mod

SMF 2.0 support Added

This mod replaces the current profile screen with a more colourful User Control Panel , It makes it easier to navigate around the profile options and provides a way to contact the admin via email.

UserCP V3.0 Released
UserCP V3.0 is for SMF2.0 Beta4 Only!!

********************
UserCP V3.0
Created By Alan S
30/10/08
********************
V3.0 is the next step for the UserCP

It includes all the features of 2.0 with a few major changes.

The UserCP is now created using a array so the buttons are layed out depending on your forum permissions. This also makes it easier to manualy add
new buttons should the 4 preset ones be used.

The way the copyright and the error pages are displayed have been completely rewritten.

See the Admin Panel ( Admin -> Configuration -> Modifications -> UserCP ) for more options that have been added.


  • UserCP now uses its own language file
  • Buttons are now built from an Array based on User permissions.
  • Added admin contact email field
  • Ability to choose which buttons are displayed by default regardless of permissions
  • Added copyright and error message functions
  • Fixed undefined index errors from v2.2

Big thanks to Kindred for the coding for the arrays.
   
 
Please Note , This Mod Could Cause Errors on Install On ModSettings.php , If It Does , Manualy Add the Code by following instructions at end of page.

Mod should work with versions 1.0.7 and above it has only been tested on 1.1 -> 1.1.4 however

SMF 2.0 users use the package UserCPv2.2

UserCP V2.0.1 users please run the UserCPV2.1QuickSearchFix_SMF2.X_Only.zip package to fix the Quick Search Bug


Bugs can be emailed to alanscomputergenius[at]gmail[dot]com

Changelog

*********************************
V1.1 - Initial Release 23/Feb/07
*********************************
V1.2

- Fixed installation errors on index.template
- Cleaned up instalation code
- Fixed bug on menu which ment the usercp tab was not highlighted when in usercp.
*********************************
V1.3

- Added 1.1.4 Compatibility
- Added fix for bug which sometimes caused 403 errors.

*********************************

V1.4 14/Dec/07

- Added "Delete My Account" option to the interface.
- Removed unwanted variables from the template
- Cleaned up code
- Added comments to make it easier to find the different parts of the usercp in the file.
- Added a proper guest error page

********************************

V2.0

- Added Admin Interface
- Added Ability to Enable/Disable User CP
- Added Ability to Disable Contacting Of Admin
- Added Ability to choose to use pm or email to contact admin
- Added Admin option to let users to switch to standard profile view
- Added 4 Customisable UserCP fields ( Use own icons/text/links )
- Added If UserCP is disabled , The Menu Button for the UserCp will automaticaly change back to profile.
- Edited Error Page For Guests
- Added User ID feature for admins ( Find out your UserID , Need for using admin pm contact option )
- Removed Unwanted Commenting Code + Added Code Explaination Comments
- Added Support For UTF8 ( English on Install )

********************************

********************
UserCP V2.0.1
Created By Alan S
13/7/08
********************
UserCP V2.0.1 is for SMF 2.0 Beta releases ONLY

No feature changes took place in 2.1 except added compatibility for SMF 2.X , Also a few template tweaks were made

DO NOT INSTALL THIS PACKAGE ON SMF 1.X forums!

********************
UserCP V2.0.2
Created By Alan S
19/8/08
********************
UserCP V2.0.2 is for SMF 2.0 Beta releases ONLY

This version fixs a bug from v2.0.1 that breaks the quick search function

DO NOT INSTALL THIS PACKAGE ON SMF 1.X forums!


********************

Upgrade Package for 1.4 -> 2.0 added + Fresh 2.0 install
Want To Translate?

If you want to translate into another language feel free to do so , The english language strings are below.

$txt['usercp'] = 'User CP';
$txt['usercp_account_info'] = 'My Account Information';
$txt['usercp_account_info_summary'] = 'Click here if you want to change your account related information such as username, email, password or other sensitive details.';
$txt['usercp_look_and_layout'] = 'Look & Layout Options';
$txt['usercp_look_and_layout_summary'] = 'Click here to change the way the forum looks for you, options include the look and layout for the boards and posts.';
$txt['usercp_my_theme'] = 'My Theme';
$txt['usercp_my_theme_summary'] = 'This screen will allow you to set your default theme which you wish to use every time you login.';
$txt['usercp_my_profile'] = 'My Profile';
$txt['usercp_my_profile_summary'] = 'Click here to change the way your profile looks and appears to everyone.';
$txt['usercp_my_stats'] = 'My Stats';
$txt['usercp_my_stats_summary'] = 'Here you can check how many posts you have made and other activity related info.';
$txt['usercp_my_posts'] = 'My Posts';
$txt['usercp_my_posts_summary'] = 'This option will show you all the posts you have made since you became a member of this site.';
$txt['usercp_my_notifications'] = 'My Notifications';
$txt['usercp_my_notifications_summary'] = 'This screen will allow you to change the type and frequency of notifications you get via e-mail when participating in threads.';
$txt['usercp_buddies'] = 'Buddies';
$txt['usercp_buddies_summary'] = 'This screen will allow you to select buddies to add to your list.';
$txt['usercp_message_options'] = 'My Message Options';
$txt['usercp_message_options_summary'] = 'This screen will allow you to set your preferences for PMs received on the board and also allow you to ignore people you do not wish to receive PMs from.';
$txt['usercp_search'] = 'Search';
$txt['usercp_search_summary'] = 'This screen will allow you to search for posts made in the board.';
$txt['usercp_contact_admin'] = 'Contact Admin';
$txt['usercp_contact_admin_summary'] = 'Confused? or have a quirey? Contact the admin at this screen';
$txt['usercp_guest'] = 'Sorry Guest , You are not allowed to access the User CP , Please';
$txt['usercp_login'] = 'Login';
$txt['usercp_or'] = 'or';
$txt['usercp_register'] = 'Register';
$txt['usercp_copyright'] = 'User Cp V2.0 | Created By Alan S';
$txt['usercp_welcome'] = 'Welcome ';
$txt['usercp_delete_account'] = 'Delete My Account';
$txt['usercp_delete_account_summary'] = 'Tired of the site? Use this option to delete your member account.';
$txt['usercp_error'] = 'Error!';
$txt['usercp_enable'] = 'Enable User Control Panel';
$txt['usercp_disabled'] = 'User Control Panel Disabled';
$txt['usercp_clickhere'] = 'Click Here To Go To The ';
$txt['usercp_profile'] = 'Profile Screen';
$txt['usercp_field1image'] = 'Custom UserCP Field 1 Image';
$txt['usercp_field1url'] = 'URL';
$txt['usercp_field1maintext'] = 'Main Text ( eg. My Posts )';
$txt['usercp_field1summary'] = 'Summary Text';
$txt['usercp_field1enable'] = 'Enable 1st Custom UserCP Field';
$txt['usercp_field2image'] = 'Custom UserCP Field 2 Image';
$txt['usercp_field2url'] = 'URL';
$txt['usercp_field2maintext'] = 'Main Text ( eg. My Posts )';
$txt['usercp_field2summary'] = 'Summary Text';
$txt['usercp_field2enable'] = 'Enable 2nd Custom UserCP Field';
$txt['usercp_field3image'] = 'Custom UserCP Field 3 Image';
$txt['usercp_field3url'] = 'URL';
$txt['usercp_field3maintext'] = 'Main Text ( eg. My Posts )';
$txt['usercp_field3summary'] = 'Summary Text';
$txt['usercp_field3enable'] = 'Enable 3rd Custom UserCP Field';
$txt['usercp_field4image'] = 'Custom UserCP Field 4 Image';
$txt['usercp_field4url'] = 'URL';
$txt['usercp_field4maintext'] = 'Main Text ( eg. My Posts )';
$txt['usercp_field4summary'] = 'Summary Text';
$txt['usercp_field4enable'] = 'Enable 4th Custom UserCP Field';
$txt['usercp_usepm'] = 'Use PM instead of email to contact admin';
$txt['usercp_adminid'] = 'Enter id of Admin here ( Look at a link in your profile to find it , ?action=profile;u=x )';
$txt['usercp_switchview'] = 'Allow users to switch to standard profile view';
$txt['usercp_enablecontactadmin'] = 'Enable Contacting Of Admin Via UserCP';



Language For the SMF2.0 Version


$txt['usercp'] = 'User CP';
$txt['usercp_account_info'] = 'My Account Information';
$txt['usercp_account_info_summary'] = 'Click here if you want to change your account related information such as username, email, password or other sensitive details.';
$txt['usercp_look_and_layout'] = 'Look & Layout Options';
$txt['usercp_look_and_layout_summary'] = 'Click here to change the way the forum looks for you, options include the look and layout for the boards and posts.';
$txt['usercp_my_theme'] = 'My Theme';
$txt['usercp_my_theme_summary'] = 'This screen will allow you to set your default theme which you wish to use every time you login.';
$txt['usercp_my_profile'] = 'My Profile';
$txt['usercp_my_profile_summary'] = 'Click here to change the way your profile looks and appears to everyone.';
$txt['usercp_my_stats'] = 'My Stats';
$txt['usercp_my_stats_summary'] = 'Here you can check how many posts you have made and other activity related info.';
$txt['usercp_my_posts'] = 'My Posts';
$txt['usercp_my_posts_summary'] = 'This option will show you all the posts you have made since you became a member of this site.';
$txt['usercp_my_notifications'] = 'My Notifications';
$txt['usercp_my_notifications_summary'] = 'This screen will allow you to change the type and frequency of notifications you get via e-mail when participating in threads.';
$txt['usercp_buddies'] = 'Buddies';
$txt['usercp_buddies_summary'] = 'This screen will allow you to select buddies to add to your list.';
$txt['usercp_message_options'] = 'My Message Options';
$txt['usercp_message_options_summary'] = 'This screen will allow you to set your preferences for PMs received on the board and also allow you to ignore people you do not wish to receive PMs from.';
$txt['usercp_search'] = 'Search';
$txt['usercp_search_summary'] = 'This screen will allow you to search for posts made in the board.';
$txt['usercp_contact_admin'] = 'Contact Admin';
$txt['usercp_contact_admin_summary'] = 'Confused? or have a quirey? Contact the admin at this screen';
$txt['usercp_guest'] = 'Sorry Guest , You are not allowed to access the User CP , Please';
$txt['usercp_login'] = 'Login';
$txt['usercp_or'] = 'or';
$txt['usercp_register'] = 'Register';
$txt['usercp_copyright'] = 'User Cp V2.0.1 | Created By Alan S';
$txt['usercp_welcome'] = 'Welcome ';
$txt['usercp_delete_account'] = 'Delete My Account';
$txt['usercp_delete_account_summary'] = 'Tired of the site? Use this option to delete your member account.';
$txt['usercp_error'] = 'Error!';
$txt['usercp_enable'] = 'Enable User Control Panel';
$txt['usercp_disabled'] = 'User Control Panel Disabled';
$txt['usercp_clickhere'] = 'Click Here To Go To The ';
$txt['usercp_profile'] = 'Profile Screen';
$txt['usercp_field1image'] = 'Custom UserCP Field 1 Image';
$txt['usercp_field1url'] = 'URL';
$txt['usercp_field1maintext'] = 'Main Text ( eg. My Posts )';
$txt['usercp_field1summary'] = 'Summary Text';
$txt['usercp_field1enable'] = 'Enable 1st Custom UserCP Field';
$txt['usercp_field2image'] = 'Custom UserCP Field 2 Image';
$txt['usercp_field2url'] = 'URL';
$txt['usercp_field2maintext'] = 'Main Text ( eg. My Posts )';
$txt['usercp_field2summary'] = 'Summary Text';
$txt['usercp_field2enable'] = 'Enable 2nd Custom UserCP Field';
$txt['usercp_field3image'] = 'Custom UserCP Field 3 Image';
$txt['usercp_field3url'] = 'URL';
$txt['usercp_field3maintext'] = 'Main Text ( eg. My Posts )';
$txt['usercp_field3summary'] = 'Summary Text';
$txt['usercp_field3enable'] = 'Enable 3rd Custom UserCP Field';
$txt['usercp_field4image'] = 'Custom UserCP Field 4 Image';
$txt['usercp_field4url'] = 'URL';
$txt['usercp_field4maintext'] = 'Main Text ( eg. My Posts )';
$txt['usercp_field4summary'] = 'Summary Text';
$txt['usercp_field4enable'] = 'Enable 4th Custom UserCP Field';
$txt['usercp_usepm'] = 'Use PM instead of email to contact admin';
$txt['usercp_adminid'] = 'Enter id of Admin here ( Look at a link in your profile to find it , ?action=profile;u=x )';
$txt['usercp_switchview'] = 'Allow users to switch to standard profile view';
$txt['usercp_enablecontactadmin'] = 'Enable Contacting Of Admin Via UserCP';



Translated Language Files

UserCP v2.0 SMF 1.X Sweedish Translation By MTF95

UserCP V2.1 SMF 2.X  Serbian Translation AlenNS

Since V2.0 came out a good deal of new language strings were added making the old translations partly useless , If people want to retranslate them again , just post them and i will add them to this post.

To add the new language strings , Copy the text strings from above and paste them into the /Themes/default/languages/modifications.yourlanguage.php

Useful Links

How to change the background colour of the UserCP
How to change the colours of the links in the UserCP
How to get the UserCp to work on different themes
How to add a custom section to the UserCP ( for V1.X only )
How to add a custom section to the UserCP ( V2.X only )

Please note as of version 2.0 you can add custom sections via the admin panel , However you will have to use the manual method above if you want to use variables in the links such as $ID_Member or $scripturl.
Quote from: Eliana Tamerin on August 23, 2008, 04:10:10 PM
SMF 7 is where it gets good. That has time travel. You can go back and post before the guy who flamed you. :P

RoarinRow


SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

wilsy

Hi Alan,

I have had this installed on my forum for a while now - thanks to yourself and Aku and I can highly recommend this mod.

My members absolutely love it!  ;)

Regards,

Wilsy.



Busy RewindBikers offered to Good Home! 1000+ members, loads of mods, SMF Gallery PRO, TinyPortal installed with great use of blocks, ultimate profiles, PAID SUBSCRIPTIONS (works flawlessly), great theme, 1,500 posts per month - PM or email me if interested.

rosiem


N3lson

Where it syas
<file name="$themedir/index.template.php">
   <operation>
      <search position="after"><![CDATA[if ($context['current_action'] == 'search2')]]></search>
        <add><![CDATA[if ($context['current_action'] == 'usercp')
$current_action = 'usercp';
      ]]></add>


that should´nt be ?
<file name="$themedir/index.template.php">
   <operation>
      <search position="after"><![CDATA[$current_action = 'search';]]></search>
        <add><![CDATA[if ($context['current_action'] == 'usercp')
$current_action = 'usercp';
      ]]></add>


Nice MOD
I´m Portuguese Yeah

sessus

QuoteExecute Modification     ./Themes/default/index.template.php     Test failed

Anyone else gets that?

Alan S

#6
Quote from: N3lson on April 29, 2007, 12:47:17 AM
Where it syas
<file name="$themedir/index.template.php">
   <operation>
      <search position="after"><![CDATA[if ($context['current_action'] == 'search2')]]></search>
        <add><![CDATA[if ($context['current_action'] == 'usercp')
$current_action = 'usercp';
      ]]></add>


that should´nt be ?
<file name="$themedir/index.template.php">
   <operation>
      <search position="after"><![CDATA[$current_action = 'search';]]></search>
        <add><![CDATA[if ($context['current_action'] == 'usercp')
$current_action = 'usercp';
      ]]></add>


Nice MOD

No it the code given in the modification.xml is correct , Its actualy $current_action =='search2' , You can use both ?action=search and ?action=search2  , but in the index.template.php it is down as search2.
Thanks for the quirey though!.

Quote from: sessus on April 29, 2007, 07:45:00 AM
QuoteExecute Modification     ./Themes/default/index.template.php     Test failed

Anyone else gets that?

@ Sessus , What other mods do you have installed?
Quote from: Eliana Tamerin on August 23, 2008, 04:10:10 PM
SMF 7 is where it gets good. That has time travel. You can go back and post before the guy who flamed you. :P

the lion

i have a sm1.1.1 board and i have instal 1.1.2 to my computer
how to instal it to my board ?
the link o my board:
osamajo.smfhost.com

Alan S

Quote from: the lion on April 29, 2007, 08:36:44 AM
i have a sm1.1.1 board and i have instal 1.1.2 to my computer
how to instal it to my board ?
the link o my board:
osamajo.smfhost.com
Quote from: the lion on April 29, 2007, 08:36:44 AM
i have a sm1.1.1 board and i have instal 1.1.2 to my computer
how to instal it to my board ?
the link o my board:
osamajo.smfhost.com

Download The Package From Here

Then go to the forum admin panel  -> Packages -> Download packages

Upload the usercp zip file and then apply the package.
Quote from: Eliana Tamerin on August 23, 2008, 04:10:10 PM
SMF 7 is where it gets good. That has time travel. You can go back and post before the guy who flamed you. :P

tallpaul

#9
do love this mod
anyone know what to change to make it work on other themes?

<!--  Edit a specific file..
  -->
- <file name="$boarddir/index.php" error="fatal">
- <!--  A seach operation, with search rules and code to modify the file with.
  -->
- <operation error="fatal">
- <!--  Search for this text before the code we add.  You can also search for after, and the end of the file.
  -->
- <search position="after" regexp="false" whitespace="exact">
- <![CDATA[ 'activate' => array('Register.php', 'Activate'),
  ]]>
  </search>
- <!--  Add this text when we find it.  Note that it's on it's own line on purpose, and the CDATA keeps things clean.
  -->
- <add>
- <![CDATA[ 'usercp' => array('usercp.php', 'usercp'),
  ]]>
  </add>
  </operation>
  </file>
- <file name="$themedir/index.template.php" error="fatal">
- <operation error="fatal">
- <search position="after" regexp="false" whitespace="exact">
- <![CDATA[ if ($context['current_action'] == 'search2')
  ]]>
  </search>
- <add>
- <![CDATA[ if ($context['current_action'] == 'usercp')
      $current_action = 'usercp';
     
  ]]>
  </add>
  </operation>
- <operation error="fatal">
- <search position="replace" regexp="false" whitespace="exact">
- <![CDATA[ if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
  ]]>
  </search>
- <add>
- <![CDATA[ if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'usercp', 'mlist', 'register', 'login', 'help', 'pm')))
     
  ]]>
  </add>
  </operation>
- <operation error="fatal">
- <search position="replace" regexp="false" whitespace="exact">
- <![CDATA[ <a href="', $scripturl, '?action=profile">' , $txt[79] , '</a>
  ]]>
  </search>
- <add>
- <![CDATA[ <a href="', $scripturl, '?action=usercp">' , $txt['usercp'] , '</a>
     
  ]]>
  </add>
  </operation>
  </file>
- <file name="$themedir/languages/Modifications.english.php" error="fatal">
- <operation error="fatal">
- <search position="after" regexp="false" whitespace="exact">
- <![CDATA[ ?>
  ]]>
  </search>

mgimadu

.ıl I love you simplemachines lı.
Forumgil.com - Enter my site.
My Mods        - Enter my Mods.
I wait you SMF 2.0

Alan S

To Make It Work With A Custom Theme

Index.Template.Php

Find
<a href="', $scripturl, '?action=profile">' , $txt[79] , '</a>

Replace With
<a href="', $scripturl, '?action=usercp">' , $txt['usercp'] , '</a>

If there is a error on install on index.template.php ......

Install the package anyway , The most likely cause of the error is that you have another mod installed and that a bit of the code was not found , the most likely code will be this so lets fix it manualy.

Index.template.php

Find
if (in_array($context['current_action'], array('search', 'admin',

Add After
'usercp',
Quote from: Eliana Tamerin on August 23, 2008, 04:10:10 PM
SMF 7 is where it gets good. That has time travel. You can go back and post before the guy who flamed you. :P

JerryLeeLewis

I have make changes in Index Template .php manually like it explained above


Very Nice Mod

For all who translate it in German here are some changes that i made in German hope it helps you

Alan S

Thanks for the translation , Link has been added to the mod site topic.


The reason why a error will occur in the index.template.php is that it the installer replaces a piece of code that many other mods change , so if the code is not exactly the same the test will fail and you will have to add the index.template code manually.
Quote from: Eliana Tamerin on August 23, 2008, 04:10:10 PM
SMF 7 is where it gets good. That has time travel. You can go back and post before the guy who flamed you. :P


Alan S

Quote from: babjusi on April 29, 2007, 01:41:34 PM
Quote from: Alan S on April 29, 2007, 01:37:15 PM
Thanks for the translation , Link has been added to the mod site topic.


The reason why a error will occur in the index.template.php is that it the installer replaces a piece of code that many other mods change , so if the code is not exactly the same the test will fail and you will have to add the index.template code manually.

Thank u for your explanation. I ain''t so good with this coding thing, can you tell me please what code should I add and where?
See the post 6 posts up

http://www.simplemachines.org/community/index.php?topic=167975.msg1073991#msg1073991

It explains the code to add in the index.template.php.
Quote from: Eliana Tamerin on August 23, 2008, 04:10:10 PM
SMF 7 is where it gets good. That has time travel. You can go back and post before the guy who flamed you. :P

sessus

Alan S , those changes worked just fine.

Would you also know how to keep the UserCP Tab selected when browsing through the Profile?

Alan S

Quote from: sessus on April 29, 2007, 07:31:32 PM
Alan S , those changes worked just fine.

Would you also know how to keep the UserCP Tab selected when browsing through the Profile?

Humm , I thought should already do that , Anyway feel free to post the code if you want , I'll include it in the next release and other users might be thankful!
Quote from: Eliana Tamerin on August 23, 2008, 04:10:10 PM
SMF 7 is where it gets good. That has time travel. You can go back and post before the guy who flamed you. :P

tallpaul

Quote from: Alan S on April 29, 2007, 11:35:54 AM
To Make It Work With A Custom Theme

Index.Template.Php

Find
<a href="', $scripturl, '?action=profile">' , $txt[79] , '</a>

Replace With
<a href="', $scripturl, '?action=usercp">' , $txt['usercp'] , '</a>

If there is a error on install on index.template.php ......

Install the package anyway , The most likely cause of the error is that you have another mod installed and that a bit of the code was not found , the most likely code will be this so lets fix it manualy.

Index.template.php

Find
if (in_array($context['current_action'], array('search', 'admin',

Add After
'usercp',

excellant cheers mate  :)

tallpaul

user cp now works but dont have the image icons displayed.
tried uploading the image file into the images folder in the custom theme (helios multi rc2) via ftp and  my main usercp but just get permission denied, cant even change the permissions
any idea's please??

Advertisement: