Upload Gravity Form files to OneDrive [closed]

I’ve been looking for an away of upload files from Gravity Form direct to the cloud on OneDrive. And so far, I found some codes that could be useful:

 add_filter( 'gform_upload_path', function ( $  path_info, $  form_id ) {         GFCommon::log_debug( "log_upload_path(): path_info for form #{$  form_id} => " . print_r( $  path_info, true ) );               return $  path_info;     }, 1, 2 );       add_filter( 'gform_upload_path', 'change_upload_path', 10, 2 ); function change_upload_path( $  path_info, $  form_id ) {    $  path_info['path'] = '/home/public_html/yourdomainfolder/new/path/';    $  path_info['url'] = 'http://yourdomainhere.com/new/path/';    return $  path_info; }    <?php require_once 'functions.inc.php'; $  token = skydrive_tokenstore::acquire_token(); // Call this function to grab a current access_token, or false if none is available.  if (!$  token) { // If no token, prompt to login. Call skydrive_auth::build_oauth_url() to get the redirect URL.        echo "<div>";        echo "<img src='statics/key-icon.png'>&nbsp";        echo "<a href='" . skydrive_auth::build_oauth_url() . "'>Login with SkyDrive</a></span>";        echo "</div>"; } else {        $  sd = new skydrive($  token);        try {            $  response = $  sd->put_file($  _GET['folderid'], '/file/to/put');            // File was uploaded, return metadata.            print_r($  response);        } catch (Exception $  e) {            // An error occured, print HTTP status code and description.            echo "Error: ".$  e->getMessage();            exit;        } } 

Source: https://docs.gravityforms.com/gform_upload_path/
https://stackoverrun.com/fr/q/8253794

Instead of my domain path I would like to point it to one folder on Onedrive and if possible, generate a new folder for each upload containing the current WooCommerce order number. I don’t have much experience with PHP so any useful help will be great!

2d gravity simulator – smaller object orbiting towards center of bigger object

In my libgdx test game, I have initially created 2 circle objects (stellar) about which I will say more in details below. However, my goal is to simulate gravity in 2d, where smaller object orbits towards center of bigger object (just like earth orbits sun) but closer and closer to the center of bigger.

So, I have created the following:

  • stellar1: smaller, 10px radius, 10 mass, dynamic (can move), initial position -160×90, velocity (0,0), accelerator (0,0)
  • stellar2: bigger, 30px radius, 30 mass, static (cannot move), initial position 0x0, velocity (0,0), accelerator (0,0)

Here is also a screenshot, just to have a picture: enter image description here

I will give the full code below of what I did so far, before that I want to mention I have 2 approaches, StellarTest1 and StellarTest2.

First StellarTest1, I’ve tried to add some extra values like 1000f to both x and y just to see something in action like:

velocity.x += 1000f * acceleration.x * deltaTime; velocity.y += 1000f * acceleration.x * deltaTime; 

Resulting in – smaller object gets towards the center of the bigger object, but once it reaches the center of bigger, the smaller object gets evicted to the opposite side. Not to mention how 1000f is not the correct value in the size of this coordinate system, but I am concerned about following computation:

acceleration.x = gravityForce * (diffX / distance) acceleration.y = gravityForce * (diffY / distance) 

Code StellarTest1:

public class StellarTest1 extends AbstractTest {      private Stellar stellar2, stellar1;      public StellarTest1(Game game) {         super(game);     }      @Override     public void create() {         game.getCartesianGrid().setEnabled(true);          // smaller  stellar         float startX = -160;         float startY = 90;         float radius = 10;         float mass = 10;         stellar1 = new Stellar(                 startX, startY,                 radius, mass,                 new Color(102, 188, 217, 100f)         );          // bigger stellar         startX = 0;         startY = 0;         radius = 30;         mass = 30;         stellar2 = new Stellar(                 startX, startY,                 radius, mass,                 new Color(252, 236, 3, 100f)         );         stellar2.updatable = false; // bigger object will not update, in other words no motion          stellar2.setOther(stellar1);         stellar1.setOther(stellar2);     }      @Override     public void update(float deltaTime) {         if (!updatable) {             return;         }         stellar2.update(deltaTime);         stellar1.update(deltaTime);     }      @Override     public void draw() {         if (!drawable) {             return;         }         stellar2.draw();         stellar1.draw();     }      private class Stellar {          Circle circle;         Vector2 velocity;         Vector2 direction;         Vector2 acceleration;         float mass, radius;         boolean updatable;         Stellar other;          public Stellar(                 float startX, float startY,                 float radius, float mass,                 Color color) {             this.radius = radius;             this.velocity = new Vector2(0, 0);             this.acceleration = new Vector2(0, 0);             this.mass = mass;             this.radius = radius;              circle = new Circle(game,                     color,                     startX, startY,                     radius);              this.updatable = true;         }          public void update(float deltaTime) {             if (!updatable) {                 return;             }             float diffX = other.circle.x - circle.x;             float diffY = other.circle.y - circle.y;              float G = 2f;             float mass = G * (other.mass - this.mass);             float distance = (float) Math.sqrt(Math.pow(diffX, 2) + Math.pow(diffY, 2));             float gravityForce = (float) (mass / Math.pow(distance, 2));              acceleration.x = gravityForce * (diffX / distance);             acceleration.y = gravityForce * (diffY / distance);              velocity.x += 1000f * acceleration.x * deltaTime;             velocity.y += 1000f * acceleration.y * deltaTime;              circle.x += velocity.x * deltaTime;             circle.y += velocity.y * deltaTime;         }          public void draw() {             game.getShapeRenderer().begin(ShapeRenderer.ShapeType.Filled);             circle.draw();             game.getShapeRenderer().end();         }          public void setOther(Stellar other) {             this.other = other;         }     }  } 

Second StellarTest2, in this example, you will see same code, except I am using here angle in degrees:

float angleInDegrees = MathUtils.atan2(diffY, diffX) * MathUtils.radiansToDegrees; ... acceleration.x = gravityForce * MathUtils.cos(angleInDegrees * deltaTime); acceleration.y = gravityForce * MathUtils.sin(angleInDegrees * deltaTime); 

In this test, I did not have to add some extra velocity to move smaller object. Also I achieved that smaller object will make a solid curve, but will not get dragger in the center. Instead, after some time it will evict out. However, still I face the issue that smaller object keeps curving in and out and towards center. Yet, I am curious if cos and sin is necessary here, and perhaps StellarTest1 is right approach.

Code StellarTest2:

public class Stellar2Test extends AbstractTest {      private Stellar stellar1, stellar2;      public Stellar2Test(Game game) {         super(game);     }      @Override     public void create() {         game.getCartesianGrid().setEnabled(true);          float startX = -160;         float startY = -90;         float radius = 10;         float mass = 30;         stellar2 = new Stellar(                 startX, startY,                 radius, mass,                 new Color(102, 188, 217, 100f)         );          startX = 0;         startY = 0;         radius = 30;         mass = 30;         stellar1 = new Stellar(                 startX, startY,                 radius, mass,                 new Color(252, 236, 3, 100f)         );         stellar1.updatable = false;          stellar1.setOther(stellar2);         stellar2.setOther(stellar1);     }      @Override     public void update(float deltaTime) {         if (!updatable) {             return;         }         stellar1.update(deltaTime);         stellar2.update(deltaTime);     }      @Override     public void draw() {         if (!drawable) {             return;         }         stellar1.draw();         stellar2.draw();     }      private class Stellar {          Circle circle;         Vector2 velocity;         Vector2 acceleration;         float mass, radius;         boolean updatable;         Stellar other;          public Stellar(                 float startX, float startY,                 float radius, float mass,                 Color color) {             this.radius = radius;             this.velocity = new Vector2(0, 0);             this.acceleration = new Vector2(0, 0);             this.mass = mass;             this.radius = radius;              circle = new Circle(game,                     color,                     startX, startY,                     radius);              this.updatable = true;         }          public void update(float deltaTime) {             if (!updatable) {                 return;             }             float diffX = other.circle.x - circle.x;             float diffY = other.circle.y - circle.y;             float angleInDegrees = MathUtils.atan2(diffY, diffX) * MathUtils.radiansToDegrees;              float G = 2;             float mass = (G * (other.mass * this.mass));             float distance = (float) Math.sqrt(Math.pow(diffX, 2) + Math.pow(diffY, 2));             float gravityForce = mass / distance;              acceleration.x = gravityForce * MathUtils.cos(angleInDegrees * deltaTime);             acceleration.y = gravityForce * MathUtils.sin(angleInDegrees * deltaTime);              velocity.x += acceleration.x * deltaTime;             velocity.y += acceleration.y * deltaTime;              circle.x += velocity.x * deltaTime;             circle.y += velocity.y * deltaTime;         }          public void draw() {             game.getShapeRenderer().begin(ShapeRenderer.ShapeType.Filled);             circle.draw();             game.getShapeRenderer().end();         }          public void setOther(Stellar other) {             this.other = other;         }     }  } 

Is it possible to lift things multiple times with different castings of reverse gravity?

My players came up with an interesting idea using reverse gravity recently which at the time I let them do because it made sense and I like to keep things flowing but wondered about the actual mechanics of it.

Reverse Gravity lifts everything centered on a point in a 50ft circle 100ft up. 2 of the players in the party had taken it, in player ones turn he cast it at ground level to lift a group of enemies the full 100 feet, the 2nd player then cast the spell a second time centering at the top of the previous spell and lifting the enemies another 100 feet. In player ones turn he stopped his version of the spell meaning player 2 could then drop them 200 feet. As there was nothing to grab hold of on the second casting there was no saving throw

At the time I was unsure if the initial casting of the spell would lock them in at 100 feet but decided to go with it. My players have also asked me if one of them could cast it repeatedly turn after turn. Effectively cancelling it as they cast it a second time lifting people multiples of 100 feet into the air before then dropping them.

Is this a DM decide situation, which I am fine with, or are there any rules stated anywhere for this situation?

Reverse Gravity: dropping concentration mid fall

When you cast the spell Reverse Gravity, creatures start falling upwards into the air. Assuming that there is nothing in their way the spell must somehow halt their momentum when they reach the top of it, as the spell says "If an object or creature reaches the top of the area without striking anything, it remains there, oscillating slightly, for the duration." If it didn’t halt their momentum somehow, they would fall up into normal gravity for another 100 feet or so, and then almost all the way back to the ground (with real world physics anyway; air resistance would be the only thing that slowed them down, and that would only remove about 5 feet worth of momentum per 100ft fall- I did the math).

Because of this I’m assuming that the spell stops momentum when the creatures hit the top of the spell area somehow.

But what happens if you drop concentration on the spell while they are falling upwards? The condition "If an object or creature reaches the top of the area without striking anything" no longer applies, as the spell isn’t in effect anymore. Physics tells us that the creature falling upwards 100 feet in a reversed gravity field would then have enough momentum to ‘fly’ another 100 feet upwards beyond that until slowing to a stop and falling back down (discounting air resistance). So lets say you dropped concentration just before they reached the top of the spell area; would they then fly up to a height of 200ft off the ground before then falling to the ground for 20d6 damage?

I know you can drop concentration as a free action anytime, but this spell doesn’t seem to indicate how it works exactly regarding the momentum gathered while falling upwards. I’m wondering if the above interpretation is reasonable.

Gravity Forms: How to add PHP function to confirmation conditional shortcode?

In Gravity Forms, I have a confirmation set up with various conditional shortcodes. Example:

[gravityforms action="conditional" merge_tag="{:3:value}" condition="contains" value="E"]*** GET A CATEGORY ***[/gravityforms] 

Additionally, I have a PHP function that gets all posts by category, and I would like to use this function inside the conditional shortcode. I’m not figuring out a way to do this, so any help would be appreciated.

My function: useful_tools_list(array( 'type' => 'documents', desc => 'true' ))

I also made it into a shortcode: [useful-tools type="documents" desc="true"]

I tried using <?php ?>, but I realized I can’t embed PHP into the editor. The conditional shortcode doesn’t support nesting other shortcodes inside of it, so that doesn’t work.

I’m wondering if there is a way to manipulate the GF conditional shortcode to allow nesting? Or another way of calling the function that I’m not aware of?

Specify a force on the entire body (e.g. gravity)

In the thread Stress calculations using finite elements User21 showed an example how to define a force over the entire body during FEM calculation as boundary condition. See the screenshot below from the corresponding position in this thread.

enter image description here

In the description of the definition of the boundary condition – force on the entire bodyUser21 has defined the differential equation system as follows.

$ ps$ == {$ 0, -9.8$ }

Which unit has this power? Is the unit $ N/m^2$ ?

If $ N/m^2$ is the correct unit, then I can understand how to calculate the normalized body force from the density and volume of the body and insert it into the right side of the differential equation.

If $ N/m^2$ is not the right unit, then I have the following questions on you:

How is the density of the material or the mass considered here? Could you please show how to use this correctly in the equation?

In my case I have a centripetal acceleration due to rotation and the equation would look like this:

$ ps$ == {$ omega ^2 * x, omega ^2 * y$ }

Omega is the angular velocity of the body for which the deformations are to be calculated with FEM. And the expression

$ omega^2 * r$

is the centripetal acceleration, where $ r$ is the distance from the center of rotation.

However also here I have the problem, density resp. masses are not considered.

Does anybody have an answer to the question how to use the density and the mass correctly in the equation?

Many thanks in advance!

Write gravity forms field values to server file before submission

I have a gravity form and I want to write the values of the fields to a server file, before submission, to capture people who don’t finish the form. I know there is a partial entries add on but I wondered whether this would be possible using node js?

I was thinking of an onblur event that writes the field value to a file.

If this is possible, how would I link this to the gravity form itself ? Where do I place the code? Can’t put js in functions.php so maybe use the css class option on the fields ?

Any advice appreciated.

DnD 3.5 Build – ‘Gravity Monkey’ idea with monk and druid

I’m about to start a DnD 3.5 campaign with a malleable DM. We are starting at level 5-8 (TBD) with 100,00 gold. I’ve been working on a build that has flavors of Sun Wukong – The Monkey King – at early levels and Pain from Naruto (almighty push stuff) at late levels. My goal is a ‘gravity monkey’ with a mantra of “The strength in this world lies in the sky and the earth.. and the forces that hold it together.”

I have approved the Wukong homebrew race and I will start with 2 levels of Monk as an orphan brought to a monastery in cold mountains (unless something more fitting is suggested). For the next several levels, I am planning to hit druid for the quarterstaff buffs and ability to summon elementals (Rashini Elemental Summoning as my idea). My end game is 6, 9, or 10 levels of the homebrew class, Mage of the Unseen Force (Gravity-mancer). I essentially want to be a monkey who hits hard and often, has battlefield control through earth and air spells, and can anytime fly around and summon elementals to supplement that control and then can start changing the gravity of the battlefield.

I’m looking for ideas for classes that might better fit the earth-air-monkey-quarterstaff thing if anyone has them.. BUT I am more specifically looking for alternative class features for the monk or especially druid. I know wild shape is great but I want to replace it to nerf my character a bit (my group isn’t heavy into optimization) and because I imagine myself pumping strength and staying in my form base most of the time. That said, the Monkey King has the power to turn himself into anything… I just don’t really want the stats from that – more the utility. I have looked at Shapeshifter ACF for druid, but it isn’t quite what I’m imagining as it seems to just buff stats if I’ve read it right. I can’t find much literature on the Elemental Druid ACF/Elemental Summoner Druid ACF, but it is very intriguing.

Question 1 synopsis: How can I make a druid (or something else) a nature-of-earth-and-air focused caster?

I also imagine myself as someone who doesn’t use many items. I want a badass quarterstaff (the Monkey King had one) that fits my ideas and have been trying to figure that out, but I am a bit unclear on staffs vs. quarterstaffs and whether a druid can use magic staffs.

Question 2 synopsis: Are there any awesome staffs that could be used as a quarterstaff and affect earth and air?.. or are there any other items that might be awesome for this build?

I will have some feats to spare. I will have my monk feats and am looking at quarterstaff focus, Rashini Elemental, and Magically Aloft for the homebrew prestige.. but otherwise have a lot of options.

Question 3: What feats work with earth, air, quarterstaff, or anything else that seems to fit?

Last notes: I live in China so anything with an Eastern flavor would be great. I don’t really want too much more homebrew as I have already added quite a bit, but suggestions are still welcome. I am not looking to be OP, just want a fun combat character. Our campaign is potentially going to be focused around finding a Deck of Many Things which my DM has a physical copy of. I don’t see that influencing my character really, but thought it was worth mentioning. I have read druid handbooks and Monkey King build threads, but am by no means well versed. I have looked at Apelord and Monkey Shen and neither fits right now, but if it makes sense with other options I am all eyes.

Thanks for the read and any answers in advance.