EzySetup
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Custom Query to Return usermeta informationUpdate:
After about 8 hours of work, I have something working. Whether it is optimal code or not, I have no idea. But it returns the information I need. If anyone has any input on a better way to go about returning and formatting the data, I’m certainly open to suggestions.
<?php // Require_Once, so no conflicts if previously loaded require_once('wp-load.php'); // Declaring $wpdb as global and using it to execute an SQL query statement that returns a PHP object global $wpdb; // Primary Query echo "<p>Primary Query:</p>"; $results0 = $wpdb->get_var("select max(user_id) FROM $wpdb->usermeta"); for ($x = 0; $x <= $results0; $x++) { $results1 = $x; $results2 = $wpdb->get_var("SELECT a.user_login FROM wp_users a WHERE a.id = $x"); $results3 = get_user_meta( $x, 'first_name', true ); $results4 = get_user_meta( $x, 'last_name', true ); $results5 = get_user_meta( $x, 'nickname', true ); $results6 = get_user_meta( $x, 'textarea_zknsk', true ); $results7 = get_user_meta( $x, 'textarea_o0nn8', true ); $results8 = get_user_meta( $x, 'textarea_fjy8e', true ); if (!empty($results6) or !empty($results7) or !empty($results8)) { echo "<pre><strong>User ID: </strong>";print_r($results1);echo "</br>"; echo "<strong>User Name: </strong>";print_r($results2);echo "</br>"; echo "<strong>First Name: </strong>";print_r($results3);echo "</br>"; echo "<strong>Last Name: </strong>";print_r($results4);echo "</br>"; echo "<strong>Nickname: </strong>";print_r($results5);echo "</br>"; echo "<strong>Board Member Notes: </strong>";print_r($results6);echo "</br>"; echo "<strong>Board Secretary Notes: </strong>";print_r($results7);echo "</br>"; echo "<strong>Board Treasurer Notes: </strong>";print_r($results8);echo "</pre>"; } } ?>
Forum: Developing with WordPress
In reply to: Custom Query to Return usermeta informationUPDATE:
I was able to use an IF statement in the PHP rather than a CASE statement in the SQL. I am returning the data I need. But I still can’t figure out how to use the max user_id in the loop. Of course, I’ll be happy to accept any suggestions on a better way to go about it.
// Return Metadata ONLY.
/* $IDmax = $wpdb->get_results("select max(user_id) FROM $wpdb->usermeta"); */ for ($x = 0; $x <= 18; $x++) { $results1 = get_user_meta( $x, 'first_name', true ); $results2 = get_user_meta( $x, 'last_name', true ); $results3 = get_user_meta( $x, 'nickname', true ); $results4 = get_user_meta( $x, 'textarea_zknsk', true ); $results5 = get_user_meta( $x, 'textarea_o0nn8', true ); $results6 = get_user_meta( $x, 'textarea_fjy8e', true ); if (!empty($results4) or !empty($results5) or !empty($results6)) { echo "<pre><strong>First Name: </strong>"; print_r($results1);echo "</br>"; echo "<strong>Last Name: </strong>"; print_r($results2);echo "</br>"; echo "<strong>Nickname: </strong>"; print_r($results3);echo "</br>"; echo "<strong>Board Member Notes: </strong>"; print_r($results4);echo "</br>"; echo "<strong>Board Secretary Notes: </strong>"; print_r($results5);echo "</br>"; echo "<strong>Board Treasurer Notes: </strong>"; print_r($results6);echo "</pre>"; } }Forum: Themes and Templates
In reply to: [Graphene] How do I remove the posts block from the home pageThanks, but I don’t see how I can modify or remove the post.
Forum: Themes and Templates
In reply to: [Twenty Ten] Disable previous and next post linksThat works perfectly. Thank you very much.
PS. It’s a club site. I’m stuck with Twenty Ten for the time being.
Thanks for the quick response. We’re using the Twenty Ten theme. Hopefully I can get so input on possibilities elsewhere.
Thanks again.
Forum: Themes and Templates
In reply to: [Graphene] How do I remove the posts block from the home pageNever mind. I found the solution.
Customizing > Graphene: General / Slider / Disable Slider
Forum: Fixing WordPress
In reply to: Strategy for restoring hacked siteWell, all they could bring me up to was PHP Version 5.5.38. I’ll just have to remember to ping them every now and then to see when they support higher versions. Hopefully this will keep me going for awhile anyway.
Thanks again,
AndrewForum: Fixing WordPress
In reply to: Strategy for restoring hacked siteYes, it’s been a pain, although not as much as it could have been had I needed to start from scratch.
I did use the plugin “WordPress phpinfo()” to discover that I wasn’t using the version of php I thought I was running.
Thanks for the tip on going to 5.6 or 7. I’ll ping my host about it today.
Forum: Fixing WordPress
In reply to: Media will not re-importDone. It worked. Thank you for the reference.
Forum: Fixing WordPress
In reply to: Media will not re-importUpdate:
I believe the plugin will work. Unfortunately, I can’t just import everything in the uploads directory in one fell swoop. I need to enter each month’s directory for the last four years and select the files in that directory, but at least it seems to be keeping the dates intact.
I’ll update again when done.
Forum: Fixing WordPress
In reply to: Media will not re-importInteresting. I would have figured that restoring a site was no different than moving from one site to another. In both situations the media has to be in the same place. What am I missing?
I do have the SQL from the hacked site, but I don’t see how I could use it. While I did export a few individual tables (such as quotes in the QuoteRotator, which I’ve used to repopulate the site). I didn’t see a table for just the media library. I certainly don’t want to import the whole DB, as it has hacked content.
I’ll give the plugin suggested a whirl. Thank you. I was hoping such a tool existed. I’ll post back with the results.
Thanks again,
AndrewPS. I do run daily backups of the DB and weekly backups of both files and the DB. But to conserve space I only keep 6 weeks. Unfortunately the hacker waited longer before utilizing the hacks and I discovered the intrusion. Therefore the only DB and file backups I have contain malicious content. Fortunately the “uploads” directory contained no malicious files. WP, plugins, etc. have all been replaced with new files.
Forum: Themes and Templates
In reply to: [Graphene] Recovering from hackRESOLVED
After all the effort I started running diagnostics on my host. Somewhere along the way my domain had been downgraded to PHP Version 5.2.17. I got it back to 5.3.2 and now everything magically works just fine.
Forum: Fixing WordPress
In reply to: Strategy for restoring hacked siteRESOLVED
After all the effort I started running diagnostics on my host. Somewhere along the way my domain had been downgraded to PHP Version 5.2.17. I got it back to 5.3.2 and now everything magically works just fine.
Forum: Fixing WordPress
In reply to: Strategy for restoring hacked siteTotally stumped (and aggravated). I’ve done dozens of WP installs and never had anything like this occur.
- Backed up DB
- Exported Pages, Media, and Comments using WP’s export tool
- Deleted database
- Deleted files
- Downloaded new instances of WP, Graphene, and Graphene Shortcodes
- Uploaded new files
- Ran /wp-admin/upgrade.php – successful and then prompted for an finished install
- Backed up DB
- Tested
- Twenty Seventeen theme ran fine. No issues with any Appearance items.
- Activated Graphene. Same issues as before.
- Activated Twenty Fifteen (it worked fine with earlier setup). It fails with same issues as Graphene.
- Dropped tables and restored to fresh DB.
- Confirmed Twenty Seventeen worked. It did.
- Activated Twenty Fifteen (it worked fine with earlier setup). It fails.
I can’t figure it out. Even with a fresh install some of the Appearance functions just do not work for some of the themes.
I have tried every variation of starting over and none work. All these functions worked on Graphene prior to deleting everything and starting over. Meaning nothing has changed on my hosting.
I’m stumped.
Forum: Fixing WordPress
In reply to: Strategy for restoring hacked siteI did post in the Graphene support area. However, I was just thinking the problem does exist with Twenty Seventeen as well. It’s not specific to Graphene. It just happens that Twenty Fifteen works. This has to be a problem in the DB, but I’ve been unable to find it.
I’m wondering, would it work to:
- Backup the SQL for each table individually
- Delete all the WP files
- Drop of the DB tables
- Re-upload fresh WP files
- Backup the DB
- Import my tables one-by-one, starting with POSTS and then OPTIONS, as these are the two areas where I’ve got the most work involved
- Use the backup to revert at the point an import breaks the admin controls
Thoughts?