[Work in Progress] Porting Template to PivotX

Discuss PivotX 2.0.x themes here, and view themes that are available for download.

[Work in Progress] Porting Template to PivotX

Postby TeeBee » Thu Apr 10, 2008 12:48 pm

At the moment I am working at porting the Wordpress Template used at http://www.timbruls.nl to PivotX. I will keep you informed of the progress.
TeeBee
 
Posts: 11
Joined: Wed Apr 09, 2008 10:28 am

Re: [Work in Progress] Porting Template to PivotX

Postby Bob » Wed Apr 23, 2008 9:04 pm

Hi Tim,

I'm a bit late to this thread, but that theme looks pretty nice.. We'll soon have a themes.pivotx.net site, where we're going to distribute themes, so you can add it there, then.
Bob
Lead Developer
 
Posts: 1374
Joined: Tue Nov 20, 2007 11:16 pm

Re: [Work in Progress] Porting Template to PivotX

Postby TeeBee » Mon Jun 30, 2008 11:02 am

I'm a bit stuck at the moment. Most of the PHP code used by wordpress is out now, and replaced by the tags used by Pivot. However, I still need some PHP coding, because this code calls the script that takes care of the colours.

I simply can't get any further, I'm not very good at PHP. So I could need some help.

Below you will see the original code and the changes I made. Maybe someone can find out where I went wrong.
Original Index:
Code: Select all
<?php get_header();?>

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
   <div class="post" id="post-<?php the_ID(); ?>">
      <h3 class="storytitle" style="background-color:<?php echo colors($post->ID + date('d'));?>;"><a href="#" rel="bookmark"><?php the_title(); ?></a></h3>
      <div class="accordion">
         <div class="storycontent">
            <div class="meta">by <?php the_author_posts_link(); ?> on <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_time('F j, Y'); ?></a> &#8212; <a href="<?php the_permalink(); ?>" rel="bookmark">Permlink</a>  &#8212; <?php the_category(','); ?> <?php edit_post_link(__('Edit This')); ?></div>
            <?php the_content(__('(more...)')); ?>
            <?php wp_link_pages(); ?>
            <div class="feedback">
               <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
            </div>
            <?php comments_template(); // Get wp-comments.php template ?>
         </div>
      </div>
   </div>
<?php endwhile; else: ?>
   <div class="nomatch">
   <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
   </div>
<?php endif; ?>

<div id="nav"><?php posts_nav_link(' | ', __('&laquo; Previous Page'), __('Next Page &raquo;')); ?></div>


<?php get_footer(); ?>


My Version of index:

Code: Select all
[[include file="colourskiss/_sub_header.html" ]]

   <div class="post">
      <h3 class="storytitle" style="background-color:<?php echo colors($post->ID + date('d'));?>;"><a href="#" rel="bookmark">[[title]]</a></h3>
      <div class="accordion">
         <div class="storycontent">
            <div class="meta">by [[author]] on [[date]] &#8212; [[singlepermalink text="permalink" title="Permanent link to entry '%title%'" ]]   &#8212; Posted in [[ category link=true ]] &#8212; [[edit]]</div>
                [[introduction]]
            [[more]]
            <!--<?php wp_link_pages(); ?>-->
            <div class="feedback">
               [[commentlink]]
            </div>
            <!--<?php comments_template(); // Get wp-comments.php template ?>-->
         </div>
      </div>
   </div>
   <div class="nomatch">
   </div>


[[include file="colourskiss/_sub_footer.html" ]]

Original Header:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://gmpg.org/xfn/11">
   <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
   <title><?php bloginfo('name'); ?><?php wp_title(); ?></title>
   <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats please -->
   <style type="text/css" media="screen">
      @import url( <?php bloginfo('stylesheet_url'); ?> );
   </style>
   <script src="<?php bloginfo('template_url'); ?>/mootools83.js" type="text/javascript"></script>
   <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
   <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
   <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
   <link rel="Shortcut Icon" href="<?php bloginfo('stylesheet_directory'); ?>/favicon.ico" type="image/x-icon" />   
   <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    <?php wp_get_archives('type=monthly&format=link'); ?>
    <script type="text/javascript">
   window.onload = function(){
      var togglers = $$('h3.storytitle');
      var stretchers = $$('div.accordion');
      var myAccordion = new Fx.Accordion(togglers, stretchers, {opacity: false, start: false, alwaysHide: true});
   <?php if (is_single() || is_page()) { ?>
      myAccordion.showThisHideOpen(0)
   <?php };?>
   };
</script>
    <?php
    function colors($n) {
    //by shaheeilyas.com
      $colornames = array("#FF0000","#DC143C","#C71585","#FF1493","#FF69B4","#FF6347","#FF8C00","#FFA500","#FFD700","#9ACD32","#6B8E23","#008000","#006400","#2F4F4F","#008080","#20B2AA","#00CED1","#4169E1","#000080","#4B0082");
      return $colornames[$n%(count($colornames))];
   }
    ?>
   <?php wp_head(); ?>
</head>

<body>
<div id="wrap">
   <div id="header">
      <table width="100%"><tr><td>
      <h1><a href="<?php bloginfo('url'); ?>/"><?php bloginfo('name'); ?></a></h1>
      <p><?php bloginfo('description'); ?></p>
      </td><td id="search">
      <form id="searchform" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
            <p><input type="text" name="s" id="s" size="15" /></p>
            <? /*<input type="submit" value="<?php _e('Search'); ?>" />*/?>
      </form>
      </td></tr></table>
   </div>

<!-- end header -->

