Mini Shell Moded By TiGER HeX
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
var
/
www
/
ridazz
/
js
/
Linux midnightridazz 4.19.0-11-cloud-amd64 #1 SMP Debian 4.19.146-1 (2020-09-17) x86_64
Upload File :
New :
File
Dir
//var/www/ridazz/js/script.js
/* Author: */ var propFind = function(needle, hay, property){ for(var i=0; i<hay.length; i++){ if(hay[i][property] == needle){ return i; } } return; } var MRCache = new Object();; $(function(){ var middle = $('#middleColumn'); var right = $('#rightColumn'); var left = $('#leftColumn'); //calendar //legends $('#headnav > a').live('click', function(e){ e.preventDefault(); var loc = e.currentTarget.hash; $(".page:not('#forum')").slideUp('fast'); $(loc).slideDown('slow'); } ); $.ajax({type:'GET',url:'json.php',data:{forum:'10',event:'30',imageList:'55',pages:'',sexiest:'',legends:''}, dataType:'script', success: function(){ MRCache.pages = MR.pages, MRCache.forum = MR.forum, MRCache.event = MR.event, MRCache.imageList = MR.imageList; //setup home var homeIndex = propFind('index', MR.pages, 'page'); var YouRidazz = propFind('youtube', MR.pages, 'page'); var Headline = propFind('headline', MR.pages, 'page'); var AboutRidazz = propFind('about', MR.pages, 'page'); console.log('hi'); $('#homeIndex')[0].innerHTML = MR.pages[homeIndex].content; $('#YouRidazz')[0].innerHTML = MR.pages[YouRidazz].content; console.log('hi'); $('#Headline')[0].innerHTML = MR.pages[Headline].content; console.log('hi'); $('#AboutRidazz')[0].innerHTML = MR.pages[AboutRidazz].content; console.log('hi'); //build legends list var ret=''; $.each(MR.legends, function(i, legend){ ret += '<a href="viewStory.php?storyId='+legend.storyId+'"><h4>'+legend.title+'</h4>' + (legend.images ? '<img src="http://midnightridazz.com/images/stories/small/'+legend.images[0]+'" />' : '' )+ '</a><p>'+legend.content+'...</p><a href="viewStory.php?storyId='+legend.storyId+'">[ Read More... ]</a>'; console.log(legend); }); $('#Legends')[0].innerHTML = ret; //build the forum list var ret=''; $.each(MR.forum, function(i, topic){ ret += '<tr><td><a class="mr-btn-forum" topic="'+topic.topic_id+'" href="forums.php?topicId='+topic.topic_id+'">'+topic.title.substr(0, 20)+'</a></td></tr>'; }); $('#ForumsTopList')[0].innerHTML = ret; //build the photo gallery list var ret=''; $.each(MR.imageList, function(i, image){ ret += '<a class="mr-btn-gallery" href="viewPhoto.php?galleryId='+image.gallery_id+'&artistId='+image.artist_id+'" class="rightColumn">'+image.artist_name.substr(0, 20)+'</a><br />'; }); $('#RecentGalleryList')[0].innerHTML = ret; //build the ride list var ret='', retImg=''; var oldTime; $.each(MR.event, function(i, event){ if(oldTime != event.entry_time){ oldTime = event.entry_time; ret += '<tr><td><hr /></td></tr><tr><td>'+event.entry_time+'</td></tr>' } ret += '<tr><td><a class="mr-btn-event" href="viewStory.php?storyId='+event.story_id+'"><img src="img/bicon.gif" /><div>'+event.story_title+'</div></a></td></tr>'; retImg += '<a href="viewStory.php?storyId='+event.story_id+'"><h4><img src="img/bicon.gif" />'+event.story_title+'</h4><h5>' +event.entry_time+'</h5>' + (event.images ? '<img src="http://midnightridazz.com/images/stories/small/'+event.images+'" />' : '' )+'</a>'; }); $('#RideList')[0].innerHTML = ret; $('#RideListImg')[0].innerHTML = retImg; var Sexiest = MR.sexiest[0]; $('#Sexiest')[0].innerHTML = '<a href="viewPhoto.php?artistId=' +Sexiest.artistId+'galleryId=' +Sexiest.galleryId+'"><img src="http://midnightridazz.com/images/gallery/large/'+Sexiest.image+'" /></a>'; //hook button click events to handlers $('.mr-btn-forum').live('click', ShowForum ); $('.mr-btn-event').live('click', ShowEvent ); $('.mr-btn-gallery').live('click', ShowGallery ); } }); }); var ShowEvent = function(e){ e.preventDefault(); var eventId =$(this).attr('href').split('=')[1]; $.ajax({type:'GET',url:'json.php',data:{'eventId':eventId}, dataType:'script', success: function(){ $.each(MR.eventId, function(i, event){ var images, eventHTML; if(typeof event.images == 'obect') for(var i = 0; i < event.images.length; i++){ images += '<img src="/images/stories/small/'+event.images[i]+'" />'; } eventHTML = '<div id="ViewEvent"><h2>' +event.story_title+'</h2><h4>'+event.entry_time+'</h4><p>' +event.story_body+'</p><div id="EventImages">' +images+'</div><h6>Posted by <a href="viewProfile.php?userId=' +event.user_id+'">'+event.username+'</a></h6></div>'; $('#ViewEvent').replaceWith(eventHTML); $('.page').slideUp('fast'); $('#rides').slideDown('slow'); } ); } }); } var ShowGallery = function(e){ e.preventDefault(); //strip all the chars except digits and & var href = $(this).attr('href').replace(/([a-z]|\.|\?|=)/ig, ''); var photoId =$(this).attr('href').split('=')[1]; var args = href.split('&'); var imageId=args[0], galleryId=args[1]; //check for a cached version of the json, having the gallery we're using if((typeof MRCache.imageId != 'object') || MRCache.imageId[0].galleryId != galleryId){ //otherwise, get it. $.ajax({type:'GET',url:'json.php',data:{imageId:imageId}, dataType:'script', async:false, success: function(){ //now cache the object MRCache.imageId = MR.imageId; } }); } var indx = propFind(imageId, MRCache.imageId, 'imageId'); if(indx >= 0){ //show the image from the cache image = MRCache.imageId[indx]; var imageHTML = '<div><a href="/viewPhoto.php?artistId=' +image.galleryId+'&galleryId='+image.imageId+'"><img src="img/arrow-left.gif"></a><a href="artist.php?artistId=' +image.galleryId+'"><img src="img/arrow-up.gif"></a><a href="/viewPhoto.php?artistId=' +image.galleryId+'&galleryId='+image.imageId+'"><img src="img/arrow-right.gif"></a></div>' +'<form id="rateNav" name="rateForm" action="/viewPhoto.php" method="GET"><select name="vote"><option value="0">Rate This Image...</option><option value="1">Sexy</option><option value="2">Really Sexy</option><option value="3">Really Really Sexy</option><option value="4">Really Really Really Sexy</option><option value="5">Really Really REALLY Fucking Sexy</option></select>' +'<input type="hidden" name="galleryId" value="'+image.imageId+'">' +'<input type="hidden" name="artistId" value="'+image.galleryId+'"></form>' +'<div><h2>'+image.galleryName+'</h2><h4>'+image.location+'</h4>' +'<img src="http://midnightridazz.com/images/gallery/large/'+image.image+'"><p>'+image.comment+'</p>' +'<h4>Posted '+image.entry_time+' by <a href="viewProfile.php?userId='+image.user_id+'">'+image.username+'</a></h4></div>'; $('.page').slideUp('fast'); $('#gallery')[0].innerHTML = imageHTML; $('#gallery').slideDown('slow'); }else{ console.log('error: could not find imageid!'); } } var ShowForum = function(e){ e.preventDefault(); var topicId = $(this).attr('topic'); var replies = ''; var threadlist = ''; //pull the forum data, could check for existing $.ajax({type:'GET',url:'json.php',data:{'forum':250,'forumId':topicId}, dataType:'script', success: function(){ //turn each topic into html, for the list view $.each(MR.forum, function(i, topic){ threadlist += '<div><a class="mr-btn-forum" topic="' +topic.topic_id+'" href="forums.php?topicId='+topic.topic_id+'">'+topic.title.substr(0, 20)+'<span>' +topic.num+'</span></a></div>'; } ); //turn each reply into html, appended to topic $.each(MR.forumId.replies, function(i, reply){ replies +='<div class="reply"><a name="reply-'+reply.reply_id+'"><br></a><p>' +reply.body+'</p><a href="#top"><img src="img/arrow-up.gif"></a><a href="viewProfile.php?userId='+reply.user_id+'">' +reply.username+'</a>' +( reply.reply_to_user_id > 0 ?'<br> responding to a <a href="#reply-'+reply.reply_to_id+'">comment</a> by ' +reply.reply_to_username+'<br>' :'') +'<h6>'+reply.entry_time+'</h6>' +'<br><a href="forumReply.php?topicId=' +topicId+'&reply_to_id='+reply.reply_id+'">reply</a></div>'; } ); var topic = MR.forumId.topic[0]; $('#ThreadView')[0].innerHTML = '<div class="reply"><a name="reply-initial"></a><div class="title">'+topic.title+'</div>' +'<a href="#bottom"><img src="img/arrow-down.gif" border="0"></a>' +'Thread started by <a href="viewProfile.php?userId='+topic.user_id+'">'+topic.username+'</a> at ' +topic.entry_time+'<br><p>'+topic.body+'</p><a href="forumReply.php?topicId='+topicId+'&reply_to_id=0">reply</a></div>' +replies; $('#ThreadList')[0].innerHTML = threadlist; $(".page:not('#forum')").hide(); $('#forum').show(); } }); }