Results 1 to 6 of 6

Thread: News Page Nav Link

  1. #1
    Senior Member ibaker's Avatar
    Join Date
    Feb 2008
    Posts
    296

    Default News Page Nav Link

    I am having an issue with the News Page Nav Link in the pagination

    The link to say page 2 should be:
    http://www.recreationalflying.org/in...r&news2_page=2

    BUT, the actual link that it is using is:
    http://www.recreationalflying.org/in...r&news2_page=2
    which when clicked just takes you to the site home page

    It seems to be adding a "news2_" after the "index.php?" ever since I went up to vBadvanced CMPS v4.1.0

    Link to the page is http://www.recreationalflying.org/in...ge=news_reader

    My LIVE site is still using vBadvanced CMPS v4.0.0 and works ok is located at http://www.recreationalflying.net/in...ge=news_reader

  2. #2
    Administrator Brian's Avatar
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,460

    Default

    Thank you for pointing this out. I've just applied the fix to the forum/modules/news.php file in the download package here, so if you will download the files again and update that one on your server, that should take care of the issue.
    Frequently Asked Questions
    CMPS Users Manual

    For vBadvanced software assistance, please use the support forums.
    Unsolicted PMs, IMs, and email will not be responded to.
    If you have a non-software related question or problem with your account, please submit a support ticket.

  3. #3
    Senior Member ibaker's Avatar
    Join Date
    Feb 2008
    Posts
    296

    Default

    Sorry Mate...but that didn't work...also note that the pagination is showing the total pages as defined in the module options and not the number of actual pages.

    I have the module options set at 15 pages and yes there are more then 15 pages of entries in the selected forum however I have added at line 143 a criteria to only pull out entries that match a prefixID:
    AND thread.prefixid = '6'
    which results in less then 15 pages of entries

  4. #4
    Senior Member ibaker's Avatar
    Join Date
    Feb 2008
    Posts
    296

    Default

    Brian
    I have had to edit my news.php to make it work in my instance for the time being by changing the Pagination block to:
    Code:
            // ##### Pagination
            if ($mod_options['portal_news_threadsperpage'] AND (($newsrows >= ($mod_options['portal_news_maxposts'] + $mod_options['portal_news_enablearchive'])) OR $vbulletin->GPC[$newspagevar]))
            {
                $vba_news_where = 'visible = 1 AND open != 10';
    
                if (!empty($mod_options['portal_threadids']))
                {
                    $vba_news_where .= ' AND (threadid IN(' . implode(',', $newstids) . ')';
                }
    
                if (!empty($mods['inforums']))
                {
                    $vba_news_where .= iif(!empty($mod_options['portal_threadids']), ' OR', ' AND') . ' forumid IN(' . implode(', ', $mods['inforums']) . ')';
                }
    
                if (!empty($mod_options['portal_threadids']))
                {
                    $vba_news_where .= ')';
                }
    
                if ($mod_options['portal_news_cutoffdate'])
                {
                    $vba_news_where .= ' AND dateline > ' . (TIMENOW - ($mod_options['portal_news_cutoffdate'] * 86400));
                }
    
                if ($ignusers)
                {
                    $vba_news_where .= ' AND postuserid NOT IN(' . $ignusers . ')';
                }
    
                if ($mod_options['portal_applypermissions'])
                {
                    $vba_news_where .= $forumperms_query;
                }
    
                $newscount = $db->query_first("
                    SELECT COUNT(*) AS count
                    FROM " . TABLE_PREFIX . "thread
                    WHERE $vba_news_where
                ");
    
                $oldshowpopups = $show['popups'];
                $show['popups'] = false;
    
                $newspagenav = construct_page_nav(
                    max($vbulletin->GPC[$newspagevar], 1),
                    $mod_options['portal_news_maxposts'],
                    min($newscount['count'], ($mod_options['portal_news_maxposts'] * $mod_options['portal_news_threadsperpage'])),
                    $vba_options['portal_homeurl'] . '?' . $vba_options['portal_pagevar'] . '=' . $pages['name']
                );
    
                $show['popups'] = $oldshowpopups;
    
                $home[$newsmod['modid']]['content'] .= '<div style="float:right;padding-top:2px; padding-bottom: ' . $vba_style['portal_vspace'] . 'px" class="floatcontainer">' . str_replace(
                    '&amp;page=',
                    '&amp;' . $newspagevar . '=',
                    $newspagenav
                ) . '</div><br /><br />';
            }
    I have 7 instances of the news.php file (each named differently) that are needed for my News Reader at:
    http://www.recreationalflying.org/in...ge=news_reader
    with each one pulling different news items up depending on the Thread PrefixID.

    I don't use the Pagination in other instances of the news.php file that is used on my site like on the home page

  5. #5
    Junior Member
    Join Date
    Aug 2005
    Posts
    13

    Default

    Hy ibaker,
    thanks for the fix, i had the same problem on my site!
    sorry for my bad english ... my german is much better

  6. #6
    Senior Member ibaker's Avatar
    Join Date
    Feb 2008
    Posts
    296

    Default

    Just creating a new site with vb 4.1.9 and CMPS v4.1.2 and have the same problem so to fix it I have had to edit the news.php module by replacing:
    Code:
                $newspagenav = str_replace(
                    array(
                        '&amp;page=',
                        '?page='
                    ),
                    array(
                        '&amp;' . $newspagevar . '=',
                        '?' . $newspagevar . '='
                    ),
                    $newspagenav
                );
    
                $home[$newsmod['modid']]['content'] .= '<div style="padding-bottom: ' . $vba_style['portal_vspace'] . 'px" class="floatcontainer">' . $newspagenav . '</div>';
            }
    With
    Code:
                $home[$newsmod['modid']]['content'] .= '<div style="padding-bottom: ' . $vba_style['portal_vspace'] . 'px" class="floatcontainer">' . str_replace(
                    '&amp;page=',
                    '&amp;' . $newspagevar . '=',
                    $newspagenav
                ) . '</div>';
            }

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Logon Problems, gets logged out when using the link to my Link-page
    By siggen in forum Troubleshooting & Problems
    Replies: 5
    Last Post: 02-22-2008, 05:10 AM
  2. Replies: 2
    Last Post: 12-27-2005, 02:34 PM
  3. Replies: 1
    Last Post: 09-23-2005, 10:41 PM
  4. Numbers (link to pages) of the previous news in news module
    By JWEB in forum "How Do I..." Questions
    Replies: 3
    Last Post: 08-20-2005, 03:54 AM
  5. The problem with the link to portal and the link to the forum main page..
    By Giowolf in forum Troubleshooting / "How do I..." Questions
    Replies: 2
    Last Post: 05-20-2005, 02:29 AM

Posting Permissions

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