My Version of Header:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://gmpg.org/xfn/11">
<title>.:TeeBee.org:.</title>
   <style type="text/css" media="screen">
      @import url("[[template_dir]]stylesheet_url")
   </style>
   <script src="[[template_dir]]mootools83.js" type="text/javascript"></script>
   <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
   <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
   <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
   <link rel="Shortcut Icon" href="[[template_dir]]favicon.ico" type="image/x-icon" />   
    <?php wp_get_archives('type=monthly&format=link'); ?>
    <script type="text/javascript">
   window.onload = function(){
      var togglers = $$('h3.storytitle');
      var stretchers = $$('div.accordion');
      var myAccordion = new Fx.Accordion(togglers, stretchers, {opacity: false, start: false, alwaysHide: true});
   <?php if (is_single() || is_page()) { ?>
      myAccordion.showThisHideOpen(0)
   <?php };?>
   };
</script>
  [[php]]<?php
    function colors($n) {
    //by shaheeilyas.com
      $colornames = array("#FF0000","#DC143C","#C71585","#FF1493","#FF69B4","#FF6347","#FF8C00","#FFA500","#FFD700","#9ACD32","#6B8E23","#008000","#006400","#2F4F4F","#008080","#20B2AA","#00CED1","#4169E1","#000080","#4B0082");
      return $colornames[$n%(count($colornames))];
   }
    ?>
   <?php wp_head(); ?>[[/php]]
</head>

<body>
<div id="wrap">
   <div id="header">
      <table width="100%"><tr><td>
      <h1>[[weblogtitle]]</a></h1>
      <p>[[weblogsubtitle]]</p>
      </td><td id="search">
      [[search]]
      </td></tr></table>
   </div>

<!-- end header -->
TeeBee
 
Posts: 11
Joined: Wed Apr 09, 2008 10:28 am

Re: [Work in Progress] Porting Template to PivotX

Postby hansfn » Mon Jun 30, 2008 9:17 pm

Just tell us/me what the function "colors" should produce for each input and I'll write an snippet/template tag. (I couldn't find it in WP 2.5 or 2.2 - maybe defined in the template it self?) We should avoid using PHP directly in the templates.
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: [Work in Progress] Porting Template to PivotX

Postby TeeBee » Mon Jun 30, 2008 9:26 pm

As far as I understand, this function takes care of the different colored entrytitle-bars, and of the change of these colours once every 24 hours. I don't know wheter it helps or not, but I attached the original WP template.
Attachments
colourskiss-1.zip
The original WP Theme
(22.23 KiB) Downloaded 491 times
TeeBee
 
Posts: 11
Joined: Wed Apr 09, 2008 10:28 am

Re: [Work in Progress] Porting Template to PivotX

Postby hansfn » Mon Jun 30, 2008 9:51 pm

Thx for the attachment, but you actually gave enough info in the first post:
Code: Select all
    <?php
    function colors($n) {
    //by shaheeilyas.com
                $colornames = array("#FF0000","#DC143C","#C71585","#FF1493","#FF69B4","#FF6347","#FF8C00","#FFA500","#FFD700","#9ACD32","#6B8E23","#008000","#006400","#2F4F4F","#008080","#20B2AA","#00CED1","#4169E1","#000080","#4B0082");
                return $colornames[$n%(count($colornames))];
        }
    ?>

You can (but it's not recommened) port this by replacing "<?php" with "[[php]] and "?>" with "[[/php]]". However, the biggest issue is that you haven't replaced
Code: Select all
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

with a subweblog.

If you need more help, just send me what you got - that's quicker than me telling you exactly what to do...
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: [Work in Progress] Porting Template to PivotX

Postby TeeBee » Tue Jul 01, 2008 7:58 am

I can't PM this zip, so it is attached here, it contains the changes I have made so far.
Attachments
colourskissPIVOT.zip
My changes
(8.8 KiB) Downloaded 579 times
TeeBee
 
Posts: 11
Joined: Wed Apr 09, 2008 10:28 am

Re: [Work in Progress] Porting Template to PivotX

Postby TeeBee » Sat Jul 05, 2008 3:05 pm

Is there anyone who can shine a light on this one?
TeeBee
 
Posts: 11
Joined: Wed Apr 09, 2008 10:28 am

Re: [Work in Progress] Porting Template to PivotX

Postby Kevin » Sat Jul 05, 2008 4:37 pm

TeeBee wrote:I can't PM this zip, so it is attached here, it contains the changes I have made so far.

Thanks for pointing that out. I have enabled attachments in private messages with a 20mb storage limit per user. Please let me know if you, or anyone, runs out of attached file space.
BlogThemesExtensionsDocumentation • Support PivotX - Click the Donate button today!
User avatar
Kevin
Administrator
 
Posts: 106
Joined: Tue Nov 20, 2007 9:58 pm
Location: Nova Scotia, Canada

Re: [Work in Progress] Porting Template to PivotX

Postby hansfn » Sun Jul 06, 2008 9:15 am

You know, I just don't have that much time - you have to be patient.

Anyway, I have more or less completed the front page - see an example in my dev/test blog. (I haven't ported get_sidebar in _sub_footer.html.) You can get the current version from http://home.himolde.no/~nordhaug/temp/colourskiss.zip After installing it (unzip it from the pivot folder), you need to enable the colourskiss snippet in the Extension config.

PS! If nothing is shown, try upgrading your PivotX with http://pivotx.net/files/pivotx-latest.zip and edit the subweblogs again.
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Next

Return to 2.x Themes

Who is online

Users browsing this forum: No registered users and 2 guests

cron