Create a "Change Avatar" button with buddypress - wordpress

I'm trying to find the code within the buddypress plugin that links directly to the "Change Profile Photo" page of the user that is logged in. I'm sure this requires php but I can not find it anywhere.
This way I can add link/button on the home page of my site that says "Change Your Avatar!" and it will go to that section of the users profile. Thanks

The following link should work: http://example.com/members/MEMBERNAME/profile/change-avatar/ The "MEMBERNAME" is the username of a user. To get the url for a users profile you can use bp_loggedin_user_domain(). Adding the following to the top of your site will show a link to allow the users change their profile image.
Change Your Avatar!

Related

current user inside wordpress menu hyperlink

I have created a custom menu for buddypress in wordpress.
The links always contain the current user.
In this example the user "admin
/members/admin/profile/
What do i have to do so that the link always points to the current user?
In a link to members, me will be handled as the current user.
For example: https://yoursite.com/members/me/ will take you to your profile.

Disable Order item link

Limit User Access
I'm trying to limit user access to not let him edit product data, such as weight, price, measurements...
I installed the Ultimate Dashboard Plugin and even managed to remove this direct access, letting him see only the orders page, because that's what I want him to have access to.
But when you open the order, he can still access the product through the order link.
Please is there any way I can disable this possibility?
You can achieve that by using the User Role Editor plugin. You can create a custom role there and uncheck the "Edit Product" capability.
Once you created the new custom role, you should go to the "All Users" page from the left admin sidebar, then find the user that you want to prevent editing the products and change its role to the new role that you created with the plugin.
Here is the documentation and examples:
http://shinephp.com/user-role-editor-wordpress-plugin/

Where to locate my Drupal redirect

I have a drupal 7 site and it is redirecting to a page after login. I don't want it to redirect to that page but want it to redirect to another page.
Where can I look for what controls this? I am fairly certain this is going to be in the admin area of drupal but have not found it yet.
You have 3 options here:
Simply install the Login Destination module and set the path you want your user to be redirected to in the admin settings page of the module.
Use the hook_user_login hook hook_user_login(&$edit, $account)
Use the Rules to specify a rule for when an user logs in.
You can :
login as admin user on the backend.
Go to folliwng URL {your drupal site}/admin/config/system/site-information
Find input box Default front page
Input which page path you have, for example dashboard (PS: dashboard page should be able to access.)
You can use Rules module,
The Rules module allows site administrators to define conditionally executed actions based on occurring events.
Create new Rule
Add Event like 'User has logged in'
If you run this Rule for any specific condition, then you can add condition like "User has role(s)" and provide user roles or leave as it is
Add Actions like 'Page redirect' and provide the page URL
Save and clear the cache
You can change the destination via rules/Actions.
Create the destination node or view
Go to 'Administration' » 'Configuration' » and under the heading 'System', click "Actions".
'Create an advanced action'
Click the drop-down menu choice "Redirect to URL...".
Click the button "Create".
On the page 'Configure an advanced action',
under the heading 'Label',
you can leave the label as the default of
"Redirect to URL".
Under the heading 'URL', type the path of the destination.
Click the button "Save".
Go to the 'Modules' page and enable module 'Trigger', if it is not already enabled.
Go to 'Administration' » 'Structure' » 'Triggers', and click the tab "User".
Under the heading 'Trigger: After a user has logged in', click the downward pointing arrow. In the drop-down menu, click the name of the action you just created.
Click the button "Assign".
Logout, and log back in to test.
Read more at https://www.drupal.org/node/683696

Wordpress backend design

I have to build an "admin only" page where an admin user can input 3 objects - a person's "name", "description" and a photo. this way they can add/edit/delete people from the website.
I have tried adding "add_menu_page()" to the admin navigation menu and that worked, but I'm kind of lost as to what to do next, or even if I'm on the right track.
I'm assuming I will load the people into the WP database and query the database when i need to display each person.
Yes you are on the right track. Just create a form for the admin where he/she can enter the name, description and photo of a person.
You should make another page using the same method i.e. add_menu_page() and load your WP DB there and provide the option to the admin to delete, edit or add from there.

wordpress: Redirect homepage

The homepage of my Wordpress site is set to display my latest posts.
I also created a landing page which includes a form for users to fill out for a free consultation.
How can I make it so that when first-time users go to the homepage, they will be redirected to the landing page? (But clicking on my site logo should still take them back to my regular homepage showing my latest posts.)
After users have filled out the "get a free consultation" form on my landing page, we would create a cookie or something so that whenever they next visit the homepage, they will just see the regular homepage with latest posts - not see the landing page any more.
Is there a way to write a code for this?
Thanks in advance!!!
setcookie() is probably a good option.
if(!$_COOKIE["been_here_before"]) {
setcookie("been_here_before", true);
header('Location: /consultation'); // Your free consultation page
}
The way to achive this is a little bit more complicated.
The best practice for this is to have your form in an overlay on the homepage, the user sees the form when accessing your website but has an option to close that layer (exemple:"already fiiled the form..."). After the user submits the form or clicks "close" then set a session variable that will be used so the user won't receive the overlay again in that session. An website that does that is this one which asks the user to register for the newsletter. If the user is already register then he can click "Already registerd?" (=Sunteti deja înregistrat?) and the overlay disapears for that session.
If the form submision is mandatory for all users to get access to the website, then force them to login in the landing page. Here is an example for that.

Resources