Myg0t
Forum Replies Created
-
Hey there,
I was having the same problem but I was able to get it to work by changing the sharing options to:
LINK SHARING:
ON – Anyone With link can view.ACCESS:
Anyone can edit.This took away the login prompt for me. Though this definitely is not the way I’m sure most of us would like to have gone about it. But it seems that exporting as CSV is now considered editing…
Forum: Plugins
In reply to: [WP jQuery DataTable] Expandable rows?I fixed it. lol. I should really wait a little bit before I ask these questions I suppose…
For those of you who might have similar problems it turns out that the _DT_CellIndex error was happening because I didn’t have the same number of <td>’s in my child <tr> as I did <th>’s. So it was freaking out.
I solved it by adding some empty <td>’s in the child <tr>. Like so:
<tr class="child-'.$user_data->user_ID.'" style="display: none"> <td colspan="4"> <h3>Contact Information</h3> <pre> <b>Email:</b> '.$user_data->email.' <b>Phone: </b>'.$user_data->phone.' <b>Address 1:</b> '.$user_data->address1.' <b>Address 2:</b> '.$user_data->address2.' <b>Country:</b> '.$user_data->country.' <b>State/Province:</b> '.$user_data->state.' <b>City:</b> '.$user_data->city.' <b>Zip Code:</b> '.$user_data->zip_code.' </pre> </td> <td style="display: none"></td> <td style="display: none"></td> <td style="display: none"></td>';
Hope this helps someone.
Forum: Plugins
In reply to: [WP jQuery DataTable] Expandable rows?Just kidding… I fixed that error…. Turned out it was because I didn’t have <thead> and <tbody> tags in my table.
Now I am getting a new error….
Uncaught TypeError: Cannot set property '_DT_CellIndex' of undefined
If you want I can repost the code, but the only different is <thead> </thead> wrapped around the <tr>’s of the <th>’s and the <tbody> </tbody> wrapped around the rest…
Thanks!
You can view the page in question here: https://dev2.myg0tm3dia.com/user-database
Forum: Plugins
In reply to: [WP jQuery DataTable] Expandable rows?Update: I’ve implemented the use of the expandable/collapsable rows using some jquery, but I still cannot get the shortcode to work… Its coming up with a
Uncaught TypeError: Cannot read property 'mData' of undefined
Do you know what would be causing this?Here is my code thus far
jQuery:
jQuery(document).ready(function($){ $("tr.parent") .attr("title","Click to expand/collapse") .click(function(){ $(this).siblings('.child-'+this.id).slideToggle("fast"); }); });
PHP Table Generation:
add_shortcode('user_database_mm','user_database_generate'); function user_database_generate(){ global $wpdb; $user_ID = get_current_user_id(); $form_db_name = "form_contact_information"; $results = $wpdb->get_results("Select * FROM $form_db_name"); $first = TRUE; echo '<div id="user_data_table_div">'; echo do_shortcode('[wp_jdt id="user_data_table"]'); foreach ($results as $user_data){ if($first){ echo '<table id="user_data_table" style="width:100%"> <tr> <th>User ID</th> <th>First Name</th> <th>Last Name</th> <th>Contact Form</th> </tr>'; $first = FALSE; } echo '<tr class="parent" id="'.$user_data->user_ID.'" title="Click to expand/collapse" > <td>'.$user_data->user_ID.'</td> <td>'.$user_data->first_name.'</td> <td>'.$user_data->last_name.'</td> <td>YES</td> </tr> <tr class="child-'.$user_data->user_ID.'" style="display: none"> <td colspan="4"> <h3>Contact Information</h3> <pre> <b>Email:</b> '.$user_data->email.' <b>Phone: </b>'.$user_data->phone.' <b>Address 1:</b> '.$user_data->address1.' <b>Address 2:</b> '.$user_data->address2.' <b>Country:</b> '.$user_data->country.' <b>State/Province:</b> '.$user_data->state.' <b>City:</b> '.$user_data->city.' <b>Zip Code:</b> '.$user_data->zip_code.' </pre> </td>'; } echo '</table></div>'; }
Much appreciated!
Thanks for the input any way!
Any other members out there that may have some answers? I’ve been banging my head on this for a while…
Hmmm Alright… I see what your saying. This could work. So let see if I can get the process straight.
WP Control will help me to run the Users Export plugin on a scheduled basis.
In doing so, my PHP function used to limit the users displayed on the members page of buddypress will need to create a string that is equal to the contents of the .csv that was exported?On a side note:
I’ve still been hacking away at this PHP. But I still can’t seem to get the ID’s quite straight. Maybe you can help me with what I think should be a pretty easy question:private function get_custom_ids() { global $wpdb; // collection based on an xprofile field // WP_User_Query arguments $args = array ( 'role' => 's2member_level2' 'fields' => array( 'id' ), ); // The User Query $user_query = new WP_User_Query( $args ); //The User Loop if ( ! empty( $user_query->results ) ) { foreach ( $user_query->results as $user ) { $custom_ids = $user->ID.","; } } else { // no users found } //$custom_ids = $wpdb->get_col("SELECT user_id FROM {$wpdb->prefix}bp_xprofile_data WHERE field_id = 8 AND value = 'no'"); return $custom_ids; }
The members directory shows empty, and that there are no users to display. So I was thinking that there must be some other way that I need to check the role of an s2member user.
So, I suppose my real question is: What means are necessary in order to check the capabilities of an s2member user from WP functions?
Another idea that i’m having is:
Can I build an array of ID’s for every single user on the system, and use get_user_field(ID,”s2member_access_role”) to check the role? Did some searching and I haven’t found a way to do that with wp_user_query… I tried calling it with no arguments, but it didn’t seem that it did anything.
Thanks!
MDo you have any useful reading material on the subject? Haven’t really dealt with cron jobs to much.
That’s a good idea… But I would need it to be dynamic, which is why I was trying to do it in PHP. If I do it with a csv, I would have to update the list manually every day or two to make sure none of the new members are displayed on the members page.
Any other good suggestions?
I appreciate your time.
M
Bump?
Here’s another, maybe easier to answer question.
How could I build a comma separated list of user id’s who are not of the role “s2member_level2”.
In essence i’d like to build a list of excluded user id’s that I could then pass to bp_has_members().
Could someone assist me? I assume I would need to use implode?
Thanks,
MForum: Themes and Templates
In reply to: Using jquery for single page layout?Alright, Thanks for the quick reply.
What exactly would you call these types of menus? That would help me out ton when trying to look for appropriate tutorials and such.
Thanks,
Myg0tAny ideas mate?
– Myg0t
Hi there, thanks for the quick response!!! ??
Alright, so i did as you said and replaced
<td>[expand title=”Collegiate Soccer USA personal promotion”]More info on why you need CSU Person promotion[/expand]</td>
with
[expand title=”Collegiate Soccer USA personal promotion” tag=”td”]More info on why you need CSU Person promotion[/expand]
The results were: Text is still the only thing clickable, The arrow is now in middle under the text, and when clicked the hidden text shows at the top of the pricing table.
I’ve left it as it is so you can view what’s happening via the link in my first post.
Thanks alot for your input!
Myg0t