Jump to content

POST_ID?


Recommended Posts

Here is what one software provider told me:

Quote
The POST_ID needs to be some unique ID for the article.
We don't support URLs as POST_ID because it's not reliable.
For the article you gave as an example, the POST_ID might be the short-name of the article in the url:
40749-seven-friends-drown-after-their-boat-capsized-when-they-huddled-in-one-corner-to-take-a-selfie
 
Or just the number from start of the name: 40749
 
You gonna need to integrate with your CMS and get the POST_ID automatically.

In IPS is there a way to correctly identify the POST_ID automatically for his script?

Thanks in advance.

Link to comment
Share on other sites

9 hours ago, TheWorldNewsMedia.org said:
Or just the number from start of the name: 40749
 

This is not post id. This is topic id.

9 hours ago, TheWorldNewsMedia.org said:

In IPS is there a way to correctly identify the POST_ID automatically for his script?

 

Where and how you will add script?

Link to comment
Share on other sites

@newbie LAC I've added the script to the bottom of my page as an add-on     real time Chat replacement .... and recirculator.... check out

https://www.theworldnewsmedia.org/topic/41080-770000-tons-of-fukushima’s-radioactive-water-to-be-released-into-ocean-under-new-plan/?spotim_referrer=newsfeed&utm_source=spotim&utm_medium=spotim_newsfeed&spot_im_comment_id=sp_H593yhZg_www.theworldnewsmedia.org%242Ftopic%242F41080-770000-tons-of-fukushima%24E2%2480%2499s-radioactive-water-to-be-released-into-ocean-under-new-plan%242F_c_5h4DT0

 

Here is my current script that is not working so well:

<div class="spot-im-frame-inpage" data-post-id=""></div>

I left "" so that it would default to the URL... which is not recommended.

How would I reference the topic ID in this script?

I'm thinking....

<div class="spot-im-frame-inpage" data-post-id="<topic_id>"></div>

or

<div class="spot-im-frame-inpage" data-post-id="[topic_id]"></div>

do you know which one would work?

 

 

Link to comment
Share on other sites

6 hours ago, TheWorldNewsMedia.org said:

@newbie LAC I've added the script to the bottom of my page as an add-on     real time Chat replacement .... and recirculator.... check out

 

If this script will be work on topics pages only you can use request.id

<div class="spot-im-frame-inpage" data-post-id="{expression="request.id"}"></div>

 

Link to comment
Share on other sites

18 minutes ago, TheWorldNewsMedia.org said:

@MDPP that didn't work either... thanks for trying though.

Depends on where you use it. It works if you use it in the topic template, but not so much in another template. What template are you trying to add this in?

Link to comment
Share on other sites

1 hour ago, TheWorldNewsMedia.org said:

I use it in the PHP TXT widget where other scripts and HTML usually run without problem.

You use "Custom text" widget.

Use php version with next code

<?php
print '<div class="spot-im-frame-inpage" data-post-id="' . \IPS\Request::i()->id . '"></div>';

or if you want to use txt widget

<div class="spot-im-frame-inpage" data-post-id=''></div>
<script>
$(function() {
    $('.spot-im-frame-inpage').attr('data-post-id', $('[data-followapp="forums"][data-followarea="topic"]').attr('data-followid'));
});
</script>

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...