WordPress Bug on IIS ? Problem when uploading image on IIS 7

You are encountering an improperly configured server. Please consult the WordPress manual on how to setup wordpress on a windows server system. AFAIK – but I’m not a windows server expert – you must configure the upload directory that the user executing the PHP WordPress application is able to access files therein for reading, writing, … Read more

Image resizing – TimThumb vs convert on upload?

WordPress and TimThumb both use GD to resize images, so quality is going to be similar. GD’s resize quality is not as good as Photoshop, you’ll notice this especially in fine details. Both WP and TimThumb can be modified to use ImageMagick, WP via a plugin, TimThumb I think requires you edit the code directly, … Read more

How can I manage and limit disk usage for each author?

Okey so this is just an example how you can archive this.. First change the upload directory to the current users username. eg uploads/admin function wpse_16722_type_upload_dir( $args ) { // Get current user data $current_user = wp_get_current_user(); // Make upload dir to current username $newdir=”https://wordpress.stackexchange.com/” . $current_user->user_login; $args[‘path’] = str_replace( $args[‘subdir’], ”, $args[‘path’] ); //remove … Read more

Large image upload size (using timthumb.php

Instead of using timthumb, use the internal image API. Firstly, specify the custom size you’re wanting to use by using add_image_size: Usage: <?php add_image_size( $name, $width, $height, $crop ); ?> So you would put this in your themes functions.php: add_image_size( ‘large_post_image_header’, 660,246,true); Then, instead of: <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘full’ ); ?> … Read more

Using Add from Server to upload by post ID

You can try to add this into your functions.php file: add_filter( ‘upload_dir’,’wpse87234_upload_dir’); function wpse87234_upload_dir($uploads){ // check if we are in the “Add From Server” media tab if (isset($_REQUEST[‘post_id’]) && isset($_GET[‘tab’]) && $_GET[‘tab’]==”server”) { $prefix=”post_”; $post_id=(int)$_REQUEST[‘post_id’]; // change the uploads info to our needs: $uploads[‘subdir’]=”https://wordpress.stackexchange.com/”.$prefix.$post_id; $uploads[‘path’]=$uploads[‘basedir’].$uploads[‘subdir’]; $uploads[‘url’]=$uploads[‘baseurl’].$uploads[‘subdir’]; } return $uploads; } This should give directory like … Read more

Check for file extension or mime type fails

Found where I made the error, on the condition, my code was: if ($filetype[‘type’] != $fileCSV || $filetype[‘type’] != $fileText) { echo “Error, the file $filename has not a valid extension: ” . $filetype[“ext”]; continue; } And the right is this one: if (!in_array($filetype[‘type’], array($fileCSV, $fileText))) { echo “Error, the file $filename has not a … Read more

tb_show not showing a media upload window . custom plugin

I couldn’t find what was wrong with the code, so I used a different code which I found on the internet and now the window is opening. var file_frame; $(‘#csv_file_button’).on(‘click’, function(event){ event.preventDefault(); if ( file_frame ) { file_frame.open(); return; } // Create the media frame. file_frame = wp.media.frames.file_frame = wp.media({ title: $( this ).data( ‘File … Read more

Maximum post size?

Try editing the post_max_size variable, if you have access to your php.ini file. This variable is the limit of the entire body of the request, which could include multiple files (source – stackoverflow). If you don’t have access to it you can try editing your functions.php file and add: @ini_set( ‘post_max_size’, ’64M’); //this will set … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)