Mali Problem u profile areas

Started by Dzungla, November 29, 2010, 10:00:24 AM

Previous topic - Next topic

Dzungla

Kako u profile areas da stavim da prikaze Avatar Clana

Probao sam da stavim u  Profile.template.php

ispod
if (!empty($context['profile_areas']) && $context['sub_template'] !== 'summary2')

ovo
$context['member']['avatar']['image']

ali mi pokazuje prazan prostor

Dzungla

ako me niste razumeli evo slike gde bi stavio avatar ali nikako nece pokazuje ime

$context['member']['name'],

pokazuje

$context['user']['avatar']['image']

ali
$context['member']['avatar']['image']

nikako nece bude samo prazan prostor

rocknroller

ako ti netko želi pomoći treba tražiti koja je verzija tvog foruma.  a i temu ne bi škodilo da napišeš.
Eto.

Dzungla

Verzija je 1.1.12 a tema je moja promena

Dzonny


if (!empty($context['user']['avatar']))
echo '
<td class="windowbg" valign="middle">', $context['user']['avatar']['image'], '</td>';

echo '
<td colspan="2" width="100%" valign="top" class="windowbg2"><span class="middletext">';

Dzungla

Dzonny nije to. to mi prikazuje $context['user']['avatar']['image']

Meni nece da prikaze $context['member']['avatar']['image']

Evo detaljnog koda gde je postavljeno

Quote// Template for the profile side bar - goes before any other profile template.
function template_profile_above()
{
   global $context, $settings, $options, $scripturl, $modSettings, $txt;

   // Assuming there are actually some areas the user can visit...
   if (!empty($context['profile_areas']) && $context['sub_template'] !== 'summary2')
   {
   
   // Prvi Red
echo'<table cellpadding="0" cellspacing="0" border="0" height="100%"><tr><td valign="top" height="100%">';
echo'<div id="sources">

          <div class="inside">
          <div class="front"><h2>', $context['member']['name'], '</h2></div><br/>';

// Ovde Avatar         
echo'<div><center>

', $context['member']['avatar']['image'], '

</center><br/><div>';


echo'', $context['member']['blurb'], '</div></div>';
      echo '
               <br/><div><table border="0" cellpadding="4" cellspacing="1" >';

      // Loop through every area, displaying its name as a header.
      foreach ($context['profile_areas'] as $section)
      {
         echo '
                  <tr>
                     <td class="front"><b>', $section['title'], '</b></td>
                  </tr>
                  <tr>
                     <td class="smalltext">';

         // For every section of the area display it, and bold it if it's the current area.
         foreach ($section['areas'] as $i => $area)
            if ($i == $context['menu_item_selected'])
               echo '
                        <b>&#187; ', $area, '</b><br />';
            else
               echo '
                        <b>&#187;</b> ', $area, '<br />';
         echo '
                        
                     </td>
                  </tr>';
      }
      echo '
               </table></div></div></div>
            </td><td td style="padding-left: 10px;" valign="top" height="100%"><div id="sources2">

          <div class="inside2">';
   }
   // If no areas exist just open up a containing table.
   else
   {
      echo '
      <table width="100%" border="0" cellpadding="0" cellspacing="0" style="padding-top: 1ex;">
         <tr>
            <td width="100%" valign="top">';
   }

   // If an error occurred whilst trying to save previously, give the user a clue!
   if (!empty($context['post_errors']))
   {
      echo '
               <table width="85%" cellpadding="0" cellspacing="0" border="0" align="center">
                  <tr>
                     <td>', template_error_message(), '</td>
                  </tr>
               </table>';
   }
}

// Template for closing off table started in profile_above.
function template_profile_below()
{
   global $context, $settings, $options;

   echo '
            <td valign="top" height="100%">

<div id="sources3">

          <div><div><br/><br/><div>
        <div class="inside4"><h2>Informacije</h2></div>
        <div class="inside4"><h2>Moje Slike</h2></div>
        <div class="inside4"><h2>Multimedija</h2></div>
        <div class="inside4"><h2>Moji Prijatelji</h2></div>
        <div class="inside4"><h2>Komentari</h2></div>
      
       
       
        </div></div></td></tr></table>';
}

Nije mi samo jasno pokazuje
$context['member']['name']
$context['member']['blurb']

