Recent Topics

1 Aug 15, 2005 16:38    

Not quite "everything", but lots of stuff you can do with your _main.php file, and really only from the top of the file down through the end of the posts loop. I might get motivated and go a bit further but I don't think a lot of people ask how to customize things beyond the posts loop. So here's the deal: just by feeding parameters with the function call you can change a lot of how certain bits get displayed. The problem is you need to be a bit geeky to figure it all out, not to mention that working through the technical documentation isn't exactly easy. With that in mind I decided to make up a skin that shows everything. After working on it a bit I decided the best way to share this "tutorial skin" was to post it here and let people know how to use it.

[url=http://wonderwinds.com/media/_main_TEST.php.txt]Grab this page[/url] and save it as _main_TEST.php in your skins/custom folder. If you've already tweaked your custom skin it probably won't matter, but it might because of the css file. Try it, and if it gets all messed up no biggie - just rename yours and [url=http://skins.b2evolution.net/files/custom.zip]grab a fresh copy of custom[/url]. Rename your skins/custom/_main.php to something like _main_ORIGINAL.php, then rename "_main_TEST.php" to _main.php.

Check it out and see what there is to see. What's happening is that things that you can easily change are displayed multiple times. If you see something you want to take advantage of open up _main.php in an editor and scroll down looking through the comments for the bit that you want to use. In most cases I provide the link to the correct section of the technical documentation to give you even more info, but mostly I give examples of how to tweak the functions by feeding parameters.

For example the real _main has this bit in it:

	if( isset($MainList) ) while( $Item = $MainList->get_item() )
	{
		$MainList->date_if_changed();
	?>
	<div class="bPost" lang="<?php $Item->lang() ?>">


Since date_if_changed() is a function you can control with parameters my _main_TEST looks like this:

	if( isset($MainList) ) while( $Item = $MainList->get_item() )
	{
		$MainList->date_if_changed();
/**
 * http://doc.b2evolution.net/0.9.0/evocore/ItemList.html#methoddate_if_changed
 *
 * See YOUR_BASEURL/admin/b2options.php?tab=regional&locale=_new_ 
 * for additional information on the changing the date format.
 *
 * You can also set the default format on the regional tab if you prefer.
 */
$MainList->date_if_changed( '<h4>', '</h4>', 'l F jS, Y' );
?>

<div class="bPost" lang="<?php $Item->lang() ?>">

Oh yeah: based on what the powers-that-be are saying about a new release happening soon I'd better point out that this applies to version 0.9.0.12 and might go backwards one or two versions, but might not go forward at all. If you're using an old version you really shouldn't. You should [url=http://prdownloads.sourceforge.net/evocms/b2evolution-0.9.0.12-2005-05-06.zip?download]upgrade to 12[/url] and add the [url=http://prdownloads.sourceforge.net/evocms/xmlrpc_fix_111.zip?download]xml-rpc patch[/url].

2 Aug 15, 2005 17:08

Do you have a link for this running somewhere just for the curious? :)

3 Aug 15, 2005 17:22

Yes, but there's no gaur... garra... promise it'll be there tomorrow. I do installations just to monkey around with stuff then blow it up when it's no longer a fun toy. As a rule once I link a test installation in the forums the spammers will snag the url and start doing their thing. That usually takes the joy out of it. Another one is when I get too confused over what was a hack and what wasn't. Once hacks start overlapping I can't be sure if I'm hacking b2evolution or my latest mutation.

Anyway for a little while it's at EDIT: it's gone. See 2 posts down for a demo page

Hmm... Maybe I oughta just save some of it as html docs and link those somewhere. EDIT: I did which is why the link above is gone

4 Aug 15, 2005 18:06

Thanks for the work. Hopefully this all-skin comes in handy in answering skin questions in the future.

6 Mar 14, 2006 04:09

EdB... I tried to grab that txt file but it said it wasn't there anymore. Have you taken it down?

7 Mar 14, 2006 15:07

Dang! Looks like I did even if I didn't mean to. What a drag cuz I was going to add the guts of it to the upcoming wiki manual, but now all I have is the cute little model of what can be done.

This hurts :'(

It just got added to and bumped way high on my list of things to do someday. I'll bump this thread when it exists again. Sorry!


Form is loading...