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

dharmashanti on "Need help with creating verifiable coupons"

$
0
0

I have a client that has a group buying site (like Groupon and LivingSocial) and he wants to each coupon purchased to have some sort of unique identifier (auto gen number, bar code, or QR code) that can then be read by the merchant via a smartphone and validated via the database.

He wants to make sure that people can't duplicate the coupons they buy.

Event Espresso has something similar to this for events, but not for just coupons on non-event type items.

Any suggestions on either a plugin that would handle this or how I can program in PHP or JS to generate a QR Code for each coupon sold and then validate it via a QR code reader?


zipsuckscom on "My site got hacked... by Iran"

$
0
0

My site got hacked... by Iran.
I get messages: Not Found
It looks like nothing was found at this location. Maybe try a search?
I try to set up a new page, and get the same message.

It's a new Free Iranian Comics site,
عکسها.com or http://zipsucks.com/
It must've rubbed the ayatollahs the wrong way.
Any idea how to fix it?

RapBatLe on "Worpdress Filter"

$
0
0

Hi, I have a blog where i sell travel oferts. I need a filter to sorting this posts. For example if i have 200 oferts i can display they in a pagination but this is not good idea. I have some custom fields (price, destination etc.) and i want to filter my post with this fields. Can you help me ? Some plugins or hardcore coding :) Sorry for my english....

Dr.Newbie on "AJAX Login: Include link in 'lostpassword'-message"

$
0
0

Hi everyone! I'm a wordpress / php newbie and need some help:

I'm using the Ajax Login on my WP project. It works great but I have a simple (and very general) php / ajax question. There is this part of the code:

$user_signon = wp_signon( $info, false );
    if ( is_wp_error($user_signon) ){
        echo json_encode(array('loggedin'=>false, 'message'=>__('NO SUCCESS')));
    } else {
        echo json_encode(array('loggedin'=>true, 'message'=>__('SUCCESS')));
    }

I'd like to include a link in the array something like:

NO SUCCESS <a class="lost" href="<?php echo wp_lostpassword_url(); ?>"><i class="retinaicon-remove"></i> FORGOT YOUR PW?</a>

I'm sorry, I really don't know how to include a link (and an icon) in the array. Can anybody help? Here is the complete Code:

function ajax_login_init(){

    wp_register_script('ajax-login-script', get_template_directory_uri() . '/ajax-login-script.js', array('jquery') );
    wp_enqueue_script('ajax-login-script');

    wp_localize_script( 'ajax-login-script', 'ajax_login_object', array(
        'ajaxurl' => admin_url( 'admin-ajax.php' ),
        'redirecturl' => home_url(),
       'loadingmessage' => __('VERIFYING...'),

    ));

    // Enable the user with no privileges to run ajax_login() in AJAX
    add_action( 'wp_ajax_nopriv_ajaxlogin', 'ajax_login' );
}

// Execute the action only if the user isn't logged in
if (!is_user_logged_in()) {
    add_action('init', 'ajax_login_init');
}

function ajax_login(){

    // First check the nonce, if it fails the function will break
    check_ajax_referer( 'ajax-login-nonce', 'security' );

    // Nonce is checked, get the POST data and sign user on
    $info = array();
    $info['user_login'] = $_POST['username'];
    $info['user_password'] = $_POST['password'];
    $info['remember'] = true;

    $user_signon = wp_signon( $info, false );
    if ( is_wp_error($user_signon) ){
        echo json_encode(array('loggedin'=>false, 'message'=>__('NO SUCCESS')));
    } else {
        echo json_encode(array('loggedin'=>true, 'message'=>__('SUCCESS')));
    }

    die();
}

pvanbavel on "Fatal error while trying to delete "all-in-one-event-calendar" plugin"

$
0
0

Fatal error: Call to a member function set_defaults() on a non-object in /home/a26jul07/domains/creatiefcontact.nl/public_html/wp-content/plugins/all-in-one-event-calendar/app/model/class-ai1ec-settings.php on line 306

Because of database errors I tried to delete all-in-one-event-calendar.
Removing a plugin should be no more than deleting all related files and DB-entries. Wether they exist or not

pvanbavel on "Fatal error while trying to delete "all-in-one-event-calendar" plugin"

$
0
0

Fatal error: Call to a member function set_defaults() on a non-object in /home/a26jul07/domains/creatiefcontact.nl/public_html/wp-content/plugins/all-in-one-event-calendar/app/model/class-ai1ec-settings.php on line 306

Because of database errors I tried to delete all-in-one-event-calendar.
Removing a plugin should be no more than deleting all related files and DB-entries. Wether they exist or not

rmgl on "Styling Google Maps - JSON?"

OldSchoolMIX on "My custom permalinks works but when I go from page to blog then 404error appears"

$
0
0

Yes, I changed my permalinks to custom /%postname%/. The pages are working, but only when I go from blog page to blog page or another words from post to post. If I go to about or contact page which are normal pages and then to blog then 404 error appears. So there is some conflict between pages and posts... Im a little bit frustrated and I will appreciate anyone for help,

Many Thanks,
Marcin


