vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Integration with vBulletin - Pinterest Sharing System by BOP5 for VB 3.8 & VB 4.x! (Pinterest Pin Button Mod) (https://vborg.vbsupport.ru/showthread.php?t=281444)

Sunka 06-03-2012 02:38 AM

Thanks BOP5, but no, it is not working totally OK.
Before you click on Like/thanks button, Pinterest icon with number shows in post. When i put mouse pointer, it shows that link is javascript:void(0) and on click popup shows like it should be.

After click on thanks/like button, post refresh and Pinterest icon is change to icon without number. Click on icon open new tab, and when you put mouse pointer, I see that now is not javascript like before, but link:
Code:

http://pinterest.com/pin/create/button/?url=http//:www.pijanitvor.com/showthread.php...

BirdOPrey5 06-03-2012 11:25 AM

Yeah, I was afraid of that... The Ajax call dbech's mod is using loads the new post, but the javascript of the showthread page was already loaded. I added the javascript code to showpost (it works fine in showpost on VB 3.8) but since it's not using the showpost as the full page the javascript isn't being loaded again.

I'm afraid I don't know how I could change this mod any further to force the javascript to reload on the AJAX call by the dbtech mod. It seems like something that would need to be initiated by their mod.

Have you tried using a different location for the Pin button? It seems very weird the whole post needs to reload on a "Like."

Sunka 06-03-2012 07:43 PM

I tried all possible options in ACP, but result is same.
Maybe solution is to move pinterest icon in post track (where is Like button here on vBorg)?

DragonByte Tech 06-03-2012 08:03 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2336092)
Yeah, I was afraid of that... The Ajax call dbech's mod is using loads the new post, but the javascript of the showthread page was already loaded. I added the javascript code to showpost (it works fine in showpost on VB 3.8) but since it's not using the showpost as the full page the javascript isn't being loaded again.

I'm afraid I don't know how I could change this mod any further to force the javascript to reload on the AJAX call by the dbtech mod. It seems like something that would need to be initiated by their mod.

Have you tried using a different location for the Pin button? It seems very weird the whole post needs to reload on a "Like."

The reason why the whole post reloads is the fact that the whole - or part of - the post can be hidden, as well as attachments.

It ended up being too much grief to try to manually re-insert those elements into the post on button click, when the showpost.php could do it all with less hassle.

I don't know what JS code you want to load, but if you're using jQuery and its .live() or .on() functions, it works when new elements are inserted into the DOM.


Fillip

BirdOPrey5 06-04-2012 12:38 PM

Thanks for the explanation Fillip.

I'm not using jquery or anything really- the Pinterest Pin button requires a block of javascript code to run to turn their static image into their button with counter. This code must run after all the static images have loaded.

I'm not even sure running it a second time will work but I hope it would.

The Pinterest JavaScript that needs to be called is this:

Code:

<script type="text/javascript">
(function() {
    window.PinIt = window.PinIt || { loaded:false };
    if (window.PinIt.loaded) return;
    window.PinIt.loaded = true;
    function async_load(){
        var s = document.createElement("script");
        s.type = "text/javascript";
        s.async = true;
        s.src = "http://assets.pinterest.com/js/pinit.js";
        var x = document.getElementsByTagName("script")[0];
        x.parentNode.insertBefore(s, x);

    }
    if (window.attachEvent)
        window.attachEvent("onload", async_load);
    else
        window.addEventListener("load", async_load, false);

})();
</script>


DragonByte Tech 06-04-2012 03:54 PM

In that case I don't know if these mods will work together period D:

Does your mod work if someone uses Quick Edit on a post? I think that also refreshes the post.

What about if someone expands a deleted post?

Fillip

BirdOPrey5 06-05-2012 04:52 PM

No it doesn't work after a quick edit, it needs to be reloaded... Hmmm.

Wakey 06-23-2012 10:40 PM

When I click the pintrest button I get the popup to post it but when I click Pin It it just reloads the popup with a black image and no description. Nothing gets posted to my pintrest account Where as on the test sites it tells you it was successful and offers you the chance to tweet it.

Any idea whats wrong?

BirdOPrey5 06-24-2012 03:06 PM

Not off hand, link to a thread?

Wakey 06-24-2012 10:05 PM

Does it on all of them but here's one

http://forum.rcflightline.com/showth...?p=859#post859


All times are GMT. The time now is 01:56 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01218 seconds
  • Memory Usage 1,741KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete