Page 1 of 2 12 LastLast
Results 1 to 20 of 24

Thread: Problem with News Module and QUOTEs

  1. #1

    Default Problem with News Module and QUOTEs

    I just found a very strange error today. I am still in the testing stages of setting up vBadvanced, and today when I pointed the news forum at a pre-existing forum on my site I was getting all sorts of html rendering issues.



    When I change the forum to point to another forum without quotes in the first 5 messages, which is what I'm pulling for news, the pages renders perfectly normal. But it appears that as soon as the quote tag is involved, and I think when it's being truncated because of the 500 char limit it's causing this issue.

    When I pull the exact same forum as show above in the graphic, but remove the 500 char limit on the new posts, it renders fine. So as far as I can tell it's definitly related to the quote tag interfereing with the table structure.

    I am also running the stock module setup... this image was a crop of the browser so you can't see the left column. The right column however is what you see embedded into the threads on the lower right corner.

    If you want to see how the rest of the page renders you can view it here: http://www.nasioc.com/uploads/vbaissue2.gif

    Please let me know what I can offer you guys to help troubleshoot the problem faster. Thanks in advance.

    -Nick
    http://www.nasioc.com/
    Last edited by [email protected]; 09-02-2006 at 08:34 PM.

  2. #2
    Join Date
    Jan 2004
    Posts
    3,185

    Default Re: Problem with News Module and QUOTEs

    Its a very old issue that we haven't found a good way to deal with yet, altho someone did suggest an easy way to fix it they did not provide us with the fix :/


    The best bet is to allow enough characters for any of your posts.
    Zachery
    I may or may not do things.

  3. #3

    Default Re: Problem with News Module and QUOTEs

    Quote Originally Posted by Zachery View Post
    Its a very old issue that we haven't found a good way to deal with yet, altho someone did suggest an easy way to fix it they did not provide us with the fix :/


    The best bet is to allow enough characters for any of your posts.
    Thanks for getting back to me...

    Hmmm... the problem is we were going to use the news module for actual news articles from a magazine that will be working with our site. So I wanted a short intro to display and allow the members to read the rest of the story at their choosing.

    I suppose we can just make sure not to use quotes in those articles.

    Is there a fix in the works? Or is this a holding pattern sort of bug?

  4. #4
    Join Date
    Jan 2004
    Posts
    3,185

    Default Re: Problem with News Module and QUOTEs

    Like I said, there was someone who had a fix but did not provide it with us. I know its something we want to fix but haven't had a good way to avoid it.
    Zachery
    I may or may not do things.

  5. #5
    Join Date
    Aug 2006
    Posts
    2

    Default Re: Problem with News Module and QUOTEs

    I'm barely familiar with PHP, but couldn't we add some script into the News Module template that would automatically replace all instances of
    PHP Code:
    [quote][/quote
    with
    PHP Code:
    [indent][/indent
    , or something like that?

  6. #6
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: Problem with News Module and QUOTEs

    Not quite that easy... You can try this method though:

    Open your includes/vba_cmps_include_bottom.php file and look for this line (right at the top):
    PHP Code:
    error_reporting(E_ALL & ~E_NOTICE); 
    Below that, add this:
    PHP Code:
    // ##### Check and end HTML tags in news posts.
    function check_string_html($text$startstring$endstring)
    {
        
    $stablecnt substr_count($text$startstring);
        
    $etablecnt substr_count($text$endstring);

        while (
    $stablecnt $etablecnt)
        {
            
    $etablecnt++;
            
    $text .= $endstring;
        }
        
        return 
    $text;

    Then look in your modules/news.php file for this code:
    PHP Code:
                    // Strip characters and add "read more"
                    
    if ($mod_options['portal_news_maxchars'] AND strlen($news['message']) > $mod_options['portal_news_maxchars'])
                    {
                        
    $news['message'] = substr($news['message'], 0strrpos(substr($news['message'], 0$mod_options['portal_news_maxchars']), ' ')) . '...' construct_phrase($vbphrase['read_more'], $vbulletin->options['bburl'], $news['threadid'], $session['sessionurl']);
                    } 
    Replace it with this:
    PHP Code:
                    // Strip characters and add "read more"
                    
    if ($mod_options['portal_news_maxchars'] AND strlen($news['message']) > $mod_options['portal_news_maxchars'])
                    {
                        
    $news['message'] = substr($news['message'], 0strrpos(substr($news['message'], 0$mod_options['portal_news_maxchars']), ' '));

                        
    $news['message'] = check_string_html($news['message'], '<div''</div>');
                        
    $news['message'] = check_string_html($news['message'], '<td''</td>');
                        
    $news['message'] = check_string_html($news['message'], '<tr''</tr>');
                        
    $news['message'] = check_string_html($news['message'], '<table''</table>');
                        
    $news['message'] = check_string_html($news['message'], '<table''</table>');

                        
    $news['message'] .= '...' construct_phrase($vbphrase['read_more'], $vbulletin->options['bburl'], $news['threadid'], $session['sessionurl']);
                    } 
    Upload those two files, and that should take care of the problem.

    Note that this may not be the prettiest solution and there's still a chance that your pages will not pass XHTML validation. It is, howerver, very easy on a server and should prevent any visible problems.
    Last edited by Brian; 09-13-2006 at 03:22 PM.

  7. #7
    Join Date
    Aug 2006
    Posts
    2

    Default Re: Problem with News Module and QUOTEs

    Where's that :falling_over_backwards_crosseyed smilie? Thanks. I will definitely try that, but just not right now. I've already spent too much time today restoring service to my site for some other issue. For now, though, I'm going to relax and think of anything but php.

  8. #8

    Default Re: Problem with News Module and QUOTEs

    I just discovered this problem on my site and I was convinced I caused it... after a few hours of looking at my code and truning off all the modules I figured out that only the news module is causing this....

    Search here and well... I could have saved a lot of time starting here!

    I will try to fix my site using this tonight if I can... Thanks for the fix even though I didn't need to ask for help!

  9. #9
    Join Date
    Aug 2006
    Posts
    10

    Default Re: Problem with News Module and QUOTEs

    Why wouldn't the code pass validation with this fix? What does the fix actually do?

  10. #10
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: Problem with News Module and QUOTEs

    It does 4 separate checks to count the number of opening/closing <div>, <td>, <tr>, and <table> tags in each news post. If it counts more opening tags than closing ones, then it adds the missing closing tag. The method may not work *perfectly* in cases where there are multiple quotes in one news post though since a tag could be closed before it technically should according to XHTML standards. But even in those cases, all browsers I've tested with still display the text without any visible problems. And that could still only happen if it has to cut off more than one [quote] tag in the news preview, so it should be fairly rare to even have any "invalid" code. So while it's not perfect, I think it's a good solution as it does what it's supposed to, and most importantly, without adding any significant extra strain to your server.

  11. #11
    Join Date
    Dec 2005
    Posts
    1

    Default Re: Problem with News Module and QUOTEs

    I've been having this problem, and used this fix. However now I have a problem where my news module expands the entire page, and my right side modules are expanded and centered directly underneath.

    I'll try working more on this later.

  12. #12
    Join Date
    Sep 2006
    Posts
    13

    Default Re: Problem with News Module and QUOTEs

    see this picture ... and attention to Read More of each post .


  13. #13
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: Problem with News Module and QUOTEs

    Blaque_Out - Can you post a link to your site so I can get a better idea of the problem?

    mecho - The site you posted the image on seems to be down. Can you attach it here instead?

  14. #14
    Join Date
    Jul 2005
    Posts
    13

    Default Re: Problem with News Module and QUOTEs

    Quote Originally Posted by Brian View Post
    Blaque_Out - Can you post a link to your site so I can get a better idea of the problem?
    Visit:

    http://www.weedtalk.com/index.php?page=wtf

    http://www.weedtalk.com/wtf.jpg

    Because I'm having the same problem myself. ANY custom modules will "push" the middles to the below the left column and the right column gets pushed to the bottom.

    I've found a couple more "bugs" too...

    http://www.weedtalk.com/missinglink.jpg

    I'm starting to like and dislike CMPS 2.2 at the same time. Sometimes I perfer the old 1.0 version but It may not work on the 3.6.x versions
    Last edited by Primeval; 10-01-2006 at 10:22 PM.

  15. #15
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: Problem with News Module and QUOTEs

    Quote Originally Posted by Primeval View Post
    Visit:

    http://www.weedtalk.com/index.php?page=wtf

    http://www.weedtalk.com/wtf.jpg

    Because I'm having the same problem myself. ANY custom modules will "push" the middles to the below the left column and the right column gets pushed to the bottom.
    Looks like that's due to some invalid code in your custom modules. You can try turning the "Use Module Shell Template" option off for those modules to see if that helps.

    I've found a couple more "bugs" too...

    http://www.weedtalk.com/missinglink.jpg

    I'm starting to like and dislike CMPS 2.2 at the same time. Sometimes I perfer the old 1.0 version but It may not work on the 3.6.x versions
    Admin CP => vBa CMPS => Edit Pages => {page name}

    Go there and make sure the Site Navigation setting there has the same values. If not, that means you've customized it for that page, so the default settings for the module are not going to have an effect. You can either use the "Use Default" checkbox to revert to using the default setting, or just change it for that page instead.

  16. #16
    Join Date
    Jul 2005
    Posts
    13

    Default Re: Problem with News Module and QUOTEs

    Quote Originally Posted by Brian View Post
    Looks like that's due to some invalid code in your custom modules. You can try turning the "Use Module Shell Template" option off for those modules to see if that helps.
    That did the trick. I wonder why it causes that problem?

    Admin CP => vBa CMPS => Edit Pages => {page name}

    Go there and make sure the Site Navigation setting there has the same values. If not, that means you've customized it for that page, so the default settings for the module are not going to have an effect. You can either use the "Use Default" checkbox to revert to using the default setting, or just change it for that page instead.
    I found that out before you answered the solution.. I didn't notice that tiny small box that didn't use the default settings.. I was going to 3 different pages at once and was getting annoyed.

  17. #17
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: Problem with News Module and QUOTEs

    The module_shell template basically has some code like this:

    Code:
    <table>
    
    $content
    
    </table>
    Then any modules which use that template should start with a <tr> and <td> tag containing the content. Otherwise, they can break.
    Last edited by Brian; 10-03-2006 at 04:14 PM.

  18. #18
    Join Date
    Apr 2006
    Posts
    4

    Default Re: Problem with News Module and QUOTEs

    just logged into my site and found exactly the same situation... basically its where a new table for the quote is started but not properly closed... if vBa can make sure that before they cut off the characters and display the read more link that no table has been started but not finished, this should be fixable...

  19. #19
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: Problem with News Module and QUOTEs

    GITs - A fix is posted in post #6 in this thread.

  20. #20
    Join Date
    Sep 2006
    Posts
    13

    Default Re: Problem with News Module and QUOTEs

    Quote Originally Posted by Brian View Post
    mecho - The site you posted the image on seems to be down. Can you attach it here instead?

    Image attached . and here also is my link
    Code:
    http://mechodownload.com/forum/cmps_index.php

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Quotes in News Posts Break Tables - fix request
    By roddy in forum Troubleshooting & Problems
    Replies: 10
    Last Post: 08-23-2007, 12:10 PM
  2. Multiple Quotes Post in 'News' module causes probs
    By bi11i in forum Troubleshooting & Problems
    Replies: 2
    Last Post: 07-19-2005, 04:57 PM
  3. Quotes within portal-news
    By Volconvo in forum Troubleshooting / "How do I..." Questions
    Replies: 2
    Last Post: 05-09-2005, 08:51 PM
  4. Problem with quotes
    By JustAskJulie in forum Troubleshooting / "How do I..." Questions
    Replies: 2
    Last Post: 08-08-2004, 09:36 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
  •