||ŞaMaTa|| Admin
Mesaj Sayısı : 315 Yaş : 32 Nerden : rize HobiLEr : Tiyatro İsminiz : Şakir Takımım : 3 Rep : 146 Kayıt tarihi : 17/12/08
| Konu: Ultimate Profile Mod C.tesi Ekim 24, 2009 8:41 am | |
| [url=Demo: http://jovant.guruserve.c...ex.php?action=profile;u=1]Demo: http://jovant.guruserve.c...ex.php?action=profile;u=1[/url]Modifikasyon linki: http://custom.simplemachi...g/mods/index.php?mod=1675Türkçe'si: Ekteki dosyayi Themes/default/languages klasorune atin. Manuel kurulum: ../Sources/Profile.php Arayın: - Kod:
-
loadLanguage('Profile'); loadTemplate('Profile'); Değiştirin: - Kod:
-
loadLanguage('Profile'); loadLanguage('UltimateProfile'); loadTemplate('Profile'); Arayın: - Kod:
-
'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: - Kod:
-
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: - Kod:
-
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: - Kod:
-
'forumProfile' => array(array('profile_extra_any', 'profile_extra_own'), array('profile_extra_any'), 'post'), Sonrasına Ekleyin: - Kod:
-
'customized' => array(array('edit_ultimate_profile_any', 'edit_ultimate_profile_own'), array('edit_ultimate_profile_any'), 'post'), Arayın: - Kod:
-
$context['profile_areas']['edit_profile']['areas']['editBuddies'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=editBuddies">' . $txt['editBuddies'] . '</a>'; Değiştirin: - Kod:
-
$context['profile_areas']['edit_profile']['areas']['editBuddies'] = '<a href="' . $scripturl . '?action=buddies">' . $txt['editBuddies'] . '</a>'; Arayın: - Kod:
-
global $context, $memberContext, $txt, $modSettings, $user_info, $user_profile, $sourcedir, $db_prefix, $scripturl; Değiştirin - Kod:
-
global $context, $memberContext, $txt, $modSettings, $user_info, $user_profile, $sourcedir, $db_prefix, $scripturl, $settings; Arayın: - Kod:
-
$context['member'] = &$memberContext[$memID]; Sonrasına Ekleyin - Kod:
-
// 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: - Kod:
-
// Recursive function to retrieve avatar files function getAvatars($directory, $level) Öncesine Ekleyin: - Kod:
-
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'; } http://www.smftr.com/forum/index.php?action=dlattach;topic=7582.0;attach=3852 | |
|