XOOPS Login Issue: 2.0.17 and 2.0.18

After updating XOOPS to 2.0.17 a few months back, I ran into a problem with certain users not able to see group specific blocks after updating. The users would authenticate, but then not see any content that was “member only”. I was hopeful this would have been resolved with 2.0.18 but it still remains an issue. The problem:

The solution:
In your XOOPS directory: /kernel/session.php

change:
var $enableRegenerateId = true;
to:
var $enableRegenerateId = false;

(Original fix documentation for 2.0.17: http://www.xoops.org/modules/newbb/viewtopic.php?topic_id=62411&forum=2&post_id=281576

The Trade Coach (WordPress CMS)

url: http://www.thetradecoach.net

The Trade Coach

SDAC Inc. provided:

  • XHTML/CSS programming
  • WordPress theme customization
  • WordPress CMS setup and configuration
  • Custom PHP Programming
  • aMember/PayPal Integration

technologies used:

XHTML, CSS, WordPress, PHP, aMember

front end:

The client approached me with a WordPress theme already picked out and in place for a basic blog. He wanted us to customize it for a content management system (CMS) which included multiple levels of membership and had public and private pages and post.

back end:

This CMS was created using aMember, a few WordPress plugins, and some custom template code to keep part of the site private for paying members only. When a member logs in they will see content appropriate to their user level per the membership package they paid with. This is the first site we worked with that used multiple levels of members – and displaying content based on the user level. Amember is used to automatically create WordPress members after their payment goes through and will expire the members when their membership is up.

lessons learned/random thoughts:

It would be great if we had more control on groups (user levels) could see. We also ran into some WordPress bugs with displaying private posts in some of the default WordPress functions and hope these will be fixed in the next version.

Upgrade Google Analytic Tracker Code

If you use Google Analytics on your web site, you should update your tracker code that is placed in your code. The new tracker is faster, and offers added tracking functionality (See Google's announcement)

New Code: (put your tracker ID in where you see the X's)

HTML:
  1. <script type="text/javascript" src="http://www.google-analytics.com/ga.js"></script>
  2. <script type="text/javascript">
  3. var pageTracker=_gat._getTracker('UA-XXXXXX-X');
  4. pageTracker._initData();
  5. pageTracker._trackPageview();
  6. </script>

While you are updating your code, you might also want to consider moving this and any other javascript to the bottom of your web site for improved performance.

MuniWireless CMS

url: http://www.muniwireless.com

MuniWireless

SDAC Inc. provided:

  • XHTML/CSS programming
  • WordPress theme
  • WordPress CMS setup and configuration
  • Custom PHP Programming
  • Migration from ezPublish to WordPress
  • mod_rewrite Programming
  • Server Migration

technologies used:

XHTML, CSS, WordPress, PHP

front end:

The client approached me with a design in progress. From that, I created a basic WordPress theme and then further revised it after more design decisions were given to me.

back end:

This CMS was created after the client decided they wanted to migrate from ezPublish to WordPress. We exported all the data, mapped it to the WordPress tables, cleaned up the code, and imported into WordPress. We then created custom rewrite rules to make sure all old URLs would be directed to the new WordPress URL structure. This is a complicated WordPress theme with lots of conditional logic and some custom PHP programming for Openads integration.

lessons learned/random thoughts:

Overall, this rivals only one or two other sites in terms of sophisticated template logic and I learned a lot in the process of creating it. We also learned a lot about WordPress that we never knew before when importing and mapping the data from ezPublish into WordPress.

Exclude Single Post in WordPress

If you would like to exclude one post from your blog, archive, search results or wherever you need to on your blog, you can do so by putting in a small piece of code within the particular WordPress loop:

The following example will show all posts except for the post with the ID of 179:

PHP:
  1. <?php if (have_posts()) : while (have_posts()) : the_post(); if( $post->ID == '179' ) continue; ?>
  2. <?php the_content();?>
  3. <?php endwhile;endif;?>

This is something that I get a lot of requests for and is very useful in a number of situations.

Exclude Single Category in WordPress

If you ever need to exclude a single category from a WordPress page (archives, index, category page, etc) you can easily do so by using a little conditional tag code within the WordPress loop.

The example below will skip over any post that is in the category with the ID of 35:

PHP:
  1. <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  2. <?php if (in_category('35')) continue; ?>
  3. <?php the_content(); ?>
  4. <?php endwhile;endif;?>

This can be helpful if you want to not show a particular category in your blog (if you have a category based site setup) - or if you want to hide some categories from your search results.

Remove “Private:” From WordPress Titles

I needed to be able filter out the text "Private:" for posts and pages that were password protected but did not want to edit any core WordPress files. To filter out that text, I added the following code into my functions.php file (within my theme directory):

PHP:
  1. function remove_private_prefix($title) {
  2. $title = str_replace(
  3. 'Private:',
  4. '',
  5. $title);
  6. return $title;
  7. }
  8. add_filter('the_title','remove_private_prefix');

(I also posted this filter in the WordPress Support Forum)

SDAC Recommends: WP Plugin: WP Super Cache

There is a new (relatively) caching plugin in town for WordPress called WP Super Cache and after using it now for a few version, I have to say I would recommend this over the old standard WP-Cache plugin. The plugin is easy to install, easy to configure, and will produce a noticeable load time decrease for your WordPress sites. There are also options to set if you want to "digg-proof" your site, use compression, or "lock down" your site during an expected traffic spike.

WordPress Logic: If Is Logged In

There are several tidbits of code that I have collected over the past few years that make it easier and easier to turn a simple WordPress installation into a very functional content management system (CMS). There are many times when it would be nice to show logged in members certain bits of information (certain categories, posts, or just a simple "Welcome back!") and of course there is a simple way of doing this:

PHP:
  1. <?php if (is_user_logged_in()): ?>

That bit of code will allow you to do something like this which will allow you to show the logged in user's preferred user name (selected in the User preferences), and then a list of member only pages (private page parent is page ID 20 - I am showing all sub pages of the members-only pages marked as private). If the user is not logged in, they will get a Welcome visitor! greeting :

PHP:
  1. <?php if (is_user_logged_in()) : ?>
  2.     <?php global $user_identity;get_currentuserinfo();?>
  3.    
  4.     <p>Welcome back <?php echo $user_identity;?></p>
  5.     <p>Here is a list of private pages only viewable by Members:</p>
  6.         <ul>
  7.             <?php wp_list_pages('title_li=&child_of=20'); ?>
  8.         </ul>
  9. <?php else :?>
  10.     Welcome, visitor!
  11. <?php endif;?>

You can make it as simple as a change in greeting for members and non-members, or put in specific logic like I did with showing the pages. The potential is limitless.

Foursquare Foundation Grant On-line Application

url: http://www.foursquaredev.net

Foursquare

SDAC Inc. provided:

  • Server Purchase/Setup/Configuration
  • XHTML/CSS programming
  • Custom PHP Form, Admin, and Scoring Admin
  • Multi-Language Form (Localization)

technologies used:

XHTML, CSS, PHP, HTML_QuickForm, jQuery", Smarty"

front end:

The client wanted a user interface that was easy to use and light weight since the users were mostly from foreign countries where internet connections were often hours away. I used minimal images, CSS, and javascript to ensure the application process (30 pages of text, radio button, and select fields, and long essays) would go as smoothly and quickly as possible why still providing feedback to the user if they missed a field or provided inappropriate data. The admin also had to be easy to use, as the Foursquare staff needed to easily access the data after the applications were submitted or if the submitter had any questions.

back end:

This form needed to be presented in English and Spanish so all text (labels, error messages, confirmation email, etc) was stored in both languages and then presented appropriately with custom logic. We used HTML_QuickForm and Smarty to build the form quickly and effectively and then used jQuery to handle custom validation rules given to us by the Foundation.

lessons learned/random thoughts:

This was by far the longest and most complex form I have ever worked on or seen. Adding in multiple languages this form was also very time consuming but a great experience. A special thanks to our talented developers on helping make this a success.