Mad Max
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Explanation and workaround for error 404 on category paginationYou are right. I usually use permalinks so this problem has never come to my mind! I think it worths a rewrite of the function to take in account your use case.
Taking out cat names/values from the function and grouping them in a “pagination settings” section of the function.php files (clearly a plugin with an admin page should be the best solution), we can rewrite the code like this:Permalinks enabled
//POSTS PER PAGE (permalinks on) $my_ppp =array( 'category' => array( 'cat1_name' => X, 'cat2_name' => Y, 'cat3_name' => Z, ), 'search' => K, );Permalinks disabled
//POSTS PER PAGE (permalinks OFF) $my_ppp =array( 'category' => array( 'cat1_ID' => X, 'cat2_ID' => Y, 'cat3_ID' => Z, ), 'search' => K, );And then the function:
if ( isset( $my_ppp ) && is_array( $my_ppp ) && count( $my_ppp ) ) add_filter('request', 'cure_wp_amnesia_on_query_string'); function cure_wp_amnesia_on_query_string($query_string){ global $my_ppp; if ( !is_admin() ){ if ( isset( $my_ppp['category'] ) && is_array( $my_ppp['category'] ) ) { if ( isset( $query_string['category_name'] ) ) { foreach ( $my_ppp['category'] as $category_name => $ppp ) { if ( $query_string['category_name'] == $category_name ) { $query_string['posts_per_page'] = $ppp; break; } } }elseif ( isset( $query_string['cat'] ) ){ foreach ( $my_ppp['category'] as $cat_id => $ppp ) { if ( $query_string['cat'] == $cat_id ) { $query_string['posts_per_page'] = $ppp; break; } } } } if ( isset( $my_ppp['search'] ) && isset( $query_string['s'] ) ) { $query_string['posts_per_page'] = $my_ppp['search']; } } return $query_string; }Forum: Fixing WordPress
In reply to: Explanation and workaround for error 404 on category pagination@ch0usse
If you are using my function “cure_wp_amnesia_on_query_string” (with your category slugs and values, of course), you no longer have to alter the query vars adding&post_per_page=x&paged=etc etc. They are automagically added every time WP needs to know their values.As I wrote above, with this function, you no longer have to “scatter” the pagination-settings on several template files.
My function just groups those settings in one point and allow you to use the value defined in the backend as the default value for every new type of archive/listing.If it doesn’t work, try to post here (or on pastebin.com) the code you are using in your theme function and templates.
Bye
Forum: Plugins
In reply to: [Big Bio Box] [Plugin: Big Bio Box] Only a pair of suggestionsHi Kevin,
ok, found it. That was an oversight on my part: I’ve copy&pasted the code on your site here, without a check in the downloadable file.Cheers
You are welcome! Happy to hear you have resolved your issue.
mmmh, I’m using this file attachment method on a 3.2.1 WP version but I think the problem is not due to the your newer WP version. Can you attach the code you are using?
@tari72: Do you have some errors? What do you mean with “can’t make it work.”
Can you make more clear which is the obscure part in my code, so I can help with it?@palgrave: I don’t think so. I’m using the last CF7 version and it works. Which version of WP are you using? Have you added a field name in the file attachement field on MAIL section?
php copy should support remote files, so just change the path to your master file:
$master_copy='http://www.mysite.it/subfolder/private/my_remote_file.pdf';IF IT DOESN’T WORK
here you can find a good tutorial with 4 solutions to read a remote file and grab its content.Once you have putted the content of the remote file in to a variable ($content in the tutorial), just write it to a file with a line of code like this:
file_put_contents($file, $content);
Suppose you decide to use the second method described in the tutorial (remember to verify that your hosting service has allow_url_fopen setted to true in php.ini), you can integrate it in my code like this:
add_action( 'wpcf7_before_send_mail', 'create_unique_coupon_and_send_it' ); function create_unique_coupon_and_send_it( $cf7 ) { //check if this is the right form if ($cf7->id==741){ $uploads = wp_upload_dir(); //define some constants define ('MY_FILE_PATH',$uploads['path'].'/myfile/'); //set filenames $master_copy='http://www.mysite.it/subfolder/private/my_remote_file.pdf'; $copy_to_send=MY-FILE_PATH.'attachment.pdf'; if ($cf7->mail['use_html']==true) $nl="<br/>"; else $nl="\n"; // get the remote file $content = file_get_contents('$master_copy'); if ($content !== false) { //make a copy of the master file and attach it if ( file_put_contents($copy_to_send, $content) !== false ){ //Let'go to the file attachment! $cf7->uploaded_files = array ( 'coupon' => $copy_to_send ); } } //Let'go to the file attachment! $cf7->uploaded_files = array ( 'coupon' => $copy_to_send ); //append some text to the outgoing email $message=$nl.$nl.'Blah blah blah.....'.$nl; $message.='So Long, and Thanks for All the Fish!'.$nl; $cf7->mail_2['body'].=$message; } }Forum: Plugins
In reply to: [Rich Text Tags] [Plugin: Rich Text Tags] Please Update if PossibleI’m happily using “Taxonomy images” to adding an image to taxonomies terms. It integrates perfectly with WP media management and doesn’t let users to mess up with impagination when adding a taxonomy description.
It uses filters to add image information to standard queries on templates like category.php, tag.php taxonomy.php and all of their derivatives. But it’s really easy to read image/term associations stored in the db as an array and use them as you need.
Forum: Plugins
In reply to: [Rich Text Tags] [Plugin: Rich Text Tags] Please Update if PossibleI’m on a 3.3 WP and I was having the same problem. Today WP notifies me a new version of this plugin, 1.4.1, but it seems the update was published on 2011-08-11, so why does the update notification has popped out today?!
Anyway, after the update process, now it works perfectly.
Forum: Plugins
In reply to: [Gallery Metabox] [Plugin: Gallery Metabox] Just onelittle additional featurePerfect. Thanks a lot Bill!
Forum: Plugins
In reply to: [Gallery Metabox] [Plugin: Gallery Metabox] Just onelittle additional featureYour argument is logically flawless, but in practice I think is more a matter of preferences.
The “Descriptions” can be some paragraphs long while “Titles” are usually some words long so I think is more suitable to show a single phrase in case images cannot be loaded.Hi Lonchbox and radleaf, you can drop me an email at mad_maxatymaildotcom.
@lonchbox: I’m giving a try to scissor continued on wp 3.3 and it seems it works. Do you have some particular problem using it? Let me know by email.
@radleaf: if you should give me an access to your wp to check what’s wrong with jcarousel. Let me know by email.
So I’ve made a try finally!
I think your plugin is great but it lacks one setting: the database prefix!
My goal is to clone a wp site to another fresh wp installation not to just change domain name, but to create a clone site and then change only relevant contents and images, but mantaining all plugins and settings.
So, at 99% of times, I use a different database prefix.I’ve tried a migration toward a new fresh 3.3 WP installation with different db prefix and your plugin correctly unserializes, changes and serializes again all data containing the old domain name, create backups and upload them to the new wp, but it uses the old db prefix and there’s no way to instruct the plugin to use the new one.
Another thing I came across (but I made only one test) is that, even if I setted the correct path to the new wp site backup folder for your plugin, the backfiles was uploaded in the root folder, ie:
new-site.com/DBBackup-13250069441.sql
new-site.com/Backup-13250069451.zipSo I moved manually those files to the right folder and then I completed the migration process.
Let me know if you need more infos.
Regards, Daniele.I’m really sorry, I’ve made a typo (missing a ‘t’); this is the correct code:
load_plugin_textdomain('scissors',false, $scissors_locale_dir);@lonchbox: have you tried the solution in the first post at the top?
1) line 50 in scissors.php:
load_plugin_texdomain('scissors', $scissors_locale_dir);change to
load_plugin_texdomain('scissors',false, $scissors_locale_dir);