dyadica.net

Fun and Games in the Dyadic Sea

Archive for the ‘php’ Category

permalink image comments image
Sunday, 12 July '09: Cross Paging for Wordpress

At times I have found the need (want even desire) to be able to create a Page from a Post.

Yes I know that this can be classed as duplication of content, but some times its nice to be able to archive things in this manner and anyway you only create the content once ;)

So without further ado I introduce to you Cross Paging:

WordPress has the ability to allow authors to assign custom fields to Posts and Pages. This arbitrary extra information is known as meta-data.

We can use this data to ID a desired Posts content for use within a Page, simply by setting a reference to the Posts ID. The page checks to see if an ID has been set,  if so, then draws the content via a custom query: Read..

Tags: , , , ,
permalink image comments image
Wednesday, 4 February '09: Logic3 FreeBird Working with WiimoteLib

Hi Just to let you know that I have just had some joy with the Logic3 nunchuck and version 1.7 of WiimoteLib.

You must start with the chuck turned off then once everything has been initialized hit the fc paring button and your all systems go.

497-2497-4

The lib views the chuck as the unknown device: a42000000, thus, in order to get it working at this initial stage Read..

Tags: , , ,
permalink image comments image
Monday, 2 February '09: the paper trail 0.6 – the matrix map

Its been just over a year since my last paper-trail posting and in that time a lot has changed. What was once, one massive script has now been condensed down to a few individual function calls.

paper-trail-06

In this post I am going to introduce the code used to create what I have entitled as a Matrix Map (above). Read..

Tags: , , ,
permalink image comments image
Friday, 30 January '09: wordpress tag calls after a custom query

Having an issue with wordpress tag calls not working after a custom query, then try the following:

<?php
$tags = get_the_term_list( $post->ID, 'post_tag', '', ', ', '' ) ;
if($tags){ echo "Tags: " . $tags;
}else{ echo "Cats: "; the_category(','); }
?>

I have also included a category call: the_category(',') to cater for instances where no tags are available, due to no tags having been set or the call being made from a page.

The call breaks down as follows:

get_the_term_list( $id = 0, $taxonomy, $before = '', $sep = '', $after = '' )
Retrieve terms as a list with specified format.
param: int $id Term ID.
param: string $taxonomy Taxonomy name.
param: string $before Optional. Before list.
param: string $sep Optional. Separate items using this.
param: string $after Optional. After list.
return: string

I find this usefull as I have alot of unorthadox (grr the loop) query’s, hope it may help you. Please be aware unless you have a pugin to fix the issue, pages will always be appear as uncategorized.

Tags: , , ,
permalink image comments image
Tuesday, 27 January '09: Revamp Nearly Complete

With the ps-wii-elite engine revamp  95% complete, lets have at what once was so.

A Bit of History

Before I introduce some of the new features and site ethos, here is how things used to be: theme archive

dyadic-night-splash

The dyadic-night implementation (above) was really where ps-wii-elite really started to take shape. Driven by blogging and wordpress experience the theme matured to be both crisper and more accessible. Read..

Tags: , , ,
permalink image comments image
Sunday, 20 January '08: The Paper Trail 0.5

With the advent of this weekends spring clean there was need to revisit the old paper trail. Upon changing the Pages page layout to one of full width I discovered a few XHTML W3C issues.

This was easily fixed however with simple modification to the pollChildren() function to embed the embedded unordered lists within link tags (duh).

As a bonus however I have now a defined entry point for the attachments script within pollChildren().

I get round to both explaining and developing this soon as the spring clean is completed.

With the W3C issues addressed focus turned to the paper trails css which now had to be modified to cater for the additional <li> tags.

The following Images detail a few examples:

paper-trail-css-b.jpg

I tried out numerous css designs in order to create a visibly usable system. I opted for the page boxes to be non symmetrical (above image). Read..

Cats: Web, css, php, wordpress
permalink image comments image
Thursday, 17 January '08: Spring Clean

Due to last nights shenanagens I have decided to start a little spring cleaning (early bird and all that). There are still some areas that vitally need addressing to improve both the ergonomics and functionality of this site. You know those bits that you will do later etc.

I have started by removing the Archives list from the root page (1). Really if you want to delve into the archives there is more than enough functionality provided by the papertrail and the main archives page.

The purpose of a root (snapshot) page should be to capture the interest of new visitors and provide veterans with immediate access to new content. Realistically at present this one is far to er.. hectic or eclectic which ever floats your boat lol.

I have also decided to remove the wiisource collective (2) completely (content can easily be accessed via standard surfing: tags, cats archives etc) and replace it with new focused projects and tutorial pages. The first of these being the wii connect project detailing the wiimote windows driver I am currently developing.

The plan is for all wiisource content to migrate to a bespoke sub domain (3) ala wii.dyadica.net. This will make things easier to find and let those who are solely wii orientated to avoid the general blog.

Read..

Tags: , , , , ,
permalink image comments image
Sunday, 28 October '07: Wordpress 2.3.1 Update

WordPress 2.3.1 is now available. 2.3.1 is a bug-fix and security release for the 2.3 series.

2.3.1 fixes over twenty bugs. Some of the notable fixes are:

  • Tagging support for Windows Live Writer
  • Fixes for a login bug that affected those with a Blog Address different than their WordPress Address
  • Faster taxonomy database queries, especially tag intersection queries
  • Link importer fixes

Unfortunately, some security issues were found in 2.3. Janek Vind found an XSS problem that can be exploited if your php setup has register_globals enabled. For this reason, upgrading to 2.3.1 is advised.

The full set of changes between 2.3 and 2.3.1 is available for viewing on trac.

Get 2.3.1 from the download page and enjoy.

Tags: ,
permalink image comments image
Monday, 13 August '07: Static Front Page

For the last couple of days I have been working on a static front page or as i like to call it a Snapshot / Highlights page. Development has had a few issues mainly deriving from getting used to the wordpress loop, however all in all its a simple process.

For those of you who would like to follow in my footsteps a great guide can be found at richandstephsipe.com.

Now the likelihood is that I have been doing something wrong due to my lack of wordpress knowledge but it seems that utilizing a quiery_posts() (ability to exclude categories) call instead of get_posts() results in the loss of accurate Conditional Tags functionality within the sidebar. It is as if I have not closed a loop properly or cleared a variable and thus the last post is stored (must be my bad php).

This however is not the case for the header as it is parsed before the body. So to temporarily cater for this issue I used what I like to call a dirty hack, aka a global. Now if there is one thing I hate when it comes to coding its using globals (spit!).

Note also screwed my tag limit to 5 (my default posts per page) however this was easily fixed by modifying the request condition within my next page function like so:

if (is_category()) {
preg_match('#FROMs(.*)sGROUP BY#siU', $request, $matches);
} elseif (is_tag()) {
preg_match('#FROMs(.*)sGROUP BY#siU', $request, $matches);
} else {
preg_match('#FROMs(.*)sORDER BY#siU', $request, $matches);
}

Note the is_tag() condition that is provided via wordpress 2.2.

Tags: , , ,
permalink image comments image
Wednesday, 20 June '07: Sub categories in wordpress

if (is_category()) { ?>

<?php
$this_category = get_category($cat);
if (get_category_children($this_category->cat_ID) != "") {
?>

<ul class='catsublist'>
<h2>Subcategories</h2>
<?php wp_list_categories('orderby=id&show_count=0&title_li=
&use_desc_for_title=1&child_of='.$this_category->cat_ID); ?>
</ul>

<?php } ?>

<?php } ?>

Cats: php, wordpress

poll categories

css | xhtml | dyadica.net © admin 2010 | powered: wordpress | fuel: ps-wii-elite | top | sign-up