/********************************* MyBB.ru, Просмотр полного профиля на странице profile.php Версия: V2.0.0 Автор: Alex_63 Дата: 21.08.2016 Последние изменения: 21.08.2016 *********************************/ //============ РАБОТА ВО ФРЕЙМЕ =============// if(self!==top&&window.name=='load_Guest_profile')(function(){ if (GroupID!=3 && location.hostname.substr(0,4)=='www.'){$.get('/login.php?action=out&id='+UserID,function(){location.reload()}); } else $(document).ready(function(){ var cnt = $('#viewprofile-next')[0]; //alert(cnt); if(cnt){cnt = cnt.outerHTML;}else cnt = 'NULL'; var Data = {Profile_Preview_content:cnt}; //console.log(Data); self.parent.postMessage(Data,'*'); }); }()); //==== //END//- Работа во фрейме ============// //==== РАБОТА НА СТРАНИЦЕ /profile.php =====// if(self===top && $('#pun-profile').length && document.URL.indexOf('section=')==-1)(function() { var GroupAccess = false; if(GroupID!=3&&(+document.URL.match(/(?:profile.php\?id=)(\d+)(?:.*?)$/)[1]==UserID||GroupID<=2))GroupAccess = true; if(!GroupAccess)return; //======= Получаем контент из фрейма ========// window.onmessage = function(e){ //console.log(e); if(e.data && e.data.Profile_Preview_content && e.data.Profile_Preview_content!='NULL'){ $('#profile').replaceWith(e.data.Profile_Preview_content); // alert(e.data.Profile_Preview_content); $('head > iframe[name="load_Guest_profile"]').replaceWith(''); var li = $('
  • E-mail:
  • '); var email = AccessEmail ? 'Послать e-mail' : '(Скрыт)'; var pm = AccessPM ? ' - Отправить ЛС' : ''; if(email)li.find('strong').prepend(email); if(pm)li.find('strong').append(pm); if(!AccessEmail&&!AccessPM)li = ''; if($('#viewprofile li span').filter(function(){return this.textContent=='E-mail:'}).length)return; $('#viewprofile').find('li span').filter(function(){return this.textContent=='Сообщений:'}).parent().before(li); }; }; //End// - window.onmessage //===========================================// //======= Установка и запуск ================// var WinLoc = location.hostname.replace(/^www\./gim,''); var DocURL = document.URL.replace(/^(?:[^\[\]]+?)(\/profile\.php)/gim,'$1'); var URLFrame = 'http://www.'+ WinLoc+DocURL; var id = document.URL.match(/(?:profile.php\?id=)(\d+)(?:.*?)$/)[1]; var AccessEmail = false,AccessPM = false; $('').appendTo('head'); $.ajax({url:'/misc.php?email='+id,async:false,success:function(res){if($(res).find('#pun-formemail').length)AccessEmail=true;}}); $(document).pun_mainReady(function(){ if($('#navpm').length)AccessPM = true; $('#profile').hide(); var lnkEditProfile = document.URL + '§ion=essentials'; var setLnkEdit = 'Редактировать профиль'; $('#pun-main h1').append(setLnkEdit); }); //End// - Установка и запуск //===========================================// }()); //=//End/-РАБОТА НА СТРАНИЦЕ /profile.php ===//