Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Plugins & Atahualpa »

wp-ecards error


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Oct 6, 2009, 08:55 AM
Algiz
 
7 posts · Jun 2009
wp-ecards error

plugin page http://wordpress.org/extend/plugins/wp-ecards/
error
Code:
Warning: include() [function.include]: Filename cannot be empty in /home/algiz/domains/xn--mylk-xva.lt/public_html/wp-content/plugins/wp-ecards/ft-wp-ecards.php on line 171

Warning: include() [function.include]: Failed opening '' for inclusion (include_path='.:/usr/local/lib/php') in /home/algiz/domains/xn--mylk-xva.lt/public_html/wp-content/plugins/wp-ecards/ft-wp-ecards.php on line 171
in ft-wp-ecards.php line 171
Code:
				include(get_page_template());
ftp-wp-ecards.php all code
Code:
<?php
/*
Plugin Name: WordPress e-Cards
Plugin URI: http://fullthrottledevelopment.com/wordpress-e-cards/
Description: This plugin converts a WordPress page or post into your very own e-card sending script.
Version: 0.1
Author: FullThrottle Development
Author URI: http://fullthrottledevelopment.com/
*/

//Primary Developer : Glenn Ansley (http://glennansley.com)

/*Copyright 2009 Glenn Ansley

/* Release History
 0.1 - Initial Release
*/

require_once('class_ftwpecards.php');

define( 'FT_WPECARD_Version' , '0.1' );

// Define plugin path
if ( !defined('WP_CONTENT_DIR') ) {
	define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content');
}
define('FT_WPECARD_PATH' , WP_CONTENT_DIR.'/plugins/'.plugin_basename(dirname(__FILE__)) );

// Define plugin URL
if ( !defined('WP_CONTENT_URL') ) {
	define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content' );
}
define( 'FT_WPECARD_URL' , WP_CONTENT_URL.'/plugins/'.plugin_basename(dirname(__FILE__)) );


// Setup form security
if ( !function_exists('wp_nonce_field') ) {
    function ft_wpecard_nonce_field($action = -1) { return; }
    $ft_wpecard_nonce = -1;
} else {
	if( !function_exists( 'ft_wpecard_nonce_field' ) ) {
	function ft_wpecard_nonce_field($action = -1,$name = 'ft_wpecard-update-checkers') { return wp_nonce_field($action,$name); }
	define('FT_WPECARD_NONCE' , 'ft_wpecard-update-checkers');
	}
}

//This function sets up my tables
if ( !function_exists('ft_wpecards_plugin_activation') ){
	function ft_wpecards_plugin_activation() {
		global $wpdb;
		include_once('tables.php');
		$ft_wpecards_tables->create_tables();
	}
}
register_activation_hook( __FILE__, 'ft_wpecards_plugin_activation' );

// Shortcode replacement
function ft_wp_ecard_insert(){
	global $wp_query;
	if ( is_page() || is_single() ){
		if ( class_exists('FT_WPECARDS') ){
			$cards = new FT_WPECARDS();
			if ( isset($wp_query->query_vars['ft_wpecards_view'])){
				$cards->load_card($wp_query->query_vars['card']);
				$cards->view_card();	
			}elseif ( (!$cards->form_submitted) || ($cards->form_submitted && is_array($cards->error_messages)) ) {
				$cards->print_errors();
				$cards->print_form();
			};
		}
	}
}
add_shortcode( 'wpecards' , 'ft_wp_ecard_insert' );

// adds styles to my header if on a [wpecards] shortcode enabled page/post
function ft_wpecards_styles(){
	global $wp_query,$wp_version;
	if ( isset($wp_query->queried_object->post_content) ){
		$pos = strpos($wp_query->queried_object->post_content, "[wpecards]");
	}
	
	if ( (isset($pos)) && ! (FALSE === $pos) ) {  // the === is important; see php docs
    	// set file name
		$css = '/ft_wpecards.css';
		
		if ( file_exists( TEMPLATEPATH . $css ) ){
			if ( $wp_version <= 2.7 ){
				?><link rel="stylesheet" type="text/css" media="screen" href="<?php bloginfo('stylesheet_directory').$css;?>" /><?php
			}else{
				wp_register_style( 'wp_ecards' , get_bloginfo('template_directory') . $css );
				wp_enqueue_style( 'wp_ecards' );			
			}
		}else{
			if ( file_exists( FT_WPECARD_PATH . $css ) ){
				
				if ( $wp_version <= 2.7 ){
					?><link rel="stylesheet" type="text/css" media="screen" href="<?php echo FT_WPECARD_URL.$css;?>" /><?php
				}else{
					wp_register_style( 'wp_ecards' , FT_WPECARD_URL . $css );					
					wp_enqueue_style( 'wp_ecards' , FT_WPECARD_URL . $css );
				}
			}
		}
		if ( $wp_version <= 2.7 ){
			?><link rel="stylesheet" type="text/css" media="screen" href="<?php bloginfo('home');?>/wp-includes/js/thickbox/thickbox.css" /><?php			
		}else{
			wp_enqueue_style('thickbox');
		}
	}
}

add_action('wp_print_scripts','ft_wpecards_styles');


// adds JS to my header if on a [wpecards] shortcode enabled page/post
function ft_wpecards_scripts(){
	global $wp_query;
	if ( isset($wp_query->queried_object->post_content) ){
		$pos = strpos($wp_query->queried_object->post_content, "[wpecards]");
	}
	if ( (isset($pos)) && ! (FALSE === $pos) ) {  // the === is important; see php docs
    	// set file name
		$js = '/ft_wpecards.js';
		
		if ( file_exists( FT_WPECARD_PATH . $js ) ){
			wp_enqueue_script( 'wp_ecards_js' , FT_WPECARD_URL . $js , array('jquery') );
		}
		
		wp_enqueue_script( 'thickbox' );
	}
}
add_action('wp_print_scripts','ft_wpecards_scripts');


