Jump to content

Recommended Posts

First of all, This is my first time here. Nice meeting you all. Hope you can help me with this problem.

 

> I have a site called >>> www.popsicles.ph

 

> In the frontpage 4 recent blog posts are posted at the top

 

> Now, I wanted to have another area where all blog posts can be display. Not in the frontpage ofcourse.

 

> So I tried making a new php file and I come up with this:

 

<?php global $trns_options, $trns; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<link rel="icon" 
      type="image/png" 
      href="http://i792.photobucket.com/albums/yy206/popsicles_ppop/faveicon.png"/>
<title>
	<?php if(is_home() ) { bloginfo('name'); ?> | <?php bloginfo('description'); } ?>
	<?php if(is_single() || is_page() || is_archive() || is_tag() || is_category() ) { wp_title('',true); ?> | <?php bloginfo('name'); } ?>
	<?php if(is_404()) { ?> <?php echo $trns["404"]; ?> | <?php bloginfo('name'); } ?>
	<?php if(is_search()) { ?><?php echo $trns["seresults"]; ?> <?php echo wp_specialchars($s, 1); ?> | <?php bloginfo('name'); } ?>
</title>
<style type="text/css" media="screen">@import url( <?php bloginfo('stylesheet_url'); ?> );</style>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />


<!--[if IE 6]>
	<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/includes/DD_belatedPNG_0.0.8a-min.js"></script>
	<script type="text/javascript">DD_belatedPNG.fix('#logo img, #footer_logo img, #slider2 img');</script>
	<style media="screen,projection" type="text/css">#videos li{padding:0 0 0 7px; }</style>
<![endif]-->	

<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />	
<link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />	
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />	
<?php wp_get_archives('type=monthly&format=link'); if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>	
<?php wp_head(); ?>



<style type="text/css">

/*Example CSS for the two demo scrollers*/

#pscroller1{
width: 780px;
height: 13px;
font-size: 12px;
border: 1px solid #D0D0D0;
margin:4px 10px 0px 0px;
padding: 3px 0px 3px 5px;
float:right;
background-color: #FEFEFE;
}

#pscroller2{
width: 350px;
height: 20px;
border: 1px solid black;
padding: 3px;
}

#pscroller2 a{
text-decoration: none;
}

.someclass{ //class to apply to your scroller(s) if desired
}

</style>

<script type="text/javascript">

/*Example message arrays for the two demo scrollers*/

var pausecontent=new Array()
pausecontent[0]='What can you say about our Homepage? For Suggestions email us at admin@popsicles.ph'
pausecontent[1]='Apply to be a Fan Writer. Click <a href="http://www.popsicles.ph/2010/01/be-a-fan-writer/">HERE</a> for more details'
pausecontent[2]='Got News? Tip Us! email us at admin@popsicles.ph'
pausecontent[3]='Got News? Blog It! email us at admin@popsicles.ph for details'
pausecontent[4]='Help Promote Popsicles. For more Details Click <a href="http://www.popsicles.ph/2009/12/do-you-love-popsicles-then-help-promote-popsicles-ph/">HERE</a>!'

var pausecontent2=new Array()
pausecontent2[0]='<a href="http://www.news.com">News.com: Technology and business reports</a>'
pausecontent2[1]='<a href="http://www.cnn.com">CNN: Headline and breaking news 24/7</a>'
pausecontent2[2]='<a href="http://news.bbc.co.uk">BBC News: UK and international news</a>'

</script>

<script type="text/javascript">

/***********************************************
* Pausing up-down scroller- � Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}

// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------

pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}


// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------

pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}

// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------

pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}

// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------

pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}

</script>


</head>

<body>

<div id="topbox">

<div class="topbox h7">
  <h7>Popsicles Updates</h7>

<script type="text/javascript">
//new pausescroller(name_of_message_array, CSS_ID, CSS_classname, pause_in_miliseconds)

new pausescroller(pausecontent, "pscroller1", "someclass", 3000)
document.write("<br />")
</script>
</div>

    </div>

<div id="header">
<a href="<?php echo get_settings('home'); ?>/"><img src="http://popsicles.ph/wp-content/uploads/theme/LOGO%20copy.png" border="0" alt="pop"></a>
       </div>

<!-- /header -->


<div id="mainmenu">
<div id="mainmenu_data">
	<ul>
<li><a href="<?php echo get_option('home'); ?>">Home</a></li>
<li><a href="http://forum.popsicles.ph/">Pop Forum</a></li>
<?php wp_list_pages('include=150,3708,185&sort_column=menu_order&title_li='); ?>

	</ul>


</div>
</div><!-- /menu -->

<div id="wrapper">

<div id="contentBody">

			<div id="primaryTopMid">
					<a class="titleCatName" href="<?php query_posts(''); ?>">LATEST NEWS</a>
	<?php $count = 0;?>
	<?php query_posts($query_string . '&cat=-5229'); ?>

      <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  			<div class="post" id="post-<?php the_ID(); ?>">

					<div class="featuredPost<?php if ($que3 == $trns_options["fea3PostCount"]) { ?> lastPost<?php } ?>">
						<h2 class="postTitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?> »</a></h2>

<?php $image = get_post_meta($post->ID, 'thumbnail', true); ?>
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="<?php echo $image; ?>" width="60px" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" class="alignright"/></a>

						<p><?php if($trns_options['enableAName'] == 1) { ?><span class="author"><?php the_author_posts_link(); ?></span><?php } ?> <?php if($trns_options['enableDate'] == 1) { ?><span class="date"><?php the_time($trns_options["timeFormat"]); ?> |<?php } ?></span> <?php print string_limit_words(get_the_excerpt(), 17); ?>...</p>
						<div class="clear"></div>

						<span class="featuredPostMeta"><?php the_time($trns_options["dateFormat"]) ?> / <?php comments_popup_link(__($trns["nocomment"]), __($trns['comment1']), __($trns['comments']));?> / <a href="<?php the_permalink() ?>" rel="bookmark"><?php echo $trns["readmore"]; ?></a><?php edit_post_link('Edit',' / ',''); ?></span>



					</div>
					</div>
  			

  		  <?php endwhile; ?>

  		  <?php else : ?>
  
  		<?php endif; ?>

<div id="paginate-slider2" class="pagination2"><?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?></div>

</div><!-- /primaryTopMid -->


	</div><!-- /contentbody -->

</div><!-- /wrapper -->
	<?php get_footer(); ?>

</body>
</html>

 

> I place it in this location: /home4/popsicl2/public_html/news.php

 

> I have no training background on php and I only rely on tutorials in the net so I just copy and paste the stuff on that php codes I posted above that would appear similar to this:

<html>

<head>

  <title>PHP Test</title>

</head>

<body>

<?php echo '<p>Hello World</p>'; ?>

</body>

</html>

 

source: http://www.php.net/manual/en/tutorial.firstpage.php

 

> when I tried viewing it on this link/url > http://popsicles.ph/news.php

 

> An error occured, it says:

 

Fatal error: Call to undefined function bloginfo() in /home4/popsicl2/public_html/news.php  on line 6

 

> I tried fixing this for a couple of days already and have not come up with a solution thats why Im asking for experts help. Guys, please help me.

So I tried making a new php file and I come up with this:

 

Did you actually write all that code or the more obvious, just copy and paste it from somewhere? On line 6 is a call to a function called bloginfo(). This function is not part of php and must be defined somewhere else within the application. You need to include this functions definition within the same scope that it is called.

So I tried making a new php file and I come up with this:

 

Did you actually write all that code or the more obvious, just copy and paste it from somewhere? On line 6 is a call to a function called bloginfo(). This function is not part of php and must be defined somewhere else within the application. You need to include this functions definition within the same scope that it is called.

 

As stated on my first post I copy and paste the file found on the home.php of my theme

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.