Forum Replies Created

Viewing 15 replies - 1 through 15 (of 29 total)
  • Thread Starter A31

    (@a31)

    Hahahaha – heated discussions here ??

    @salsaturation – Yes thank you.
    What I have eventually done is to find a maintained theme that more or less suits our needs, then created a child theme with a few minor adjustments on it to accommodate our needs.

    It would have been nice to have a theme completely dedicated to us, but it really does not warrants the cost when a child theme accomplishes the same goal.

    Thank you for the responses.

    Thread Starter A31

    (@a31)

    This is for a business site, but no theme does not have to be on repository.
    They say new theme because Twenty Seventeen apparently can not do this.

    Do you perhaps have some link of sorts for me where I can learn how to do this with Twenty Seventeen?

    Thank you so much

    Thread Starter A31

    (@a31)

    Thank you very much.

    I have to be honest, the entire process with this company has been absolutely ridiculous, and there were so many discrepancies. And I really have to bite my tongue not to rant and shame with all the details and screenshots of their comments and lies.

    All that being said, I am now forced having to get another outsource to complete this task. Damage is done, and I write this down to lessons learned… never buy hours upfront…

    Thank you all very much for your inputs, I really appreciate it.

    Thread Starter A31

    (@a31)

    As luck would have it… many hours before the query… but right after I post for help , I get a solution. Here is my code now:

    $sequence = 0;
    $event_id = 1234;
    $status = 'TENTATIVE';
    
    $start = '20170510';
    $start_time = '160630';
    $end = '20170510';
    $end_time = '180630';
    $subject = "Meeting";
    $desc = "Details";
    
    $ical = "BEGIN:VCALENDAR\r\n";
    $ical .= "VERSION:2.0\r\n";
    $ical .= "PRODID:-//YourCassavaLtd//EateriesDept//EN\r\n";
    $ical .= "METHOD:REQUEST\r\n";
    $ical .= "BEGIN:VEVENT\r\n";
    $ical .= "ORGANIZER;SENT-BY=\"MAILTO:[email protected]\":MAILTO:[email protected]\r\n";
    $ical .= "ATTENDEE;[email protected];ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;RSVP=TRUE:mailto:[email protected]\r\n";
    $ical .= "UID:".strtoupper(md5($event_id))."-kaserver.com\r\n";
    $ical .= "SEQUENCE:".$sequence."\r\n";
    $ical .= "STATUS:".$status."\r\n";
    $ical .= "DTSTAMPTZID=Africa/Nairobi:".date('Ymd').'T'.date('His')."\r\n";
    $ical .= "DTSTART:".$start."T".$start_time."\r\n";
    $ical .= "DTEND:".$end."T".$end_time."\r\n";
    $ical .= "LOCATION:".$venue."\r\n";
    $ical .= "SUMMARY:".$summary."\r\n";
    $ical .= "DESCRIPTION:".$event['description']."\r\n";
    $ical .= "BEGIN:VALARM\r\n";
    $ical .= "TRIGGER:-PT15M\r\n";
    $ical .= "ACTION:DISPLAY\r\n";
    $ical .= "DESCRIPTION:Reminder\r\n";
    $ical .= "END:VALARM\r\n";
    $ical .= "END:VEVENT\r\n";
    $ical .= "END:VCALENDAR\r\n";
    
        $SendMail_To = '[email protected]';
        $SendMail_Subject = 'TESTING';
        $SendMail_Message = $ical;
    function set_html_content_type()
                        {
                            //return 'text/html';
                            return 'text/calendar';
                        }
                        
                        add_filter ('wp_mail_content_type', 'set_html_content_type' );
                        
                        wp_mail($SendMail_To,$SendMail_Subject,$SendMail_Message,$Headers,$Attachment_Array);
                                            
                        remove_filter( 'wp_mail_content_type', 'set_html_content_type' );

    Hope this can help someone else…

    Thread Starter A31

    (@a31)

    Ok unfortunately, it did not resolve my problem. ??
    My AJAX Requests is still not working on this specific user.

    Any other suggestions?

    Thread Starter A31

    (@a31)

    Thank you very much, I will try that and let you know how it went.

    Thread Starter A31

    (@a31)

    Thank you very much for your reply.
    You pointed me in the right direction and I managed to fix it.

    Thank you!

    Forum: Hacks
    In reply to: Conditional send_headers
    Thread Starter A31

    (@a31)

    What i have done now, is to write a unique string into the database when the user clicks view for a specific document, then redirects to the ViewPDF page, and there pull from the database the criteria.

    This does work, but seems like a long long way around just to pass a variable?

    Forum: Hacks
    In reply to: Conditional send_headers
    Thread Starter A31

    (@a31)

    Preferably it is sent from a form.

    The user selects the document he /she wishes to view, that then sends the ID of the doc and is then displayed.

    Hope that makes sense?

    Forum: Hacks
    In reply to: Conditional send_headers
    Thread Starter A31

    (@a31)

    Hi Chris,

    Your last post helped a lot and it is working! Thank You!!

    Can you perhaps help with the next phase?

    How do I pass a variable into that function from another form?

    I need to set the WHERE conditions (ID) of the document that needs to be displayed.

    Forum: Hacks
    In reply to: Nested Select Menu
    Thread Starter A31

    (@a31)

    Thnx to bcworkz for all your help!!

    Forum: Hacks
    In reply to: Nested Select Menu
    Thread Starter A31

    (@a31)

    Ok, so I KNOW this has been such a long struggle for me, I finally got something right!!

    I am posting it here so that HOPEFULLY the next person won’t have to struggle so much as what I did.

    Please note that this is a VERY minimalistic approach, nothing has been properly escaped / validated or is secure.

    It really is only to demonstrate how I managed after more than 3 months to get AJAX working:

    Let’s start with the main plugin file:

    <?php
    /*
    Plugin Name: AJAX Multiple Selectbox
    Plugin URI: https://www.tigita.co.za/
    Description: AJAX Multiple Selectbox
    Author: Adrian Beyers
    Version: 1.0
    Author URI: https://www.tigita.co.za/
    */
    
    /***************************
    * GLOBAL VARIABLES
    ***************************/
    
    if (!isset($wpdb)) $wpdb = $GLOBALS['wpdb'];
    global $wpdb;
    
    /***************************
    * SCRIPTS
    ***************************/
    
    function ASB_load_scripts()
    {	
    
    	//Include Javascript library
    	wp_enqueue_script("jquery");
    	wp_enqueue_script("sack");
    
    	wp_enqueue_script('ASB_jQuery', plugins_url( '/js/myScripts.js' , __FILE__ ) , array( 'jquery' ));
    
    	// including ajax script in the plugin Myajax.ajaxurl
    	wp_localize_script( 'ASB_jQuery', 'MyAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php')));
    }
    add_action('wp_enqueue_scripts', 'ASB_load_scripts');
    add_action( 'admin_enqueue_scripts', 'ASB_load_scripts');
    
    /***************************
    * INCLUDES
    ***************************/
    
    include ('inc/setup_addPages.php');
    include ('inc/setup_shortcodes.php');
    include ("inc/setup_addFunctions.php");
    
    /***************************
    * REGISTER PAGES
    ***************************/
    
    register_activation_hook(__FILE__,'ASB_Func_addPage');
    register_deactivation_hook(__FILE__,'ASB_Func_removePage');

    Next the setup_addFunctions.php:

    <?php
    
    //*******************************************************************************************************************************************
    	function form_SelectBoxExample()
    	{
    		echo 	'
    					<form id="AddNewSubject_Form" onsubmit="return false;">
    
    						<p>
    							<label>Select Option 1: </label>
    							<select class="" name="sel_Option1" id="sel_Option1" required="required">
    								<option value="">Please Select... </option>
    								<option value="Ford">Ford</option>
    								<option value="Mercedes">Mercedes</option>
    							</select>
    						</p>
    						<p>
    							<label>Select Option 2: </label>
    							<select class="" name="sel_Option2" id="sel_Option2" required="required">
    								<option value="">Please Select... </option>
    							</select>
    						</p>
    					</form>
    				';
    	}
    	add_action('SelectBoxExample_Form', 'form_SelectBoxExample');
    
    //*******************************************************************************************************************************************
    
    //*******************************************************************************************************************************************
    
    	function ASB_func_GetOption2()
    	{
    		global $wpdb;
    
    		if (isset($_POST['SelectedOption1']))
    		{
    			$Option1 = $_POST['SelectedOption1'];
    
    			$SQL_Query = 	("SELECT Option2 FROM customOptions_tbl WHERE Option1 = '" . $Option1 . "'");
    			$SQL_Result = $wpdb->get_results($SQL_Query);
    
    			foreach($SQL_Result as $mySQL_Result)
    			{
    				$Option2 = $mySQL_Result->Option2;
    				echo '<option value=' . $Option2 . '>' . $Option2 . '</option>';
    			}
    
    		}
    
    		die();
    		return true;
    	}
    	add_action('wp_ajax_ASB_func_GetOption2', 'ASB_func_GetOption2');
    	add_action('wp_ajax_nopriv_ASB_func_GetOption2', 'ASB_func_GetOption2');
    
    //*******************************************************************************************************************************************
    ?>

    Now the myScript.js:

    // JavaScript Document
    
    jQuery(document).ready(function ($)
    {
    	jQuery('#sel_Option1').change(function()
    	{
    		var SelectedOption1 = jQuery("#sel_Option1").val();
    
    		jQuery.ajax(
    		{
    			type: 'POST',
    			url: MyAjax.ajaxurl,
    			data: 	{
    						"action": "ASB_func_GetOption2",
    						"SelectedOption1": SelectedOption1
    					},
    			success: function(data)
    			{
    				jQuery('#sel_Option2').html(data);
    			}
    		});
    	});
    });

    setup_shortcodes.php:

    <?php
    
    	global $wpdb;
    
    	/***************************
    	* SETUP FRONT-END SHORTCODES
    	***************************/
    
    	add_shortcode("ASB_MultiSelect","ASB_MultiSelect_Shortcode");
    
    	function ASB_MultiSelect_Shortcode($atts)
    	{
    		  include ('MultiSelect.php');
    	}
    
    ?>

    And lastly MultiSelect.php:

    <?php
    
    	do_action('SelectBoxExample_Form');

    I REALLY hope that this helps someone else!

    Forum: Hacks
    In reply to: Nested Select Menu
    Thread Starter A31

    (@a31)

    I have managed to trace one error in the jQuery code:

    success: function(data) {
               //data = JSON.parse(xhr.responseText); //WRONG CODE
    	   $("#responsecontainer").html(data); // RIGHT CODE

    so now that error is sorted, but I get the following:

    Fatal error: Call to undefined function wp_get_current_user() in C:\xampp\htdocs\WPTest\wp-content\plugins\NewAjaxTry\inc\MyData.php on line 11

    I presume this is the part that you are referring to that I have not yet linked / hooked / enqueued the needed files.

    But I still have no idea where I am missing that…

    Any advice?

    Forum: Hacks
    In reply to: Nested Select Menu
    Thread Starter A31

    (@a31)

    I have installed Firebug to help me troubleshoot, and the error I get is:

    SyntaxError: JSON.parse: unexpected character

    data = JSON.parse(xhr.responseText);

    Does that help?

    Forum: Hacks
    In reply to: Nested Select Menu
    Thread Starter A31

    (@a31)

    Hi there,

    Thank you very much for your feedback. I have a couple of questions on what you mentioned though.
    You mention that my AJAX request is not being sent to the URL using the localized variable, is this not what you are referring to:

    wp_localize_script('custom-script1', 'custom-script_vars1', array('ajaxurl' =>  admin_url('admin-ajax.php')));

    then you also mention that you do not see any handler function hooked, I thought that my AT_load_scripts() function with
    add_action(‘wp_enqueue_scripts’, ‘AT_load_scripts’); was actually that, if not, can you please explain?

    Thank you very much for helping me figure this out.

    Kind Regards

Viewing 15 replies - 1 through 15 (of 29 total)