Forum Replies Created

Viewing 15 replies - 1 through 15 (of 112 total)
  • The fixed worked. Thank You.

    Thread Starter kokoruz

    (@kokoruz)

    Thank you for the link. Sounds like exactly what I am looking to accomplish.

    Thread Starter kokoruz

    (@kokoruz)

    Thank you for those links. I will take a look.

    Thread Starter kokoruz

    (@kokoruz)

    These are all great for tracking the activity of someone with site editing ability but what I am looking for is something that tracks the activity of a subscribed user to understand what how they interact with the front end of the site. What content are they viewing or not viewing. What links or buttons do they interact with. I know with GA I can get a generic overview of my site activity but my client wants to know specifically what their subscribers are doing on the site.

    Thread Starter kokoruz

    (@kokoruz)

    I’m sorry, that post is missing the word Analytics. It should have said “why my redirects are not showing up in Google.?Analytics”

    Thread Starter kokoruz

    (@kokoruz)

    The issue was related to is_archive(‘corporate-officer’). It had nothing to do with wpseo_breadcrumb_links.

    Once the code was updated to is_post_type_archive(‘corporate-officer’) the issue I was experiencing went away.

    Another developer shared with me that is_archive does not contain parameters.

    https://developer.www.ads-software.com/reference/functions/is_archive/

    Thread Starter kokoruz

    (@kokoruz)

    Unfortunately after following the steps outlined above, nothing has changed.

    Any other thoughts?

    Thread Starter kokoruz

    (@kokoruz)

    I appreciate your help. I did resolve the one error but the truncation is still a mystery.

    Thanks again for looking through this with me.

    Thread Starter kokoruz

    (@kokoruz)

    The quote marks resolved that issue.

    I have taken a screen grab to show the type is set to varchar(16)

    https://drive.google.com/file/d/1naAj7ckZub45yJX76yVIT5c_JRsTzz88/view?usp=sharing

    I did notice I am getting the following log warning

    mod_fcgid: stderr: WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 1 for query SELECT * FROM 4R51claX_stores WHERE store_number = made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/stockscatter/page-home.php’)

    Thank You

    Thread Starter kokoruz

    (@kokoruz)

    I did just as you outlined. In my log files I have the following

    mod_fcgid: stderr: Phone value from fgetcsv: 423-282-5106

    as well as the following. Perhaps that is the issue?

    mod_fcgid: stderr: PHP Warning: Use of undefined constant stores – assumed ‘stores’ (this will throw an Error in a future version of PHP) on line 20 ($table = $wpdb->prefix.stores;)

    Loo forward to your feedback.

    Thread Starter kokoruz

    (@kokoruz)

    I’m hoping to give this one more short with you. If what I have posted does not help to answer the question then I thank you for sticking with me for this long.

    <?php
    // Import stores to db from csv file stores.csv
    function importStores() {
        $file = fopen(__DIR__ . '/stores.csv', 'r');
    
        $ok = $exit = $fail = 0;
        $id_stored = [];
        $id_duplicated = [];
    
        while (($row = fgetcsv($file)) !== FALSE) {
            $id = $row[2]; // storeNumber
            global $wpdb;
    
            if (!isset($id_stored[$id])) {
                $id_stored[$id] = $id;
            } else {
                $id_duplicated[] = $id;
            }
    
            $table = $wpdb->prefix.stores;	
            $existed = $wpdb->get_row("SELECT <code>id</code> FROM <code>4R51claX_stores</code> WHERE <code>store_number</code> = " . $id);
    
    if (!$existed) {
    $showErrors = $wpdb->show_errors();
    		
    $data = array ('retailer' => $row[1], 'store_number' => $id, 'store_name' => $row[3], 'address' => $row[4], 'city' => $row[5], 'state' => $row[6], 'zip' => $row[7], 'm_vendor_id' => $row[8], 'lw_branch_name' => $row[9], 'lw_branch_page_link' => $row[10], 'lw_branch_street' => $row[11], 'lw_branch_city' => $row[12], 'lw_branch_state' => $row[13], 'lw_branch_zip' => $row[14], 'inside_sales_phone' => $row[15], 'inside_sales_contact' => $row[16], 'email' => $row[17], 'outside_sales_contact' => '', 'outside_sales_phone' => '', 'pcid' => $row[18]);
    
    $format = array ('%s','%d','%s','%s','%s','%s','%s','%d','%s','%s','%s','%s','%s','%s','%d','%s','%s','%s','%d');
    			
    $inserted = $wpdb->insert($table,$data,$format);
    
    if ($inserted) { echo '<p>OK Insert: ' . $id . ' - #' . $wpdb->insert_id . ' (' . ( ++$ok) . ')</p>';}
    else {echo $showErrors; echo '<p>Fail Insert: ' . $id . ' (' . ( ++$fail) . ')</p>';}
    
    } else {echo '<p>Existed Insert: ' . $id . ' (' . ( ++$exit) . ')</p>';}
    
    flush(); ob_flush();
    }
        fclose($file);
    
        echo '<p>DONE</p>';
        echo '<p>Imported: ' . count($id_stored) . '</p>';
        echo '<p>Duplicated: ' . count($id_duplicated) . '</p>';
        die;
    }
    if (isset($_GET['import_stores'])) {
        importStores();
    }
    • This reply was modified 4 years, 4 months ago by kokoruz.
    Thread Starter kokoruz

    (@kokoruz)

    this is where the csv file is read
    $file = fopen(__DIR__ . ‘/stores.csv’, ‘r’);

    The code does not actually create the table. The table was created in phpMyAdmin. This code only inserts the data.

    In phpMyAdmin the space that imports $row[15] is set to
    Name: inside_sales_phone
    Type: varchar(16)
    Collation: utf8_general_ci
    Null: Yes
    Default: NULL

    I sure hope I am answering your questions correctly. Thanks again for your response.

    Thread Starter kokoruz

    (@kokoruz)

    the code for that is below

    $wpdb->insert('4R51claX_stores', array ('inside_sales_phone' => $row[15]), array ('%s'));

    is there something else I should be doing? I appreciate the response.

    Thread Starter kokoruz

    (@kokoruz)

    If you are asking me if the CSV file is correct in terms of the data containing the full phone number it is.

    If you are asking something else please elaborate as I do very much appreciate the help solving this.

    • This reply was modified 4 years, 4 months ago by kokoruz.
    Thread Starter kokoruz

    (@kokoruz)

    I should also note that I imported the CSV file directly into the database and had no issues with the csv file but when I use the $wpdb->insert($table,$data,$format); method the phone format gets messed up. I have dashes in some of the url values with no issue but those dam phone numbers just won’t work.

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