Results 1 to 11 of 11

Thread: display single post

  1. #1
    Join Date
    Feb 2006
    Posts
    62

    Default display single post

    I was wondering if anyone knew how a single post can displayed through vba using a showthread id..i'm sure it can't be that hard but i'm pretty much stuck.

    I have tried the vbulletin external.php but that doesnt show the post content. I would love to be able to show single posts as the news.php does. Please someone help! Any suggestion would be greatly appreaciated..

  2. #2
    Join Date
    Feb 2006
    Posts
    62

    Default Re: display single post

    hopeful bump

  3. #3

    Default Re: display single post

    Are you trying to do this in a module for a specific post that won't be changing? If so, you'll need to write your own php file or hack one of the existing ones to pull the content for display. Alternatively, you might be able to duplicate the news module and point it to a forum with only one post in it .

    There are a couple of other ways it could be done as well depending on how complicated you want to get vs. how much coding you want to do.
    Tom Morris
    Porsche Boxster discussion forum.
    Today's Conservative discussion forum.

  4. #4
    Join Date
    Feb 2006
    Posts
    62

    Default Re: display single post

    thanx for the reply Tom M..
    I want to basically show the forum as with latest topics module..
    so it will show a specified amount of threads..and I want to be able to pass the thread id to a new page which will simply display the thread or single post within vba..essentially taking the news module a level lower..

    any idea which file i should look at to achieve this? i've had a look at news.php and i find it hard to figure whats going on...any suggestions?

  5. #5

    Default Re: display single post

    Quote Originally Posted by Decipher
    thanx for the reply Tom M..
    I want to basically show the forum as with latest topics module..
    so it will show a specified amount of threads..and I want to be able to pass the thread id to a new page which will simply display the thread or single post within vba..essentially taking the news module a level lower..

    any idea which file i should look at to achieve this? i've had a look at news.php and i find it hard to figure whats going on...any suggestions?
    I must be missing somehting as it seem like that's what the latest topics module does already.
    Tom Morris
    Porsche Boxster discussion forum.
    Today's Conservative discussion forum.

  6. #6
    Join Date
    Feb 2006
    Posts
    62

    Default Re: display single post

    well the latest topics module will show, say, the last 5 forum posts, and generate a link to the forum thread..IE when you click on it you leave the CMPS.
    I want it to display exactly the same, but instead of generating a link like forums/showthread.php?t=16, I want it to generate a link like index.php?page=showthread&t=16 which will then display the thread (and replies) within VBA and not VB, and so you do not leave the CMPS..

  7. #7

    Default Re: display single post

    In that case, I believe that you can still accomplish what you want by creating a version of showthread or showpost that makes use of the vBa wrappers.
    Tom Morris
    Porsche Boxster discussion forum.
    Today's Conservative discussion forum.

  8. #8
    Join Date
    Feb 2006
    Posts
    62

    Default Re: display single post

    well i thought that I (or someone with a bit more knowledge than me) could utilize news.php, as it displays the first single post of the thread...showthread.php is a large file i cant work out how to extract the code needed to diplay the thread..has anyone requested this before? I cannot find similar posts in this forum but it would be such a cool feature of vba!

  9. #9
    Join Date
    Feb 2006
    Posts
    62

    Default Re: display single post

    ok im getting somewhere now using news.pgp...will post up some of my ideas pretty soon

  10. #10
    Join Date
    Feb 2006
    Posts
    62

    Default Re: display single post

    right...i have figured out a "not the best way but still works" method to displaying the single post...it does not display replies but I actually can live without that...
    So here's how I did it:
    download news.php and save it as showthread.php
    now you need to scroll to about line 41 where u will find the following two lines of code:
    PHP Code:
    $newstids array_keys($mod_options['portal_threadids']);
    $newspids array_values($mod_options['portal_threadids']); 
    now i added the following above:
    PHP Code:
    if (!isset($_GET['t'])) die ("no thread specified");
    else 
    $mod_options['portal_threadids'] = array($_GET['t'] => $_GET['t']); 
    basically i print_r()'d $mod_options and figure out the threads to display are an associative sub-array called portal_theadids...now what I don't understand is that it was creating the array as (for example)
    array (
    [4] => 4
    [10] => 15
    [12] => 10
    )
    so the key is the threadid and the value is? some random number in my head I could not find any matching numbers that would go here...so i just replace that array with
    array (
    [t] => t
    )
    t being thread id, and that seems to work

    upload showthread.php to modules dir
    goto vba admin_cp >> edit module news >> copy >> new module title: showthread; file to include: showthread.php >> save
    add new module page >> Page Title: Viewing thread; identifier:showthread; modules enabled: showthread >> save

    now http://www.yoursite.com/index.php?page=showthread&t=9 will display first post of threadid 9

    now to get this link auto, edit the (for example) adv_portal_latesttopicbits template and replace the url of the thread to reflect your domain eg: <a href="http://www.yoursite.com/index.php?page=showthread&t=$thread[threadid]" title="$thread[preview]">

    i threw this together is the last 20min so ive still got a lil editing and testing to do...
    i'm so happy i got this to work...would love some feedback or suggestions!
    One thing I would like is when you view the showthread page, it updates the views for the thread you are viewing...any suggestions?

    EDIT: to remove the "Viewing Thread" from the nav menu, simply edit every page and exclude the "Viewing Thread" page from the "Site Navigation Options"
    Last edited by Decipher; 03-12-2006 at 03:27 PM.

  11. #11
    Join Date
    Jan 2006
    Posts
    17

    Default Re: display single post

    many thanks for this decipher i think this is just what im looking for will try it shortly

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Add page navigation to news (multi-page single post browsing)
    By StewardManscat in forum Add-On Modules & Modifications
    Replies: 11
    Last Post: 12-18-2005, 12:59 PM
  2. Single column display 100% width?
    By JohnBee in forum Troubleshooting / "How do I..." Questions
    Replies: 7
    Last Post: 05-08-2005, 01:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •