Jump to content
Sign in to follow this  

Call to undefined function

Recommended Posts


I'm getting a "Call to undefined function" error on this page (view source): http://www.phillipvanrooyen.com/alkivolleyball/players/ - I'm using platformpro 1.3 - I created a child section as described in your support docs here:http://www.pagelines.com/docs/custom-sections and created a new page template to add the section to:

		Section: Pullquote Section
		Author: PageLines
		Description: Shows a pull quote taken from
		Version: 1.0.0
		Demonstrates how to create a cool site section in 50 lines of code!
		Note: the only other piece to make this work is the 'pagelines_register_section()' function in your functions.php
	class BaseAvaPlayersPage extends PageLinesSection {
	   function __construct( $registered_settings = array() ) {
			/* The name and ID of the section */
			$name = __('AVA Players Page Section', 'pagelines');
			$id = 'avaPlayers';
			/* Setup description, areas it works with, icon, etc...*/
			$default_settings = array(
				'description' 	=> 'AVA Players Page Section - Displays AVA Players table from Bryan Frost PHP CODE',
				'workswith' 	=> array('main'),
				'icon'			=> $this->section_root_url.'/features.png',
				'version'		=> 'pro'
			/* Draw section using the section API */
			$settings = wp_parse_args( $registered_settings, $default_settings );
		   	parent:GDN__construct($name, $id, $settings);
		/* Use this function to create the template for the section */
	 	function section_template() {
	                            <select name="ratingsDropDownList" id="ratingsDropDownList" class="">
	                              <option value=0>-- Any --</option>
	                              <?php GetRatingDropDownOptions(); ?>
			<?php }
		// Some of the optional functions not used here.
		function section_options($optionset = null, $location = null) {} /* Adds Options in the admin. Use this function to add them; see PageLines.com for more info */
		function section_persistent(){} /* Runs in every page, including in admin (not used in this section) */
		function section_head(){} /* Runs in site header, only if section is active (not used here) */
	} /* End of section class - No closing tag needed */
- The child section has php code that calls a file called players.code.php referenced in header.php:
		This file controls the HTML <head> and top graphical markup (including Navigation) for each page in your theme.
		You can control what shows up where using WordPress and PageLines PHP conditionals
		This theme copyright (C) 2008-2010 PageLines
		do_action('pagelines_before_html'); //hook
	?><!DOCTYPE html><!-- HTML 5 -->
	<html <?php language_attributes(); ?>>
	<link rel="stylesheet" type="text/css" href="css/players-table.css" media="all" />
			do_action('pagelines_code_before_head'); //hook
			pagelines_head_common(); // Common header information
			do_action('pagelines_head'); //hook
			print_pagelines_option('headerscripts'); // Header Scripts Input Option
			pagelines_font_replacement('calluna.font.js'); // Cufon Font Replacement
			pagelines_fix_ie('.pngbg, .shadow-bottom, .post-comments a, #fcolumns_container, #footer img, .branding_wrap img, .fboxgraphic img '); // Fix IE Issues. Args = .png images to fix in ie6
			wp_head(); // Hook (WordPress)
- Within players.code.php the so called "Call to undefined function" is actually defined:
	// File: players.code.php
	// Author: Bryan Frost
	// Date Created: 2010-03-25
	// players.php codebehind
	$abbreviatedSeason = "'10";
	$abbreviatedYear = sprintf('%s%d', "'",date("y"));
	$ratingsChartLink = "?";
	function GetFirstNameSelected()	{ return $_POST['firstName']; }
	function GetLastNameSelected()	{ return $_POST['lastName']; }
	function GetRatingSelected()	{ return $_POST['ratingsDropDownList']; }
	function GetGenderSelected()
		if (isset($_POST['gendersDropDownList']))
			return $_POST['gendersDropDownList'];
			return 1;
	function Foo()
		echo "bar";
	// Create HTML options for ratings (retain selection)
	function GetRatingDropDownOptions()
		$array = GetRatings();
		foreach($array as $key => $value)
			$selectedText = ($key == GetRatingSelected() ? " selected="selected"" : "");
			echo "<option value=$key $selectedText>$value</option>";

- It seems the file referenced in the header.php is not being seen... Even though everything seems to be wired up correctly. Any help would be appreciated. Thanks

Share this post

Link to post
Share on other sites

I don't actually see a place where the players.code file is being called. You need to link to it from the section_head function in the new section you created if it involves requires scripts.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this