Announcement

Collapse
No announcement yet.

Bypassing Threads Display Page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cynthia
    replied
    Well, I don't know what I did but after several attempts at removing the code and redoing it - it now works! Thanks Erwin!

    Now, to do this for multiple boards I just repeat the same code, one beneath the other, changing the forumid an threadid right?

    Leave a comment:


  • Erwin
    replied
    Use this instead:

    PHP Code:
    if ($forumid=='xx') {

        
    header("Location: ../forums/showthread.php?s=&threadid=yy");

      exit;


    Leave a comment:


  • Cynthia
    replied
    I'm sorry Erwin! Back again with the same problem.

    I put in the missing } but still get the parse error message.

    <?php
    error_reporting(7);

    // jump from forumjump
    $goto = '';
    switch($forumid) {
    case 'home': $goto = 'index'; break;
    case 'search': $goto = 'search'; break;
    case 'pm': $goto = 'private'; break;
    case 'wol': $goto = 'online'; break;
    case 'cp': $goto = 'usercp'; break;
    }
    if ($goto != '') {
    if ($s) {
    $sessionhash = $s;
    }
    header("Location: $goto.php?s=$sessionhash");
    exit;
    }
    // end forumjump redirects
    if_($forumid=='125')_{
    ____header("Location: http://www.mothering.com/discussions...threadid=28725");
    __exit;
    }

    Leave a comment:


  • Erwin
    replied
    Look at my code carefully. You are missing a } at the bottom of each of the forum redirect code.

    You need to close the function with a }

    Remember - every { needs a } to close it.

    Leave a comment:


  • Cynthia
    replied
    Still getting the same message. Here's the file:

    // end forumjump redirects
    if_($forumid=='125')_{
    ____header("Location: http://www.mothering.com/discussions...threadid=28725");
    __exit;




    if (!$action=="markread") {

    Leave a comment:


  • Cynthia
    replied
    Thanks Erwin. I'm trying it right now...

    So I'll do the same for every forum I want to place this in, pasting the same code in, one beneath the other, with the xx and yy appropriately changed for each forum, right?

    Leave a comment:


  • Erwin
    replied
    Oops - try my code again - I forgot to disable the [url] tag and it parsed my code into a link. Copy the code from the same post and try it again - it should work now.

    Leave a comment:


  • Cynthia
    replied
    I did. I got this when I clicked on any forum link:
    Parse error: parse error, unexpected T_STRING in /usr/www/users/mother1/discussions/forumdisplay.php on line 21

    Here's my mod of the file that caused the error:

    <?php
    error_reporting(7);

    // jump from forumjump
    $goto = '';
    switch($forumid) {
    case 'home': $goto = 'index'; break;
    case 'search': $goto = 'search'; break;
    case 'pm': $goto = 'private'; break;
    case 'wol': $goto = 'online'; break;
    case 'cp': $goto = 'usercp'; break;
    }
    if ($goto != '') {
    if ($s) {
    $sessionhash = $s;
    }
    header("Location: $goto.php?s=$sessionhash");
    exit;
    }
    // end forumjump redirects
    if_($forumid=='125')_{
    ____header("Location: <a href="http://www.mothering.com/discussions/showthread.php?s=&threadid=28725" target="_blank">http://www.mothering.com/discussions...threadid=28725</a>");
    __exit;
    }
    if (!$action=="markread") {
    $templatesused='forumdisplay_threadslist_rateoption,forumdisplay_threadslist_threadrate,fo rumdisplaybit_threadrate,forumhome_lastpostby,forumdisplay_announcement,forumdisplay_moder ator,forumdisplay_newthreadlink,forumdisplay_moderatedby,forumdisplay_forumbit_level1_post ,forumdisplay_forumbit_level1_nopost,forumdisplay_forumbit_level2_post,forumdisplay_forumb it_level2_nopost,';
    $templatesused.='forumdisplay_loggedinuser,forumdisplay_loggedinusers,forumdisplay_adminop tions,forumdisplay_forumslist,forumdisplay_multipagenav_more,forumdisplay_multipagenav_pag enumber,forumdisplay_multipagenav,forumdisplay_gotonew,forumdisplaybit,forumdisplay_thread slist,forumdisplay_nothreads,forumrules,forumdisplay,forumdisplay_sortarrow,forumdisplay_n ewthreadlink,forumdisplay_announcementsonly,forumhome_moderator';
    } else {
    $templatesused='standardredirect,redirect_markreadforum';
    }
    Last edited by Cynthia; Wed 30th Oct '02, 2:14am.

    Leave a comment:


  • Erwin
    replied
    Really? It shouldn't...

    Well, let's try a mini-hack.

    Open forumdisplay.php,

    Find:

    PHP Code:
    // end forumjump redirects 
    Underneath, add:

    PHP Code:
    if ($forumid=='xx') {

        
    header("Location: http://www.yourforums.com/forums/showthread.php?s=&threadid=yy");

      exit;


    Replace xx with the forum id and yy with the thread id. This will make the forum redirect to the thread throughout your site, including via your forumjump.
    Last edited by Erwin; Wed 30th Oct '02, 4:47am.

    Leave a comment:


  • Cynthia
    replied
    That worked well but only from within the category. If I click on the forum title from the home page it takes me to the threads list.

    Leave a comment:


  • Erwin
    replied
    Easy. Go to your Admin CP, then to the Forums & Moderators section, click Modify, choose the Forum, and then replace the Forum Title with the code from my previous post, replacing the threadid=xx with the actual threadid of the post you want to point to.

    Leave a comment:


  • Cynthia
    replied
    That makes sense Erwin but how do I do it? I'm afraid I need it spelled out a bit more.

    Leave a comment:


  • Erwin
    replied
    You could make the Forum Titles of these forums link straight to the threads:

    Put this as the Forum Title:

    </a><a href="http://www.yourforums.com/forums/showthread.php?s=&threadid=xxxx">Forum Title</a>

    xxxx being the threadid.

    If you want the Forum Title to link to the latest post in the thread (the top one), use this:

    </a><a href="http://www.yourforums.com/forums/showthread.php?s=&goto=lastpost&threadid=xxxx">Forum Title</a>

    Leave a comment:


  • Cynthia
    started a topic Bypassing Threads Display Page

    Bypassing Threads Display Page

    I hope I can explain this clearly. I have a group of forums within a category and I want only one thread in each of these forums. So rather than be taken to the threads list page I want to be able to click on the forum, from the main page or from within the category forums list page, and be taken directly to the one thread in that board. How can I set this up?

Related Topics

Collapse

Working...
X