V 4.1.10 Developer Hi, I have modified my thanks.tpl page with certain options that will direct the customer to various pages on my site once they have finished posting an ad. I have a "Share" (addtoany) button integrated on each individual ad (viewlistings2) so anyone can share the ad they see on Facebook, Twitter or whatever Social Site they are associate with. Is there a simple block of code that would allow the user to immediately Share their own ad on their Facebook etc. from the thanks.tpl? Even just Facebook would be fine if it's too big of a problem. Any direction would be helpful! Thank you! -Scott
Code: http://www.facebook.com/sharer.php?u= Then the link to their ad, I don't think that facebook requires an urlencoded link anymore. If that doesn't work, then you'll have to somehow urlencode the link first before appending the facebook link.
where to get the listing ID? Thanks Mike for the direction. I have put this in place now, but I am not entirely sure where to drag the listing URL from. I could use the same URL to post at the bottom so customers could view their own listing right after they post it. I tried Code: http://www.pickyourownpet.com/classifieds/viewlisting.php?view={$listingid} but this did not seem to work. I am messing around with a few other things, but to no avail... I do appreciate you constant help, and I hate to be a burden. But again, I thank you. -Scott
i had the same problem, the listing id number is not on the tanks.tpl so you would have to modify the php code to show it. Nick
Nick, Did you ever modify it in a way that it would work? Could you point me in the right direction? Thanks!
Howto: Facebook sharer I'm using this code: Code: <span class="facebook"> {literal} <script>function fbs_click() {u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}</script> {/literal} <a href="http://www.facebook.com/share.php" onclick="{literal}return fbs_click(){/literal}" target="_blank">Send to Facebook</a> </span> And this rock's Hope this helps you, and others. Ombre
You do realize that the code you posted would share the link to the thanks.tpl page on facebook since it is based on the current location, right? Not quite sure how this helps the poster with his issue.
You are right. Maybe he should place "share" link on the listing page, so all users can post it to facebook also .
The easiest way is perhaps to allow the user to click a link on the thanks page to their advert. Then use the share link.
That is the whole point! The poster of this thread needs the link to view the ad to begin with. The link for the viewlisting is NOT available in the thanks.tpl template. If it were than there wouldn't be an issue.
I already told him this after being emailed about it. The only way is to make modification to the core code or make a module to do it. The viewlisting url would need to be passed through from the end of the checkout process.
I figured out a way to make this happen! I used the feature_listings_horizontal plugin on the Thanks.tpl. It is as follows: Code: {css_listings_horizontal number=1 cols="1" show_price = "N" lfilter="on" truncate = "Y" truncate_end = "25" truncate_suffix = '...' type="new" align="center"} This will display their Ad they Just Posted! I put a message above it that encourages them to go to their ad and "Like" it or share it with their friends on Facebook! Thanks for all your help! I hope this will help someone in the future! -Scott
Nice Idea! I like that type of hack (well not a hack really) using templatecodes. Its such a good little thing to do, I am going to use it myself on all my sites and perhaps make it part of the products.