The normal Text widget allows you to insert arbitrary Text and/or HTML code. This allows that too, but also parses any inserted PHP code and executes it. This makes it easier to migrate to a widget-based theme but the fun part is, together with the Mobypicture plugin it enables you to include multiple Mobypicture streams in your sidebars. Just like I included the public stream.
Install both widgets and then include the same Mobypicture php code you would use to include the a Moby stream in a post or page.
]]>Please do not hesitate to report bugs or submit your feature requests either via a comment or Twitter (@Chillez73).
]]>Note that I decided to change the image class name in the final version 1.2.1 so those of you who installed v1.2.1 beta and upgrade to 1.2.1 will have to make a small change to their style.css
v1.2.1 beta used class ‘img.mobypic’ while v1.2.1 uses class ‘img.mobypicture_raw’. This is more logical as now the PHP string and image class have the same name. (BTW this also counts for the images displayed by the widget and non-raw code, these images have a class=”mobypicture”.) See also plugin installation notes.
]]>
One of the comments received on the Mobypicture plugin is that it ignores the image style settings included the WP theme style.css that is being used. I have extended the plugin with an additional function that only retrieves the images from Mobypicture.com and does not include any formatting. You will have to include img.mobypic with the desired settings in your style.css
1. As always download the plugin and put contents in your wp-content/plugins folder and activate the plugin.
2. Open the theme style.css and include the class img.mobypic in the image handling section (if you have one
). I used these settings for my test:
img.mobypic img.mobypicture_raw{
padding: 2px;
margin: 0 2px 3px 0;
border: 1px solid #2772B3;
width: 50px;
height: 50px;
}
3. Next, open the file sidebar.php in your favorite editor and include the following code at the desired location. Don’t forget to change the username. Of course you can change the other settings to your liking as well:
<h2>Mobypicture_raw Test</h2><ul>
<?php mobypicture_raw($public = false, $group = false, $username = chillez73, $num = 9, $square = true, $linked = true); ?>
</ul>
That’s it!
Download version 1.2.1 beta here. Public release v1.2.1 now available here.
Note: v1.2 is not compatible with v1.2 beta code, please replace with new code (see plugin installation notes)
Rewriting the plugin including support for multiple widget instances appeared to be more difficult than anticipated. Therefore I decided to release this version prior version 2.0
Next step will be figuring out to use the API instead of the RSS feed and, of course, add support for multiple widget instances.
]]>The source of the data will still be derived from the Mobypicture RSS feed. Once I get this version working I will start looking into a way to use the API instead of RSS to get the source data.
]]>
Today I received the request from Mathys whether I could include support for Mobypicture groups in the plugin. I have been toying around in the code and got a working version. I am not yet satisfied about the way I achieved this but hey it is a start. Check it out here.
]]>