Welcome Guest [Log In] [Register]
Welcome to ZetaScript! We hope you enjoy your visit.

At ZetaScript, you will be able to access codes and modifications for your ZetaBoards and InvisionFree Forum. Register today or log in to see these great features!


Username:   Password:
Newest post showing Null
Topic Started: Apr 27 2011, 06:35 PM (784 Views)
atomicwitch
Member Avatar

We have this code which shows the lastest post/poster on the top of the board. In the last day or so it is returning 'Null' as you can see here. It's the same for FF, IE, Opera and Google Chrome.
http://i.imgur.com/4JfWX.png


Code:
 
<script type="text/javascript">
$.get(main_url + "site/",function(Q){
$("div.category:first").prepend('<div id="News" style="margin-bottom:15px;"><div class="category"><table class="cat_head"><tbody><tr><td><h2>Newest Post</h2></td></tr></tbody></table><table cellpadding="0" cellspacing="0"><tbody><tr><td style="width: 75%;" valign="center">Topic: ' + $("#portal_l .portal_box h4:first",Q).html() + ' <br />Newest Poster: ' + $("#portal_l .portal_box h4:first",Q).next($('.portal_content a')).html() +'</span></td></tr></tbody></table></div></div>');
});
</script>


Has something become corrupt? (I don't even know if that can happen)

I don't actually remember where the code came from, but as it's not on the ZB list I'm assuming it was here as these are the only places I've got codes from.
Offline
 
Pro
Member Avatar
Underground Coding

Make sure that your board portal and try again. Also, please post in the correct forum next time.
Offline
 
atomicwitch
Member Avatar

Pro
Apr 27 2011, 06:51 PM
Make sure that your board portal and try again. Also, please post in the correct forum next time.
sorry, I don't understand that bit in bold.

Where is the correct forum? Is this not Support?
Sorry, I expect FF made the screen jump while I was clicking. It does that (too often)
Edited by atomicwitch, Apr 27 2011, 07:17 PM.
Offline
 
Pro
Member Avatar
Underground Coding

Sorry, I meant to say make sure your board portal is enabled and try again.
Offline
 
atomicwitch
Member Avatar

Yes it's enabled.
Offline
 
Alam
Member Avatar

Can you provide a board link?
Offline
 
atomicwitch
Member Avatar

Yes, but you need to be approved to see the board. You can see the Portal though.
http://s4.zetaboards.com/Emmys_Guys_and_Gals
Offline
 
SlyCooperFan1
Member Avatar
The Changer When Gorgor Is Absent
I am testing this out on my own test board, and I am having my own issues with it. After I managed to fix it up a little, the variables showed up as "null", but the box did show up in Firefox. Google Chrome refuses to show any part of the code, however.

This might be the code's problem, not your problem.
Offline
 
atomicwitch
Member Avatar

Ok. It was working though.
Offline
 
SlyCooperFan1
Member Avatar
The Changer When Gorgor Is Absent
For some reason, I fixed the code well enough only to make it work on the Portal page itself. On any other page, the variables would just show up as null.

I haz no idea. :/

This is as far as I got:
Code:
 
<script type="text/javascript">
var url=main_url+"site/";
$.get(url,function(d){
var topic=$(".portal_box:first h4:first",d).html();
var np=$(".portal_content:first a",d).html();
$("div.category:first").before('<div id="news" style="margin-bottom:15px;" class="category"><table class="cat_head"><tbody><tr><td><h2>Newest Post</h2></td></tr></tbody></table><table cellpadding="0" cellspacing="0"><tbody><tr><td style="width: 75%;" valign="center">Topic: '+topic+'<br />Newest Poster: '+np+'</td></tr></tbody></table></div>');
});
</script>
Offline
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · Code Repair · Next Topic »

Theme design by Flying Whales and coded by Gabriel. of Outline.