繁体   English   中英

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

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

我需要使用facebook / twitter / email按钮与加载的照片共享页面。 照片表格的脚本是几年前由一位离开的同事编写的,我得出的结论是我无法自定义此内容。 我已经包含了尽可能多的信息。 谢谢!

编辑:我可以为任何想为此刺死的人提供wp登录详细信息。 非常感谢!

  1. 转到此页面:etncal.staging.wpengine.com/community-event-photos/
  2. 输入ID#09070073,单击获取照片按钮
  3. 加载新页面,URL将显示为:etncal.staging.wpengine.com/download-your-community-event-photos/?photo=090700731381779074495
  4. 参数已传递到url,输入的照片代码为前8位数字
  5. 共享此按钮链接到不带参数的页面网址-因此,共享没有加载图像的空白页面。 需要使用唯一的网址和照片共享页面。

社区事件照片表单使用两页:

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

添加到此页面正文的代码:

[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]加载图像的页面:etncal.staging.wpengine.com/download-your-community-event-photos/

添加到此页面正文的代码:

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

同一wordpress页面的标题中包含指向以下js文件的链接(单击“添加媒体”右侧的第二个按钮,使用插件添加):etncal.staging.wpengine.com/wp-content/themes/canvas_child/js/ photos.js

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

问题是您将addthis:url参数设置为与地址栏不同的值。 这是您页面上的代码:

<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>

您需要将addthis:url参数设置为图片页面的URL 将标签设置为图片页面的URL。

暂无
暂无

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

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