a $context['member']['avatar']['image'] nece :(

Dzonny

Ajde probaj ovaj kod:

if ($context['user']['is_guest'] || empty($context['user']['avatar']['image']))
echo '<img src="/board/Themes/your_theme/images/nophoto.gif" alt="Guest" border="0" />';
else
echo $context['user']['avatar']['image'];

Stavi to bilo gde u template (samo da bude validan kod) i vidi hoće li se prikazati avatar. A trebalo bi da se prikaže, kod mene se prikazuje...


Dzungla

Stavio sam.

Kada sam na drugom profilu nekog clana pokazuje moj avatar ne pokazuje avatar tog clana u kojem sam profilu

Cola-Coca

Inace nitko ti nebi trebao ovde da pomogne dok nevrati SMF copyright na samom dnu foruma.
I LOVE SMF

Dzonny

Steven, slažem se.
@Dzungla, da li znaš da je uklanjanje copyrighta zabranjeno?

elem, vidi šta se dešava kada staviš ovaj kod:

if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
echo '
<div style="overflow: auto; width: 100%;">', $message['member']['avatar']['image'], '</div><br />';

Dzungla

Cu da Vratim...


Prikazuje mi prazan prostor :(

Cola-Coca

I LOVE SMF

Dzungla

Vraceno je po Stefan80 po tvojoj zelji ili naredbi    ;D

Dzungla

Dzonny a jel moze u Profile.php da se namesti avatar u taj deo de prikazuje taj meni?

Quote// Allow the change or view of profiles...
function ModifyProfile($post_errors = array())
{
   global $txt, $scripturl, $user_info, $context, $ID_MEMBER, $sourcedir, $user_profile, $modSettings;

   loadLanguage('Profile');
   loadLanguage('UltimateProfile');
   loadTemplate('Profile');

   /* Set allowed sub-actions.

    The format of $sa_allowed is as follows:

   $sa_allowed = array(
      'sub-action' => array(permission_array_for_editing_OWN_profile, permission_array_for_editing_ANY_profile[, require_validation]),
      ...
   );

   */

   $sa_allowed = array(
      'summary' => array(array('profile_view_any', 'profile_view_own'), array('profile_view_any')),
      'statPanel' => array(array('profile_view_any', 'profile_view_own'), array('profile_view_any')),
      'showPosts' => array(array('profile_view_any', 'profile_view_own'), array('profile_view_any')),

      'showTopics' => array(array('profile_view_any', 'profile_view_own'), array('profile_view_any')),
      'editBuddies' => array(array('profile_extra_any', 'profile_extra_own'), array()),
      'trackUser' => array(array('moderate_forum'), array('moderate_forum')),
      'trackIP' => array(array('moderate_forum'), array('moderate_forum')),
      'showPermissions' => array(array('manage_permissions'), array('manage_permissions')),
      'account' => array(array('manage_membergroups', 'profile_identity_any', 'profile_identity_own'), array('manage_membergroups', 'profile_identity_any')),
      'forumProfile' => array(array('profile_extra_any', 'profile_extra_own'), array('profile_extra_any')),
      'customized' => array(array('edit_ultimate_profile_any', 'edit_ultimate_profile_own'), array('edit_ultimate_profile_any')),
      'pictures' => array(array('profile_view_any', 'profile_view_own'), array('profile_view_any')),
      'comment' => array(array('profile_view_any', 'profile_view_own'), array('profile_view_any')),
      'buddies' => array(array('profile_view_any', 'profile_view_own'), array('profile_view_any')),
      'report' => array(array('profile_view_any', 'profile_view_own'), array('profile_view_any')),
      'theme' => array(array('profile_extra_any', 'profile_extra_own'), array('profile_extra_any')),
      'notification' => array(array('profile_extra_any', 'profile_extra_own'), array('profile_extra_any')),
      'pmprefs' => array(array('profile_extra_any', 'profile_extra_own'), array('profile_extra_any')),
      'deleteAccount' => array(array('profile_remove_any', 'profile_remove_own'), array('profile_remove_any')),
      // Tinyportal
      'tpsummary' => array(array('profile_view_any', 'profile_view_own'), array('profile_view_any')),
      'tparticles' => array(array('profile_extra_any', 'profile_extra_own'), array('tp_articles')),
      'tpdownload' => array(array('profile_extra_any', 'profile_extra_own'), array('tp_dlmanager')),
      'tpshoutbox' => array(array('profile_extra_any', 'profile_extra_own'), array('tp_blocks')),
      'tpgallery' => array(array('profile_extra_any', 'profile_extra_own'), array('tp_gallery')),
      'tplinks' => array(array('profile_extra_any', 'profile_extra_own'), array('tp_links')),
      // end Tinyportal
   );

   // Set the profile layer to be displayed.
   $context['template_layers'][] = 'profile';

   // Did we get the user by name...
   if (isset($_REQUEST['user']))
      $memberResult = loadMemberData($_REQUEST['user'], true, 'profile');
   // ... or by ID_MEMBER?
   elseif (!empty($_REQUEST['u']))
      $memberResult = loadMemberData((int) $_REQUEST['u'], false, 'profile');
   // If it was just ?action=profile, edit your own profile.
   else
      $memberResult = loadMemberData($ID_MEMBER, false, 'profile');

   // Check if loadMemberData() has returned a valid result.
   if (!is_array($memberResult))
      fatal_lang_error(453, false);

   // If all went well, we have a valid member ID!
   list ($memID) = $memberResult;

   // Is this the profile of the user himself or herself?
   $context['user']['is_owner'] = $memID == $ID_MEMBER;

   // No Subaction?
   if (!isset($_REQUEST['sa']) || !isset($sa_allowed[$_REQUEST['sa']]))
   {
      // Pick the first subaction you're allowed to see.
      if ((allowedTo('profile_view_own') && $context['user']['is_owner']) || allowedTo('profile_view_any'))
         $_REQUEST['sa'] = 'summary';
      elseif (allowedTo('moderate_forum'))
         $_REQUEST['sa'] = 'trackUser';
      elseif (allowedTo('manage_permissions'))
         $_REQUEST['sa'] = 'showPermissions';
      elseif ((allowedTo('profile_identity_own') && $context['user']['is_owner']) || allowedTo('profile_identity_any') || allowedTo('manage_membergroups'))
         $_REQUEST['sa'] = 'account';
      elseif ((allowedTo('profile_extra_own') && $context['user']['is_owner']) || allowedTo('profile_extra_any'))
         $_REQUEST['sa'] = 'forumProfile';
      elseif ((allowedTo('profile_remove_own') && $context['user']['is_owner']) || allowedTo('profile_remove_any'))
         $_REQUEST['sa'] = 'deleteAccount';
      else
         isAllowedTo('profile_view_' . ($context['user']['is_owner'] ? 'own' : 'any'));
   }

   // Check the permissions for the given sub action.
   isAllowedTo($sa_allowed[$_REQUEST['sa']][$context['user']['is_owner'] ? 0 : 1]);

   // Make sure the user is who he claims to be, before any important account stuff is changed.
   if (!empty($sa_allowed[$_REQUEST['sa']][2]))
      validateSession();

   // No need for this anymore.
   unset($sa_allowed);

   $context['profile_areas'] = array();

   
   // Set the menu items in the left bar...
   if (!$user_info['is_guest'] && (($context['user']['is_owner'] && allowedTo('profile_view_own')) || allowedTo(array('profile_view_any', 'moderate_forum', 'manage_permissions'))))
   {
      $context['profile_areas']['info'] = array(
         'title' => $txt['profileInfo'],
         'areas' => array()
      );

      if (($context['user']['is_owner'] && allowedTo('profile_view_own')) || allowedTo('profile_view_any'))
      {
      
         $context['profile_areas']['info']['areas']['summary'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=summary">' . $txt['summary'] . '</a>';
         $context['profile_areas']['info']['areas']['statPanel']   = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=statPanel">' . $txt['statPanel'] . '</a>';
         $context['profile_areas']['info']['areas']['showPosts']   = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=showPosts">' . $txt['showPosts'] . '</a>';

         if (!empty($modSettings['tcip_enabled']) && !empty($modSettings['tcip_show_topic_list'])) $context['profile_areas']['info']['areas']['showTopics']   = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=showTopics">' . $txt['showTopics'] . '</a>';
      }

      // Groups with moderator permissions can also....
      if (allowedTo('moderate_forum'))
      {
         $context['profile_areas']['info']['areas']['trackUser'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=trackUser">' . $txt['trackUser'] . '</a>';
         $context['profile_areas']['info']['areas']['trackIP'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=trackIP">' . $txt['trackIP'] . '</a>';
      }
      if (allowedTo('manage_permissions'))
         $context['profile_areas']['info']['areas']['showPermissions'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=showPermissions">' . $txt['showPermissions'] . '</a>';
   }

   // Edit your/this person's profile?
   if (($context['user']['is_owner'] && (allowedTo(array('profile_identity_own', 'profile_extra_own')))) || allowedTo(array('profile_identity_any', 'profile_extra_any', 'manage_membergroups')))
   {
      $context['profile_areas']['edit_profile'] = array(
         'title' => $txt['profileEdit'],
         'areas' => array()
      );

      if (($context['user']['is_owner'] && allowedTo('profile_identity_own')) || allowedTo(array('profile_identity_any', 'manage_membergroups')))
         $context['profile_areas']['edit_profile']['areas']['account'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=account">' . $txt['account'] . '</a>';

      if (($context['user']['is_owner'] && allowedTo('profile_extra_own')) || allowedTo('profile_extra_any'))
         $context['profile_areas']['edit_profile']['areas']['forumProfile'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=forumProfile">' . $txt['forumProfile'] . '</a>';
         
      if (($context['user']['is_owner'] && allowedTo('edit_ultimate_profile_own')) || allowedTo('edit_ultimate_profile_any'))
         $context['profile_areas']['edit_profile']['areas']['customized'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=customized">' . $txt['profile_customized'] . '</a>';
      
      if (($context['user']['is_owner'] && allowedTo('profile_extra_own')) || allowedTo('profile_extra_any'))
      {
         $context['profile_areas']['edit_profile']['areas']['theme'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=theme">' . $txt['theme'] . '</a>';
         $context['profile_areas']['edit_profile']['areas']['notification'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=notification">' . $txt['notification'] . '</a>';
         $context['profile_areas']['edit_profile']['areas']['pmprefs'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=pmprefs">' . $txt['pmprefs'] . '</a>';
      }

      // !!! I still don't think this warrants a new section by any means, but it's definitely not part of viewing a person's profile, if only the owner can do it.
      if (!empty($modSettings['enable_buddylist']) && $context['user']['is_owner'] && allowedTo(array('profile_extra_own', 'profile_extra_any')))
         $context['profile_areas']['edit_profile']['areas']['editBuddies'] = '<a href="' . $scripturl . '?action=buddies">' . $txt['editBuddies'] . '</a>';
   }

   // If you have permission to do something with this profile, you'll see one or more actions.
   if (($context['user']['is_owner'] && allowedTo('profile_remove_own')) || allowedTo('profile_remove_any') || (!$context['user']['is_owner'] && allowedTo('pm_send')))
   {
      // Initialize the action menu group...
      $context['profile_areas']['profile_action'] = array(
         'title' => $txt['profileAction'],
         'areas' => array()
      );

      // You shouldn't PM (or ban really..) yourself!! (only administrators see this because it's not in the menu.)
      if (!$context['user']['is_owner'] && allowedTo('pm_send'))
         $context['profile_areas']['profile_action']['areas']['send_pm'] = '<a href="' . $scripturl . '?action=pm;sa=send;u=' . $memID . '">' . $txt['profileSendIm'] . '</a>';
      // We don't wanna ban admins, do we?
      if (allowedTo('manage_bans') && $user_profile[$memID]['ID_GROUP'] != 1 && !in_array(1, explode(',', $user_profile[$memID]['additionalGroups'])))
         $context['profile_areas']['profile_action']['areas']['banUser'] = '<a href="' . $scripturl . '?action=ban;sa=add;u=' . $memID . '">' . $txt['profileBanUser'] . '</a>';

      // You may remove your own account 'cuz it's yours or you're an admin.
      if (($context['user']['is_owner'] && allowedTo('profile_remove_own')) || allowedTo('profile_remove_any'))
         $context['profile_areas']['profile_action']['areas']['deleteAccount'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=deleteAccount">' . $txt['deleteAccount'] . '</a>';
   }

   // This is here so the menu won't be shown unless it's actually needed.
   if (!isset($context['profile_areas']['info']['areas']['trackUser']) && !isset($context['profile_areas']['info']['areas']['showPermissions']) && !isset($context['profile_areas']['edit_profile']) && !isset($context['profile_areas']['profile_action']['areas']['banUser']) && !isset($context['profile_areas']['profile_action']['areas']['deleteAccount']))
      $context['profile_areas'] = array();

   // Set the selected items.
   $context['menu_item_selected'] = $_REQUEST['sa'];
   $context['sub_template'] = $_REQUEST['sa'];

   // All the subactions that require a user password in order to validate.
   $context['require_password'] = in_array($context['menu_item_selected'], array('account'));

   $context['member'] = array(
      'id' => $memID,
      'username' => $user_profile[$memID]['memberName'],
      'name' => !isset($user_profile[$memID]['realName']) || $user_profile[$memID]['realName'] == '' ? '' : $user_profile[$memID]['realName'],
      'email' => $user_profile[$memID]['emailAddress'],
      'posts' => empty($user_profile[$memID]['posts']) ? 0: (int) $user_profile[$memID]['posts'],
      'hide_email' => empty($user_profile[$memID]['hideEmail']) ? 0 : $user_profile[$memID]['hideEmail'],
      'show_online' => empty($user_profile[$memID]['showOnline']) ? 0 : $user_profile[$memID]['showOnline'],
      'registered' => empty($user_profile[$memID]['dateRegistered']) ? $txt[470] : strftime('%Y-%m-%d', $user_profile[$memID]['dateRegistered'] + ($user_info['time_offset'] + $modSettings['time_offset']) * 3600),
      'group' => $user_profile[$memID]['ID_GROUP'],
      'gender' => array('name' => empty($user_profile[$memID]['gender']) ? '' : ($user_profile[$memID]['gender'] == 2 ? 'f' : 'm')),
      'karma' => array(
         'good' => empty($user_profile[$memID]['karmaGood']) ? '0' : $user_profile[$memID]['karmaGood'],
         'bad' => empty($user_profile[$memID]['karmaBad']) ? '0' : $user_profile[$memID]['karmaBad'],
      ),
      'avatar' => array(
         'name' => &$user_profile[$memID]['avatar'],
         'href' => empty($user_profile[$memID]['ID_ATTACH']) ? '' : (empty($user_profile[$memID]['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $user_profile[$memID]['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $user_profile[$memID]['filename']),
         'custom' => stristr($user_profile[$memID]['avatar'], 'http://') ? $user_profile[$memID]['avatar'] : 'http://',
         'selection' => $user_profile[$memID]['avatar'] == '' || stristr($user_profile[$memID]['avatar'], 'http://') ? '' : $user_profile[$memID]['avatar'],
         'ID_ATTACH' => &$user_profile[$memID]['ID_ATTACH'],
         'filename' => &$user_profile[$memID]['filename'],
         'allow_server_stored' => allowedTo('profile_server_avatar') || !$context['user']['is_owner'],
         'allow_upload' => allowedTo('profile_upload_avatar') || !$context['user']['is_owner'],
         'allow_external' => allowedTo('profile_remote_avatar') || !$context['user']['is_owner'],
      ),
      'icq' => array('name' => !isset($user_profile[$memID]['ICQ']) ? '' : $user_profile[$memID]['ICQ']),
      'aim' => array('name' => empty($user_profile[$memID]['AIM']) ? '' : str_replace('+', ' ', $user_profile[$memID]['AIM'])),
      'yim' => array('name' => empty($user_profile[$memID]['YIM']) ? '' : $user_profile[$memID]['YIM']),
      'msn' => array('name' => empty($user_profile[$memID]['MSN']) ? '' : $user_profile[$memID]['MSN']),
      'website' => array(
         'title' => !isset($user_profile[$memID]['websiteTitle']) ? '' : $user_profile[$memID]['websiteTitle'],
         'url' => !isset($user_profile[$memID]['websiteUrl']) ? '' : $user_profile[$memID]['websiteUrl'],
      ),
   );

   // Call the appropriate subaction function.
   $_REQUEST['sa']($memID);

   if (!empty($post_errors))
   {
      // Set all the errors so the template knows what went wrong.
      foreach ($post_errors as $error_type)
         $context['modify_error'][$error_type] = true;
      rememberPostData();
   }

   // Set the page title if it's not already set...
   if (!isset($context['page_title']))
      $context['page_title'] = $txt[79] . ' - ' . $txt[$_REQUEST['sa']];
}

Dzonny

Tu je defnisan avatar, ali ga trebaš dodati u profile.template da bi se prikazao tamo gde ti hoćeš.
Svakako da je kod onaj koji si pokušavao. Jesi li siguran da si dobro postavio kod?
Prikači fajl sa postavljenim kodom, kako si pokušavao, kao attachment da pogledam.

Dzungla

evo od linije 20, stoji poslednji kod koji si mi dao

Cola-Coca

Quote from: Dzungla on December 02, 2010, 03:42:43 AM
Vraceno je po Stefan80 po tvojoj zelji ili naredbi    ;D

Nije moja zelja vec je zelja SMF autora. Jedino sto trazu je od svih nas to da stoji taj copyright na samom dnu foruma. Mislim da puno i netraze zar ne !??!
;)
I LOVE SMF

Dzonny

Ovo kod mene prikazuje avatare, kao što ti želiš. Ajde probaj kod tebe, pa javi rezultate.

Dzungla

#18
ma jok .. prazno polje

Dzungla

da mozda negde ne zeza    Ultimate Profile    0.9.1

Advertisement: