If this is your first visit, check our documentation. To post, register or login.
Forums / Community Contributed Add-Ons / Addon Sideboxes / Help! - Twitter HTML code in sidebox cause PHP error

Help! - Twitter HTML code in sidebox cause PHP error

Started by pexter on 2 Jan 2014, 8:26 PM · Views: 2,434

Results 1 to 2 of 2
2 Jan 2014, 8:26 PM
#1
pexter avatar

pexter

New Zenner

Join Date:
May 2013
Location:
Karlskoga, Sweden
Posts:
48
Plugin Contributions:
0

Post #1 by pexter

Hi all,
I wanted to add a twitter news feed, so I installed the blank sidebox addon and added my twitter widget html code to that. It looks great but I just noticed that I can't click my banner anymore and that a error logfile is created. I don't know if anything else also is affected!? :(

Any ideas how to resolve this?

Here's the code and error message:

blank_sidebox_defines.php:

<?php /** * blank sidebox definitions - text for inclusion in a new blank sidebox * * @package templateSystem * @copyright 2007 Kuroi Web Design * @copyright Portions Copyright 2003-2007 Zen Cart Development Team * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: blank_sidebox.php 2007-05-26 kuroi $ */ define('BOX_HEADING_BLANK_SIDEBOX', 'News'); define('TEXT_BLANK_SIDEBOX', ''); ?>

blank_sidebox.php:

<?php /** * blank sidebox - allows a blank sidebox to be added to your site * * @package templateSystem * @copyright 2007 Kuroi Web Design * @copyright Portions Copyright 2003-2007 Zen Cart Development Team * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: blank_sidebox.php 2007-05-26 kuroi $ */ // test if box should display $show_blank_sidebox = true; if ($show_blank_sidebox == true) { require($template->get_template_dir('tpl_blank_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_blank_sidebox.php'); $title = BOX_HEADING_BLANK_SIDEBOX; $title_link = false; require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default); } ?>

tpl_blank_sidebox.php:

<?php /** * blank sidebox - allows a blank sidebox to be added to your site * * @package templateSystem * @copyright 2007 Kuroi Web Design * @copyright Portions Copyright 2003-2007 Zen Cart Development Team * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: blank_sidebox.php 2007-05-26 kuroi $ */ $content = ''; $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">'; // Replace the text and HTML tags between the apostophes on lines 19 and 20. // Use as many or as few lines using this model as you need for your custom content. // If you have a multilingual site define your text in the languages/YOUR_LANGUAGE/extra_definitions/blank_sidebox_defines.php and include it as shown in line 19. // If your site is monolingual, you can put the text right here as shown on line 20 (and nobody will know!) $content .= '<p>' . TEXT_BLANK_SIDEBOX . '</p>'; $content .= '<html>' . '<a class="twitter-timeline" height="300" href="https://twitter.com/Scaffoldusa" data-widget-id="414489528905109504">Tweets by @Scaffoldusa</a><script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>' . '</html>'; $content .= '</div>'; ?>

This is the error message:
PHP Warning: Cannot modify header information - headers already sent by (output started at /includes/languages/english/extra_definitions/blank_sidebox_defines.php:18) in /includes/functions/functions_general.php on line 45

The site is https://www.scaffoldusa.com

Thanks!

3 Jan 2014, 8:12 PM
#2
pexter avatar

pexter

New Zenner

Join Date:
May 2013
Location:
Karlskoga, Sweden
Posts:
48
Plugin Contributions:
0

Post #2 by pexter

ob_start(); in the beginning of blank_sidebox_defines.php seams to have solved the issue! :smile: