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.

bluedevil

I get this on my error log.    (Alan's mod)

Quote8: Undefined index: member
File: /home/midwesta/public_html/Themes/default/usercp.template.php (main sub template - eval?)
Line: 73

...but works fine.   Any thoughts?

G6Cad

It's right where the text are shown in the template. Do you have any missing text strings or funny looking characters ?   

alan s

Im in the process of recoding this mod to make it more efficent and coding it to meet the SMF Mod coding guidelines. Should look a lot better when im done.

bluedevil

Quote from: G6Ã,â,,¢ on March 20, 2007, 11:01:54 AM
It's right where the text are shown in the template. Do you have any missing text strings or funny looking characters ?  

Im working on it as we speak.

RoarinRow

There are a couple of versions in this board.  This is the one I'm using:

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

$entries_per_row = 4; // Range 3-5 probably best
$admin_user = 3; // 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>';

SMF 2.0 RC3
TP 1.0 beta 5-1
Wordpress 3.0

bluedevil

Quote from: G6â„¢ on March 20, 2007, 11:01:54 AM
It's right where the text are shown in the template. Do you have any missing text strings or funny looking characters ?  


This is what shows in line 73


<font face="Verdana" size="2"> <a href="', $scripturl, '?action=theme;sa=pick;u=', $context['member']['id'], ';sesc=', $context['session_id'], '"><b>My Theme</a><br>


Im not sure whats missing.

bluedevil

Quote from: RoarinRow on March 20, 2007, 08:49:51 PM
There are a couple of versions in this board.  This is the one I'm using:



How come you have awards and karma on your file? you can see those from your profile?

RoarinRow

Quote from: bluedevil on March 20, 2007, 09:42:17 PM
Quote from: RoarinRow on March 20, 2007, 08:49:51 PM
There are a couple of versions in this board.  This is the one I'm using:



How come you have awards and karma on your file? you can see those from your profile?

Not sure, that's just the entire code I got from here.  I didn't add that part.  I only change this part to my member ID:

$admin_user = 3;   // Member # of Forum Administrator for 'Contact' PM

SMF 2.0 RC3
TP 1.0 beta 5-1
Wordpress 3.0

bluedevil

Quote from: bluedevil on March 20, 2007, 09:39:29 PM
Quote from: G6Ã,â,,¢ on March 20, 2007, 11:01:54 AM
It's right where the text are shown in the template. Do you have any missing text strings or funny looking characters ?  


This is what shows in line 73


<font face="Verdana" size="2"> <a href="', $scripturl, '?action=theme;sa=pick;u=', $context['member']['id'], ';sesc=', $context['session_id'], '"><b>My Theme</a><br>


Im not sure whats missing.

I noticed when clicking on "my themes" it allows me to change my theme of course.  BUt when i change to whatever theme and want to change back i noticed that i changed everyone elses themes as well.

If its my profile,i should be able to change my own theme right?

RoarinRow

Quote from: bluedevil on March 20, 2007, 09:57:50 PM
Quote from: bluedevil on March 20, 2007, 09:39:29 PM
Quote from: G6â„¢ on March 20, 2007, 11:01:54 AM
It's right where the text are shown in the template. Do you have any missing text strings or funny looking characters ?  


This is what shows in line 73


<font face="Verdana" size="2"> <a href="', $scripturl, '?action=theme;sa=pick;u=', $context['member']['id'], ';sesc=', $context['session_id'], '"><b>My Theme</a><br>


Im not sure whats missing.

I noticed when clicking on "my themes" it allows me to change my theme of course.  BUt when i change to whatever theme and want to change back i noticed that i changed everyone elses themes as well.

If its my profile,i should be able to change my own theme right?

yeah, going through the profile screen should just change your settings, not the forum's  :o

SMF 2.0 RC3
TP 1.0 beta 5-1
Wordpress 3.0

This website is proudly hosted on Crocweb Cloud Website Hosting.