haampie
Forum Replies Created
-
Forum: Plugins
In reply to: Using custom field to display images in postHi there,
Which line is line 15 of single.php?
Forum: Plugins
In reply to: Always a zero after an ajax responseGot it :]
There is one line of script in
admin-ajax.php
after my own ajax_action that says:die('0');
The solution is to adddie()
to the end of your own ajax function, so you die the script beforedie('0')
:]function secretnameofmyawesomeplugin_js(){ if(isset($_POST['url']) && !empty($_POST['url'])){ echo 'ok'; } else { echo 'false'; } } die()
Forum: Plugins
In reply to: Redeclaring functions – error on my own pluginThanks for your comment willkemp, but unfortunately there are no relevant errors in the logs.
If I remove the add_option function and the update check, the error is gone. So I think something is wrong with
add_option('wp_poll_db_version', $wp_poll_db_version);
I’ll post the whole script again:
<?php global $wp_poll_db_version; $wp_poll_db_version = '0.1'; function my_own_poll_installation(){ global $wp_poll_db_version; global $wpdb; $table_name = $wpdb->prefix . 'poll_engine'; if($wpdb->get_var("SHOW TABLES LIKE '" . $table_name . "'") != $table_name){ $sql = "CREATE TABLE " . $table_name . " ( id mediumint(9) NOT NULL AUTO_INCREMENT, time bigint(11) DEFAULT '0' NOT NULL, name tinytext NOT NULL, text text NOT NULL, url VARCHAR(55) NOT NULL, UNIQUE KEY id (id) );"; require_once(ABSPATH . 'wp-admin/include/upgrade.php'); dbDelta($sql); $welcome_name = "Admin"; $welcome_text = "Congratulations, you just completed the installation!"; $insert = "INSERT INTO " . $table_name . " (time, name, text) " . "VALUES ('" . time() . "','" . $wpdb->escape($welcome_name) . "','" . $wpdb->escape($welcome_text) . "')"; $results = $wpdb->query( $insert ); //add_option('wp_poll_db_version', $wp_poll_db_version); } /*$installed_ver = get_option( "wp_poll_db_version" ); if( $installed_ver != $wp_poll_db_version ) { $sql = "CREATE TABLE " . $table_name . " ( id mediumint(9) NOT NULL AUTO_INCREMENT, time bigint(11) DEFAULT '0' NOT NULL, name tinytext NOT NULL, text text NOT NULL, url VARCHAR(55) NOT NULL, UNIQUE KEY id (id) );"; require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); dbDelta($sql); update_option( "wp_poll_db_version", $wp_poll_db_version ); }*/ } function wp_poll_menu(){ add_menu_page('WP Poll Engine', 'Poll Settings', 8, 'poll_settings', 'wp_poll_page'); add_submenu_page('poll_settings', 'Subpage for Poll Settings', 'Subpage', 8, 'poll_settings_sub', 'wp_poll_subpage'); } function wp_poll_page() { echo '<h2>Title</h2>'; } function wp_poll_subpage(){ echo '<h2>Subpage</h2>'; } register_activation_hook(__FILE__, 'my_own_poll_installation'); add_action('admin_menu', 'wp_poll_menu'); ?>
Forum: Plugins
In reply to: Redeclaring functions – error on my own pluginHey Matt,
Maybe the register_activation_hook function is bugged, because changing the name of my installation function makes no sense. I’m absolutely sure there is no function called my_own_poll_installation_function() ??
As I said before, when I remove the line containing the register_activation_hook, there is no error.
Forum: Plugins
In reply to: Redeclaring functions – error on my own pluginWhoops, I marked the topic as resolved when I posted it ?? So, it is not resolved!
If I remove the line with the register_activation_hook function there is no error… But I want to use that function anyway.
Forum: Themes and Templates
In reply to: WordPress displays the whole style.css in admin areaSorry, I need to post something more:
Above is the sourcecode of the admin area.And by the way, I made this theme myself…
Forum: Themes and Templates
In reply to: WordPress displays the whole style.css in admin area<h3>New WordPress
Theme URI: https://zjapske.no-ip.org/wordpress/
Description: Something new
Version: 1.0
Author: Harmen Stoppels
Tags: beautiful colors, fixed widthThis layout may not be used without the written permission of Harmen Stoppels!
*/* {
padding: 0;
margin: 0;
}
body {
font-family: Georgia,”Times New Roman”,Times,serif;
font-size: 12px;
[…More CSS…]
input#submit {} 1.0
Author: Harmen Stoppels
Tags: beautiful colors, fixed widthThis layout may not be used without the written permission of Harmen Stoppels!
*/* {
padding: 0;
margin: 0;
}
body {
font-family: Georgia,”Times New Roman”,Times,serif;
font-size: 12px;
[…More CSS…]
input#submit {}</p>
Well, it starts with a h3 wich isn’t closed. Then the whole sheet is displayed again and closes a p tag, wich isn’t opened…
Forum: Themes and Templates
In reply to: WordPress displays the whole style.css in admin areaSomeone?
Forum: Developing with WordPress
In reply to: UserroleThanks ??