-->

2007-06-18需要共享由JS生成的自定义网址(AddThis need to share cu

2019-10-18 18:52发布

我需要的Facebook / Twitter的/电子邮件按钮与装入照片共享页面。 为照片形式的脚本编写年前已经离开我和一个同事得出结论,这是什么我不能够自定义自己。 我已经包括了我能想到的尽可能多的信息。 谢谢!

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

  1. 到这个网页:etncal.staging.wpengine.com/community-event-photos/
  2. 输入编号09070073,单击获取照片按钮
  3. 新的页面加载和URL将读取:etncal.staging.wpengine.com/download-your-community-event-photos/?photo=090700731381779074495
  4. 有一个参数被传递到网址,进入照片代码是第8位
  5. 分享此按钮被链接到该网页的URL,而不参数 - 因此没有加载的图像的空白页被共享。 需要使用专属的网址和照片共享页面。

社区活动照片的形式使用两页:

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

链接到下面的js文件包含在同一个页面的WordPress的标题(点击按钮2日向媒体添加使用一个插件添加的右侧):etncal.staging.wpengine.com/wp-content/themes/canvas_child/js/ photos.js

照片都坐落在这里:etncal.staging.wpengine.com/wp-content/themes/canvas_child/images/community/photos/

Answer 1:

问题是,你设置前页: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>

您需要设置前页:url参数的照片页面的网址标记设置为照片页的URL。



文章来源: AddThis need to share custom url generated by js