Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
TheWorldNewsMedia.org Posted July 14, 2017 Posted July 14, 2017 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.
newbie LAC Posted July 15, 2017 Posted July 15, 2017 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?
TheWorldNewsMedia.org Posted July 15, 2017 Author Posted July 15, 2017 @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?
newbie LAC Posted July 16, 2017 Posted July 16, 2017 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>
TheWorldNewsMedia.org Posted July 16, 2017 Author Posted July 16, 2017 @newbie LACThank you... I will try that.
MDPP Posted July 17, 2017 Posted July 17, 2017 12 minutes ago, TheWorldNewsMedia.org said: It didn't work. ;-( Perhaps this? <div class="spot-im-frame-inpage" data-post-id="{$topic->tid}"></div>
TheWorldNewsMedia.org Posted July 17, 2017 Author Posted July 17, 2017 @MDPP that didn't work either... thanks for trying though.
MDPP Posted July 17, 2017 Posted July 17, 2017 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?
TheWorldNewsMedia.org Posted July 17, 2017 Author Posted July 17, 2017 I use it in the PHP TXT widget where other scripts and HTML usually run without problem.
newbie LAC Posted July 17, 2017 Posted July 17, 2017 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>
TheWorldNewsMedia.org Posted July 22, 2017 Author Posted July 22, 2017 Thank you @newbie LAC the code seems to be working flawlessly.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.