Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 23 Jul 2016, 13:39
karlm's Avatar
karlm karlm is offline
 
Join Date: Jul 2006
Real name: Karl
Obtaining Unique URL for each page? (VB5.2)

How would I obtain the unique URL for a page so I can call it from PHP/HTML, please?

I guess it would be similar to the post identifier, clicking on it gives the URL to that post in a popup window.
Reply With Quote
  #2  
Old 23 Jul 2016, 13:54
Replicant's Avatar
Replicant Replicant is offline
 
Join Date: Sep 2014
Real name: Mel
So you want to get the url of a nodeid? Where is the nodeid coming from? See the attachment for php usage of the function getAbsoluteNodeUrl()

This can also be done entirely with javascript and AJAX calling route/getAbsoluteUrl
Attached Images
File Type: jpg getAbsoluteNodeUrl.jpg (32.4 KB, 21 views)
__________________
VB5 mods - RepliClock VB4 mods - Member Online Status
Reply With Quote
  #3  
Old 23 Jul 2016, 15:27
karlm's Avatar
karlm karlm is offline
 
Join Date: Jul 2006
Real name: Karl
Forgive my ignorance, I'm reasonably experienced in programming of old but today's languages are somewhat over my head.

So please allow me to ask for an answer that I can digest a little easier.

I need a means to call the URL of the current page so a script can ensure it has the correct values. In short, I'm looking at replacing the 'comments' used in 'articles' of VB5 so instead of a boring plain box with some bot deterrent questions, a guest can leave a comment on each page.

Disqus seems like the obvious answer as although VB5 can have 'guests' commenting, aside from checking IP addresses and such there's no real way to tell one guest from another. With Disqus I get to see who they actually are whilst not having to be a registered member and still retain a high level of moderation over such comments.

They supply a default code to apply to web pages, which I've done.

I edited my 'article' page (default template 36) to have a PHP module at the bottom of the page. I pasted their code into the PHP module and it says I have to find the Unique URL to ensure content isn't mixed up with other content.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

So, while you've very kindly assisted with guiding me to what I may need, I have no idea how that is applied in this case.

Here is their explanation for what is needed:
These variables should be defined by using your CMS’ or platform’s dynamic values, if available. For example, the Disqus WordPress plugin defines these variables by default using the following PHP values:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
I hope this clarifies what I'm looking for and clarifies my absolute lack of comprehension on the topic.

Here's an example of where I'm using it (not trying to spam, so please delete this link if it's considered spam)

http://antimisandry.com/articles/cul...enging-picture
Reply With Quote
  #4  
Old 23 Jul 2016, 16:21
Replicant's Avatar
Replicant Replicant is offline
 
Join Date: Sep 2014
Real name: Mel
Ok, that's pretty easy to do as the information is already in every page. Probably won't need the php module either. There is a canonical url in the header if every page. This can be retrieved and the variable set for disqus using jquery and set to the this.page.url variable. For the this.page.identifier variable, you can use the pageData.nodeid variable that is embedded in the page.

Here is what the header code for the canonical url looks like.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
VB5 mods - RepliClock VB4 mods - Member Online Status
Reply With Quote
  #5  
Old 23 Jul 2016, 18:22
karlm's Avatar
karlm karlm is offline
 
Join Date: Jul 2006
Real name: Karl
Yeah, all of that flew like Concord over my head lol...

I received your PM and will eagerly accept your kind offer
Reply With Quote
  #6  
Old 24 Jul 2016, 05:10
Replicant's Avatar
Replicant Replicant is offline
 
Join Date: Sep 2014
Real name: Mel
Thumbs up

Open one of the articles on your site, enable sitebuilder, drag an ad module down below the article, edit the module, paste this code into an ad and save. You can select who sees it during the configuration of the module.
You will also want to disable comments for Articles to make the comment box disappear. You may have to hide the comments disabled message with CSS. I started a Discus account and tested the functionality, it works as expected. I am a bit confused as to why use the outside forum since the guest user has to signup for a discus account to post. Why not just have the user sign up to your forum instead?


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
VB5 mods - RepliClock VB4 mods - Member Online Status

Last edited by Replicant; 24 Jul 2016 at 15:24.
Reply With Quote
  #7  
Old 24 Jul 2016, 13:38
karlm's Avatar
karlm karlm is offline
 
Join Date: Jul 2006
Real name: Karl
The reason being is because there are already hundreds of thousands of Disqus users registered, this enables some level of control over guest comments without each & every guest being named "guest". I'm just trialling it for now...

Thank you so kindly for your assistance with the code & support in how to implement it. I really appreciate the help.
Reply With Quote
  #8  
Old 25 Jul 2016, 04:27
noypiscripter's Avatar
noypiscripter noypiscripter is offline
 
Join Date: Aug 2013
Instead of looping through all the link tags and looking for canonical, the canonical href can be retrieved using a single line:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

--------------- Added 25 Jul 2016 at 04:29 ---------------

If the discus code is inserted after the jQuery include, you can also use:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Glenn Vergara, an ex-vB Developer, now a vB Mod Developer

GIPHY for vB5 | AutoLinker | Video Attachments Player | New Registered Users Module | Clear System Cache Cron | DragNDrop Upload | Topic AJAX AutoUpdate | Force Read Topic
Reply With Quote
  #9  
Old 25 Jul 2016, 04:53
Replicant's Avatar
Replicant Replicant is offline
 
Join Date: Sep 2014
Real name: Mel
Originally Posted by noypiscripter View Post

If the discus code is inserted after the jQuery include, you can also use:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
Thanks Glenn. The code is in an ad module for easy usergroup administration without writing custom templates. This is the Jquery code I had come up with originally. I battled this one because the code is before jquery loads. I'm not very proficient with pure JS so I have to hit places like Stack Exchange for answers to get it done. I didn't particularly like the looping, but this one was taking way too much time and there aren't that many link tags to cause a severe performance hit, so I rolled with it.
__________________
VB5 mods - RepliClock VB4 mods - Member Online Status
Reply With Quote
  #10  
Old 25 Jul 2016, 15:34
noypiscripter's Avatar
noypiscripter noypiscripter is offline
 
Join Date: Aug 2013
Actually, if you use window onload handler, you can safely use jQuery inside the handler as the jQuery has been loaded completely at that point even if the script was inserted before the jQuery include. Although I don't like using window onload for this particular issue because if a thread has multiple large images, the browser has to wait for them to be completely loaded before the Discus code is executed and initialized. And besides, window onload is not necessary.

I recommend using pure JS without window onload.
__________________
Glenn Vergara, an ex-vB Developer, now a vB Mod Developer

GIPHY for vB5 | AutoLinker | Video Attachments Player | New Registered Users Module | Clear System Cache Cron | DragNDrop Upload | Topic AJAX AutoUpdate | Force Read Topic
Reply With Quote
  #11  
Old 16 Feb 2019, 02:17
final kaoss final kaoss is offline
 
Join Date: Apr 2006
Hi thanks for some of these helpful replys, I'm trying to add disqus to the vbulletin archive. (using vb4 though)

Any help on what to fill in here?

this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable

Last edited by final kaoss; 16 Feb 2019 at 02:22.
Reply With Quote
Reply


Tags
unique url, vbulletin5


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 20:30.

Layout Options | Width: Wide Color: