help please with the display one post script |
help please with the display one post script |
Jul 23 2005, 01:16 PM
Post
#1
|
|
|
Newbie ![]() Group: Member Posts: 2 Joined: May 2005 Member No: 145,582 |
Hi. I have the display one post script on my site (xanga.com/butterfly_chica); however, when I click "older posts" it doesn't show the next one in line(July 12) but it shows one from way back(June 30).
Here's the script that I used: <!-- begin code provided by createblog.com --> <script> numberOfEntries = 1; // if(location.pathname=='/home.aspx'){ var tds = document.getElementsByTagName ('a'); for (var i = 0; i < tds.length; i++) { timeString = tds[i].innerText; if(timeString.match(/\d+:\d+ [ap]m\b/i)){break;} } stuff = tds[i].parentNode.parentNode.parentNode.parentNode.parentNode; for(j=1;j<numberOfEntries;j++){ stuff=stuff.nextSibling.nextSibling.nextSibling if(stuff.tagName=='BR'){ stuff=stuff.previousSibling; } } for(i=0;i<20;i++){ if(stuff.tagName=='HR' && stuff.nextSibling.tagName=='TABLE') { break; } stuff = stuff.nextSibling; stuff.style.display='none'; }} </script> <!-- end code provided by createblog.com --> I didn't mess with anything in the script. I did place a script that renames the "next 5/previous 5" words...could that have anything to do with it? Also, is there any way to only display the next 2(while staying at one post a page) and that be it without having to delete all the older posts? Any help is greatly appreciated. |
|
|
|
![]() |
Jul 23 2005, 02:01 PM
Post
#2
|
|
|
Newbie ![]() Group: Member Posts: 2 Joined: May 2005 Member No: 145,582 |
i see what you are saying now...so the code just basically shows the first post(in order) on every page while hiding the other 4? thanks for helping me understand how that code works.
here's the next 5/previous 5 rename script that i used: <!-- begin code provided by createblog.com --> <script language="javascript"> <!-- var links = document.getElementsByTagName ("a"); for (var l = 0; l < links.length; l++) { str = links[l].innerHTML; if (str.match (/d+:d+ (am|pm)/i)) links[l] else if (str.match (/next 5 >>/i)) links[l].innerHTML = str.replace (/next 5 >>/i, "Older Posts"); else if (str.match (/<< previous 5/i)) links[l].innerHTML = str.replace (/<< previous 5/i, "Newer Posts"); }//--> </script> i tried changing all the 5's to 2's but then it changed the "older/newer" posts back to "next/previous 5". i don't know either. |
|
|
|
butterfly_chica help please with the display one post script Jul 23 2005, 01:16 PM
dorischu so basically the code provided in Createblog is sh... Jul 23 2005, 01:47 PM![]() ![]() |