Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all 8245 articles
Browse latest View live

hillak on "custom plugin producing 'dead' content in some browsers"

$
0
0

I've searched until I'm blue and tried everything I can think of. Problem: I can display a form and the footer w/link but they don't work in ff or chrome. Works in IE. Form comes from a custom plugin with classes -just getting started (new to wp but not php). The plugin is activated and the relevant portion looks like this:

class MyClass
{
    // the class constructor

    public function __construct()
    	{
                //left from another failed attempt in case I end up back here...
                //add_filter( 'abo_listings',array( $this, 'init' ) );
	}

	public static function init()
	{
	    if (isset($_POST['submitted']))
	    	{
		self::callfunctiontodealwithdata($_POST);
		}
	    else
	    	{
		    require_once('views/myformview.php');
		    $content = myForm::render();
		    return $content;
		    }
	}//end init
}//end class

if (!is_admin())
{$new = new MyClass;
}

myForm::render() returns the html markup for the form. I've tried packaging the markup in multiple ways (ob_start/clean for ex) but same result.
A custom theme page template (listings) has this code:

$content = MyClass::init();
                 echo $content;

I've also tried apply_filter hook (hence commented out constructor code) here but same result: dead form and footer link in ff and chrome.

I think it is a wp issue since a/the footer link is dead too and b/ if I put the init() code in the constructor, it generates a working form in all browsers. However it displays the form before the page loads.

BTW I've tested the form markup and validated it for html5. Anyway I pared it down to a simple 2 element form with no divs, no footer and same result. Any suggestions would be appreciated as I'm hours on this with no progress... Again, form works and access to all classes work (see results in IE of all things...)
Temporary link : http://www.corridorwest.com/wp/lisings/
Thanks for looking!


efishop on "Query week filter"

$
0
0

Hello all,
I have the fallowing php code:

$my_query = new WP_Query('category_name=Citat&showposts=1&orderby=rand'); ?>  

<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
  <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php echo get_post_meta( get_the_ID(), 'citat', true ); ?></a><br/>
<div class="autor_citat"><?php echo get_post_meta( get_the_ID(), 'autor', true ); ?></div>
<?php endwhile;

How can I add a function that display only the displays post from current week?

I have tried this: http://codex.wordpress.org/Template_Tags/query_posts#Time_Parameters but with no luck, it display tree posts instead of one.

Engr.MTH on "Disable Specific Categories By ID with wp_dropdown_cats WordPress Filter"

$
0
0

I use front-end form to allow users submit the posts from the front end. I use this function wp_dropdown_categories() to allow users select which category the post will be in from a dropdown menu. I use JaveScript to disallow users from selecting specific categories by disable these categories. I want to disable (not remove or exclude) these categories with php where the user can see the category but he/she can't choose it.So my research reaches to this filter. So how can I use wp_dropdown_cats wordpress filter to disable specific categories by ID?

isto1 on "36 Failed Login attempts"

$
0
0

Hi,

In the last two days I've had 36 failed login attempts from the IP address 192.3.180.228 the IP address bounces back to colocrossing.com. Is there anything I can do about it such as block the IP or something similar?

Thanks,
Jack

vladicorp on "Chnage the Slider from Blog Section to Header of CyberChimps Pro"

$
0
0

Hello I bought this theme CyberChimps Pro, does anybody knows how to move the slider inside the header section ? right now it is connected wit the blog element of wordpress ?

JeremyPark123999 on "Allow only specific usernames"

$
0
0

Hi, I am trying to set up a website for my minecraft server. I want to set up the buddypress registration to only allow users to register if their username reads as a premium account on the minecraft.net server. I found a plugin that was meant to do that, but it hasn't been updated for a long time, and it no longer works. I have been trying to alter the plugin, but so far, it hasn't shown any results. As far as I can tell, the plugin is not blocking users, and that is all. Could someone tell me if I have done something wrong?
I have changed the code a lot from the original, but I don't think that I have damaged anything, let me know if you need the original, and I will post it.

EDIT: It turns out that I did damage some of the code, I was getting a very small error on the wordpress plugin page, I fixed that, and upaded the code below.

Here is the plugin's code:

<?php
/*
   Plugin Name: Minecraft Validator
   Description: Simple plugin to verify new WordPress accounts against the Minecraft user database. If the username doesn't show up as a valid Minecraft player, it won't let them register.
   Version: 1.4
   Author: Ghost1227
   Author URI: http://www.ghost1227.com
*/

/* Run activation hook when plugin is activated */
register_activation_hook(__FILE__, 'get_wp_version');

/* Rewrite registration form */
function mcv_registration_form() {
	wp_enqueue_script( 'login_form', plugins_url() . '/minecraft-validator/usernamerewrite.js', array('jquery'), false, false );
}
add_action('login_head', 'mcv_registration_form');

/* Get WordPress version */
function get_wp_version() {
    global $wp_version;
    if ( version_compare ( $wp_version, '3.1', '<')) {
        exit ( "<div style='font-size: 13px; font-family: 'HelveticaNeue-Light', 'Helvetica Neue Light', 'Helvetica Neue', sans-serif;'><strong>Attention:</strong> This plugin will not work with your version of WordPress.</div>" );
    }
}

/* Register actions */
add_action('register_post', 'verify_mc_account', 10, 3);
add_action('admin_menu', 'add_mcval_options');

/* Check account on minecraft.net */
function verify_mc_account($login, $email, $errors) {
	$user_info = get_userdata(1);
	$options = array(
        'timeout' => 5,
    );
    $mcacct = wp_remote_get('http://www.minecraft.net/haspaid.jsp?user='.$user_info->user_login);

    if ( $mcacct == 'false' ) {
        if ( $mcacct == 'false' ) {
            $errors->add('mc_error',__('<strong>ERROR:</strong> Minecraft account is invalid.'));
            return $errors;
        } else {
            $errors->add('mc_error',__('<strong>ERROR:</strong> Unable to contact minecraft.net.'));
            return $errors;
        }
        add_filter('registration_errors', 'verify_mc_account', 10, 3);
    }
}
/* Activation/Deactivation */
function set_mcval_options() {
    add_option('hide_me', 'false');
}

function unset_mcval_options() {
    delete_option('hide_me');
}

register_activation_hook(__FILE__, 'set_mcval_options');
register_deactivation_hook(__FILE__, 'unset_mcval_options');

/* Add admin menu */
function add_mcval_options() {
    if ( get_option('hide_me') != "true" ) {
        add_options_page('Minecraft Validator Options', 'Minecraft Validator', 8, 'mcval-options', 'mcval_options');
    }
}

/* Display options page */
function mcval_options() {

    ?>

    <div class="wrap">
        <h2>Minecraft Validator</h2>

    <?php
        if ( $_REQUEST['submit'] ) {
            update_mcval_options();
            ?>
                <script type="text/javascript">
                <!--
                    window.location = <?php echo "'options-general.php'"; ?>
                //-->
                </script>
            <?php
        }
        print_mcval_form();
    ?>

    </div>

<?php }

function update_mcval_options() {
    update_option( 'hide_me', 'true' );
}

function print_mcval_form() {
    ?>

<?php }

Roman.L on "Applying "Attachment Display Settings" to all selected images"

$
0
0

When you editing Post or Page you can select Add Media button then if you have images uploaded already you can click on one an use either CTRL+LMB or SHIFT+LMB to select multiple images.

Once you select them you can edit "Attachment Display Settings" on right side, however its only works for once image at a time. Is there solution to apply same setting to all selected images?

gatherporn on "create wordpress static index page!"

$
0
0

Hi,
sorry but my english is not so good, I hope you understand what I meant below.

How should I do it then!

On the index page that lists menu name home there are messages that come automatically via feeds. Then I have a page with quick links menu name with logos that I want, I now use it as a static page.
If I do that quick links menu name as a static page that works.
But if I now at home (index) is in the menu, it will remain just the same as quick links, and this I would like to have back. My page feeds
Also, I would then like to change in headlines, the menu name now that's just the index page.

The themes that I is typically used grid bulletin if you need to know something.

thanks for your help


manex on "Get post editor content from pop-up"

$
0
0

Hi,

I am developing a plugin for my website(WordPress version 3.8.2) that when adding or editing posts has the capability of translating the content of those posts using web-services. I found some plugins with that functionality but they are designed for using Google translate, which is now a paid service, so they are not what I am looking for.

Up to now, I added a button to the post editor that opens a pop-up in which I will have the translation capabilities, such as, choose source and target language etc. This is the code I used for the button.

function oi_itzultzaile_botoia_gehitu()
	{
		echo '<a href="'.get_bloginfo("wpurl").'/wp-content/plugins/ohar-itzultzailea/itzulpen-orria.php?TB_iframe=true"
				class="thickbox" title="'.__("Ohar Itzultzailea","ohar-itzultzailea").'">
					<img src="'.get_bloginfo("wpurl").'/wp-content/plugins/ohar-itzultzailea/irudiak/itzuli-botoia.png" ></img>
			</a>';

	}

	add_action('media_buttons', 'oi_itzultzaile_botoia_gehitu');

The popup works fine. Now, I am trying to get the content in the post editor, so that I can use it as a parameter for the web-service. However, no luck so far. I have been looking into the documentation and browsed into the results given by google but I did not find something that would help me. Does anybody know how to do it?

Thanks for your help, :D

Manex

alexander70 on "Perhaps hacked site"

$
0
0

Hi!
A feeling that the site is hacked. I have to say, no viruses, Kaspersky silent.
http://audiobook-online.com

In Google Chrome and Mozilla Firefox as if everything is normal. But Internet Explorer 11 visible extra banners, contextual advertising, which I did not install. I installed the top and bottom banners from Google only. At Internet Explorer 11 visible. And yet, some time ago there were somewhere in the admin 2 comments, though, comments have been turned off, here they are:

Craig
%/csetgrpat78
176.125.64.249
Отправлен 15.12.2013 в 14:35
.
hello.

Charlie
%/vxbzmgs8751
31.132.241.148
Отправлен 04.12.2013 в 05:10
.
tnx for info!!

Possible to find this hack?

screamapillar on "Rename files based on post meta upon upload"

