Welcome, Guest. Please login or register.

ShoutBox!

Scrubmeister

2024-04-19, 10:32:40
Good to see the site back faster than ever. :)
 

Skhilled

2024-04-18, 21:09:09
I've upgraded the server...more resources. ;)
 

Ken

2024-04-18, 20:57:10
Now that you mention it...  :D
 

Skhilled

2024-04-18, 20:47:19
...and, you should notice that the site is much faster.  :o
 

Ken

2024-04-18, 20:31:37
Hey Steve.
 

Skhilled

2024-04-18, 17:56:10
Re-read the message below...
 

Skhilled

2024-03-31, 15:22:06
Oh yeah, you need to upgrade the site first...
 

Ken

2024-03-30, 09:54:54
Whoops! I forgot that the SMF install here on OFF is out of date!  :'(
 

Ken

2024-03-30, 09:44:48
 Conga-Rats Steve!  :thumbup:
Me gonna install it here just for the fun of it!  :)
 

Skhilled

2024-03-29, 22:15:23
Released!  :D

Recent Topics

TP Articles


Search in titles
Search in article texts

Author Topic: UserCP Re-Discovered!  (Read 3166 times)

0 Members and 1 Guest are viewing this topic.

Offline Ken (OP)

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 11674
  • Gender: Male
  • View Gallery
UserCP Re-Discovered!
« on: April 01, 2012, 06:32:21 AM »
Just 're-discovered' the FamilyForum UserCP page!

It's a really nice page and I've always liked it a lot, so I'll edit it a bit to correct the broken links for some of the functions and then add it back into the Profile pages.  :bigthumb:
"Not all who wander are lost."-Tolkien
Yesterday When I was Young.

Offline Ken (OP)

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 11674
  • Gender: Male
  • View Gallery
Re: UserCP Re-Discovered!
« Reply #1 on: April 01, 2012, 06:48:52 AM »
Lotsa code here!  :yikes:
Need to sort through all these strings to see why extra code is being added to the page address when a button is clicked.

Example:
<<< The search button should take us to the search page, but the extra code that is added to the address string causes it to go to the forum page.

Code: [Select]
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 = 80; // 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.png',    '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.png',    '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.png',    '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.png',    '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.png',    'title' => 'My Stats',
'label' => 'Here you can check how many posts you have made, which games you are a champion in 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.png',    '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.png',    '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.png',    '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.png',    '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 (!$user_info['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.png',    '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.png',    '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.png',    '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'].'?phpMyAdmin=6b84a268fac5bc82be63787800983323"><img border="0" src="'.$ent['image'].'" width="'.$img_size.'" height="'.$img_size.'"></a></td>';
$line_2 .= '<td style="font-size:small;font-weight:bold;text-align:center;vertical-align:top;padding:3px;"><a href="'.$scripturl.$ent['link'].'?phpMyAdmin=6b84a268fac5bc82be63787800983323">'.$ent['title'].'</a></td>';
$line_3 .= '<td style="font-size:x-small;text-align:center;vertical-align:top;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>';
"Not all who wander are lost."-Tolkien
Yesterday When I was Young.

Offline Skhilled

  • Administrator
  • *
  • Posts: 9005
  • Gender: Male
  • All of my passwords are protected by amnesia...
  • View Gallery
    • Buildz Hosting
Re: UserCP Re-Discovered!
« Reply #2 on: April 01, 2012, 04:44:26 PM »
You have to remember that a lot has changed to SMF and to TP since that was written.

Offline Ken (OP)

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 11674
  • Gender: Male
  • View Gallery
Re: UserCP Re-Discovered!
« Reply #3 on: April 01, 2012, 07:46:14 PM »
You have to remember that a lot has changed to SMF and to TP since that was written.

Yeah... the code is not all that clear to me, maybe it needs to be posted on the TinyPortal site to see if someone wants to take a look.
"Not all who wander are lost."-Tolkien
Yesterday When I was Young.