Results 1 to 3 of 3

Thread: Integrating CMPS causes CSS issues

  1. #1
    Join Date
    Sep 2006
    Posts
    10

    Default Integrating CMPS causes CSS issues

    Hi All,

    I have tried integrating my forumdisplay.php file into CMPS, however it causes some CSS issues when I do so.

    Before I integrate, my HTML head looks like this:

    Code:
    <link rel="stylesheet" type="text/css" href="clientscript/vbulletin_css/style00011l/forumdisplay-rollup.css" /> 
    <!--[if lt IE 8]>
    <script type="text/javascript" src="clientscript/vbulletin-threadlist-ie.js?v=403"></script>
    <link rel="stylesheet" type="text/css" href="clientscript/vbulletin_css/style00011l/threadlist-ie.css" />
    <![endif]--> 
    <link rel="stylesheet" type="text/css" href="clientscript/vbulletin_css/style00011l/additional.css" /> 
    <!--[if lt IE 8]>
    <link rel="stylesheet" type="text/css" href="clientscript/vbulletin_css/style00011l/replacement-vbulletin-ie.css" />
    <![endif]-->
    After integration, I get the following:

    Code:
    <link rel="stylesheet" type="text/css" href="clientscript/vbulletin_css/style00011l/forumdisplay-rollup.css" /> 
    <link rel="stylesheet" type="text/css" href="clientscript/vbulletin_css/style00011l/threadlist-ie.css" /> 
    <link rel="stylesheet" type="text/css" href="clientscript/vbulletin_css/style00011l/additional.css" /> 
    <!--[if lt IE 8]>
    <link rel="stylesheet" type="text/css" href="clientscript/vbulletin_css/style00011l/replacement-vbulletin-ie.css" />
    <![endif]-->
    This causes a problem because non-IE browsers render incorrectly now. Any ideas what may be causing this?

    Adam

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

    Default

    Thank you for pointing this out. It looks like the code within the <head> tags of vB's templates is getting more complex and the old functions to strip the CSS/javascript aren't working as well anymore. You should be able to solve this though by looking in your includes/vba_cmps_include_top.php file for this code:
    PHP Code:
                                    // Custom content from another page
                                    
    case 'module':
                                        if (
    $nonindex)
                                        {
                                            
    // Integrated content replacements
                                            
    $bodytag strpos($nonindex'<body');
                                            
    strip_body_tags($nonindex);

                                            if (
    $bodytag)
                                            {
                                                
    // Work around for <body> tags that could contain js with >'s
                                                
    preg_match('#<body\s*(\s+\w+\s*=\s*(("|\').*?(?<!\\\)\3))*>#s'$nonindex$bmatches);  

                                                
    $bodycut strlen($bmatches[0]) + $bodytag;
                                                
    $newheader substr($nonindex0$bodycut);

                                                
    $oldheader substr($nonindex0$bodycut);
                                                
    // Find and add any stylesheets that might be in the content's <head> tag
                                                
    preg_match_all('@(<\!--\[if (.{4,8})\]>)?(\r\n)?<link rel="stylesheet" type="text/css" href="(.*?)" />(\r\n)?(<\!\[endif\]-->)[email protected]'$oldheader$stripcss);

                                                if (!empty(
    $stripcss[0]))
                                                {
                                                    
    $css_string '';
                                                    foreach (
    $stripcss[0] AS $cssfiles)
                                                    {
                                                        
    $css_string .= "$cssfiles\r\n";
                                                    }
                                                    
                                                    
    $headinclude .= $css_string;
                                                }

                                                
    $nonindex substr($nonindex$bodycut);
                                            }

                                            
    $bodyendcut strpos($nonindex'<!--start debug html-->');

                                            if (!
    $bodyendcut)
                                            {
                                                
    $bodyendcut strpos($nonindex'</body>');
                                            }

                                            if (
    $bodyendcut)
                                            {
                                                
    $nonindex substr($nonindex0$bodyendcut);
                                            }

                                            
    $nonindex str_replace(
                                                array(
    $header$navbar$footer$headinclude$spacer_open$spacer_close),
                                                
    '',
                                                
    $nonindex
                                            
    );

                                            
    // adv_portal template replacements
                                            
    $ptemplate =& $vbulletin->templatecache['adv_portal'];

                                            
    $bodytag strpos($ptemplate'<body');

                                            if (
    $bodytag)
                                            {
                                                
    $bodycut strpos($ptemplate'>'$bodytag);
                                                
    $ptemplate substr($ptemplate$bodycut 1);
                                            }

                                            
    $home[$mods['modid']]['content'] = $nonindex;
                                        }
                                    break; 
    Replace with this:
    PHP Code:
                                    // Custom content from another page
                                    
    case 'module':
                                        if (
    $nonindex)
                                        {
                                            
    // Integrated content replacements
                                            
    $bodytag strpos($nonindex'<body');
                                            
                                            
    strip_body_tags($nonindex);

                                            if (
    $bodytag)
                                            {
                                                
    // Work around for <body> tags that could contain js with >'s
                                                
    preg_match('#<body\s*(\s+\w+\s*=\s*(("|\').*?(?<!\\\)\3))*>#s'$nonindex$bmatches);  

                                                
    $bodycut strlen($bmatches[0]) + $bodytag;
                                                
    $newheader substr($nonindex0$bodycut);
                                                
    $nonindex substr($nonindex$bodycut);
                                            }

                                            
    $bodyendcut strpos($nonindex'<!--start debug html-->');

                                            if (!
    $bodyendcut)
                                            {
                                                
    $bodyendcut strpos($nonindex'</body>');
                                            }

                                            if (
    $bodyendcut)
                                            {
                                                
    $nonindex substr($nonindex0$bodyendcut);
                                            }

                                            
    $nonindex str_replace(
                                                array(
    $header$navbar$footer$headinclude$spacer_open$spacer_close),
                                                
    '',
                                                
    $nonindex
                                            
    );

                                            
    // adv_portal template replacements
                                            
    $ptemplate =& $vbulletin->templatecache['adv_portal'];

                                            
    $bodytag strpos($ptemplate'<body');

                                            if (
    $bodytag)
                                            {
                                                
    $bodycut strpos($ptemplate'>'$bodytag);
                                                
    $ptemplate substr($ptemplate$bodycut 1);
                                                
    $ptemplate '$final_rendered = \'' addcslashes($newheader'\'') . $ptemplate;
                                            }

                                            
    $home[$mods['modid']]['content'] = $nonindex;
                                        }
                                    break; 
    Then go to your Plugin Manager in the Admin CP, find the 'Cache Templates' plugin for the CMPS, and change the Plugin PHP Code to the following:
    PHP Code:
    $cache[] = 'adv_portal_navtab';
    $cache[] = 'adv_portal_navtab_subpages';

    if (
    defined('VBA_PORTAL'))
    {
    $cache[] = 'adv_portal';
    $cache[] = 'adv_portal_footer';

    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
    Join Date
    Sep 2006
    Posts
    10

    Default

    Excellent! That's done the trick. Thanks

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Integrating CMPS with Reviewpost
    By mrjbs in forum "How Do I..." Questions
    Replies: 2
    Last Post: 01-20-2009, 11:11 AM
  2. Integrating PhotoPro with CMPS
    By John Thawley in forum Chit Chat
    Replies: 13
    Last Post: 10-05-2007, 08:45 AM
  3. Issues with integrating page
    By Reece in forum Troubleshooting & Problems
    Replies: 7
    Last Post: 02-22-2007, 07:28 PM
  4. integrating vb pages into vba cmps
    By scruby in forum "How Do I..." Questions
    Replies: 4
    Last Post: 11-21-2005, 01:53 AM
  5. Integrating a Php Script into the CMPS
    By Polo in forum Troubleshooting / "How do I..." Questions
    Replies: 2
    Last Post: 12-23-2004, 01:54 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
  •