$
0
0

I'm trying to rename image files:

  • upon upload
  • to a specific post type
  • using that post's custom fields.

I'm creating a custom field contains the IDs of multiple uploaded images. The interface for adding them uses this method for invoking the media uploader.

In the plugin I'm making, it's critical to rename the uploaded image files. This post type has another custom field called "Reference ID", which is unique and is not the post ID. This reference number must prefix the image filename.

I have tried adding filters to wp_handle_upload_prefilter and sanitize_file_name, but the problem is that I cannot get post information to these functions. If this is possible, that would probably solve the problem.

The only other alternative I see is to create my own upload interface and use wp_insert_attachment which will easily allow me to rename files based on post meta. I'd rather stick to WP's own media uploader but it's looking like that may not be possible.

I'm sure there must be some alternative I haven't thought of. Input and ideas of any kind are much appreciated.

Many thanks to those who respond.

xvegax on "NO plugin: Connecting the WordPress gallery feature with custom categories"

$
0
0

Hi guys,

Without using any plugins I want to achieve to get the WordPress own gallery to correspond with custom created categories. I mean, I want to use a gallery without declaring which images to use, but instead just show all images of one category for example.

I created those categories with the following code in my child functions.php:

function is_add_categories_to_attachments() {
register_taxonomy_for_object_type( 'category', 'attachment' );
}
add_action( 'init' , 'is_add_categories_to_attachments' );

So far, everything is good. In the media menu I can add as many categories I want to now. In my case I made three of them, named alpha, beta and gamma.

--- Problem comes now:

But then I tried to combine that within a page with the wordpress gallery code and that just does not work at all:

[gallery type="squares" categories="alpha" order="DESC" orderby="ID" link="file"]

I also tried "category" instead of "categories", but that did not work, too.

So, I guess, there will not be an easy solution or maybe it is easy for programming geniuses (I am not). :) Can you help me out and show me how to combine those?

Thank you very much in advance.

jtlessons on "Can you get hacked by email?"

$
0
0

Hi, I have a Schedule Free Lesson form on my site:
http://www.jeffrey-thomas.com

I get batches of 4 to 5 emails through this form and they are all bogus with fake emails and only a few feilds filled out.

Is it possible to be hacked by these emails somehow? It has been going on for quite sometime. I just ran a site scan with Sucuri and the site is clean. I just don't know why someone would bother sending these emails to me through the form unless they have a agenda. Thanks, Jeff

ricardobnews on "Problemas com Redirecionamento"

$
0
0

Ola boa Noite estou tendo problemas em 2 sites meus infelizmente recentemente não e 100% das vezes mais quando clico em algumas matérias tenho meu site redirecionado para um vídeo do youtube do Justin Bieber sem minha autorização meus leitores estão reclamando disso e muito chato e ta atrapalhando o desempenho! alguém sabe a causa disso ou como evitar? se existe algum plugin que proteja ou algo parecido por gentileza caso possam me ajudar agradecerei muito

cromermusic on "Use my own MySQL tables?"

$
0
0

Is it possible to use my own tables for custom post types?
I think it's quite annoying when ALL data gets stored in the wp_posts table. Images, posts, tags, categories you name it. It looks like a real mess when you look in the database.

Lets say Posts (title & content) go into 1 table, images into another, tags into another etc. Why? To get more control over the database of course. Or should I consider making my own CMS?


midorian on "How to edit pagination?"

$
0
0

How can I edit the pagination?

If I add this:

previous_post_link();
next_posts_link();

Instead of:
twentyfourteen_post_nav();

It only shows the "previous link" and not the next post link. :/

Christiaan Conover on "TinyMCE not appearing when wp_editor is called (WP 3.9)"

$
0
0

One of the features of my plugin is to add a TinyMCE editor instance inside a meta box on the Edit Post screen. This has worked great up until 3.9, and I'm not clear as to what's going wrong.

Here are the relevant files containing the code for the meta box editor (links to files inside Github commit):

admin/author-customization-admin.php
admin/assets/js/edit-post.js

What am I missing? This is what I'm given when I load the Edit Post screen:
http://i.imgur.com/6GQUUa9.png

The contents are there though, which you can see when you highlight inside the textarea:
http://i.imgur.com/jTSlgWm.png

On WordPress 3.8.1 the code works just fine:
http://i.imgur.com/i7nTqPb.png

I'm not sure whether it's an issue with the PHP code or the JavaScript. Any help is appreciated.

forbiddenlaw on "Hep to delete advert"

eminentinfoweb on "updated automatically to WordPress 3.8.2."

$
0
0

Recently I have received an email from Wordpress saying, Howdy! Your site at http://www.eminentinfoweb.com has been updated automatically to WordPress 3.8.2.

How come WordPress automatically updated my version without my permission? I hope its not a hack or something. Is it?

jtlessons on "Heartbleed Bug & Wordpress"

$
0
0

Hey, I am not sure if this has been addressed yet? Is there any danger from this bug to wordpress sites? Is there anyway to check and make sure your site is clear?
Thansk, Jeff

Viewing all 8245 articles
Browse latest View live




Latest Images