Log In · Register

 
 
Closed TopicStart new topic
help please with the display one post script
butterfly_chica
post 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.
 
dorischu
post Jul 23 2005, 01:47 PM
Post #2


Newbie of Goddess
****

Group: Member
Posts: 265
Joined: Oct 2004
Member No: 56,346



so basically the code provided in Createblog is show 1 post and hide the rest of 4 posts. If you using "next 5/previous 5" of course it will go to the next/previous 5 posts & showing the very 1st + hide the 4 rest.

Sorry that i can't help, i'm trying to search the code u want in the Xanga Script. But looks like i can't find it too. sweating.gif
 
butterfly_chica
post Jul 23 2005, 02:01 PM
Post #3


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 &gt;&gt;/i)) links[l].innerHTML = str.replace (/next 5 &gt;&gt;/i, "Older Posts");
else if (str.match (/&lt;&lt; previous 5/i)) links[l].innerHTML = str.replace (/&lt;&lt; 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.
 

Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: