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: 554
  • Total: 554

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.

CampCounselor

ok i was not sure. sorry i only had 5 hours of sleep last night and so i am dragging

brianjw


softtouch_ph

Its damn nice, but I have one problem. Because it is an article, it will be seen if you list articles... how can I prevent that people see this profile if they display articles?

Sin69

an alternative would be to install the custom action mod and paste the code into it rather than in an article.

softtouch_ph


wilsy

#155
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.

RoarinRow


SMF 2.0 RC3
TP 1.0 beta 5-1
Wordpress 3.0

brianjw


RoarinRow

Quote from: brianjw on February 19, 2007, 05:55:41 PM
lol aku changed his name to The Game Pimp :D

OMG!  He has too much time on his hands   :laugh:

SMF 2.0 RC3
TP 1.0 beta 5-1
Wordpress 3.0


This website is proudly hosted on Crocweb Cloud Website Hosting.