Support forums : Branches

[done] qp5_smallstep

Discussion about existing branches and the directions they need to go in, or, for branches that are going to happen. "Quickies" is wide open. "Branches" is more focused.

Moderator: Dracones

[done] qp5_smallstep

Postby EdB » Mon Mar 04, 2013 9:47 pm

https://code.launchpad.net/~quam-plures ... _smallstep

This branch makes 2 changes to the database that sets up the first shared plugin fields. Basically core knows that a user might have an avatar file ID and/or a "biography" bit, but core does nothing with those fields - it takes a plugin asking for them to make them happen. Then the next plugin that wants either of those already has them :)

I owe us a skeleton plugin that uses these fields to show how a plugin will activate/access them!

    This branch increments your database by 2 steps.
  • This branch might affect your plugins!
    • b2evo_Callbacks (in javascripts) is now called app_Callbacks.
    • You can still require 'functions.js' but 'functions.min.js' is better due to faster for your visitors.
  • Know your password before you upgrade because this branch MIGHT cause your current login to fail due to a change in encoding checks.

I did a quick installation and it worked, but I haven't drilled down and tried to find what's broken. For that reason I don't want to mark it 'mature' and put it in merge. I get to make some money tonight so I can't play much more today. If anyone has time to, give it a shot and lemme know if you find problems.
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: qp5_smallstep

Postby EdB » Wed Mar 06, 2013 12:24 am

EdB wrote:... I owe us a skeleton plugin that uses these fields to show how a plugin will activate/access them! ...


Gotta make a change to the branch and retest, but I found out where I documented the change :) Once I found it I remembered working the code so that the plugin aspect was really easy. Basically it goes like this:
Code: Select all
/**
* @see Plugin::GetDefaultUserSettings()
*/
function GetDefaultUserSettings( & $params )
{
   $user_settings = array(
      'use_avatar' => true,
      'use_biography' => true,
   ) );
   return $user_settings;
}

Those two bits are all it takes to tell core to show the fields to the user when they hit their admin-side profile page. Accessing it is then done with something like $User->avatar_ID or $User->biography. The avatar is a file number, the biography allows html and is a TEXT field in the database. hmmm.... might be this-> instead of User-> ... not sure right off the top of my head. Anyway it's in there and it worked, so now I gotta retest and push the change to the branch.
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona


Return to Branches

Who is online

Users browsing this forum: No registered users and 3 guests

cron