// Flush rewrite rules so that WP will add mine
function ft_wpecards_flush_rewrite_rules() {
   global $wp_rewrite;
   $wp_rewrite->flush_rules();
}
add_action('init', 'ft_wpecards_flush_rewrite_rules');

// Add rewrite rules for topics
function ft_wpecards_viewcard_rewrite_rules( $wp_rewrite ){

	$new_rules = array( 'viewcard/(.*)' => 'index.php?ft_wpecards_view=1&card='.$wp_rewrite->preg_index(1) );
	
	$wp_rewrite->rules = $new_rules + $wp_rewrite->rules;
	//echo "<pre>"; print_r($wp_rewrite->rules); echo "</pre>"; die();
}
add_action( 'generate_rewrite_rules' , 'ft_wpecards_viewcard_rewrite_rules' );

// Register query vars to use in script
function ft_wpecards_register_query_vars($query_vars){
	$query_vars[] = 'ft_wpecards_view';
	$query_vars[] = 'card';
	return $query_vars;
	die();
}
add_filter( 'query_vars' , 'ft_wpecards_register_query_vars' );

function init_wpecards_viewcard(){
	global $wp_query;
	if ( isset($wp_query->query_vars['ft_wpecards_view']) ){
		if ( $ft_wpecards_parentpost = ft_wpecards_get_post_id($wp_query->query_vars['card']) ){
			if ( ft_wpecards_get_post_type($wp_query->query_vars['card']) == 'post' ) {
				query_posts("p=".$ft_wpecards_parentpost."&ft_wpecards_view=1&card=".$wp_query->query_vars['card']);
				include(get_single_template());
				//exit;
			}else{
				query_posts("page_id=".$ft_wpecards_parentpost."&ft_wpecards_view=1&card=".$wp_query->query_vars['card']);
				include(get_page_template());
				//exit;
			}
		}else{
			include(get_404_template());
		}
		exit;
	}
	//die('tr');
}
add_action('template_redirect','init_wpecards_viewcard');

// this function gets the id of the post that generated the ecard being queried
function ft_wpecards_get_post_id( $card_hash ){
	global $wpdb;
	$sql = "SELECT post_id FROM `".$wpdb->prefix."ft_wpecards` WHERE card_hash = '".$wpdb->prepare($card_hash)."'";
	if ( $ft_wpecards_post = $wpdb->get_row($sql) ){
		return $ft_wpecards_post->post_id;
	}
	return false;
}

// this function gets the permalink of the post that generated the ecard being queried
function ft_wpecards_get_permalink( $card_hash ){
	global $wpdb;
	$sql = "SELECT post_id FROM `".$wpdb->prefix."ft_wpecards` WHERE card_hash = '".$wpdb->prepare($card_hash)."'";
	if ( $ft_wpecards_post = $wpdb->get_row($sql) ){
		return get_permalink($ft_wpecards_post->post_id);
	}
}

// this function gets the post_type of the post that generated the ecard being queried
function ft_wpecards_get_post_type( $card_hash ){
	global $wpdb;
	
	if ( $id = ft_wpecards_get_post_id( $card_hash ) ){
		$sql = "SELECT post_type FROM `".$wpdb->prefix."posts` WHERE ID = ".$wpdb->prepare($id);
		if ( $ft_wpecards_post = $wpdb->get_row($sql) ){
			return $ft_wpecards_post->post_type;
		}		
	}
}
?>
  #2  
Old Oct 6, 2009, 10:56 AM
juggledad's Avatar
juggledad
 
22,376 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
does it work if you use the default theme? If not contact the plugin author
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Oct 6, 2009, 06:19 PM
Algiz
 
7 posts · Jun 2009
yes this is def Atahualpa 3.3.3 theme but didnt work... An another theme this plugin work good
  #4  
Old Oct 7, 2009, 06:23 AM
juggledad's Avatar
juggledad
 
22,376 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
Ok, I'm puzzled about this plugin - it says to upload a photo but not attach it to the post?? I can't seem to get it to work
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Oct 7, 2009, 11:35 AM
Algiz
 
7 posts · Jun 2009
choose and you send a postcard okay, but when someone else is reviewing this postcard then error
  #6  
Old Oct 7, 2009, 02:48 PM
juggledad's Avatar
juggledad
 
22,376 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
algiz, I'm trying to install it and get it to work. I've installed it and activated it but how do you fet the thumbnails to show in the post? That's what I can't figure out (I must be dense today)
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parse error: syntax error, unexpected '<' in the functions.php file pingitt Atahualpa 3 Wordpress theme 6 Mar 12, 2013 04:52 AM
[SOLVED] Home page won't load! Parse error, syntax error lhanft Atahualpa 3 Wordpress theme 4 Aug 30, 2009 02:44 PM
[SOLVED] Parse error: syntax error, unexpected ':', expecting ')' in /home/cwicsol/pu norwichkaren Page & Category Menu Bars 1 Jul 12, 2009 11:04 AM
Parse error: syntax error!!! liabelle Atahualpa 3 Wordpress theme 2 Apr 23, 2009 12:48 AM
Error 500 - Internal server error gpeery Installing & running WordPress 5 Mar 1, 2009 07:05 PM


All times are GMT -6. The time now is 09:47 AM.


Powered by vBulletin® Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.