Hard code the button
-
Hi!
I want to use this plugin, but I need to hardcode the button where I wan’t it to appear.
Can you help me on this?
Also, it does generates some notices, undefined indexes in settings. On a multisite with 3.5.1.
Thank you!
https://www.ads-software.com/extend/plugins/join-my-multisite/
-
*ponder* you can just make a link or any button you want and have it point to the join page. Would a Shortcodes help? I could slip that in probably.
I have a fix in my test bed for the notices, and I was just being distracted and forgot to upload it. ?? thanks for reminding me.
Aha, I was thinking about that actually after I’ve checked the widget.php. I don’t need a shortcode for that.
So the plugin handles the logged in user id who visits the url and all that? Cause that would be great!
And for this I am trying to figure out how to display all the users with a subscription-level on a page.
Got this now, but it lists all users of the entire network.
function contributors() { global $wpdb; $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users ORDER BY display_name"); foreach($authors as $author) { $blogs = get_blogs_of_user( $author->ID ); if($blogs) { foreach ( $blogs as $blog ) { echo '<li><a href="'. $blog->siteurl .'" class="ttip-bottom" data-original-title="'. get_the_author_meta('display_name', $author->ID) .'">'; echo get_avatar($author->ID, 64); echo "</a></li>"; } } } }
So the plugin handles the logged in user id who visits the url and all that? Cause that would be great!
I’m not sure what you’re asking. Do you mean does it know the difference between a logged in user and a logged out user, and a user who’s a member and one who’s not? It should!
And for this I am trying to figure out how to display all the users with a subscription-level on a page.
per site or for the whole network?
Sorry for that!
Yes, I wondered if the plugin handled all the other parts (the ifs and elses and all).Yes, as I said, that piece of code I got lists the entire networks users.
I want that to output all the users with a subscriber-level registered to a site (so the site admin and superadmins don’t appear in it).
So what’s needed is the correct get_results arguments so it finds out which site it’s on.
The plugin should handle all the ifs and elses ?? I pushed a new version today with fixes for the warnings.
You should be able to use get_users for that call: https://codex.www.ads-software.com/Function_Reference/get_users
get_users worked like a charm!
Thank you!
It seems I can’t get it to work properly.
I’ve network activated the plugin, and visited the settings page on the subsite to save the settings. Then I’ve added a user that’s not connected to the subsite.
But when I click the following button:
<a href="?jmm-join-site" id="join-site" class="btn btn-inverse">Phrase here</a>
Nothing happens, did I misunderstand the href part?The link should be to your registration page.
So if you made it domain.com/register/ then you link to that.
Sorry, I am not getting this at all now.
So the user will have to sign up using the registration page?
Let’s step back ??
The original question was “I want to use this plugin, but I need to hardcode the button where I wan’t it to appear.”
Where are you now with this? How are you trying to get the button to show and where?
Ok, I will try to explain.
1. I am on this “users” blog. Let’s call it site A.
2. When viewing this users profile, I want to have a button which says “Add me as friend”
3. On the profile I want to list a number of recently joined friends (subscribers).So, number 3 works good with the get_users.
I thought that when a (logged in of site B) user clicked the button, it would a be added to site A as a subscriber, maybe through the query “?jmm-join-site”.
I’m using Gravity forms to sign up on the main sites homepage.
Ah, okay. I think I get it.
I just tested this:
<form action="?jmm-join-site" method="post" id="notmember"> <input type="hidden" name="action" value="jmm-join-site"> <input type="submit" value="Join This Site" name="join-site" id="join-site" class="button"> </form>
It works as designed.
I made that into a shortcode
[join-this-site]
which should be available as the dev version here: https://www.ads-software.com/extend/plugins/join-my-multisite/developers/ (it’ll be version 1.4.1)That should let you put the button where you want.
Hi again Ipstenu!
Sorry, but I don’t think this is resolved yet. Not in the way I wan’t it at least ??
So, here we go:
I have site A and site B.If site A visits site B (B has the join-setting to automatic) site A gets added as a subscriber. Works just like I want it to.
However, I wan’t site A to click a button on site B to actually join it as a subscriber.
So, the plugin works good, but the button doesn’t work the way I need it to.
Thank you!
I don’t know how I missed this…
You want someone to click a button on Site A to add them to Site B? Users aren’t sites, but you seem to be using them interchangeably, which is VERY confusing to me.
However, I wan’t site A to click a button on site B to actually join it as a subscriber.
Site A is a SITE. It can’t click on anything. If you’re saying you don’t want users to be auto-added to a site, but instead to click on a button to join a specific site while visiting, that totally works.
If you have the join-setting to automatic, then you don’t get to ALSO have a button. It’s either or.
- The topic ‘Hard code the button’ is closed to new replies.