Version: 1.00, by Spinball
Developer Last Online: Oct 2023
Category: Integration with vBulletin -
Version: 3.8.2
Rating:
Released: 04-13-2009
Last Update: Never
Installs: 4
Template Edits
Re-useable Code Translations
No support by the author.
We publish movie and hardware reviews using their own databases and CMS style scripts I created. I wanted to incorporate discussions related to those reviews along side them. I have wanted to do this for ages, but only just cracked it and I thought I would share my findings here.
Hopefully a moderator will move this thread if it is in the wrong forum.
Ok firstly I am displaying a discussion thread in web pages external to my forums but on the same server. That's the first restriction.
Also since I have vBSEO installed, the page *has* to be in a different folder than my forums otherwise vBSEO redirects calls to my page to the forums instead.
Ok, so my reviews are in AVForums.com/reviews and my forums are in AVForums.com/forums.
I need to link a discussion thread to each review and a threadid field in the review table allows that.
I could manually create a thread for each review and then update the threadid in the review, but it can be done automatically.
I have created an RSS feed for our reviews and I'm using the vBulletin RSS to thread functionality to automatically create a new thread within an hour of a new review being published. Since I know what the title of the automatically created thread will be, and what forum it will be in, I can interrogate the thread table to find the threadid and write it into the review. I wrote a script to do this and a cron job to fire it every hour. Easy.
So now we have our review and our discussion thread and the threadid is stored in the review record.
Now all we have to do is display the last page of the discussion thread in our review. Since our reviews are split into tabs, I created a new 'Comments' tab for this purpose.
Next I created a new template called SHOWTHREAD_embedded and copied the contents of the SHOWTHREAD template into it. I then removed all the elements of the page I don't want like the <body> tags and everything outside of them along with some of the buttons and the moderation and menu elements. I don't need this stuff since it's a basic comments page with limited functionality. Don't want to over complicate things.
Then I made a copy of showthread.php called showcomments.php, changed the 2 references to the SHOWTHREAD template to SHOWTHREAD_embedded and saved into my reviews folder. This script can be tested directly by running /reviews/showcomments.php?t=123456 with any thread id replacing 123456. It returns the thread as you'd expect with no style applied (since we removed it from the template).
The last step is running the showcomments script when someone clicks the Comments tab on my review pages.
I use curl to do this:
And display $comments in your page.
Note that the page=9999 ensures you display the last page of your thread.
We do have an issue with the relative links used in the SHOWTHREAD_embedded template bring broken since we are in the reviews folder rather than the forums folder.
But since we have the comments in a string variable $comments, we can do some string replaces to fix these:
And it works well.
I know it's very possibly inefficient and there are likely some things that could be done better, but even with my extremely limited knowledge of how vB works, I had it working in a couple of hours.
Any suggestions on how to improve it are welcome.
I hope this info helps someone.
you think this could be mod-ed to make a Automatic Discussion Thread? our site deals with program files in diff forums.. and really would like to have auto discussion thread posted when a file is posted.
thank you for any help or ideals