say_hello on "stripslash a database-dump: how To"

$
0
0

how to stripslahs a data dump form a mysql db.

in order to get only the text.

[code]
(9, 54, '[2012:10:13] Die Stunde Null - ein Medium wird neu erfunden...', 'die-stunde-null-ein-medium-wird-neu-erfundenbuches', '', '<p>E-Books auf )[/code]

look forward to hear from you

impolex on "Youtube video output in comments through custom upload plugin"

$
0
0

I'm developing a pluggin for a client that will allow users to upload videos to easily upload videos and display videos for comments. Through the Youtube API users will fill out the video information and upload the video within my clients site in the comment section for the post. The pluggin will simultaneously upload the video to a community Youtube account and display the video in the comment.

The Youtube video is stored in the WordPress site as a url in the comment meta for the comment.

I have successful created the system for uploading Youtube and for storing the resulting URL.

My issue rests in attempting to display the video. I have found that WordPress does not want to do this. I have attempted four different techniques to achieve my result and none work.

Attempt 1: Processed Short Code

add_filter( 'comment_text', 'modify_comment');
    function modify_comment( $text ){

        if( $youtube = get_comment_meta( get_comment_ID(), 'youtube', true ) ) {
            $youtube = '[video src="http://www.youtube.com/watch?v='.$youtube.'" ]';
            $text = do_shortcode($youtube) . '<p>' . $text . '</p>';
        }
        return $text;
    }

Output: Clickable URL

Attempt 2: Plain Shortcode

add_filter( 'comment_text', 'modify_comment');
    function modify_comment( $text ){

        if( $youtube = get_comment_meta( get_comment_ID(), 'youtube', true ) ) {
            $youtube = '[video src="http://www.youtube.com/watch?v='.$youtube.'" ]';
            $text = $youtube . '<p>' . $text . '</p>';
        }
        return $text;
    }

Output: Shows shortcode as plain text

Attempt 3: Constructed iFrame

add_filter( 'comment_text', 'modify_comment');
    function modify_comment( $text ){

        if( $youtube = get_comment_meta( get_comment_ID(), 'youtube', true ) ) {
            $youtube = '<div><iframe title="YouTube video player" class="youtube-player" type="text/html" width="640"
height="390" src="http://www.youtube.com/watch?v='.$youtube.'" frameborder="0"
allowFullScreen></iframe></div>';
            $text = $youtube . $text;
        }
        return $text;
    }

output: Empty white box (broken iFrame)

Attempt 4: Just the URL

add_filter( 'comment_text', 'modify_comment');
    function modify_comment( $text ){

        if( $youtube = get_comment_meta( get_comment_ID(), 'youtube', true ) ) {
            $youtube = 'http://www.youtube.com/watch?v='.$youtube.';
            $text = $youtube . '<p>' . $text . '</p>';
        }
        return $text;
    }

Output: Plain Text URL (kind of expected that)

Has anyone else attempted this before? Can you think of any other ways to do this?

Frilly on "First part of my text not appearing with Auto Excerpt everywhere plugin."

$
0
0

Hi I'm really stuck with this problem. I'm using the book review plugin for my new site, and also the "Auto Excerpt everywhere" plugin for the "read more" link on posts. My problem is that the (read more) plugin takes the text from the "my thoughts" segment and I really want the synopsis of the book to appear before the jump.

Hope someone can help with this problem . . .

This is a link to the site.

http://frillybookreviews.url.ph/

digitalzoomstudio on "Using WP Media Uploader in Outside PHP File"

$
0
0

Hello WordPress Gurus,

I am trying to introduce the WP 3.5 Media Uploader in a custom admin page for a plugin. All works fine except that when I try to upload I get an error:

An error occurred in the upload. Please try again later.

From /wp-admin/async-upload.php I get just -1 response

Test if yourself if you wish - http://thezoomer.net/themeadmin-testmediauploader/wordpress/wp-content/plugins/test_mediauploader/test_mediauploader.php?outsidewp=on

I have also created user with upload capability if you wish to test logged in, but it's the same error - http://thezoomer.net/themeadmin-testmediauploader/wp-login.php

[ User id and password redacted ]

I am really stuck in making upload work. Any help is welcome.

Code

test_mediauploader.php - http://pastebin.com/yPP4CJY3

get_wp.php - http://pastebin.com/qmaCji97

jtbuzz on "Built-in search"

$
0
0

Wondering if anyone can provide me with some insight here...

So I've been trying to use FAQ plugin that has search capability. I've come to learn that this plugin uses WP's built-in search function and so pretty much searches the entire site instead of FAQ-related content.

Anyhoo, that would be fine and all, but the website is currently set to redirect on the home page, causing the search queries to break.

Is there anyway to limit what WP's built in search will look for?

Thanks!

(If more info/examples needed, I'll be happy to provide that)

hampsterj on "automate help"

$
0
0

i'm trying to automate when i upload say an audio file the name of my post is set the the name of the file i'm uploading and set a download name could any one point me on a path to start this

jan4971 on "Problem with user_mail in functions.php"

$
0
0

Hey guys, i have some issues with this thing here:

add_shortcode('authors-list', 'my_authors_list_shortcode');
function my_authors_list_shortcode( $atts = array() ) {
    global $wpdb;
    $users = $wpdb->get_results( "SELECT ID, display_name FROM {$wpdb->users}" );

    $content = "<ul class='authors-list'>";
    foreach( $users as $user ) {
        $content .= "<li>";
        $content .= get_avatar( $user->ID, 70 );
        $content .= "<h3>" . $user->display_name . "</h3>";
        $content .= "<p class='author-description'>" . get_user_meta( $user->ID, 'description', true ) . "</p>";
        $content .= "<p class='author-description'>" . get_user_meta( $user->ID, 'phone', true ) . "</p>";
        $content .= "<p class='author-description'>" . get_user_meta( $user->ID, 'livingplace', true ) . "</p>";
		$content .= "<p class='author-description'>" . $current_user->user_email . "</p>";
		$content .= "</li>";
    }
    $content .= "</ul>";
    return $content;
}

It seems like there is no way to output all users email adresses.
Any one got an idea ?


_F12 on "Custom data without working against WordPress"

$
0
0

I have battling with this problem for a while now so I thought I would get some help.

Basically I have a set of entries, which I want to display on one page each, but which are not posts and which I do not want to display as such (i.e. I want to write my own page to display them - no metadata, no comments, etc.). What is the best solution to this?

I could have my own page and database table (with associated plugin for data entry) working with GET variables to define which entry to show, but I think this may be working against rather than with the WP framework. Is there possibly a way to leverage the posts system to do this rather than create my own, while not impacting on the ability to have proper WP posts? One of the other issues is I am trying to use WP_QuickLatex to process the data in these entries so using my own database poses a problem there (since that plugin processes the post data). I am also considering using shortcodes in the entries as well.

Any suggestions would be much appreciated as I feel like I am going around in circles.

janaeniell@gmail.com on "Woocommerce Single Product Page Variable Title"

$
0
0

I'm currently trying to write a php variable into the Single Product page of my Woocommerce store template. My husband has a storefront located here: http://jamminjdcards.com/blog/shop/ Under the 'Box Breaks' drop down in the navigation you'll notice both 'Box Breaks' and 'Pack Breaks'. The 'Box Breaks' takes you to the main shop page with all products. The 'Pack Breaks' takes you to a category named 'pack-breaks-shop' and I have code written in my functions.php file to omit all Pack Breaks from the main shop page so they remain separate. One last thing is I have sub-categories established: pack-breaks-football and pack-breaks-basketball nested under the pack-breaks-shop category. All Pack Break products will be applied to both the pack-breaks-shop and applicable sub-category.

All of this has worked superbly - however I remembered that regardless of Category, all products use the same Single Product page template. Right now the title reads "Box Breaks" for all Single Products. Now that I'm adding Pack Breaks though, that title doesn't apply. What I'm trying to do is write a variable php if statement that basically states if we're in the pack-breaks-shop category, to echo x title, else echo x title - so that all other pages will say "Box Breaks".

I hope I've explained that clearly. Let me know if I need to clarify.

Right now I don't have any Pack Breaks up - we haven't launched them yet, so you can't view it on my live server - only on my localhost. However, at this point I mainly just need someone to look at my code and tell me what I'm doing wrong. I'm new to php, so please take a look here:

http://pastebin.com/W8ePubjW

Currently I have this in my title div - which you can see on the live server. As far as templates go, I have this pasted in the product-image.php template found in woocommerce > single-product > add-to-cart > product-image.php.

As of right now I'm implemented this code on my localhost and it has no effect - the title still shows up, but only as "Box Breaks". It doesn't change on any category to "Pack Breaks".

Please let me know if you need additional information. Thank you!

Jurs on "Gallery shortcode defaults"

$
0
0

I have tweaked the gallery shortcode to add support 3 different column layouts (bootstrap).
Like this
[gallery ids="..." small="6" medium="4" large="3"]

I have tried to define defaults for each size (line 40-42) but they don't work.

Preferably i would like to add the three sizes with default so they are placed in the editor. Like the way the id'd are automatically placed when you add the gallery.

Any help on this would be great!

piggycoin on "How do I multiply all my woocommerce prices by a php variable?"

$
0
0

Hey there!

I'm trying to multiply all my woocommerce store prices (the prices of all products in all the pages of the website) by a PHP variable.

I have a PHP file: "example.php" with a "$var" inside but can't seem to find the code responsible for all the store prices.

Any suggestions?

Roman.L on "Add Media "Uploaded to this post" by any means..."

$
0
0

When writing post or page you can click Add Media and on Insert Media tab you have drop-down menu first two options are "All Media Items" and "Uploaded to this post".

I am looking for any way to make "Uploaded to this post" default option. I am open to any solutions that will work even editing source files for WordPress directly.

So far i only found jQuery solutions that work very slow first letting 200 images load and only then switching to "Uploaded to this post".

I assume it could be faster if i can limit images that load by default to 1 as i don't ever need to see all images anyway.

Viewing all 8245 articles
Browse latest View live




Latest Images