Pre-Alpha 1.0
MB Montessori

tenterhooks

suspense seldom kills

Archive for the ‘Tenterhooks’ Category

Site Closed

Monday, May 12th, 2008

I have revived this site in a static format - no new posts and no new comments. All my work will be posted on my main site: www.webdezine.ca . I apologize to anyone that attempted to access the site over the last 6+ months, but I abruptly returned to school which has gobbled up all of my free time. I will be around my webdezine site attempting to update the menu to work with Wordpress 2.3-2.5.

Thanks for all your support in the past :)

Best,
Sheri

I know I said no more but…

Saturday, March 10th, 2007

I love to customize my sites to do what I want them to do. And yes, it’s hard to tell when enough is enough.

The idea for the ‘rating system’ came to mind when I created the separate bookmark category menu. I love feedback of all sorts. It’s how I grow as a designer and developer. Just because I like something doesn’t mean it’s everyones cup of tea and I would really like to get a handle on all the different opinions that pervade peoples minds on topics of interest.

So, I have implemented a rating system for my bookmark category posts. I started with a great little plugin called Rate My Stuff to enable me, from the administration side of the site, to place a rating on any post. I will only be using it for bookmark sites that I post but the ability is there to place a rating on other items — if I ever feel the desire to rate anything else!

Now, it’s nice that you know my opinions but that’s only half the story. If you take the time to comment, you should also be able to share your ‘rating’ opinion. I like to be fair!

Now you can. On every bookmark post you will be able to comment and rate the site. The rating is a general overall rating. As time wears on it might become necessary to split things up. We can then have different categories within the rating system such as design, usability, content, support etc. But for now, this is a good start! The rating system is from 1 to 5. I didn’t bother to go below 1. A rating of one star is all that is needed to tell the world that you think the site sucks the big one. From there on it proceeds with half stars.

I hope to get some ratings in the comments table as I have a lot of bookmarks I want to share with the world. There are some awesome sites out there and of course some that make me want to gag.

Tags: , , , ,

wp_list_pages, include parameter?

Thursday, March 8th, 2007

This came from a post on Wordpress Support where the member was looking to lessen his workload by ‘including’ the pages he wanted to display rather than excluding them. As he posts new pages regularly he had to constantly update the pages to ‘exclude’ in his sidebar navigation. Here is the post:

Posted by falp on 03/08/07 :

Hello,
 
This is my first website with wordpress so please excuse if my question is obvious.
 
I want to create a navigation menu on the sidebar using wp_list_pages funtion, but instead of excluding certain pages I want to INCLUDE only certain pages. Is this possible?
 
The reason for this is that as I add more pages to the site I constantly need to update my sidebar.php to exclude the new page ids.
 
I thought of the possibility of creating a static menu linking directly to the pages in question, but then I loose the current_page_item class that is otherwise automatically added.
 
Any pointers would be of great help.
 
Thanks in advance,
 
Frank

In response to Frank’s query, Otto42 came up with a little known parameter that can be used in the ‘wp_list_pages’: the ‘include’ parameter.

Posted by Otto42 on 03/08/07 :

Though it's not documented well, wp_list_pages() appears to support the "include" parameter. So you can do something like this:
wp_list_pages('include=4,8,15,16,23,42');
To show only those pages. Not entirely sure how that would work, mind you, so the results may be unusual. Or they may not. Hard to say.

This does work! but I like to keep on my toes and this seemed like a simple little thing to accomplish, so I took a stab at it.

A little function from me:

<?php
function get_the_pa_ges (){
global $wpdb;
if ( ! $these_pages = wp_cache_get('these_pages', 'pages') ) {
        $these_pages = $wpdb->get_results('select ID, post_title from '. $wpdb->posts .' where post_status = "publish" and post_type = "page" order by ID');
         wp_cache_add('these_pages', $these_pages, 'pages');
   }
  return $these_pages;
}
function list_certain_pages($page_ids=''){
$page_ids = explode(',',$page_ids);
$output = '';
$these_pages = get_the_pa_ges ();
foreach ($these_pages as $thats_them){
$the_page_id = $thats_them->ID;
if (isset($page_ids) && in_array($the_page_id,$page_ids)){
$output .= '<a href="'.get_permalink($thats_them->ID).'" title="'.$thats_them->post_title.'">'.$thats_them->post_title.'</a><br/>';
}
}
return $output;
}
echo list_certain_pages('2,10,89');
?>

This also works. I included a call the database that can be cached. And if someone were to already have my wordpress menu installed, you could use the already cached function called ‘get_pa_ge ()’ to load up the page array needed to create this little side menu by replacing this line :
‘$these_pages = get_the_pa_ges ();’ with ‘$these_pages = get_pa_ge ();’.

As I gaze into my crystal ball, I can tell what you are thinking: “If Wordpress natively supports ‘inclusion’ in the function….why use your function?”. And the answer from beyond this realm is quite simple. Page Load Time. The wp_list_pages function parses at least 183 lines of code through the various functions required to produce the list while my function uses 21 lines.

Tags: , , , ,

Popular Posts Addition

Wednesday, March 7th, 2007

Some of you might have noticed the popular posts addition to the sidebar (looks like about 300 people so far! :lol: ) . I originally borrowed the code from the Fire Stats Plugin for Wordpress that I installed a few days ago.

I created a new function for the addition by modifying the original code a little to allow re-placement of the url with the post title. All was well until I changed my base url option to include the World Wide Web (www) prefix, and then changed my permalinks to Apache’s mod-rewrite .

ARGH!

So now, the stats in the popular mod were waaay off. They only reflected the results for one url per post rather than the multitude of urls now populating my database. Another wonky problem was the original code for Fire Stats. It populates the url table using php’s predefined variable $_SERVER[’REQUEST_URI’]. This variable grabs a hold of the ENTIRE uri including any parameters which might be tacked onto the end. When displaying the “popular post” I was only displaying the count of direct links to the post–no parameters, no www, and no mod-rewrites were included in the count.

If you know me then you know that this problem was getting under my skin and I couldn’t just let it be!

Earlier this evening I finished a brand new function that tracks down all the various url’s for each individual post, combines the counts, then displays the links with “true” counts for reference. The function took a little fiddling around and a lot of testing but I am very happy with the result. No matter where the link originated, what is attached to it or what format it is presented in…it will be counted!

Tags: , , , , ,

The world is mine to command!!

Monday, March 5th, 2007

I have implemented gzip compression on this site. The speed is like night and day. The page began as 28k and ended as 7k. Not bad. Not bad at all. To implement this wonder of virtual mother nature I first attempted to include the information within my .htaccess file. This only produced errors. More googling produced a solution. I could place the information within my php.ini file. PRESTO! It worked.

The operative line reads: zlib.output_compression = 4096

I really didn’t bother to read what exactly this means…I just know that it speeds up my site.

To test out the compression I entered my url into a form found on this page:

G-Zip
Test my page for yourself! What a difference a day makes :)

Tags: , , , , ,

Final Mod

Tuesday, February 27th, 2007

That’s my story an’ I’m stickin’ to it.

For awhile anyway.

The member section mod is up and running. Available through the Members menu, it takes you to a page where all sorts of member info is listed — that is, the info that the member chooses to list, besides the basic name, reg. date, and comments posted info. The display preferences can be chosen from the profile page page after log-in.

I had a little bit of a rough go with this one. It’s because I am so aware and some might say obsessed, with sql queries namely the number and efficiency. Try as I might - joins flying in all directions - I could not get this mod working in one query. It is because of the layout of the Wordpress mysql tables. While selecting information from the users table returned a few plump little multidimensional arrays with all the values I could ask for in a single row, the users meta table forced me to retrieve many more rows to get the information I needed - resulting in many scrawny little arrays. To illustrate my point more clearly: (more…)

Tags: , , , ,

Masking Categories in Main Page

Saturday, February 24th, 2007

This post is a reiteration of a thread over atWordpress Support. I am placing it here for posterity :-P

Posted by SubjectEgo on 02/23/07 :

I have need for a setup that will display posts from a specific category "Announcements" on the main page, and mask all others. Other posts must still be accessible through direct linking and through the sidebar. I have not been able to develop a fix for the current setup. Is there a straightforward solution to this?

After carefully scanning the Wordpress Source Cross Reference I came up with a

(more…)

Tags: , ,

Hacked

Friday, February 23rd, 2007

Another wordpress hack. I’m working on the “member” section to allow members to share some or all of their profile and I noticed an annoying little glitch in the profile.php file.

Wordpress allows the user to select a name from the many stored in the database to display publicly when they post a comment. Well, the drop down menu pulls all the names and places them in a drop down list whether they are different or not. Quite annoying to see “joe” written out 4 times!

So I hacked the code…again.
(more…)

Tags: , ,

Blog customization

Friday, February 16th, 2007

So, my blog customization is finished. Wordpress is a very straightforward code. It was shocking to see plain language embedded right into the core files. IMHO, it limits the global attraction of Wordpress. Everytime you have to edit the source code to change the heading of a box, it increases the possibility that errors are going to be made. Using a language file which defines variables in relation to plain language is a safer way to create content. Even then…not everyone knows PHP and one missed single quote could frustrate an administrator or noob. I’ll step off my soapbox now.

