Recent Topics

1 Jun 22, 2010 16:41    

My b2evolution Version: Not Entered

I need a standart set of custom fields for all blogs, but it's a per-blog feature and i do not want to create them each time i create a new blog.

@¥åßßå : you had a custom field plugin afai remember -the one with kiva support thing- ... Does your plugin do the above and more importantly do you think it'll work with 3.3.3 ?

any other ideas are appreciated, thank you i.a.

4 Jun 24, 2010 08:32

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 ?

5 Jun 25, 2010 05:12

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 );

6 Jun 25, 2010 11:58

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

7 Jun 25, 2010 18:19

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;
}

8 Jun 25, 2010 18:44

[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]

¥

9 Jun 25, 2010 18:50

Thanks for the tip :)

10 Jun 25, 2010 18:51

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

¥

11 Jun 28, 2010 10:27

/*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

12 Jun 28, 2010 17:50

It's good to hear that one of my unreleased plugins is finally in use :)

13 Jul 12, 2010 23:41

Thank you! Thank you! Thank you!


Form is loading...