Forum Replies Created
-
Thank you, that was the problem.
I need to brush up on my php string processing knowledge.Have a great day !!
V.
In reply to: How to Modify Content Before Saving if to DBThank you for the help. Here is my code updated and working properly.
// Check the activity content function mmAddLocationCategory($activity_content) { //get the category from POST $category = isset($_POST['bpp_ex_custom_dropdown']) ? $_POST['bpp_ex_custom_dropdown']:null; // Get the location from the user's profile $bp_location = xprofile_get_field_data('Location', bp_loggedin_user_id()); // Add category to the content if(!is_null($category)) { //update the category to activity meta $activity_content = $activity_content . "<br>#" . $category . " #" . $bp_location; } return $activity_content; } add_filter('bp_activity_new_update_content', 'mmAddLocationCategory', 10, 2 );The only problem I have to solve now is how to insert a <br> in the content. It seems the filter strips all break html code. Instead of getting;
content #singing #cityI get;
content #singing #cityThe <br> that is added to the string in the code, gets removed for some reason.
Thank you for your help
V.
In reply to: How to Modify Content Before Saving if to DBThank you for the observation.
I have updated the code and ran it and still doesn’t add the text.I’m thinking it might be the return line or perhaps I need to use a different function.
// Check the activity content function mmAddLocationCategory( $args ) { //get the category from POST $category = isset($_POST['bpp_ex_custom_dropdown']) ? $_POST['bpp_ex_custom_dropdown']:null; // Get the location from the user's profile $user_id = bp_loggedin_user_id(); $bp_location = xprofile_get_field_data('Location', $user_id); // Add the location to all of the user's activity $mmLocation = "<a href=http://dev.areyoupop.com/activity/?s=%23" . $bp_location . ">#" . $bp_location . "</a>"; // Add category to the content if(!is_null($category)) { //update the category to activity meta $content = $content . "<br />" . $category . " " . $mmLocation . $args['type']; } return $content; } add_action('bp_activity_posted_update', 'mmAddLocationCategory', 10, 2 );In reply to: How to Modify Content Before Saving if to DBHenry,
Thank you for your prompt reply. I forgot to remove the testing code I was using.
This is the actual code;// Check the activity content function mmAddLocationCategory( $args ) { //get the category from POST $category = isset($_POST['bpp_ex_custom_dropdown']) ? $_POST['bpp_ex_custom_dropdown']:null; // Get the location from the user's profile $user_id = bp_loggedin_user_id(); $bp_location = xprofile_get_field_data('Location', $user_id); // Add the location to all of the user's activity $mmLocation = "<a href=http://dev.areyoupop.com/activity/?s=%23" . $bp_location . ">#" . $bp_location . "</a>"; // Add category to the content if(!is_null($category)) { //update the category to activity meta $content = $content . "<br />" . $category . " " . $mmLocation . $args['type']; } return $content; } add_action('bp_activity_post_update', 'mmAddLocationCategory', 10, 2 );In reply to: Hacking BP Classes to Search OR Instead of ANDHenry,
Are the search terms in an AND operation?
I would like the search terms to be in an OR operation.
Is there a way to do this using bp_parse_args. The function doesn’t mention thisThank you for any hints,
V.
In reply to: Hacking BP Classes to Search OR Instead of ANDthank you
I forgot the filter. Here it is again;
function kendyman_seventeen_options( $options ) { echo "here5"; exit(); $args = array( 'orderby' => 'name', /* ou id ou count .. */ 'order' => 'ASC', /* ou DESC */ 'include' => array( 1, 5 ) /* list of category ids to include */ ); $cats = get_terms( 'category', $args ); foreach( $cats as $term ){ $options['cat-'.$term->term_id] = $term->name; } return $options; } add_filter('bp_core_search_site', 'kendyman_seventeen_search_by_cat_url', 10, 2);In reply to: Adding Location to the Bottom of Activity [Code]@shanebp thank you that worked !!
Are there links on how to get the large image in the activity entry.php file instead of the small version?
Thank you for your help
V.
In reply to: [Resolved] Dashboard Activity Page is BlankThank you @mercime
It was a profile plugin.V.
In reply to: How Do I Make A Registration Field Read From DBShanebp,
Thank you for your quick reply. Since I just wanted to remove the sidebar I realized the following;
1. register.php is to modify the main content area within <div id=”content” >
2. Defining page_register.php as a template and assigned it to the registrar page removes the sidebar if <?php //get_sidebar(); ?> is commented out.
3. I can just upload all the data using the myphpadmin to upload all the locations instead of manually through bp interfaceThank you,
V.
In reply to: [Resolved] Register Page as Homepage redirect issueHenry,
Thank you so much for the script. Works like a charm !! 🙂 5 Stars
V.