I have used these plugins: (more…)

Tags: , ,

New Wordpress Menu

Thursday, February 15th, 2007

08/03/07: Clarification:

UPDATE! Please download the sitemap fix for version 2.0.3. All new downloads, please also download the fix and overwrite the file. The next version will be available as soon as my main site has finished it’s facelift.

The What

The Webdezine Pure CSS Horizontal Menu is a dropdpwn, cross browser multi-level (nested) css navigation system for Wordpress that can be displayed across the top of your header area. It includes support for Pages, Categories, Archives, Blogroll and Meta Links. The menus can be used in place of or in addition to the default Wordpress fuctions wp_list_categories, wp_list_pages, wp_get_archives, wp_list_bookmarks, and meta data that is contained in the sidebar.php. The menu is currently compatible with Wordpress 2.1.* and will soon be available to 2.0.* Wordpress users. The menu is as always, free for personal use, although support is greatly appreciated. Commercial users (including developers) should download the commercial version of the menu.

The Screen Shots

wd_css_shot1.gif wd_css_shot2.gif wd_css_shot3.gif
wd_css_shot4.gif wd_css_shot5.gif wd_css_shot6.gif
wd_css_shot7.gif wd_css_shot8.gif wd_css_shot9.gif
wd_css_shot10.gif wd_css_shot11.gif wd_css_shot12.gif


The Demos


The Features

  • The Menu
    • The menu is entirely CSS based. It does not rely on client-side scripting such as Javascript to hide or reveal the menu levels.
    • The menu is based a degradable unordered html list
    • The menu can be nested to a maximum of 4 levels (do the users really want more than that?).
    • The menu is compatible with PHP4+
    • A sitemap is connected to the title links in case of menu failure (unlikely).
    • Each menu or nested level can be styled individually if you wish
    • The css classes are based on divs and links for maximum compatibility
    • You can now choose which menus to display and how
    • You can exclude pages or categories from your menus
    • You can display page, post or link counts in your menus
    • You can organize your blogroll into multiple top-level categories
    • …………etc.
  • The Sitemap
    • The sitemap is also based a degradable unordered html list
    • Each menu or nested level can be styled individually if you wish
    • The css classes are based on divs and links for maximum compatibility
    • A sitemap page is created upon activation
    • If you already have a great sitemap, you can detour this one and link your menu to the one already in place
  • The Admin
    • The admin is now a pimped up wonder
    • Tabs separate the option sections
    • Display the options in English, French, Spanish, German, or Italian
    • Choose to display the titles (Pages/Categories/Archives) or spread the top levels across the header. Each menu is individually customized - e.g. display the archive title, but not the page title
    • More options for the menu - Choose the date format for the archives, exclude categories, ….
    • Input your old sitemap url and the menu takes care of the rest
    • Edit the CSS directly from the option page (and the IE6 css!)
    • Preview your changes in the option page (I got tired of refreshing my development site - this is much better)
  • The Machine
    • Nonce security has been added
    • Personal and Commercial License payments are now accepted through the option screen
    • Licensees are automatically registered for the in-depth support forum for help with customization, support and feature requests
    • If caching is enabled the calls to the database are cached
    • If a new category or post is created the cache is refreshed allowing your visitors to get the newest information instantly.
    • Upon activation, the plug-in loads up the default values - Upon deactivation, the plugin removes all options/sitemap from the database….almost like it was never there.

The Structure

<ul>
  <li><a href="">LIST NAME
    <table>
      <tr>
        <td>
          <ul>
            <li><a href="">PARENT CAT
              <table>
                <tr>
                  <td>
                    <ul>
                      <li><a href="">CHILD CAT
                         <table>
                            <tr>
                              <td>
                                <ul>
                                  <li><a href="">SUB-CHILD CAT</a></li>
                                </ul>
                              </td>
                            </tr>
                         </table>
                  </a>
                      </li>
                    </ul>
                  </td>
                </tr>
              </table>
              </a>
            </li>
          </ul>
        </td>
      </tr>
    </table>
    </a>
  </li>
</ul>
 
Why the tag soup?  To make it compitable with IE of course!

The Compatibility

OS Browser Version Compatible? Issues?
Windows XP Firefox 2.X Yes None
Windows XP Internet Explorer 6 Yes None
Windows XP Internet Explorer 7 Yes None
Windows XP Opera 9.1 Yes None
Linux Firefox 2.0.0.3 Yes None
Linux Konqueror 3.5.6 Yes None

I need a heads up for non-windows OS browsers. Please drop me a comment listing your Operating System, Browser, Version, whether it’s compatible or not and any issues related to the operation of the menu.Thanks for your help!

The Stats

  • Version Download Totals
    • Webdezine Wordpress Menu V1.0 (23)
    • Webdezine Wordpress Menu PHP4 V1.0 (4)
    • Webdezine Wordpress Menu V1.1 (58)
    • Webdezine Wordpress Menu PHP4 V1.1 (28)
    • Webdezine Wordpress Menu PHP4 V1.2 (40)
    • Webdezine Wordpress Menu PHP5 V1.2 (537)
    • Webdezine Wordpress Menu PHP4 V1.3 (487)
    • Webdezine Wordpress Menu PHP5 V2.0 - PERSONAL & COMMERCIAL (20)
    • Webdezine Wordpress Menu PHP5 V2.0.1 - PERSONAL & COMMERCIAL (17)
    • Webdezine Wordpress Menu PHP5 V2.0.2 - PERSONAL & COMMERCIAL (109)

The Download

The Why

I found the default lists impractical and IMHO quite ugly. I also wanted to use the same menu for my blog that I will be using for my main site.

The How

The Installation Instructions

  • Download the .zip file
  • Extract the .zip file
  • Upload the folder called ‘webdezine_menu’ and the file called ‘webdezine_css_menu.php’ into your plugin directory located in /wp-content/plugins
  • Upload the webdezine_sitemap.php page template into your theme file located in /wp-content/themes.
  • Add this code to your header file
    <?php
    if (function_exists('get_menu'))
    get_menu('topmenu');
    ?>
    

    It will look like this in the default theme

    <div id="header">
      <div id="headerimg">
        <h1><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
        <div class="description"><?php bloginfo('description'); ?></div>
    <?php
    if (function_exists('get_menu'))
    get_menu('topmenu');
    ?>
      </div>
    </div>
    <hr />
    
  • Head over to your admin interface and activate the plugin
  • Head over to the webdezine css menu option page and customize to your liking
  • IMPORTANT! When using the Blogroll menu you must only use top parent categories to store your links. These are special categories you have created that have a category parent ID of ZERO. You may organize your links into those categories. The links will pop out in a list from each “0″ level link category.

The Upgrade Instructions

  • download the current zip
  • To UPGRADE:
    • From 2.0 to 2.0.1:

      • overwrite the “scr.js” file in the webdezine plugin folder
      • overwrite the “wd_all_the_menus.php” in the webdezine plugin folder
    • From 2.0.1 to 2.0.2:
      • overwrite the “wd_all_the_menus.php” in the webdezine plugin folder

The Customization

The function variables can be changed from the admin option menu. Note: Please remember that should you change the CSS class names available through the option menu, you will also have to change the class names within the CSS file.

The Changes

  • 02/25/07: Version 1.0 released - not a plugin
  • 02/27/07: Version 1.1 released - not a plugin
    • Missing close bracket at line 198 FIXED
    • Query ERROR: “You have an error in your SQL syntax; check the manual
      that corresponds to your MySQL server version for the right syntax” - FIXED
    • Amended the read_me file to include instructions on how to add the css style information
  • 03/12/07: Version 1.2 released - a plugin
    • changed the menu to a plugin to allow more to easily use this resource
    • fixed 2 lines of code that prevented the page menu from displaying the sub-child page names
    • fixed 2 lines of code that prevented the post count from showing correctly in the category menu
    • added support for the blogroll–now a drop-down menu like the others
    • added a variable in blogroll function to allow a separate css class for different styling of links
    • removed the read-me file and placed the information here
  • 03/13/07: Version 1.3 released -PHP4
    • Fixed a mismatched file name in the PHP4 version
    • Fixed the missing php tags within the code to add to the template
  • 05/01/07: Version 2.0 release - PHP5 only
    • Completely rewrote the functions eliminating all known bugs
    • Added many more options for customization
    • Revamped the admin section
    • Added css editing support from the admin
    • Added page preview from the admin
    • Created a licensee forum for in-depth support
    • Integrated forum registration with Paypal into the option page
    • Created separate personal and commercial versions
    • Worked like a dawg on this plugin
  • 05/02/07: Version 2.0.1 released
    • fixed admin javascript conflict
  • 05/02/07: Version 2.0.2 released
    • fixed array check in “wd_all_the_menus.php
  • 05/08/07: Version 2.0.3 released
    • added PHP4 compatibility
  • 08/05/07: SITEMAP FIX FOR 2.0.3
    • overwrite existing file with replacement

The Bugs

Found a bug? I’d be happy to squash it. Just leave me a comment and I’ll do what I can.

Here is a link to another way to accomplish a dynamic css menu for wordpress:
side dynamic menu for pages. While not a drop down or one that is used for all links, it does highlight the page links if that is more important to the blog than the other links available.

Tags: , , , , ,