View Single Post
Old 01-16-2013, 10:45 PM   PM User | #1
joesruddock
New Coder

 
Join Date: Jul 2010
Posts: 56
Thanks: 11
Thanked 0 Times in 0 Posts
joesruddock is an unknown quantity at this point
Javascript blog problem.

Hi all,

Sorry to bother you. I have been really struggling understanding what is probably quite simple. I have been working on BlogSpot coding a theme. Currently, whenever a post is made, on the homepage it gets turned into a 'summary' rather than being shown as a full post. Below is the code which I have identified as handling the task. I have tried changing it and deleting it many times all resulting in the same result - The post is visible but none of the hyperlinked titles or post dates etc show, only the main content. I was hoping if someone could help me solve this so that when I post, a full article is shown on the blog rather than just a summary?

PHP Code:
<script type='text/javascript'>
//<![CDATA[
function removeHtmlTag(strx,chop){
if(
strx.indexOf("<")!=-1)
{
var 
strx.split("<");
for(var 
i=0;i<s.length;i++){
if(
s[i].indexOf(">")!=-1){
s[i] = s[i].substring(s[i].indexOf(">")+1,s[i].length);
}
}
strx s.join("");
}
chop = (chop strx.length-1) ? chop strx.length-2;
while(
strx.charAt(chop-1)!=' ' && strx.indexOf(' ',chop)!=-1chop++;
strx strx.substring(0,chop-1);
return 
strx+'. ';
}
function 
createSummaryAndThumb(pIDpURL,pTITLE){
var 
div document.getElementById(pID);
var 
imgtag "";
var 
img div.getElementsByTagName("img");
var 
summ summary_noimg;
if(
img.length<=1) {
imgtag '<span style="float:left; padding:0px 10px 5px 0px;"><a href="'+pURL+'"><img src="http://2.bp.blogspot.com/-GNUL-jRXlQA/T9J9Vnzbs2I/AAAAAAAADIM/vCpsRcwGbrM/s000/017.jpg" width="'+img_thumb_width+'px"/></a></span>';
summ summary_img;
}
if(
img.length>=1) {
imgtag '<span style="padding:0px 0px 10px 0px;"><a href="'+pURL+'"><img src="'+img[0].src+'" width="'+img_thumb_width+'px"/></a></span>';
summ summary_img;
}
if (
postCount>=1){
if(
img.length<=1) {
imgtag '<span><a href="'+pURL+'"><img src="http://2.bp.blogspot.com/-GNUL-jRXlQA/T9J9Vnzbs2I/AAAAAAAADIM/vCpsRcwGbrM/s000/017.jpg" width="'+img_thumb_width1+'px" height="'+img_thumb_height1+'px"/></a></span>';
summ summary_img1;
}
if(
img.length>=1) {
imgtag '<span><a href="'+pURL+'"><img src="'+img[0].src+'" width="'+img_thumb_width1+'px" height="'+img_thumb_height1+'px"/></a></span>';
summ summary_img1;
}
}
var 
summary imgtag '<div style="text-align:center;">' '<a href="'+pURL+'" style="font-size: 14px;font-weight: normal;line-height: 14px;color:#444751;">' pTITLE '</a>' '</div>' +'<div style="font-size: 13px;font-style: italic;">' removeHtmlTag(div.innerHTML,summ) + '<a href="'+pURL+'" class="morelink">' 'Continue Reading' '</a>' '</div>';
if (
postCount>=1){
var 
summary imgtag '<div style="text-align:center;">' '<a href="'+pURL+'" style="font-size: 14px;font-weight: normal;line-height: 14px;color:#444751;">' pTITLE '</a>' '</div>';
}
div.innerHTML summary;
}
//]]>
</script> 
I hope this makes sense. Thanks very much!
joesruddock is offline   Reply With Quote