What is McJiffy EASy good for?

  • Adding a Store to Your Site
  • Domain Parking
  • Stand Alone Site

How much does McJiffy EASy Cost?

Absolutely nothing. McJiffy is released as an open source project under the LGPL license.

What if I have questions about McJiffy EASy?

The easiest way to get your questions answered is to use the McJiffy Forum. There you can ask question and hopefully get answers.

Using Wordpress themes with EASy

Hi folks

Was thinking about themes for EASy and how much of a pain (for me anyhow) it to create them (while I'm a feature creep, I'm very a lazy/unskilled graphic coder, I much prefer to recycle layouts than create from scratch). Anyhow... I've been doing a fair bit of work with Wordpress (WP) and I thought the layout for most WP blogs is very similar to EASy's default layout ...so I wonders if there is anyway to use WP themes with EASy without having to do too much work......

Seems that there may be: I created a bit of code as a kinda preloader that catches any WP function calls and feeds back the equivalent EASy reply.

Here's some examples of what it looks like at the moment:

****Warning early beta code...looks totally pants in IE, but not too bad in firefox.***

http://test.baronkurtz.com/ Wii theme
http://test2.baronkurtz.com/ Grunge Banner theme
http://test3.baronkurtz.com/ Halo theme
http://test4.baronkurtz.com/ Computerized
http://test5.baronkurtz.com/ MSN Live theme

It's worth repeating:

****Warning early beta code...looks totally pants in IE, but not too bad in firefox.***

These are all standard WP themes that I grabbed from the interweb. The only modification I made to the WP theme code was to add a three line block of code to call my custom script at the very start of the index page, nothing else has been changed.

Anyhow, what do you folks think? Is this something that could be useful?

C.

interesting idea This could

interesting idea

This could be a very marketable feature. I haven't played with WordPress much. This site runs Drupal. Would making a WP plugin be usable? Right now EASy is just meant as a simple, quick solution. So creating a WP plugin may go against those ideas. Mainly because as it stands, EASy doesn't require the website owner to do any work. If we made a WP plugin, then that would require the website owner to setup and then configure a WP site.

If I could figure it out, I would love to be able to import relevant content into EASy without looking like a scraper site. Ebay does let you search their buyers guides, but they don't give you the full text in RSS, just a teaser.

A WP plugin is different

A WP plugin is different from what I was thinking about with the above, with the above code I wanted a simple way of using themes that are readily available.

But funny you should mention it I was looking for something similar. I was thinking about grabbing, say 10 eBay items and squirting them into one of my WP blogs automatically each week. Current autoblog plugins (as well as being unstable) create a new blog post for each RSS entry rather than grouping them together as I initially wanted.

C.

Update: a bit more googling pointed me to this:
http://www.itsgottabered.com/wordbay/ it's free as in beer but not free as in speech.

Yeah, I had heard about

Yeah, I had heard about wordbay, so a plugin would duplicate a lot of that work.

How had you thought about doing the WP templates? I looked at it really quickly and figured that we would need to basically make a library file that would rewrite all the WP template functions to work with the EASy script.

> make a library file that

> make a library file that would rewrite all the WP template functions to work with the EASy script

Yup, that's what I did in the above demo site(s): drop the WP theme into EASy's theme folder, add:

<?php
include(ROOT_DIR. "/themes/easy-wth.php");
include(
"page.php");
exit;
?>

To the start of the theme's index.php. It calls easy-wth.php where all the WP functions are listed.
The index.php file is quite complex so I do an include to use page.php instead, it's a much 'simpler' page.
Finally I just 'exit' out of index.php to stop it being parsed.

Then it's just a question of seeing what errors come up, figuring out what they do and either ignoring them or feeding back relevant code/links/etc. While best practice is to always use the same function names in themes (sigh) that's not always the case with WP themers.

Here's the code I've got so far:

<?php

////////////////////////////////////////////
///////  EASy Wordpress Theme Hack /////////
//////   ChuckMcB v0.001           /////////
////////////////////////////////////////////


define('TEMPLATEPATH',ROOT_DIR.'themes/'.$site['theme']);

/////////////////////////////////////////////
////////     header.php hacks     ///////////
/////////////////////////////////////////////

function language_attributes() {
}

function
bloginfo($str) {
    if (
$str == 'stylesheet_url') {
        global
$themeUrl;
        global
$site;
        echo
$themeUrl. $site['theme']. "/style.css";
    }
    elseif (
$str =='stylesheet_directory') {
        global
$themeUrl;
        global
$site;
        echo
$themeUrl. $site['theme'];
    }
    elseif (
$str == 'name') {
        global
$site;
        echo
$site['title'];
    }
    elseif (
$str == 'description') {
        global
$site;
        echo
$site['slogan'];
    }

}



function
is_404() {
    return
false;
}

function
is_single() {
}

function
wp_title() {
}

function
get_settings() {
}

function
wp_head() {
}

function
get_option() {
    global
$baseUrl;
    echo
$baseUrl;
}

function
the_search_query() {
}

function
wp_link_page() {
}



/////////////////////////////////////////////
////////    sidebar.php hacks    ///////////
/////////////////////////////////////////////


function wp_list_pages() {
}

function
_e() {
}

function
wp_list_cats() {
    global
$mainkeywords;
    global
$mainkey;
    global
$baseUrl;
    foreach (
$mainkeywords as $mainkey) {
     
$html = '<li><a href="' .$baseUrl. 'buy/' .urlencode($mainkey).'">' .$mainkey. '</a></li>';             
        echo
$html;
    }

}

function
is_home() {
}

function
current_time() {
    echo
time();
}

function
get_results($str) {
    echo
'';
}

function
get_links() {
   
$html = '<li><a href="http://test.baronkurtz.com">Wii theme</li>';
   
$html .= '<li><a href="http://test2.baronkurtz.com">Grunge Banner theme</li>';
   
$html .= '<li><a href="http://test3.baronkurtz.com">Halo theme</li>';
   
$html .= '<li><a href="http://test4.baronkurtz.com">Computerized</li>';
   
$html .= '<li><a href="http://test5.baronkurtz.com">MSN theme</li>';
    echo
$html;
}

function
wp_get_archives() {
}

function
wp_list_bookmarks() {
   
$html = '<li><a href="http://test.baronkurtz.com">Wii theme</li>';
   
$html .= '<li><a href="http://test2.baronkurtz.com">Grunge Banner theme</li>';
   
$html .= '<li><a href="http://test3.baronkurtz.com">Halo theme</li>';
   
$html .= '<li><a href="http://test4.baronkurtz.com">Computerized</li>';
   
$html .= '<li><a href="http://test5.baronkurtz.com">MSN theme</li>';
    echo
$html;
}

function
wp_register() {
}

function
wp_loginout() {
}

function
wp_meta() {
}

/////////////////////////////////////////////
////////       page.php hacks     ///////////
/////////////////////////////////////////////


function get_header() {
    global
$site;
    include(
$site['theme']. "/header.php");
}

function
get_sidebar() {
    global
$site;
    include(
$site['theme']. "/sidebar.php");
}

function
wp_list_categories() {

    global
$mainkeywords;
    global
$mainkey;
    global
$baseUrl;
    foreach (
$mainkeywords as $mainkey) {
       
$html = '<ul>';
     
$html .= '<li><a href="' .$baseUrl. 'buy/' .urlencode($mainkey).'">' .$mainkey. '</a></li>';             
     
$html .= '</ul>';
        echo
$html;
    }

}

function
have_posts() {
   
   
$html = '<div style="width:500px; margin-bottom:10px !important /*Non-IE6*/; margin-bottom:5px /*IE6*/;">';
    global
$ebayItems;
    global
$ebayItem;
    global
$country;
    foreach (
$ebayItems as $ebayItem) {
       
$html .= '<div style="width: 120px; float: left; margin: 20px; 10px; height: 200px">';
       
$html .= '<div style="width: 100%; height: 100px; text-align: center"><a href="' .$ebayItem['link']. '">' .$ebayItem['image']. '</a></div>';
       
$html .= '<div style="font-size: 1.1em; text-align: left"><a href="' .$ebayItem['link']. '">' .$ebayItem['title']. '</a></div>';

        if (
$ebayItem['type']=="Auction") {
           
$html .= '<div style="font-weight: bold; color: #c03">' .$country['currentbid']. ': <b>' .$ebayItem['currentbid']. '</b> (' .$ebayItem['bidcount'].' '.$country['bids']. ')</div>';
        }

        if (!empty(
$ebayItem['bin'])) {
           
$html .= '<div style="font-weight: bold; color: #393">' .$country['bin']. ': <b>' .$ebayItem['bin']. '</b></div>';
           }
       
$html .= '<div style="color: #999">' .$country['ends']. ': <b>' .$ebayItem['endtime']. '</b></div>';
       
$html .= '</div>';
    }

   
$html .= '</div>';
    echo
$html;
}

function
edit_post_link() {
}


function
get_footer() {
    global
$site;
    include(
$site['theme']. "/footer.php");
}


/////////////////////////////////////////////
////////       footer.php hacks   ///////////
/////////////////////////////////////////////


function wp_footer() {
}


?>

C.

---

Chuck I tried out your code,

Chuck I tried out your code, but it's not working right for me.

I included the 3 lines to the index.php file then saved the rest of your code as easy-wth.php. I uploaded it to the same theme folder with the wordpress template but it's not working for me.

Do you have any suggestions?

Hi primster7 Noting that

Hi primster7

Noting that this code is over two years old (and to be honest I dropped trying to use WP theams in favour for using single page .css/.html themes as per the domain in my signature)

What exactly is not working when you try it?

---

http://www.dnagxxames.net/
(remove the xx to view the site)

I just don't understand

I just don't understand where the easy-wth.php code is.

I also don't understand if that long code is just for the page.php file, or if I have to manually go back in and edit the header.php & footer.php etc. If I do have to edit the header.php etc manually, what do I do with the other code that is already there?

If you could help me with this I would appreciate it.

Have another read of my

Have another read of my instructions.

The 'long code' goes in a file that you need to create called 'easy-wth.php' and put the 'short bit of code' at the start of the wordpress index.php file before anything else that is in that file.

But as I said a lot has changed in the last two year, so I can't guarantee this code will still work.

---

http://www.dnagxxames.net/
(remove the xx to view the site)