简体   繁体   English

AddThis需要共享由js生成的自定义URL

[英]AddThis need to share custom url generated by js

I need the facebook/twitter/email buttons to share the page with the photo loaded. 我需要使用facebook / twitter / email按钮与加载的照片共享页面。 The script for the photo form was written years ago by a colleague that has left and I have concluded that it is something I am not able to customize myself. 照片表格的脚本是几年前由一位离开的同事编写的,我得出的结论是我无法自定义此内容。 I have included as much info as I could think of. 我已经包含了尽可能多的信息。 Thanks! 谢谢!

EDIT: I can provide wp login details for anyone that would like to take a stab at this for me. 编辑:我可以为任何想为此刺死的人提供wp登录详细信息。 Very much appreciated! 非常感谢!

  1. Go to this page: etncal.staging.wpengine.com/community-event-photos/ 转到此页面:etncal.staging.wpengine.com/community-event-photos/
  2. Enter ID# 09070073, click Get Photo button 输入ID#09070073,单击获取照片按钮
  3. New page loads and the url will read: etncal.staging.wpengine.com/download-your-community-event-photos/?photo=090700731381779074495 加载新页面,URL将显示为:etncal.staging.wpengine.com/download-your-community-event-photos/?photo=090700731381779074495
  4. A parameter has been passed to url and the photo code entered is the first 8 digits 参数已传递到url,输入的照片代码为前8位数字
  5. Share this buttons are linking to the page url without parameter - so the blank page without the image loaded is being shared. 共享此按钮链接到不带参数的页面网址-因此,共享没有加载图像的空白页面。 Need to share page with unique url & photo. 需要使用唯一的网址和照片共享页面。

Community Event Photo form uses two pages: 社区事件照片表单使用两页:

1] Page with form: etncal.staging.wpengine.com/community-event-photos/ 1]页面,格式为:etncal.staging.wpengine.com/community-event-photos/

Code added to body of this page: 添加到此页面正文的代码:

[js]varUnique=new Date().getTime() //will always be unique
function CheckForm() {
var photoID = document.photoForm.photoID.value;
var numericExpression = /^[0-9]+$/;
var eightdigit = /^\d{8}$/;
if(photoID.match(eightdigit)) {
var urlID = (photoID.concat(varUnique));
var newURL = 'http://etncal.staging.wpengine.com/download-your-community-event-photos/?photo=';
location.href=(newURL.concat(urlID));
return false;
} else {
alert('Please enter the eight digit number for your photo ID.');
return false;
}
}[/js]

2] Page that loads image: etncal.staging.wpengine.com/download-your-community-event-photos/ 2]加载图像的页面:etncal.staging.wpengine.com/download-your-community-event-photos/

Code added to body of this page: 添加到此页面正文的代码:

<div class="clear-mg"></div>
<div class="photo">[js]
displayPhoto();
[/js]</div>

Link to the following js file is included in header of same wordpress page (click on 2nd button to right of Add Media, using a plugin to add): etncal.staging.wpengine.com/wp-content/themes/canvas_child/js/photos.js 同一wordpress页面的标题中包含指向以下js文件的链接(单击“添加媒体”右侧的第二个按钮,使用插件添加):etncal.staging.wpengine.com/wp-content/themes/canvas_child/js/ photos.js

PHOTOS ARE LOCATED HERE: etncal.staging.wpengine.com/wp-content/themes/canvas_child/images/community/photos/ 照片位于此处:etncal.staging.wpengine.com/wp-content/themes/canvas_child/images/community/photos/

The problem is that you're setting the addthis:url parameter to a different value from the address bar. 问题是您将addthis:url参数设置为与地址栏不同的值。 Here's the code on your page: 这是您页面上的代码:

<div addthis:url='http://etncal.staging.wpengine.com/download-your-community-event-photos/' addthis:title='Download Your Community Event Photo ' class="addthis_toolbox addthis_default_style addthis_32x32_style">
    <a class="addthis_button_facebook"></a>
    <a class="addthis_button_twitter"></a>
    <a class="addthis_button_email"></a>
</div>

You need to set the addthis:url parameter to the URL of the photo page or set your tag to the URL of the photo page. 您需要将addthis:url参数设置为图片页面的URL 将标签设置为图片页面的URL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM