Recent Topics

1 Jan 14, 2010 06:03    

My b2evolution Version: 3.3.x

I'm converting the WP theme "CorporateMag" (original demo: http://wpjunction.com/themes/corporate/ ) for b2evo but got stuck with the "sliding/gliding" scripts... my limitation :p

This is the original "SLIDE" script:


<?php
if($corporatemag->option['slideCat'] !='Select a category:' && $corporatemag->option['slideCat'] !='' && $corporatemag->option['slideNum'] != 0 && $corporatemag->option['slideNum'] !=''):
$slidecat = $corporatemag->option['slideCat'];
$slidecount = $corporatemag->option['slideNum'];
$my_query = new WP_Query('category_name= '. $slidecat .'&showposts='.$slidecount.'');
if($my_query->have_posts()):
?>
	<script type="text/javascript">
	stepcarousel.setup({
		galleryid: 'mygallery', //id of carousel DIV
		beltclass: 'belt', //class of inner "belt" DIV containing all the panel DIVs
		panelclass: 'panel', //class of panel DIVs each holding content
		panelbehavior: {speed:500, wraparound:true, persist:true},
		defaultbuttons: {enable: true, moveby: 4, leftnav: ['<?php bloginfo('template_directory'); ?>/images/sliding-prev-button.gif', -25, 78, 'slide-prev-nav'], rightnav: ['<?php bloginfo('template_directory'); ?>/images/sliding-next-button.gif', 15, 78, 'slide-next-nav']},
		statusvars: ['statusA', 'statusB', 'statusC'], //register 3 variables that contain current panel (start), current panel (last), and total panels
		contenttype: ['external'] //content setting ['inline'] or ['external', 'path_to_external_file']
	})
	</script>

	<div id="mygallery" class="stepcarousel">
		<div class="belt">
		<?php while ($my_query->have_posts()) : $my_query->the_post();$do_not_duplicate = $post->ID; ?>
			<div class="panel">
				<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" > <img src="<?php echo get_post_meta($post->ID,'thumbnail', true); ?>" width="200" height="156" alt="<?php the_title(); ?>"/> </a>
			</div>
		<?php endwhile; ?>
		</div>
	</div><!-- /mygallery -->
<?php endif; endif; ?>

Then this is the original "GLIDE" script:


<?php
if ($corporatemag->option['featuredCat'] != '' && $corporatemag->option['featuredCat'] != 'Select a category:'  && $corporatemag->option['featuredNum'] != '0' && $corporatemag->option['featuredNum'] !=''):
$glidecat = $corporatemag->option['featuredCat'];
$glidecount = $corporatemag->option['featuredNum'];
$my_query = new WP_Query('category_name= '. $glidecat .'&showposts= '. $glidecount);
if ($my_query->have_posts()):
?>
<script type="text/javascript">
featuredcontentglider.init({
	gliderid: "featured-posts",
	contentclass: "post",
	togglerid: "togglebox",
	remotecontent: "", 
	selected: 1,
	persiststate: true,
	speed: 300,
	direction: "leftright",
	autorotate: true, 
	autorotateconfig: [10000, 9999] //if auto rotate enabled, set [milliseconds_btw_rotations, cycles_before_stopping]
})
</script>
<div id="featured-posts-wrapper">
	<div id="featured-posts" class="glidecontentwrapper">
	<?php while ($my_query->have_posts()) : $my_query->the_post();$do_not_duplicate = $post->ID; ?>
		<div class="post">
			<h2 class="title"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
			<div class="entry">
				<p><?php the_content_rss('', TRUE, '', 140); ?></p>
				<a class="more-link" href="<?php the_permalink() ?>" title="Read More <?php the_title(); ?>"><span>Read More...</span></a>
			</div>
		</div>
	<?php endwhile; ?>
	</div>
	<div id="togglebox" class="glidecontenttoggler">
		<a href="#" class="prev"></a>
		<a href="#" class="next"></a>
		<div class="clear"></div>
	</div>
	<div class="clear"></div>
</div><!-- /featured-posts-wrapper -->
<?php endif; endif; ?>

For the GLIDE script, I am thinking of tapping b2evo's "Featured" feature as well, and probably give the end-user the option to choose between using the built-in "Featured" feature or go by the "Categories" method (as shown in the GLIDE script above).

I hope someone can help convert it to b2evolution :D Those two are the last missing part of the skin to convert, and that's how far my PHP (and b2evo params/arrays/etc) goes. So I'm stuck :p

One more request, please leave the name and URL you want to be credited for ^_^

Thanks a bunch!!


Form is loading...