TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 563
  • Total: 563

USER CP - An alternative to Profile Screen

Started by akulion, October 18, 2006, 07:57:31 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

clarkkent93

Quote from: wilsy on February 19, 2007, 02:58:53 PM
Hi all,

Great mod!

I have attached some transparent gif icons for use with this mod (see screenshot).

Use with the code below from JA Cortina, slightly modified to handle the gif extensions and to  set the font size of the descriptions from bold to normal: -


global $context, $scripturl, $modSettings, $ID_MEMBER, $txt;

$entries_per_row = 4; // Range 3-5 probably best
$admin_user = 1; // Member # of Forum Administrator for 'Contact' PM
$img_size = 64; // used for height AND width of 'icon'

reloadSettings();
loadLanguage('Profile');
list ($memID) = loadMemberData($ID_MEMBER, false, 'profile');
$context['user']['is_owner'] = $memID == $ID_MEMBER;

/////////////////////////////////////////////////////////////
//
//  link  - construction to yield the part of the URL after 'index.php'
//  image - location of graphic 'icon'
//  title - entry 'name'
//  label - entry description

if (($context['user']['is_owner'] && allowedTo('profile_identity_own')) || allowedTo(array('profile_identity_any', 'manage_membergroups')))
$cp_entry[] = array('link' => '?action=profile;u='.$ID_MEMBER.';sa=account',    'image' => 'usercp/ksysguard.gif',    'title' => 'My Account Info',
'label' => 'Click here if you want to change your account related information such as username, email, password or other sensitive details.');

if (($context['user']['is_owner'] && allowedTo('profile_extra_own')) || allowedTo('profile_extra_any'))
$cp_entry[] = array('link' => '?action=profile;u='.$ID_MEMBER.';sa=theme',    'image' => 'usercp/kivio.gif',    'title' => 'Look & Layout Options',
'label' => 'Click here to change the way the forum looks for you, options include the look and layout for the boards and posts.');

if ($modSettings['theme_allow'] || $context['user']['is_admin'])
$cp_entry[] = array('link' => '?action=profile;u='.$ID_MEMBER.';sa=pick;sesc='.$context['session_id'],    'image' => 'usercp/blockdevice.gif',    'title' => 'My Theme',
'label' => 'This screen will allow you to set your default theme which you wish to use every time you login.');

if (($context['user']['is_owner'] && allowedTo('profile_extra_own')) || allowedTo('profile_extra_any'))
$cp_entry[] = array('link' => '?action=profile;u='.$ID_MEMBER.';sa=forumProfile',    'image' => 'usercp/kuser.gif',    'title' => 'My Profile',
'label' => 'Click here to change the way your profile looks and appears to everyone.');

if (($context['user']['is_owner'] && allowedTo('profile_view_own')) || allowedTo('profile_view_any'))
$cp_entry[] = array('link' => '?action=profile;u='.$ID_MEMBER.';sa=statPanel',    'image' => 'usercp/kwalletmanager.gif',    'title' => 'My Stats',
'label' => 'Here you can check how many posts you have made and other activity related info.');

if (($context['user']['is_owner'] && allowedTo('profile_view_own')) || allowedTo('profile_view_any'))
$cp_entry[] = array('link' => '?action=profile;u='.$ID_MEMBER.';sa=showPosts',    'image' => 'usercp/kedit.gif',    'title' => 'My Posts',
'label' => 'This option will show you all the posts you have made since you became a member of this site.');

if (($context['user']['is_owner'] && allowedTo('profile_extra_own')) || allowedTo('profile_extra_any'))
$cp_entry[] = array('link' => '?action=profile;u='.$ID_MEMBER.';sa=notification',    'image' => 'usercp/mailreminder.gif',    'title' => 'My Notifications',
'label' => 'This screen will allow you to change the type and frequency of notifications you get via e-mail when participating in threads.');

if (!empty($modSettings['enable_buddylist']) && $context['user']['is_owner'] && allowedTo(array('profile_extra_own', 'profile_extra_any')))
$cp_entry[] = array('link' => '?action=profile;u='.$ID_MEMBER.';sa=editBuddies',    'image' => 'usercp/kdmconfig.gif',    'title' => 'Buddies',
'label' => 'This screen will allow you to select buddies to add to your list.');

