WordPress.org

Ready to get started?Download WordPress

Forums

Simple Share Buttons Adder
[resolved] Use pop Up instead of blank page (27 posts)

  1. shyne23
    Member
    Posted 11 months ago #

    Hello,

    is it possible to use a Pop up instead of a blank or the same page.

    http://wordpress.org/plugins/simple-share-buttons-adder/

  2. siskoto
    Member
    Posted 10 months ago #

    Hello,

    I would like to add the same question. It is quite inconvenient to have the social networks open in a new window because people will most probably never come back to the site. It would be great if you provide us with the required code.

    Thanks!

    P.S. Awesome plugin!

  3. shyne23
    Member
    Posted 10 months ago #

    Hello i found a solution. maybe you will implement it in the plugin.

    i will give an example for facebook. so anybody cann use this to create pop up's for the other share buttons.

    1: go to plugins/editor
    2: choose Simple Share buttons Adder
    3: select simple-share-buttons-adder.php
    4: search for facebook.com till you find this code

    $htmlShareButtons .= '<a id="ssba_facebook_share" href="http://www.facebook.com/sharer.php?u=' . $urlCurrentPage . '" ' . //($arrSettings['ssba_share_new_window'] == 'Y' ? 'target="_blank"' : NULL) . '>';

    5: replace it with the folowing code

    $htmlShareButtons .= '<a id="ssba_facebook_share" href=\'javascript:PopUp("http://www.facebook.com/sharer.php?u=' . $urlCurrentPage . '")\'>';

    6: enjoy!

  4. siskoto
    Member
    Posted 10 months ago #

    Hey shyne23,

    thank you for your feedback! I added the code as you said but it didn't work. I have no idea about php so I might be missing something.

    Thanks!

  5. shyne23
    Member
    Posted 10 months ago #

    Hey Siskoto,

    sorry i miss one point.

    you have to add the following code to your header.php (before head)

    <script language="JavaScript">
    <!--
    function PopUp(URL) {
    window.open(URL, 'Windowname', 'width=450, height=300, toolbar=0, scrollbars=1 ,location=0 ,statusbar=0,menubar=0, resizable=0');
    }
    //-->
    </script>

  6. siskoto
    Member
    Posted 10 months ago #

    Awesome! You made my life so much better! Thanks!
    Is there anything special in the pinterest share link?

  7. shyne23
    Member
    Posted 10 months ago #

    Hey,

    Pinterest already use a iframe. It looks like a new page, but its a Javascrip, you can select the image to pin. After selecting a picture anoter popup will appear and the other window will dissapear.

  8. shyne23
    Member
    Posted 10 months ago #

    I look for a solution. Maybe you like this one more!

    $htmlShareButtons .= '<a id="ssba_pinterest_share" href=\'javascript:PopUp("http://pinterest.com/pin/create/button/?url='. $urlCurrentPage . '&media='.wp_get_attachment_url(get_post_thumbnail_id()).'&description='.get_the_title().'")\'>';

    with this code you can only post one fixed picture.

    Enjoy!

  9. siskoto
    Member
    Posted 10 months ago #

    Well, this one did not actually work. I will stick with the standard option given in the plugin. Thanks again for all your help!

  10. shyne23
    Member
    Posted 10 months ago #

    Did you replace the original code with the new one ?

  11. siskoto
    Member
    Posted 10 months ago #

    yes, I did but it opened the pinterest sharing page and nothing in it. You can see it here:

    http://all1studio.com/newsite/projects/bikeshelf/

  12. shyne23
    Member
    Posted 10 months ago #

    Okay, you didnt get the attachment_url. Please look if there ist a wp_get_attachment_url function in your post.php

  13. siskoto
    Member
    Posted 10 months ago #

    I don't have post.php file but page.php and here is the code:

    <?php get_header(); ?>
    
    		<?php get_template_part( 'element', 'getslider' ); ?>
    
    		<?php get_template_part( 'element', 'pagecaption' ); ?>
    
    			<!-- THE POST LOOP -->
    			<?php while ( have_posts() ) : the_post(); ?>	
    
    				<?php if(get_custom_field('hide_title') == 'Yes') : else : ?>
    				<h2 class="title"><span><?php the_title(); ?></span></h2>
    				<hr />
    				<?php endif; ?>
    
    				<!-- FEATURED IMAGE (optional) -->
    				<?php if(get_option_tree('show_featured_image') == 'Yes') : ?>
    						<?php if (has_post_thumbnail( $post->ID )) 	{
    						$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); ?>
    						<a class="featured-image-insert" href="<?php echo $image[0]; ?>" data-rel="prettyPhoto">
    							<img class="aligncenter" src="<?php echo $image[0]; ?>" alt="<?php the_title(); ?>" />
    						</a>
    					<br class="clearfix" />
    					<?php } else {} ?>
    				<?php endif; ?>
    
    				<?php the_content(); ?>
    
    				<br class="clearfix" />
    				<!--<hr />-->
    
    				<?php wp_link_pages('before=<br /><div id="page-links"><span>Pages:</span>&after=</div><hr />&link_before=<div>&link_after=</div>'); ?>
    
    			<?php endwhile; ?>			
    
    <?php get_footer(); ?>
  14. WPyogi
    Volunteer Moderator
    Posted 10 months ago #

  15. siskoto
    Member
    Posted 10 months ago #

    @WPyogi

    sorry about that

  16. shyne23
    Member
    Posted 10 months ago #

    I found the problem. My code doesn't work with the nextgen gallery because it looks for attached images of a post. i am sorry but you have to use the default function of the ssba plugin.

    regards

  17. siskoto
    Member
    Posted 10 months ago #

    Ok, thanks for trying though and for all the time you spent on my problem!

    Kind regards

  18. Nannica
    Member
    Posted 3 months ago #

    if anyone (like me) don't like to mess with the core in a plugin, add som javascript to fix this:

    $('a').each(function() {
    	var href = $(this).attr('href');
    	$(this).removeAttr('target');
    	$(this).attr("href", "javascript:PopUp('" + href +"')");
    });

    This rewrite the link but if the user doesn't have javascript it still works and doesn't make any rewrites.

    Place the code that shyne23 posted in the head. All done!

  19. wakki
    Member
    Posted 2 months ago #

    Hi shyne23
    This is really great! Works like a charm!

    Nannica, I'm curious, where should your code be placed? I tried some things but failed.

  20. David Neal
    Member
    Plugin Author

    Posted 2 months ago #

    Hi all,

    Funnily enough a popup window is now default behaviour for Simple Share Buttons Plus . Upon clicking a share button it also saves the details so that you can track all sharing activity in your dashboard.

    Not that I'm trying to sell it but it also uses a retina-ready CSS sprite and has hover effects too! ;)

    Thanks,

    David

  21. buffer808
    Member
    Posted 2 months ago #

    $('.ssba a').each(function(){
            return $(this).attr('target','').on('click',function(e){
                e.preventDefault();
                window.open($(this).attr('href'), $(this).attr('alt'), 'width=450, height=300, toolbar=0, scrollbars=1 ,location=0');
            })
        });

    no need to edit the core, try this one.

  22. jrotem
    Member
    Posted 2 months ago #

    Hello David,

    Very nice plugin, thank you. I just purchased Plus but the pop-up window only works on twitter; on all others the popup appears within a page -- a blank page but not target=_blank, if you know what I mean. ;)

    Also, cancelling/closing those pop-ups takes a really long time. You can see this in action on http://rotemstudio.com/ten-basic-layout-tips-for-non-designers/

    Thank you for any assistance. :)

  23. jrotem
    Member
    Posted 2 months ago #

    I stand corrected -- popups not working for twitter either. I disabled adBlocker to see if that was the issue but no change.

  24. jrotem
    Member
    Posted 2 months ago #

    One more question -- i do not want the text to appear within the buttons but is there a way to have them appear with hover?

  25. David Neal
    Member
    Plugin Author

    Posted 2 months ago #

    Hey,

    Great to hear you're trying Simple Share Buttons Plus!

    May I please ask that you open a ticket here http://sharebuttons.ticksy.com

    I've had a try and the popups are working no problems for me. Could you please provide the details given when you visit http://www.supportdetails.com in your ticket.

    Thanks,

    David

  26. realfoodyear
    Member
    Posted 2 months ago #

    Shyne23, can I ask what you mean by "add the following code to your header.php (before head)"? Do you mean Admin/Advanced, the HTML insertion tab?

  27. David Neal
    Member
    Plugin Author

    Posted 2 months ago #

    I wouldn't recommend editing your theme's header.php, it shall only be overwritten sometime by an update of your theme. http://www.simplesharebuttons.com/plus/ has the feature now, something I may well add to the free version if I get the time.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.