Tag: HOWTOs

My Page Order WordPress Plugin Modifcation

I have been working with a client recently that was using the My Page Order plugin for the WordPress CMS I set up. They had several “draft” pages they used for templates and did not want them to show up in the My Page Order Admin interface. After looking at the SQL code, I added in a piece that would only show published (live) pages.
To make the same change in your code, open up the plugin file (mypageorder.php), go to line 47 and change the following line:

$results=$wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = $parentID and post_type = 'page' ORDER BY menu_order ASC");

to:

$results=$wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = $parentID and post_type = 'page' and post_status='publish' ORDER BY menu_order ASC");

Now, only the pages you really want to order will appear in the menu.

bbPress and WordPress Integration

Here is a quick guide if you are looking to integrate WordPress and bbPress so that your WordPress users can log into bbPress and your bbPress users can log into WordPress.

  1. Download/install/configure WordPress. You will need to upload the WordPress files to your web site directory and create a WordPress database. The installation process for WordPress is painless.
  2. Download/install/configure bbPress. For the easiest and painless experience, upload the bbPress files into the same directory your WordPress files are in (most likely your web root folder).
  3. Do not create a bbPress database, rather define use your WordPress database settings in the bbPress config.php file. At the bottom of the config.php file for bbPress there are preferences that you will need to set so that bbPress knows to share cookies and authentication. This is documented in the config.php file so just follow directions.

That is it. Once you have both bbPress and WordPress set up and configured, your users can then enjoy having accounts to log into both systems using the same user name and password.

Terms of Use Javascript

Need: A script that a client could easily call within a URL to force the users to agree to their terms of use before downloading a file.

Solution:Either put the following code in the header, or in a .js file to include:


function terms(){
	question = confirm("Terms of Use text here")
 if (question !="0"){
		document.URL()
	}
  }

Then, call this code in your HTML code by using:

<a href="http://jzelazny.wpengine.com" />Download Link</a>