2 yabba Jun 22, 2010 18:33

I have an Extra Fields plugin too :roll: it adds custom item/blog fields. It was never released.
You will have to manually add the fields in plugin code, you'll figure it out ;)
[url=http://www.sonorth.com/travel/download/977G3VJJ82]Get it[/url]
sam2kb wrote:
I have an Extra Fields plugin too :roll: it adds custom item/blog fields. It was never released.
You will have to manually add the fields in plugin code, you'll figure it out ;)[url=http://www.sonorth.com/travel/download/977G3VJJ82]Get it[/url]
Yep, that looks quite the thing i need, but the values i typed in does not show up in front end...How do i call em ?
It seems like I forgot to code the frontend to this plugin :)
Anyway, you can pull the values with this method
$xtraFields = $Plugins->get_by_code('xtraFields');
$my_var = $xtraFields->get_field( 'field_name', 'blog', 44 );
'field_name' - unique field name you defined in config
'blog' - target object type, either "blog" or "item"
44 - object ID
Example: get item fields
$my_var = $xtraFields->get_field( 'field_name', 'item', $Item->ID );
Example: get blog fields
$my_var = $xtraFields->get_field( 'field_name', 'blog', $Blog->ID );
Thank you.. seems like just what i need but i ve put this
<?php $my_var = $xtraFields->get_field( 'recip_url', 'item', $Item->ID ); ?>
inside content but nothing displays, and the loop gets cut off
Make sure you didn't forget about this. You should also check the box in plugin settings in order to enable item/blog fields.
global $Plugins;
$xtraFields = $Plugins->get_by_code('xtraFields');
// uncomment to see if plugin is enabled and working good
// var_export($xtraFields);
while (Item loop)
{
$my_var = $xtraFields->get_field( 'recip_url', 'item', $Item->ID );
echo $my_var;
}
[offtopic]
in your plugin, you can use
if( is_a( $obj, 'Item' )
{
// foo
}
elseif( is_a( $obj, 'Blog') )
{
// bar
}
else
{
// bugger
}
And remove your object_type param requirement
[/offtopic]
¥
Thanks for the tip :)
No worries, I use it in another plugin and it just makes shit easier for the user ;)
Note, final param needs to be $Item||$Blog not ++ ->ID
¥
/*edited my own post*/ seems to be working now.. further edit:
yep definitely working, and just what i needed..cant thank you enough, as if it wasn't enough that you are the only one around trying to maintain evo, (other than ¥åßßå -despite his departure-), and yet you keep coming up with exact solutions to my needs.. cheers, let me know if i can do anything for you to help back
It's good to hear that one of my unreleased plugins is finally in use :)
Thank you! Thank you! Thank you!
Pretty sure it's a per post thing, have zero idea if it works in 3.anything.
Wouldn't be to hard to knock it around to suit your needs. Plugin post is here @link [url=http://b2evo-archived.waffleson.co.uk/2009/01/add-fields-to-your-posts]Add Fields To Your posts[/url] ... let me know if the download url is borked ;)
¥