if (($context['user']['is_owner'] && allowedTo('profile_extra_own')) || allowedTo('profile_extra_any'))
$cp_entry[] = array('link' => '?action=profile;u='.$ID_MEMBER.';sa=pmprefs',    'image' => 'usercp/mail.gif',    'title' => 'My Messages Options',
'label' => '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.');


if (!$context['user']['is_guest'] && (($context['user']['is_owner'] && allowedTo('profile_view_own')) || allowedTo(array('profile_view_any', 'moderate_forum', 'manage_permissions','tp_dlmanager','tp_blocks','tp_articles','tp_gallery','tp_linkmanager'))))
if($context['user']['is_owner'] || allowedTo('tp_blocks'))
$cp_entry[] = array('link' => '?action=profile;u='.$ID_MEMBER.';sa=tpshoutbox',    'image' => 'usercp/messenger.gif',    'title' => 'Show My Shouts',
'label' => 'This screen will show a log of all the shouts you have made in the shoutbox.');

if ($context['allow_search'])
$cp_entry[] = array('link' => '?action=search',    'image' => 'usercp/find.gif',    'title' => 'Search',
'label' => 'This screen will allow you to search for posts made in the board.');

if (allowedTo('pm_send'))
$cp_entry[] = array('link' => '?action=pm;sa=send;u='.$admin_user,    'image' => 'usercp/agent.gif',    'title' => 'Contact Admin',
'label' => 'Still having problems?<br>Then contact the admin from here and submit your questions.');

/////////////////////////////////////////
// Karma Description Log
//if (($modSettings['karmaMode'] == '1') || ($modSettings['karmaMode'] == '2'))
// if ((!empty($modSettings['karmaisowner']) && ($context['user']['is_owner'])) || (empty($modSettings['karmaisowner'])) || ($context['user']['is_admin']))
// $cp_entry[] = array('link' => '?action=ownkarma;u='.$ID_MEMBER,    'image' => '',    'title' => $txt['who_change_my_karma'],
// 'label' => 'Show log of who who affected your '.$modSettings['karmaLabel'].'.');
/////////////////////////////////////////

/////////////////////////////////////////
// Awards Mod Badge Album
//loadLanguage('ManageAwards');
//if (isset($txt['pa_description']))
// $cp_entry[] = array('link' => '?action=profile;u='.$ID_MEMBER.';sa=awards',    'image' => '',    'title' => 'Badge Album',
// 'label' => 'Manage your Award badge album.');
/////////////////////////////////////////

/////////////////////////////////////////
// Logout
//$cp_entry[] = array('link' => '?action=logout;sesc='.$context['session_id'],    'image' => '',    'title' => 'Logout',
// 'label' => 'Log off the Forum.');
/////////////////////////////////////////

$cell_width = (int) (100 / $entries_per_row);
$row_ent = 0;

$line_1 = '';
$line_2 = '';
$line_3 = '';

echo '<table>';
foreach ($cp_entry as $ent) {

$line_1 .= '<td valign="top" width="'.$cell_width.'%" align="center" height="'.$img_size.'px"><a href="'.$scripturl.$ent['link'].'"><img border="0" src="'.$ent['image'].'" width="'.$img_size.'" height="'.$img_size.'"></a></td>';
$line_2 .= '<td class="windowbg3" style="font-size:small;font-weight:bold;text-align:center;vertical-align:top;padding:3px;"><a href="'.$scripturl.$ent['link'].'">'.$ent['title'].'</a></td>';
$line_3 .= '<td style="font-size:x-small;text-align:center;vertical-align:top;font-weight:normal;padding:3px;">'.$ent['label'].'</td>';

$row_ent = $row_ent + 1;
if ($row_ent == $entries_per_row) {
$row_ent = 0;
echo '<tr height="', $img_size, 'px">', $line_1, '</tr>';
echo '<tr height="1.3em">', $line_2, '</tr>';
echo '<tr height="125px">', $line_3, '</tr>';
$line_1 = '';
$line_2 = '';
$line_3 = '';
}
}
if ($row_ent > 0) {
$line_1 .= '<td colspan="'.($entries_per_row - $row_ent).'"> </td>';
$line_2 .= '<td colspan="'.($entries_per_row - $row_ent).'"> </td>';
$line_3 .= '<td colspan="'.($entries_per_row - $row_ent).'"> </td>';
echo '<tr height="', $img_size, 'px">', $line_1, '</tr>';
echo '<tr height="1.3em">', $line_2, '</tr>';
echo '<tr height="125px">', $line_3, '</tr>';
}
echo '</table>';


Regards,

Wilsy.

Is this code similar to Aku?  Is there a screenshot on what Aku's looks like?

I'm just covering my bases now so I ask less dumb questions later! :)


brianjw

Quote from: clarkkent93 on February 19, 2007, 08:38:13 PM
Is this code similar to Aku?Ã,  Is there a screenshot on what Aku's looks like?
I'm just covering my bases now so I ask less dumb questions later! :)
Aku doesn't have this code on his website anymore because he swithced to vBulletin. If you would like to see the exact code he used to have; use the info below:
http://www.brianjwilson.com/index.php?action=usercp
Username: test
Password: test
Please remember that editing any part of the profile will cause the test account to be deleted. Do Not Post any messages with it. Only use it for viewing snippets and mods.
The code is the same thing aku has brought out to you, the only things that were modified differently are the images ;)

jacortina

Aku's should come out looking just about the same. This was his original idea and he made up a block which was HTML code. I adapted it to be generated by a PHP script so that things like permission checking could be done so icons a user couldn't use didn't show up (for instance, if you don't allow theme changing, only the admin will have that show up).

clarkkent93

Quote from: J.A.Cortina on February 19, 2007, 11:43:23 PM
Aku's should come out looking just about the same. This was his original idea and he made up a block which was HTML code. I adapted it to be generated by a PHP script so that things like permission checking could be done so icons a user couldn't use didn't show up (for instance, if you don't allow theme changing, only the admin will have that show up).

If I use your code, should I still follow the instructions on the 1st page for setting this up?

brianjw

Quote from: clarkkent93 on February 20, 2007, 03:07:43 AM
Quote from: J.A.Cortina on February 19, 2007, 11:43:23 PM
Aku's should come out looking just about the same. This was his original idea and he made up a block which was HTML code. I adapted it to be generated by a PHP script so that things like permission checking could be done so icons a user couldn't use didn't show up (for instance, if you don't allow theme changing, only the admin will have that show up).

If I use your code, should I still follow the instructions on the 1st page for setting this up?
Yes :coolsmiley:

clarkkent93

I've decided to use JA Cortina's code as this is more along the lines I'm looking for.  I'm trying to add the necessary code to my theme and can't seem to find exactly what was mentioned.

I'm using the Enterprise theme.  I've attached a copy of my template.  Even if you can just point me in the right place, I would appreciate it. 

I'm also hoping I started right by placing the main code in a php article (#8)?

Thanks for everybody's help. 

Bernard


jacortina

That code (I think you meant message #80), goes in an article (PHP article).

You'd need to get the graphics files and put them in a subdirectory as described in the first step of the first message in this thread.

Then you follow the instructions in that first message at step 3

The code from your file that you need to alter is in this block:
// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo ($current_action == 'profile' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td class="maintab_' , $current_action == 'profile' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=profile">' , $txt[79] , '</a>
</td>' , $current_action == 'profile' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

clarkkent93

Thanks JA!  That was just what I needed to finish.

alan s

#169
Im after turning this into a modification for smf , Theres a few small changes though. I also plan to develop this mod further.

Version 1.0

- This doesnt use tp at all , It creates a user action ?action=usercp instead of the ?page=XX

- Instead of using articles , it uses 2 different files , usercp.php and usercp.template.php

- The shoutbox shouts option has been removed

- Instead of sending a pm to the admin you send a email to the webmaster address. The webmaster email is the one the admin account registered to the forum with.

___________________________________________________________________________________________________________________

Version 1.5 Roadmap

- Permissions for the user cp.

- Added support for tinyportal ,Will be able to add extra options to the usercp via the admin panel.


____________________________________________________________________________________________________________________

Permission to use the original code and to edit it was of course given by Aku.

Demo :

http://corkthings.com/testforum/index.php?action=usercp
User : test
Pass : test

http://custom.simplemachines.org/mods/index.php?mod=698

Since its not approved yet i have attached it to the post.

Mod should work with version 1.0.7 and above , however it has only been tested on 1.1.1 and 1.1.2

Dilber MC Compatibility Package Available Here

This website is proudly hosted on Crocweb Cloud Website Hosting.