Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter etiennesky

    (@etiennesky)

    I found the problem is related to my theme (sparkling) which stupidly hides all submit buttons…

    #submit,
    .tagcloud,
    .comment-reply-link,
    .widget_rss ul,
    /* button[type=submit], */
    .postform,
    table#wp-calendar {
    display: none;
    }

    Thread Starter etiennesky

    (@etiennesky)

    Here is the complete patch (there was the admin stuff missing)

    --- wonderm00ns-simple-facebook-open-graph-tags/includes/settings-page.php	2013-11-27 16:34:14.000000000 +0100
    +++ plugins/wonderm00ns-simple-facebook-open-graph-tags/includes/settings-page.php	2013-12-22 19:21:30.979843357 +0100
    @@ -19,6 +19,7 @@
     			$usersettings['fb_app_id']= 						trim(wonderm00n_open_graph_post('fb_app_id'));
     			$usersettings['fb_admin_id_show']= 					intval(wonderm00n_open_graph_post('fb_admin_id_show'));
     			$usersettings['fb_admin_id']= 						trim(wonderm00n_open_graph_post('fb_admin_id'));
    +			$usersettings['fb_jssdk_show']= 					intval(wonderm00n_open_graph_post('fb_jssdk_show'));
     			$usersettings['fb_locale_show']= 					intval(wonderm00n_open_graph_post('fb_locale_show'));
     			$usersettings['fb_locale']= 						trim(wonderm00n_open_graph_post('fb_locale'));
     			$usersettings['fb_sitename_show']= 					intval(wonderm00n_open_graph_post('fb_sitename_show'));
    @@ -51,7 +52,6 @@
     			update_option('webdados_fb_open_graph_settings', $usersettings);
     		}
     	}
    -
     	//Load the settings
     	extract(wonderm00n_open_graph_load_settings());
    
    @@ -104,6 +104,15 @@
     									</td>
     								</tr>
     								<tr>
    +									<td colspan="2"><hr/></td>
    +								</tr>
    +								<tr>
    +									<th scope="row" nowrap="nowrap"><?php _e('Include Facebook JavaScript SDK?', 'wd-fb-og');?></th>
    +									<td>
    +										<input type="checkbox" name="fb_jssdk_show" id="fb_jssdk_show" value="1" <?php echo (intval($fb_jssdk_show)==1 ? ' checked="checked"' : ''); ?>/>
    +									</td>
    +								</tr>
    +								<tr>
     									<td colspan="2"><hr/></td>
     								</tr>
     								<tr>
    Only in plugins/wonderm00ns-simple-facebook-open-graph-tags/includes: settings-page.php~
    diff -ru wonderm00ns-simple-facebook-open-graph-tags/wonderm00n-open-graph.php plugins/wonderm00ns-simple-facebook-open-graph-tags/wonderm00n-open-graph.php
    --- wonderm00ns-simple-facebook-open-graph-tags/wonderm00n-open-graph.php	2013-11-27 16:34:14.000000000 +0100
    +++ plugins/wonderm00ns-simple-facebook-open-graph-tags/wonderm00n-open-graph.php	2013-12-22 19:23:58.756287265 +0100
    @@ -22,6 +22,7 @@
     		'fb_app_id',
     		'fb_admin_id_show',
     		'fb_admin_id',
    +		'fb_jssdk_show',
     		'fb_locale_show',
     		'fb_locale',
     		'fb_sitename_show',
    @@ -180,6 +181,8 @@
     		$fb_title=esc_attr(strip_tags(stripslashes(get_bloginfo('name'))));
     		//$fb_url=get_option('home').(intval($fb_url_add_trailing)==1 ? '/' : ''); //2013-11-4 changed from 'siteurl' to 'home'
     		$fb_url=((!empty($s['HTTPS']) && $s['HTTPS'] == 'on') ? 'https://' : 'https://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];  //Not really canonical but will work for now
    +		//$fb_url = $_SERVER["SCRIPT_URI"];
    +		//if($_SERVER["QUERY_STRING"]!="") $fb_url .= "?" . $_SERVER["QUERY_STRING"];
    
     		switch(trim($fb_desc_homepage)) {
     			case 'custom':
    @@ -315,13 +318,34 @@
     	if(intval($fb_image_show)==1 && trim($fb_image)!='') $html.='<meta property="og:image" content="'.trim(esc_attr($fb_image)).'" />
     ';
     	if(intval($fb_image_show_schema)==1 && trim($fb_image)!='') $html.='<meta itemprop="image" content="'.trim(esc_attr($fb_image)).'" />
    +';
    +	if(intval($fb_jssdk_show)==1) {
    +		$tmp_app_id = (trim($fb_app_id)!='') ? '&appId='.trim($fb_app_id) : '';
    +		$tmp_locale = trim(trim($fb_locale)!='' ? trim($fb_locale) : trim(get_locale()));
    +		$html.='<script type="text/javascript">
    +(function(d, s, id) {
    +  var js, fjs = d.getElementsByTagName(s)[0];
    +  if (d.getElementById(id)) return;
    +  js = d.createElement(s); js.id = id;
    +  js.src = "//connect.facebook.net/' . $tmp_locale . '/all.js#xfbml=1' . $tmp_app_id . '";
    +  fjs.parentNode.insertBefore(js, fjs);
    +}(document, "script", "facebook-jssdk"));
    +</script>
     ';
    +	}
    +
     	$html.='<!-- END - Facebook Open Graph Meta Tags for WordPress -->
     ';
     	echo $html;
     }
     add_action('wp_head', 'wonderm00n_open_graph', 9999);
    
    +function wonderm00n_open_graph_add_fb_root( $content ) {
    +	return "<div id='fb-root'></div>" . $content;
    +}
    +if(intval($webdados_fb_open_graph_settings['fb_jssdk_show'])==1)
    +	add_filter ('the_content', 'wonderm00n_open_graph_add_fb_root');
    +
     function wonderm00n_open_graph_add_opengraph_namespace( $output ) {
     	if (stristr($output,'xmlns:og')) {
     		//Already there
    Thread Starter etiennesky

    (@etiennesky)

    Well it “works for me” (tested on firefox and chrome), have you tried it?

    I guess there is a difference between it “should” and it “must”.

    Also the Facebook Comments plugin adds it to the footer like this, and it works fine:

    add_action(‘wp_footer’, ‘fbmlsetup’, 100);

    Here are a few possible solutions to “properly” insert the fb-root div but they are not the best solution, easier to do it as I suggest.

    1) add it in a template (requires each template to be modified)

    2) add it using jquery, I read somewhere that this should work:
    jQuery(document).ready( function($) {
    $(‘body’).prepend(‘<h1>Hello world</h1>’);
    } );
    However, this might cause some page load delays or weird display changes.

    Thread Starter etiennesky

    (@etiennesky)

    Actually, I had a peek at the HTTP API and it doesn’t look so bad, so I went ahead and implemented it.

    Please update from the github repos and try to configure the plugin again, and come back with results. Then tell me which of the issues still apply!

    Thread Starter etiennesky

    (@etiennesky)

    Hi Gwyneth,

    nice to see some people are interested in this plugin. First let me say I do not have time currently to work on this, I am finishing my PhD…

    Also, I basically fixed and enhanced the plugin, so that is why the configuration dialog is mostly the same.

    I am not sure how to fix the curl problem… can you try and change the config so that the other http method works? It’s a little tricky to setup. From the code I read that if the HTTP_Request2 PEAR package is installed, and not curl, then the former is used.

    I didn’t change much in the HTTP code, and I have never read about the WordPress HTTP library – is it this one here https://codex.www.ads-software.com/HTTP_API ?

    If you can get this fixed let me know, I can apply the patch to the github repos.

    Once the rest api is configured properly most problems you mention should be fixed.

    Yes it would be nice fif Florian added me as a co-dev but I can work on github for now (when I’ll have the time).

    cheers,
    Etienne

    I did the following, using the twentytewlve theme

    Basically you call the qtrans_generateLanguageSelectCode() function.

    //wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) );
    $html = wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu', 'echo'=>'0' ) );
    $html = preg_replace("/<\/ul>/", "<li style='float: right; margin-top:15px; margin-right: -15px' >".qtrans_generateLanguageSelectCode('image', '', true)."</li></ul>", $html, 1);
    echo $html;

    the problem seems to come from permalinks in wordpress. That’s where th 2006 is coming from (e.g. https://www.host.com/wordpress/2006/01/01/somepost)

    If you deactivate permalinks in wordpress OR urlrewrite in Gallery2 the problem goes away.

    Internally to G2, there are “request variables” which correspond to the url used. In this case they are ([g2_view] => core.ShowItem [g2_path] => 2006/01/01/somepost)
    Anyone have an idea how to fix this in WordPress, so that the permalink part of the url is removed from the request to Gallery2?

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