Support » Plugins » [Plugin: Random / Rotating Ads V2] Image upload option Datafeedr ads

Viewing 15 replies - 1 through 15 (of 20 total)
  • Thread Starter Rhand

    (@rhand)

    Support forum @ http://wphelpcenter.com/ seems impossible to find. Maybe they only offer commercial services. Anyone?

    Thread Starter Rhand

    (@rhand)

    Found forum, but seems to be for commercial users: http://www.datafeedr.com/forums/index.php

    what about the plug-in kadom ads management? i’m liking that. i place an ad by uploading the image

    you can look at http://www.lewiscountysirens.com to see what mine looks like. i haven’t got them to rotate yet, but then, i’m pretty new at this

    Thread Starter Rhand

    (@rhand)

    Thanks news reporter. Will have a look asap.

    Thread Starter Rhand

    (@rhand)

    Removed this post as it was mentioned twice..

    Thread Starter Rhand

    (@rhand)

    Added this code for an image upload field, but it does not work yet:

    <?php
    	function my_admin_scripts() { // load necessary script including new script
    	wp_enqueue_script('media-upload');
    	wp_enqueue_script('thickbox');
    	wp_register_script('my-upload', WP_PLUGIN_URL .'/my-script.js', array('jquery','media-upload','thickbox'));
    	wp_enqueue_script('my-upload');
    	}
    
    	function my_admin_styles() {
    	wp_enqueue_style('thickbox');
    	}
    
    	if (isset($_GET['page']) && $_GET['page'] == 'datafeedr-ads') {
    	add_action('admin_print_scripts', 'my_admin_scripts'); // run javascripts in html header
    	add_action('admin_print_styles', 'my_admin_styles'); // add your own css styles
    
    	}
    
    	?>
    
    				<tr valign="top">
    				<th scope="row">Upload Image</th>
    				<td><label for="upload_image">
    				<input id="upload_image" type="text" size="36" name="upload_image" value="" />
    				<input id="upload_image_button" type="button" value="Upload Image" />
    				<br />Enter an URL or upload an image for the banner.
    				</label></td>
    				</tr>

    Thread Starter Rhand

    (@rhand)

    Maybe the script has to be adjusted as it is part of another plugin now with its own form. Here is the custo script that should be loaded:

    jQuery(document).ready(function() {
    
    jQuery('#upload_image_button').click(function() {
     formfield = jQuery('#upload_image').attr('name');
     tb_show('', 'media-upload.php?type=image&TB_iframe=true');
     return false;
    });
    
    window.send_to_editor = function(html) {
     imgurl = jQuery('img',html).attr('src');
     jQuery('#upload_image').val(imgurl);
     tb_remove();
    }
    
    });

    Thread Starter Rhand

    (@rhand)

    Complete plugin code here: http://wordpress.pastebin.com/yprywP7J

    Thread Starter Rhand

    (@rhand)

    Added script to top which did load thickbox and I did get a pop-up thanks to mordot at #wordpress (IRC) . Now I see the added my-script.js is not loaded so I think:

    wp_register_script('my-upload', WP_PLUGIN_URL.'/my-script.js', array('jquery','media-upload','thickbox'));
    wp_enqueue_script('my-upload');

    is not loaded. Any ideas why?
    The media-upload does not load either. The latter I suspect to be a js conflict..

    See http://wordpress.pastebin.com/xF0xs9mL
    `

    Thread Starter Rhand

    (@rhand)

    Well wp_register path was off. This path:

    wp_register_script('my-upload', WP_PLUGIN_URL.'/datafeedr-ads/my-script.js', array('jquery','media-upload','thickbox'));

    works better. Only now it shows two thickboxes under each other. One empty and the other with the media uploader..

    Thread Starter Rhand

    (@rhand)

    Hmmm TB_Title is loaded twice and TB_ajaxContent is there for no reason. How can I get rid of those?

    Thread Starter Rhand

    (@rhand)

    Well I removed class=”thickbox” in added upload field which apparently loaded styled thickboxes twice. Looking better yet again 🙂 Updated code: http://wordpress.pastebin.com/7QZ8ucBM

    Thread Starter Rhand

    (@rhand)

    Next q, how do I get the the link to the uploaded url to be added to the add box?

    code: http://wordpress.pastebin.com/7QZ8ucBM

    Thread Starter Rhand

    (@rhand)

    Well I do get the url, but I would like the javascript to wrap the url in an <img src=”” /> tag as well. How would I do that?

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘[Plugin: Random / Rotating Ads V2] Image upload option Datafeedr ads’ is closed to new replies.