Ultimate Profile Mod

Started by Yağız..., November 01, 2008, 09:46:36 PM

Previous topic - Next topic

Yağız...

Modifikasyon linki: http://custom.simplemachines.org/mods/index.php?mod=1675
Türkçe'si:
Ekteki dosyayi Themes/default/languages klasorune atin.

Manuel kurulum:
../Sources/Profile.php
Arayın:
    loadLanguage('Profile');
    loadTemplate('Profile');


Değiştirin:
    loadLanguage('Profile');
    loadLanguage('UltimateProfile');
    loadTemplate('Profile');


Arayın:
        'forumProfile' => array(array('profile_extra_any', 'profile_extra_own'), array('profile_extra_any')),

Sonrasına Ekleyin:
        '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')),


Arayın:
        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>';


Değiştirin:
        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 ($modSettings['profile_enable_pictures'] == 1)
                $context['profile_areas']['edit_profile']['areas']['pictures'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=pictures">' . $txt['profile_pictures'] . '</a>';
        }

        if (($context['user']['is_owner'] && allowedTo('profile_extra_own')) || allowedTo('profile_extra_any'))
        {


Arayın:
        'forumProfile' => array(array('profile_extra_any', 'profile_extra_own'), array('profile_extra_any'), 'post'),

Sonrasına Ekleyin:
        'customized' => array(array('edit_ultimate_profile_any', 'edit_ultimate_profile_own'), array('edit_ultimate_profile_any'), 'post'),

Arayın:
            $context['profile_areas']['edit_profile']['areas']['editBuddies'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=editBuddies">' . $txt['editBuddies'] . '</a>';

Değiştirin:
            $context['profile_areas']['edit_profile']['areas']['editBuddies'] = '<a href="' . $scripturl . '?action=buddies">' . $txt['editBuddies'] . '</a>';

Arayın:
    global $context, $memberContext, $txt, $modSettings, $user_info, $user_profile, $sourcedir, $db_prefix, $scripturl;

Değiştirin:
    global $context, $memberContext, $txt, $modSettings, $user_info, $user_profile, $sourcedir, $db_prefix, $scripturl, $settings;

Arayın:
    $context['member'] = &$memberContext[$memID];

Sonrasına Ekleyin:
    // Which template should we use?
    if (@$context['member']['options']['customized_private'] == 1 && @$modSettings['enable_buddylist'] == 1) {
            if ($context['member']['is_reverse_buddy'] || allowedTo ('profile_extra_any') || $context['user']['is_owner'])
                $view_customized = true;
            else
                $view_customized = false;
    } else {
        $view_customized = true;
    }


    if ((isset ($context['member']['options']['customized']) && $context['member']['options']['customized'] == 1) || $modSettings['profile_enable_all'] == 1) {
        if ($view_customized) {
            loadTemplate ('UltimateProfile');
            $context['sub_template'] = 'summary2';
        }
    }

    // For avatars: if we're always html resizing, assume it's too large.
    if ($modSettings['avatar_action_too_large'] == 'option_html_resize' || $modSettings['avatar_action_too_large'] == 'option_js_resize') {
        $avatar_width = !empty($modSettings['avatar_max_width_external']) ? ' width="' . $modSettings['avatar_max_width_external'] . '"' : '';
        $avatar_height = !empty($modSettings['avatar_max_height_external']) ? ' height="' . $modSettings['avatar_max_height_external'] . '"' : '';
    } else {
        $avatar_width = '';
        $avatar_height = '';
    }


    // Prepare the buddy list.
    if (isset ($modSettings['enable_buddylist']) && $modSettings['enable_buddylist'] == '1') {
        $buddies = array();
        $request = db_query ('SELECT BUDDY_ID FROM ' . $db_prefix . 'buddies
                WHERE ID_MEMBER = ' . $context['member']['id'] . ' AND approved = 1
                ORDER BY position ASC, time_updated DESC
                LIMIT 0, 6', __FILE__, __LINE__);
        while ($row = mysql_fetch_assoc ($request))
            $buddies[] = $row['BUDDY_ID'];

        loadMemberData ($buddies);
        foreach ($buddies as $buddy) {
            $user_data = $user_profile[$buddy];
            $user_data['avatar_image'] = $user_data['avatar'] == '' ? ($user_data['ID_ATTACH'] > 0 ? '<img src="' . (empty($user_data['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $user_data['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $user_data['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($user_data['avatar'], 'http://') ? '<img src="' . $user_data['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($user_data['avatar']) . '" alt="" class="avatar" border="0" />');
            $user_data['is_online'] = (!empty($user_data['showOnline']) || allowedTo('moderate_forum')) && $user_data['isOnline'] > 0;

            if ($buddy != $memID)
                $context['member']['buddies_data'][$buddy] = $user_data;
        }
    }

    // Profile pictures.
    if ($modSettings['profile_enable_pictures'] == 1) {
        $request = db_query ('SELECT ID_PICTURE, time, title, filename
                FROM ' . $db_prefix . 'profile_pictures
                WHERE ID_MEMBER = ' . $memID . '
                ORDER BY RAND() LIMIT 6', __FILE__, __LINE__);
        while ($picture = mysql_fetch_assoc ($request)) {
            $context['pictures'][] = array (
                'ID_PICTURE' => $picture['ID_PICTURE'],
                'title' => $picture['title'],
                'url' => $scripturl . '?action=profile;u=' . $memID . ';sa=pictures;view=' . $picture['ID_PICTURE'],
                'thumb' => $modSettings['profile_pictures_url'] . '/' . $memID . '_' . $picture['time'] . '_thumb.' . get_extension ($picture['filename']),
                'time' => timeformat ($picture['time']),
            );
        }

        if (@$context['member']['options']['pictures_budd_only'] == 1 && @$modSettings['enable_buddylist'] == 1) {
            if ($context['member']['is_reverse_buddy'] || allowedTo ('profile_extra_any') || $context['user']['is_owner'])
                $context['can_view_pics'] = true;
            else
                $context['can_view_pics'] = false;
        } else
            $context['can_view_pics'] = true;
    }


    // Prepare and load comments.
    $request = db_query('SELECT COUNT(*)
        FROM ' . $db_prefix . 'profile_comments
        WHERE COMMENT_MEMBER_ID = "' . $memID . '"', __FILE__, __LINE__);
    list ($commentCount) = mysql_fetch_row ($request);
    mysql_free_result ($request);

    $maxComments = 10; // hard-coded; should this be configurable?

    // Make sure the starting place makes sense and construct our friend the page index.
    $context['start'] = (int)$_REQUEST['start'];
    $context['page_index'] = constructPageIndex($scripturl . '?action=profile;u=' . $memID, $context['start'], $commentCount, $maxComments, false);
    $context['current_page'] = $context['start'] / $maxComments;
    $context['current_member'] = $memID;
    $context['can_delete'] = allowedTo('profile_extra_any') || ($context['user']['is_owner'] && allowedTo('profile_extra_own'));

    $request = db_query ('SELECT com.ID_COMMENT, com.ID_MEMBER, com.comment, com.time, mem.realName, mem.showOnline,
                IFNULL(lo.logTime, 0) AS isOnline, IFNULL(a.ID_ATTACH, 0) AS ID_ATTACH, a.filename, a.attachmentType, mem.avatar
                FROM ' . $db_prefix . 'profile_comments as com
                    LEFT JOIN ' . $db_prefix . 'members AS mem ON (com.ID_MEMBER = mem.ID_MEMBER)
                    LEFT JOIN ' . $db_prefix . 'log_online AS lo ON (lo.ID_MEMBER = com.ID_MEMBER)
                    LEFT JOIN ' . $db_prefix . 'attachments AS a ON (a.ID_MEMBER = com.ID_MEMBER)
                WHERE com.COMMENT_MEMBER_ID = ' . $memID . '
                ORDER BY ID_COMMENT DESC
                LIMIT ' . $context['start'] . ', ' . $maxComments, __FILE__, __LINE__);

    while ($row = mysql_fetch_assoc ($request)) {

        censorText($row['comment']);

        $row['is_online'] = (!empty($row['showOnline']) || allowedTo('moderate_forum')) && $row['isOnline'] > 0;

        $context['comments'][] = array (
            'body' => parse_bbc ($row['comment']),
            'author' => array (
                'realName' => $row['realName'],
                'ID_MEMBER' => $row['ID_MEMBER'],
                'avatar' => $row['avatar'] == '' ? ($row['ID_ATTACH'] > 0 ? '<img src="' . (empty($row['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $row['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" class="avatar" border="0" />'),
                'online' => array (
                    'is_online' => $row['is_online'],
                    'text' => &$txt[$row['is_online'] ? 'online2' : 'online3'],
                    'href' => $scripturl . '?action=pm;sa=send;u=' . $row['ID_MEMBER'],
                    'link' => '<a href="' . $scripturl . '?action=pm;sa=send;u=' . $row['ID_MEMBER'] . '">' . $txt[$row['is_online'] ? 'online2' : 'online3'] . '</a>',
                    'image_href' => $settings['images_url'] . '/' . ($row['is_online'] ? 'useron' : 'useroff') . '.gif',
                    'label' => &$txt[$row['is_online'] ? 'online4' : 'online5']
                ),
            ),
            'time' => timeformat ($row['time']),
            'reply' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . ';sa=comment',
            'delete' => $scripturl . '?action=profile;u=' . $memID . ';sa=comment;delete=' . $row['ID_COMMENT'] . ';sesc=' . $context['session_id'],
        );

    }
    mysql_free_result ($request);


Arayın:
// Recursive function to retrieve avatar files
function getAvatars($directory, $level)


Öncesine Ekleyin:
function customized($memID)
{
    global $context, $modSettings, $sourcedir, $db_prefix, $func;

    // filter bad HTML...
    require_once $sourcedir . '/InputFilter.php';
    $allowed_tags = array ('b', 'i', 'u', 'a', 'p', 'br', 'span', 'style', 'div', 'img', 'hr', 'table', 'tr', 'td', 'object', 'embed', 'param', 'ul', 'ol', 'li', 'strong', 'em');
    $allowed_attribs = array ('href', 'title', 'id', 'class', 'style', 'align', 'type', 'src', 'height', 'width', 'alt', 'valign', 'border', 'cellspacing', 'cellpadding', 'colspan', 'name', 'value', 'flashvars');
    $myFilter = new InputFilter($allowed_tags, $allowed_attribs, 0, 0);

    // HTML&CSS customization field
    $request = db_query ('SELECT value FROM ' . $db_prefix . 'themes
            WHERE ID_MEMBER = "' . $memID . '" AND variable = "css"', __FILE__, __LINE__);
    while ($row = mysql_fetch_assoc ($request)) {
        $html = $myFilter->process (un_htmlspecialchars ($row['value']));
        db_query ('UPDATE ' . $db_prefix . 'themes SET
            value = SUBSTRING('' . addslashes (htmlspecialchars ($html)) . '', 1, 65534)
            WHERE ID_MEMBER = "' . $memID . '" AND variable = "css"', __FILE__, __LINE__);
    }

    // MediaBox field
    $request = db_query ('SELECT value FROM ' . $db_prefix . 'themes
            WHERE ID_MEMBER = "' . $memID . '" AND variable = "media"', __FILE__, __LINE__);
    while ($row = mysql_fetch_assoc ($request)) {
        $html = $myFilter->process (un_htmlspecialchars ($row['value']));
        db_query ('UPDATE ' . $db_prefix . 'themes SET
            value = SUBSTRING('' . addslashes (htmlspecialchars ($html)) . '', 1, 65534)
            WHERE ID_MEMBER = "' . $memID . '" AND variable = "media"', __FILE__, __LINE__);
    }

    // Just this and nothing more thanks to the SMF's powerful template system
    $context['show_spellchecking'] = !empty($modSettings['enableSpellChecking']) && function_exists('pspell_new');
    loadThemeOptions($memID);
}

function buddies($memID)
{
    global $modSettings, $context, $db_prefix, $user_profile, $scripturl;

    // For avatars: if we're always html resizing, assume it's too large.
    if ($modSettings['avatar_action_too_large'] == 'option_html_resize' || $modSettings['avatar_action_too_large'] == 'option_js_resize') {
        $avatar_width = !empty($modSettings['avatar_max_width_external']) ? ' width="' . $modSettings['avatar_max_width_external'] . '"' : '';
        $avatar_height = !empty($modSettings['avatar_max_height_external']) ? ' height="' . $modSettings['avatar_max_height_external'] . '"' : '';
    } else {
        $avatar_width = '';
        $avatar_height = '';
    }

    if (isset ($modSettings['enable_buddylist']) && $modSettings['enable_buddylist'] == '1') {
        $buddies = array();
        $request = db_query ('SELECT BUDDY_ID FROM ' . $db_prefix . 'buddies
                WHERE ID_MEMBER = ' . $context['member']['id'] . ' AND approved = 1
                ORDER BY position ASC, time_updated DESC', __FILE__, __LINE__);
        while ($row = mysql_fetch_assoc ($request))
            $buddies[] = $row['BUDDY_ID'];

        loadMemberData($buddies);
        foreach ($buddies as $buddy) {
            $user_data = $user_profile[$buddy];
            $user_data['avatar_image'] = $user_data['avatar'] == '' ? ($user_data['ID_ATTACH'] > 0 ? '<img src="' . (empty($user_data['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $user_data['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $user_data['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($user_data['avatar'], 'http://') ? '<img src="' . $user_data['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($user_data['avatar']) . '" alt="" class="avatar" border="0" />');
            $user_data['is_online'] = (!empty($user_data['showOnline']) || allowedTo('moderate_forum')) && $user_data['isOnline'] > 0;

            if ($buddy != $memID)
                $context['member']['buddies_data'][$buddy] = $user_data;
        }
    }
}

function pictures($memID)
{
    global $sourcedir;

    require_once $sourcedir . '/ProfilePictures.php';
    PicturesController($memID);
}

function get_extension ($filename)
{
    return substr (strrchr ($filename, '.'), 1);
}

function is_buddy ($memID, $buddyID)
{
    global $db_prefix, $buddy_list, $modSettings;

    // when buddy list if off, everybody is your friend
    if (!isset ($modSettings['enable_buddylist']) || $modSettings['enable_buddylist'] == '0')
        return true;

    if (!is_array ($buddy_list)) {
        $request = db_query ('SELECT buddy_list FROM ' . $db_prefix . 'members WHERE ID_MEMBER = ' . $memID, __FILE__, __LINE__);
        list ($buddy_list) = mysql_fetch_row ($request);

        $buddy_list = explode (',', $buddy_list);
    }

    if (in_array ($buddyID, $buddy_list))
        return true;
    else
        return false;
}

function comment($memID)
{
    global $context, $db_prefix, $txt, $sourcedir;

    // guests ar not allowed to comment
    is_not_guest();

    if (isset ($_GET['add'])) {
        if (!$_POST['comment'])
            fatal_error ($txt['profile_comment_field'], false);

        checkSession('post');

        // only buddies can post comments?
        loadThemeOptions($memID);
        if (isset ($context['member']['options']['comments_budd_only']) && $context['member']['options']['comments_budd_only'] == 1) {
            if (!is_buddy ($memID, $context['user']['id']) && !allowedTo('profile_extra_any'))
                fatal_error ($txt['profile_comments_buddies_only'], false);
        }


        $request =    db_query ('INSERT INTO ' . $db_prefix . 'profile_comments SET
            ID_MEMBER = "' . $context['user']['id'] . '",
            comment = '' . htmlspecialchars ($_POST['comment']) . '',
            time = "' . time() . '",
            COMMENT_MEMBER_ID = "' . $memID . '"', __FILE__, __LINE__);

        // should we notify user?
        if (@$context['member']['options']['comments_notif_disable'] != 1 && $context['user']['id'] != $memID) {
            require_once $sourcedir . '/Subs-Post.php';
            sendpm (array('to' => array($memID), 'bcc' => array()), sprintf ($txt['profile_notif_com_subject'], $context['user']['name']), sprintf ($txt['profile_notif_com_body'], $context['user']['name']), false, array ('id' => 0, 'name' => $txt['profile_notif_com_user'], 'username' => $txt['profile_notif_com_user']));
        }

        redirectexit('action=profile;u=' . $memID);

    } elseif (isset ($_GET['delete'])) {
        checkSession('get');

        $allowed = false;

        if (allowedTo('profile_extra_any'))
            $allowed = true;
        elseif ($context['user']['is_owner'] && allowedTo('profile_extra_own')) {
            // Are you deleting comment that is on your own profile?
            $request = db_query ('SELECT COMMENT_MEMBER_ID FROM ' . $db_prefix . 'profile_comments WHERE ID_COMMENT = "' . (int)$_GET['delete'] . '"', __FILE__, __LINE__);
            list ($user_id) = mysql_fetch_row ($request);

            if ($context['user']['id'] == $user_id)
                $allowed = true;
        }

        if ($allowed)
            db_query ('DELETE FROM ' . $db_prefix . 'profile_comments WHERE ID_COMMENT = "' . (int)$_GET['delete'] . '"', __FILE__, __LINE__);

        redirectexit ('action=profile;u=' . $memID);

    } else {
        // only buddies can post comments?
        loadThemeOptions($memID);
        if (isset ($context['member']['options']['comments_budd_only']) && $context['member']['options']['comments_budd_only'] == 1) {
            if (!is_buddy ($memID, $context['user']['id']) && !allowedTo('edit_ultimate_profile_any'))
                fatal_error ($txt['profile_comments_buddies_only'], false);
        }

        $context['sub_template'] = 'add_comment';

    }

}

function report($memID)
{
    global $context, $txt, $scripturl, $db_prefix, $user_info, $ID_MEMBER, $modSettings, $sourcedir, $language;

    is_not_guest();

    if ($memID == $ID_MEMBER)
        fatal_lang_error('profile_report_own', false);

    if (isset($_POST['sc']) || isset($_POST['submit'])) {
        checkSession();
        spamProtection('spam');

        $reporterName = un_htmlspecialchars($user_info['name']) . ($user_info['name'] != $user_info['username'] && $user_info['username'] != '' ? ' (' . $user_info['username'] . ')' : '');
        require_once($sourcedir . '/Subs-Post.php');

        // Find all of this forum's administrators.
        $request = db_query("
            SELECT ID_MEMBER, emailAddress, lngfile
            FROM {$db_prefix}members
            WHERE ID_GROUP = 1 OR FIND_IN_SET(1, additionalGroups)
                AND notifyTypes != 4
            ORDER BY lngfile", __FILE__, __LINE__);

        // Send every moderator an email.
        while ($row = mysql_fetch_assoc($request))
        {
            loadLanguage('UltimateProfile', empty($row['lngfile']) || empty($modSettings['userLanguage']) ? $language : $row['lngfile'], false);

            // Send it to the administrator.
            sendmail($row['emailAddress'], $txt['profile_report_subject'] . ': ' . $context['member']['name'],
                sprintf($txt['profile_report_email1'], $context['member']['name']) . $txt['profile_report_email2'] . ' ' . (empty($ID_MEMBER) ? $txt['guest'] . ' (' . $user_info['ip'] . ')' : $reporterName) . ' ' . $txt['profile_report_email3'] . ":  " .
                $scripturl . '?action=profile;u=' . $context['member']['id'] . "  " .
                $txt['profile_report_comment'] . ": " .
                $_POST['comment'] . "  " .
                $txt[130], $user_info['email']);
        }
        mysql_free_result($request);
        redirectexit();
    }

    $context['sub_template'] = 'report_profile';
}

Yağız...

#1
../Themes/default//Profile.template.php
Arayın:
if (!empty($context['profile_areas']))

Değiştirin:
if (!empty($context['profile_areas']) && $context['sub_template'] !== 'summary2')

Arayın:
// Can they add this member as a buddy?
if (!empty($context['can_have_buddy']) && !$context['user']['is_owner'])
echo '
&nbsp;&nbsp;<a href="', $scripturl, '?action=buddy;u=', $context['member']['id'], ';sesc=', $context['session_id'], '">[', $txt['buddy_' . ($context['member']['is_buddy'] ? 'remove' : 'add')], ']</a>';


Değiştirin:
// Can they add this member as a buddy?
if (!empty($context['can_have_buddy']) && !$context['user']['is_owner'])
echo '
&nbsp;&nbsp;<a href="', $scripturl, '?action=buddies;sa=add;u=', $context['member']['id'], ';sesc=', $context['session_id'], '">[', $txt['buddy_add'], ']</a>';


Arayın:
// Template for showing theme settings. Note: template_options() actually adds the theme specific options.
function template_theme()


Öncesine Ekleyin:
// Template for profile specific options - about me, interests, customization...
function template_customized()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;

// The main containing header.
echo '
<form action="', $scripturl, '?action=profile2" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator" enctype="multipart/form-data">
<table border="0" width="85%" cellspacing="1" cellpadding="4" align="center" class="bordercolor">
<tr class="titlebg">
<td height="26">
&nbsp;<img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" align="top" />&nbsp;
', $txt['profile_customized'] , '
</td>
</tr><tr class="windowbg">
<td class="smalltext" height="25" style="padding: 2ex;">
', $txt['profile_customized_info'], '
</td>
</tr><tr>
<td class="windowbg2" style="padding-bottom: 2ex;">
<table border="0" width="100%" cellpadding="5" cellspacing="0">';

echo ' <tr>
<td width="40%" valign="top">
<b>', $txt['profile_customize_enable'], '</b>
</td>
<td>
<input type="hidden" name="default_options[customized]" value="0" /><input type="checkbox" name="default_options[customized]"', (@$context['member']['options']['customized'] == 1) ? ' checked="checked"' : '', ' value="1" class="check" />
</td>
</tr>
<tr>
<td colspan="2"><br /></td>
</tr>
<tr>
<td width="40%" valign="top">
<b>', $txt['profile_customize_private'], '</b>
</td>
<td>
<input type="hidden" name="default_options[customized_private]" value="0" /><input type="checkbox" name="default_options[customized_private]"', (@$context['member']['options']['customized_private'] == 1) ? ' checked="checked"' : '', ' value="1" class="check" />
</td>
</tr>
<tr>
<td width="40%" valign="top">
<b>', $txt['profile_comments_disable'], '</b>
</td>
<td>
<input type="hidden" name="default_options[comments_disable]" value="0" /><input type="checkbox" name="default_options[comments_disable]"', (@$context['member']['options']['comments_disable'] == 1) ? ' checked="checked"' : '', ' value="1" class="check" />
</td>
</tr>
<tr>
<td width="40%" valign="top">
<b>', $txt['profile_comments_budd_only'], '</b>
</td>
<td>
<input type="hidden" name="default_options[comments_budd_only]" value="0" /><input type="checkbox" name="default_options[comments_budd_only]"', (@$context['member']['options']['comments_budd_only'] == 1) ? ' checked="checked"' : '', ' value="1" class="check" />
</td>
</tr>
<tr>
<td width="40%" valign="top">
<b>', $txt['profile_comments_notif_disable'], '</b>
</td>
<td>
<input type="hidden" name="default_options[comments_notif_disable]" value="0" /><input type="checkbox" name="default_options[comments_notif_disable]"', (@$context['member']['options']['comments_notif_disable'] == 1) ? ' checked="checked"' : '', ' value="1" class="check" />
</td>
</tr>';
if ($modSettings['profile_enable_pictures'] == 1)
echo '
<tr>
<td width="40%" valign="top">
<b>', $txt['profile_pictures_budd_only'], '</b>
</td>
<td>
<input type="hidden" name="default_options[pictures_budd_only]" value="0" /><input type="checkbox" name="default_options[pictures_budd_only]"', (@$context['member']['options']['pictures_budd_only'] == 1) ? ' checked="checked"' : '', ' value="1" class="check" />
</td>
</tr>';
echo '
<tr>
<td colspan="2">
<br />
<hr class="hrcolor" />
</td>
</tr>
<tr>
<td width="40%" valign="top">
<b>', $txt['profile_about'], ':</b>
<div class="smalltext">', $txt['profile_about_desc'], '</div><br />
<br />';

if ($context['show_spellchecking'])
echo '
<input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'creator\', \'default_options[about]\');" />';

echo '
</td>
<td>
<textarea class="editor" name="default_options[about]" rows="8" cols="65">', @$context['member']['options']['about'], '</textarea><br />';

// Load the spell checker?
if ($context['show_spellchecking'])
echo '
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/spellcheck.js"></script>';

echo ' </td>
</tr>';

echo '
<tr>
<td width="40%" valign="top">
<b>', $txt['profile_interests'], ':</b>
<div class="smalltext">', $txt['profile_interests_desc'], '</div><br />
<br />';

if ($context['show_spellchecking'])
echo '
<input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'creator\', \'default_options[interests]\');" />';

echo '
</td>
<td>
<textarea class="editor" name="default_options[interests]" rows="8" cols="65">', @$context['member']['options']['interests'], '</textarea><br />
</td>
</tr>';

if ($modSettings['profile_allow_mediabox'] == 1)
echo '
<tr>
<td width="40%" valign="top">
<b>', $txt['profile_media'], ':</b>
<div class="smalltext">', $txt['profile_media_desc'], '</div><br />
<br />
</td>
<td>
<textarea class="editor" name="default_options[media]" rows="8" cols="65">', @$context['member']['options']['media'], '</textarea><br />
</td>
</tr>';

if ($modSettings['profile_allow_customize'] == 1)
echo '
<tr>
<td colspan="2">
<br />
<hr class="hrcolor" />
</td>
</tr>

<tr>
<td width="40%" valign="top">
<b>', $txt['profile_css'], ':</b>
<div class="smalltext">', $txt['profile_css_desc'], '</div><br />
<br />
</td>
<td>
<textarea class="editor" name="default_options[css]" rows="8" cols="65">', @$context['member']['options']['css'], '</textarea><br />
</td>
</tr>';

// Show the standard "Save Settings" profile button.
template_profile_save();

echo '
</table>
</td>
</tr>
</table>';

echo '
</form>';

if ($context['show_spellchecking'])
echo '
<form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value="" /></form>';
}

function template_report_profile()
{
global $context, $txt, $scripturl;

echo '
<form action="', $scripturl, '?action=profile;u=', $context['member']['id'] ,';sa=report" method="post" accept-charset="', $context['character_set'], '">
<table border="0" width="80%" cellspacing="0" class="tborder" align="center" cellpadding="4">
<tr class="titlebg">
<td>', $txt['profile_report_text1'], '</td>
</tr><tr class="windowbg">
<td style="padding-bottom: 3ex;" align="center">
<div style="margin-top: 1ex; margin-bottom: 3ex;" align="left">', $txt['profile_report_text2'], '</div>
', $txt['profile_report_text3'], ': <input type="text" name="comment" size="50" />
<input type="submit" name="submit" value="', $txt['profile_report_submit'], '" style="margin-left: 1ex;" />
</td>
</tr>
</table>
<input type="hidden" name="sc" value="', $context['session_id'], '" />
</form>';
}

function template_add_comment()
{
global $context, $txt, $scripturl;

echo '
<form action="', $scripturl, '?action=profile;u=', $context['member']['id'] ,';sa=comment;add" method="post" accept-charset="', $context['character_set'], '">
<table border="0" width="80%" cellspacing="0" class="tborder" align="center" cellpadding="4">
<tr class="titlebg">
<td>', $context['member']['name'] ,': ', $txt['profile_comment_add'], '</td>
</tr>
<tr class="windowbg">
<td style="padding: 3ex;">
', $txt['profile_comment'], ':<br />
<textarea  cols="50" rows="4" name="comment"></textarea><br />
<br />
<input type="submit" name="submit" value="', $txt[10], '" />
</td>
</tr>
</table>
<input type="hidden" name="sc" value="', $context['session_id'], '" />
</form>';
}

function template_buddies()
{
global $context, $settings, $txt, $scripturl;

echo '
<table border="0" width="85%" cellspacing="1" cellpadding="4" align="center" class="bordercolor">
<tr class="titlebg">
<td height="26">
&nbsp;<img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" align="top" />&nbsp;
<a href="', $scripturl ,'?action=profile;u=', $context['member']['id'] ,'">', $context['member']['name'] ,'</a> - ', $txt['profile_buddies'] ,'
</td>
</tr>
<tr>
<td class="windowbg2" style="padding-bottom: 2ex;">
<table width="100%">';

if (isset ($context['member']['buddies_data'])) {
$i = 1;
foreach ($context['member']['buddies_data'] as $buddy_id => $data) {
if ($i == 1)
echo '
<tr>';
echo '
<td align="center">
', $data['avatar_image'],'<br />
<a href="', $scripturl , '?action=profile;u=', $data['ID_MEMBER'] , '">' , $data['realName'] , '</a><br />
<i>', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/buddy_' . ($data['is_online'] ? 'useron' : 'useroff') . '.gif' . '" alt="' . $txt[$data['is_online'] ? 'online2' : 'online3'] . '" align="middle" />' : $txt[$data['is_online'] ? 'online2' : 'online3'], $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $txt[$data['is_online'] ? 'online2' : 'online3'] . '</span>' : '', '</i>
</td>';
if ($i == 3)
echo '
</tr>';

$i++;
if ($i == 4) $i = 1;
}
} else
echo ' <tr><td>', $txt['profile_buddies_no'] ,'</td></tr>';

echo '
</table>
</td>
</tr>
</table>';
}


../Sources/ModSettings.php
Arayın:
);

// By default do the basic settings.
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'basic';
$context['sub_action'] = $_REQUEST['sa'];


Değiştirin:
'ultprofile' => 'ModifyUltProfileSettings',
);

// By default do the basic settings.
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'basic';
$context['sub_action'] = $_REQUEST['sa'];


Arayın:
);

// Default to core (I assume)
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'basic';


Değiştirin:
'ultprofile' => 'ModifyUltProfileSettings',
);

// Default to core (I assume)
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'basic';


Arayın:
'layout' => array(
'title' => $txt['mods_cat_layout'],
'href' => $scripturl . '?action=featuresettings;sa=layout;sesc=' . $context['session_id'],
),


Sonrasına Ekleyin:
'ultprofile' => array(
'title' => $txt['ultimate_profile'],
'href' => $scripturl . '?action=featuresettings;sa=ultprofile;sesc=' . $context['session_id'],
),


Arayın:
function ModifyKarmaSettings()

Öncesine Ekleyin:
function ModifyUltProfileSettings()
{
global $txt, $scripturl, $context, $settings, $sc;

loadLanguage('UltimateProfile');

$config_vars = array(
array('check', 'profile_enable_all'),
'',
array('check', 'profile_enable_pictures'),
array('text', 'profile_pictures_path'),
array('text', 'profile_pictures_url'),
array('int', 'profile_pictures_number'),
array('int', 'profile_pictures_width'),
'',
array('check', 'profile_allow_customize'),
array('check', 'profile_allow_mediabox'),
);

// Saving?
if (isset($_GET['save']))
{
saveDBSettings($config_vars);
redirectexit('action=featuresettings;sa=ultprofile');
}

$context['post_url'] = $scripturl . '?action=featuresettings2;save;sa=ultprofile';
$context['settings_title'] = $txt['ultimate_profile'];

prepareDBSettingContext($config_vars);
}


../Themes/default/languages/Modifications.turkish.php
Arayın:
?>

Öncesine Ekleyin:
$txt['ultimate_profile'] = 'Özelleþtirilmiþ Profil';
$txt['permissionname_edit_ultimate_profile'] = 'Özelleþtirilmiþ profili düzenle';
$txt['permissionname_edit_ultimate_profile_own'] = 'Kendi profilini';
$txt['permissionname_edit_ultimate_profile_any'] = 'Herhangi bir profili';
$txt['permissionhelp_edit_ultimate_profile'] = 'Bu izin üyelerin özelleþtirilmiþ profillerini düzenlemesini saðlar.';
$txt['cannot_edit_ultimate_profile_own'] = 'Kendi özelleþtirilmiþ profilinizi düzenlemeye yetkiniz yok.';
$txt['cannot_edit_ultimate_profile_any'] = 'Baþkasýnýn özelleþtirilmiþ profilinizi düzenlemeye yetkiniz yok.';


../index.php
Arayın:
'buddy' => array('Subs-Members.php', 'BuddyListToggle'),

Sonrasına Ekleyin:
'buddies' => array('Buddies.php', 'BuddiesMain'),

../Sources/ManagePermissions.php
Arayın:
'profile_remove' => true,

Sonrasına Ekleyin:
'edit_ultimate_profile' => true,

Arayın:
'manage_bans',
'send_mail',


Sonrasına Ekleyin:
'edit_ultimate_profile',

../Sources/Subs-Members.php
Arayın:
db_query("
DELETE FROM {$db_prefix}collapsed_categories
WHERE ID_MEMBER $condition", __FILE__, __LINE__);


Sonrasına Ekleyin:
db_query("
DELETE FROM {$db_prefix}buddies
WHERE ID_MEMBER $condition
OR BUDDY_ID $condition", __FILE__, __LINE__);
db_query("
DELETE FROM {$db_prefix}profile_comments
WHERE COMMENT_MEMBER_ID $condition", __FILE__, __LINE__);
db_query("
DELETE FROM {$db_prefix}profile_albums
WHERE ID_MEMBER $condition", __FILE__, __LINE__);

$request = db_query ("SELECT ID_PICTURE FROM {$db_prefix}profile_pictures WHERE ID_MEMBER $condition", __FILE__, __LINE__);
require_once($sourcedir . '/ProfilePictures.php');
while ($row = mysql_fetch_assoc ($request)) {
delete_picture ($row['ID_PICTURE']);
}

Manuel(elle) kurulum bitmiştir. Aşağıdaki dosyalarıda karşılarında söylenen yerlere atınız.

  • Sources dosyası forum anadizinine.
  • Themes dosyası forum anadizinine.
  • profile_pictures dosyası forum anadizinine.
Son olarakta database.php dosyasını forum anadizininize atıp çalıştırıyorsunuz.
Manuel kurulum tek mesaja sığmadığından iki mesaj halinde gönderilmiştir. Eski konu kilitlenmiştir. Lütfen buradan devam ediniz.

♀φ®♪└┘δ


Ben  modu  kurdum,  aktif ettim, üye   izinlerini de verdim  kendi  profilimdeki yerleri düzenledikten sonra  kaydederken "profil  bulunamadı" hatası verdi bir iki kez tekrar denedim ve  şuan  kurdugum mod yönetimden aktif  görünmesine  rağmen  ben profilden göremiyorum... Neden olabilir? nasıl düzelir??

Yağız...

Özel mesajda Profile.php'de hata verdiğini yazmıştınız. Buradaki manuel kurulumu dener misiniz? Muhtemelen o hatadan kaynaklanıyordur.

Mur4T

Üstadlar. Şöyle bir sıkıntım var. Resimlerin altına yorum yapıldığında avatarlar kocaman gözüküyor. yani üye avatarını başka bir url den yüklemiş. Boyutuda 487×478. Avatarı otomatik 150x150 ayarlı ama. Burda avatarını yüklediği url deki orjinal boyut çıkıyor. Bu ayarlanabilir mi acaba. Saygılar...

♀φ®♪└┘δ


Evet  profile.php  de kurulum yaparken hata vermişti  dün manuel kurmuştum oray  ama  kurulumdan sonra çalışmıştı.Az önce baktım bazı  kodları  değiştirmemişim ve  ilk mesajda  verilen tüm değişiklikleri  yaptım bu sefer de   2639  satır için  parse  error  hatası verdi. O satır da  aşağıdaki  gibi.. ( daha  önce  profilime  bakanlar  modu vardı  çakışmış olabilir mi?

            value = SUBSTRING('' . addslashes (htmlspecialchars ($html)) . '', 1, 65534)

Yaptığım  değişikliklerden sonraki  profile.php   ekte....

ahdevefa

bu modu sorunsuz yükledim fakat daha önce yuklediğim referral mod linkinin bu yenı profil tipindede gösterilmesini istiyorum....bunda gorulmuyor....bunu nasıl halledecez?????.

♀φ®♪└┘δ


Arkadaşlar    benim  soruna  el  atabilecek biris yok mu?

Hoochie Coochie Man

@PaRDuS kurulumu başa alıp tekrar denemeni tavsiye ederim.
İnadına SMF 1.1.X

♀φ®♪└┘δ

erhan  kurulumu  ben paket  olarak  yapmıştım sadece Sources/Profile.php dosyasında  hata vermişti.  o  dosyayı da  manuel  editledim ilk mesaj değişmiş galiba  benim de  dikkatimi  çekti. Değişen yer neresi söyleyebilirsen ya da ekteki dosyaya  bakabilirsen oradan düzelteyim ya da  sıfırdan Sources/Profile.php yi  yukardaki anlatıma göre editlemek zorunda  kalacağım :)

Hoochie Coochie Man

Yooo hayır ben kodlarda birşey değiştirmedim, mod linki çalışmıyordu, onu düzelttim. Zaten sana tavsiye ettiğimde oydu, profil.php yi yukarıdaki anlatıma göre tekrar düzenlemek.
İnadına SMF 1.1.X

♀φ®♪└┘δ


Arkadaşlar  yine manuel olarak  profil.php yi  editledim  yine  aynı  satırda  hata verdi  sorun nedir bakabilirmisiniz.  Profil.php yukardaki  mesajımda  ekte de vardı bakabilirseniz...

Verdiği Satır Hatası:
Quote
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/xxxxx/public_html/forum/Sources/Profile.php on line 2639

Yağız...

Emin degilim ama ektekini dener misin?

horoz29

Bendede hata verdi. Sonradan düzelttim. modifactions.turkish.php türkçe karakterlerde sorun var. onları düzgün şekilde verirsen düzelecek.

$txt['ultimate_profile'] = 'Özelleştirilmiş Profil';
$txt['permissionname_edit_ultimate_profile'] = 'Özelleştirilmiş profili düzenle';
$txt['permissionname_edit_ultimate_profile_own'] = 'Kendi profilini';
$txt['permissionname_edit_ultimate_profile_any'] = 'Herhangi bir profili';
$txt['permissionhelp_edit_ultimate_profile'] = 'Bu izin üyelerin özelleştirilmiş profillerini düzenlemesini sağlar.';
$txt['cannot_edit_ultimate_profile_own'] = 'Kendi \ özelleştirilmiş profilinizi düzenlemeye yetkiniz yok.';
$txt['cannot_edit_ultimate_profile_any'] = 'Başkasını\'nın özelleştirilmiş profilinizi düzenlemeye yetkiniz yok.';
------------

\  bu işareti koyunca düzeldi.... Bu kısmı düzgün verebilirsen bizde tam düzeltelim. Şimdiden Teşekkürler...

Yağız...

Oralarda tırnak işareti yok ki?..

♀φ®♪└┘δ


Yağız  denedm ama  yine aynı hatayı verdi...Bir  çözümü  olmalı..

♀φ®♪└┘δ

 
flod  olacak  ama  2  gün  geçti  ve   sorunu  halledebilecek yok mu?

Yağız...

Bu hatayı hiç almamıştım. O yüzden bilemiyorum.

♀φ®♪└┘δ

 
Yukardaki ekteki  Profil.php  de ya da  aşağıdaki  satırda sorun ne?


value = SUBSTRING('' . addslashes (htmlspecialchars ($html)) . '', 1, 65534)

a11

Bir ara bende bu modifikasyonu kurmuştum , sitede seo kurulu diye hatalar vermişti.
Seo kurulu mu sitede ? O yüzden hata veriyor olmasın ?

Advertisement: