Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter shyfrog

    (@shyfrog)

    Hello,

    I am using the Elementor loop item within their theme builder. There are no options to allow PHP from within the theme builder. I’m beginning to think the only way is by adding a function that targets the loop item and inserts it.

    I’m not certain how to go about that.

    Thread Starter shyfrog

    (@shyfrog)

    I see that… but what is the code I need to insert after “url=” that pulls each URL for the articles automatically?

    Thread Starter shyfrog

    (@shyfrog)

    Thread Starter shyfrog

    (@shyfrog)

    Thread Starter shyfrog

    (@shyfrog)

    There are no errors to fix.
    The pages are just not indexed any more.
    They were indexed before October 15. Then suddenly, not indexed.
    Also, Google has disallowed indexing requests.

    shyfrog

    (@shyfrog)

    Curious, do I need to start a separate ticket for this since it is not Yoast related for our site?

    shyfrog

    (@shyfrog)

    We’re not using Yoast at all.
    We are using WPSSO.

    shyfrog

    (@shyfrog)

    I am having the same issue.
    On October 15, we had 3,298 indexed AMP pages.
    An update came out for AMP for WP on that date and since then we’ve watched outr index go down…
    2,703 on Oct 16
    1,822 on Oct 18
    etc…
    Today we are at 306 indexed AMP pages.

    Help!

    -nods-
    It works for us since the pub is the host of all the shows. It’s just an extra step when creating the event.

    I just wish it would sync all the events afterward instead of having to copy and paste the event ID’s over and over for each individual event sync. C’est la vie…

    Maybe FB will…nevermind. lol

    When I create an event as “Harlow’s Pub” and then try to sync, it throws the error mentioned above.

    However, if I choose “going” (instead of “interested” or “not going”) to the event, while I’m acting as Harlow’s Pub in the event page, it allows the event to sync.

    At this point, I can get one event at a time synced using “Import Single Event” with the event ID.

    However, I have to make sure that the event sponsor/page is “going” to the event, else it throws an error like this:

    Graph returned an error: Unsupported get request. Object with ID ‘322813248311560’ does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api

    I cannot ever get it to sync all events at once – i.e.[Update].
    It times out and then the app gets rate limited by Facebook. Fun times.

    • This reply was modified 5 years, 11 months ago by shyfrog.

    I absolutely love this plugin. Such a shame the FB breaks it so soon after it starts working again. I can’t imagine the frustration it causes a developer. Any chance of looking at this again to see what’s up?

    Thread Starter shyfrog

    (@shyfrog)

    Alright, this forum is dead. But in case someone sees this, I’ve made some progress.
    Once again, I am not a coder…and I’m flying by the seat of my pants.

    I’ve modified the code some more and now have the months in ASC order, but the days within the months are DESC (??)

    Code below

    define('DMS3_FBEVENTS_DOMAIN', 'dms3-fb-events');
    load_plugin_textdomain(DMS3_FBEVENTS_DOMAIN, false, basename(dirname(__FILE__)) . '/languages');
    
    /*function dms3_format($yyyy_mm_ddT) {
     *   $y = substr($yyyy_mm_ddT, 0, 4);
     *   $m = substr($yyyy_mm_ddT, 5, 2);
     *   $d = substr($yyyy_mm_ddT, 8, 2);
     *   if ('' == $m | '' == $d | '' == $y):
     *       return '';
     *   else:
     *       return $m . '-' . $d . '-' . $y;
     *   endif;
    }*/
    
    function dms3_format($yyyy_mm_ddT) {
    	$t=substr($yyyy_mm_ddT,11,5); // get the time value only
    	$d=substr($yyyy_mm_ddT,0,10); //get date separately from the time
    	$d=date("l, F j, Y", strtotime($d)); //format date output
    	$t12  = date("g:i a", strtotime($t)); //convert from 24 to 12 hour time
    	return $d." - ".$t12;
    }
    
    function dms3_time_format($yyyy_mm_ddThh_mm) {
        $h = substr($yyyy_mm_ddThh_mm, 11, 2);
        $m = substr($yyyy_mm_ddThh_mm, 14, 2);
        if ('' == $h || '' == $m):
            return '';
        else:
            return $h . ':' . $m;
        endif;
    }
    
    // limit of selected elements
    $dms3_limit = 15;
    // make sure this api file is in your directory, if not get it here https://github.com/facebook/php-sdk/tree/master/src
    if (!class_exists('Facebook')):
        require 'facebook.php';
    endif;
    
    // [fb_event_list appid="" pageid="" appsecret="" locale=""]
    function fb_event_list($atts) {
        global $dms3_limit;
    
        $time_offset = get_option('gmt_offset');
    
        ob_start();
    
        try {
            extract(shortcode_atts(array(
                'appid' => '',
                'pageid' => '',
                'appsecret' => '',
                'fbLocale' => 'America/New_York',
                'limit' => $dms3_limit,
                'order' => 'ASC'
                            ), $atts));
    
            $fqlResult = wp_cache_get('fb_event_list_result', 'fb_event_list');
            if (false == $fqlResult) {
    //          Authenticate
                $facebook = new Facebook(array(
                    'appId' => $appid,
                    'secret' => $appsecret,
                    'cookie' => true, // enable optional cookie support
                ));
    //          query the events
    //          we will select name, pic, start_time, end_time, location, description this time
    //          but there are other data that you can get on the event table
    //          as you've noticed, we have TWO select statement here
    //          since we can't just do "WHERE creator = your_fan_page_id".
    //          only eid is indexable in the event table, sow we have to retrieve
    //          list of events by eids
    //          and this was achieved by selecting all eid from
    //          event_member table where the uid is the id of your fanpage.
    //          *yes, you fanpage automatically becomes an event_member
    //          once it creates an event
                $fql = "SELECT name, pic, start_time, end_time, location, description, eid
                        FROM event WHERE eid IN ( SELECT eid FROM event_member WHERE uid = " . $pageid . " AND start_time > 0 )
                        ORDER BY start_time ASC";
                $param = array(
                    'method' => 'fql.query',
                    'query' => $fql,
                    'callback' => ''
                );
    
                $fqlResult = $facebook->api($param);
    
                wp_cache_set('fb_event_list_result', $fqlResult, 'fb_event_list', 300);
            }
    //      table heading
            echo '<table class="dms3_fb_events">';
            $now = date('c', time() + $time_offset * 60 * 60);
                usort($fqlResult, create_function('$a,$b', "return strnatcmp(\$b['start'], \$a['start']);"));
    //      looping through retrieved data
            foreach ($fqlResult as $keys => $values) {
                $start = $values['start_time'];
                $start_date = dms3_format($start);
                $start_time = dms3_time_format($start);
                $end = $values['end_time'];
                $end_date = dms3_format($end);
                $end_time = dms3_time_format($end);
                $classes = "";
                if ($start < $now)
                    if ($now < $end) /* ongoing */
                        $classes = 'dms3-fb-ongoing-event';
                    else
                        $classes = 'dms3-fb-past-event';
                else
                    $classes = 'dms3-fb-upcoming-event';
                if ($classes != "")
                    $classes = ' class="' . $classes . '" ';
                //printing the data
                echo '<tr' . $classes . '>';
                echo '<td class="dms3_fb_events_content">';
                echo "<div class='dms3_fb_events_title'>" . $start_date . "<br />" . $values['name'] . "</div>";
                echo "<img src={$values['pic']} class='dms3_fb_events_image' />";
                echo "<span class='dms3_fb_events_description'>" . $values['description'] . "</span>";
                echo "<span style='float: right;'><a href='https://www.facebook.com/event.php?eid={$values['eid']}' target='_blank'>" . __('view facebook event', DMS3_FBEVENTS_DOMAIN) . '</a></span>';
                echo '</td>';
                echo '</tr>';
            }
            echo "</table>";
        } catch (Exception $e) {
            echo 'Caught exception: ', $e->getMessage(), "\n";
        }
    
        $htmlOutput = ob_get_clean();
        return $htmlOutput;
    }
    
    add_shortcode('fb_event_list', 'fb_event_list');
    // end fb_event_list shortcode
    ?>
    Thread Starter shyfrog

    (@shyfrog)

    Awesome! Looking forward to that ??

Viewing 14 replies - 1 through 14 (of 14 total)