Results 1 to 10 of 12

Hybrid View

  1. #1
    Join Date
    Jun 2011
    Posts
    8
    Plugin Contributions
    0

    Default Inserting a shoutbox into a blank sidebox.

    Ok, this is my first post, forgive me if I have posted in the wrong forum. I am using v1.3.9a. I have a small problem getting a php shout box into a blank sidebox.

    I have installed the sidebox with no problems, the issue is that I'm a php noob and I can't get the shout box into the sidebox.

    I can see in my blank sidebox that I have a line of code where I can put the content of said box:

    Code:
    $content .= '';
    and I have a line of code to insert the shoutbox in a blank page:

    Code:
    <?php include("sb/shoutbox.php"); ?>
    (incidently the shout box does actually work), what I can't work out is how to marry the two bits of code to make the file 'shoutbox.php' the content for the blank sidebox.

    If I'm missing any information please let me know and I'll try to provide it.

    Thanks.

  2. #2
    Join Date
    Jun 2011
    Posts
    8
    Plugin Contributions
    0

    Default Re: Inserting a shoutbox into a blank sidebox.

    ...is this even possible?

  3. #3
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Inserting a shoutbox into a blank sidebox.

    You're problem is probably that you're trying to out the contents at a time when Zen Cart is trying to built a string with the content that will be output later.

    From what you've written, there's also a good chance that you've inserted extra PHP tags where they're not needed.

    You also haven't said where you've put your shoutbox. If the sb folder is in your site's root, you're OK, anywhere else and I wouldn't expect the file you're including to be found.

    So, make sure the sb folder is in the site's root and try the following (no PHP tags)
    PHP Code:
    ob_start();
    include(
    "sb/shoutbox.php");
    $content .= ob_get_contents();
    ob_end_clean(); 
    What this does is open an output buffer so that your content can be assigned locally to the content variable for use at the appropriate time, then closes and empties the buffer.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  4. #4
    Join Date
    Jun 2011
    Posts
    8
    Plugin Contributions
    0

    Default Re: Inserting a shoutbox into a blank sidebox.

    Thanks a lot, I'll try that when I get home and let you know. The directory 'sb' is not in the root foder, it's in the same folder as the blank sidebox php file. I will move it to the root (by that I take it you mean the root of the zencart installation not the whole server).


  5. #5
    Join Date
    Jun 2011
    Posts
    8
    Plugin Contributions
    0

    Default Re: Inserting a shoutbox into a blank sidebox.

    Quote Originally Posted by kuroi View Post
    PHP Code:
    ob_start();
    include(
    "sb/shoutbox.php");
    $content .= ob_get_contents();
    ob_end_clean(); 
    I can put this code directly between the single quote marks in:

    PHP Code:
    $content .= ''
    ?

  6. #6
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Inserting a shoutbox into a blank sidebox.

    No the code needs to be allowed to execute at that point, not be embedded in a string.

    I'm also slightly puzzled because I would have expected the shoutbox to give you a piece of HTML to put in the template and a php file to handle the responses. Are you sure you have this the right way around?

    Also, have you checked how the shoutbox will santize the data entered by your visitors to prevent your site suffer XSS hacks?
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  7. #7
    Join Date
    Jun 2011
    Posts
    8
    Plugin Contributions
    0

    Default Re: Inserting a shoutbox into a blank sidebox.

    The shoutbox code was from here:
    eukhost.com
    , no mention of HTML as far as I can see.

  8. #8
    Join Date
    Jun 2011
    Posts
    8
    Plugin Contributions
    0

    Default Re: Inserting a shoutbox into a blank sidebox.

    Quote Originally Posted by kuroi View Post
    Also, have you checked how the shoutbox will santize the data entered by your visitors to prevent your site suffer XSS hacks?
    Had not checked this, perhaps it would be better to look for a better shoutbox?

 

 

Similar Threads

  1. Replies: 1
    Last Post: 23 Apr 2010, 02:23 PM
  2. Inserting Advanced Poll in a blank sidebox
    By AdamTOW in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 9 Oct 2008, 10:17 PM
  3. Download ABOUT US - Inserting Custom Page Into Sidebox
    By Centec2b in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 31 Jul 2008, 07:07 PM
  4. Putting code into Kuroi's Blank Sidebox
    By dealbyethan.com in forum Basic Configuration
    Replies: 8
    Last Post: 15 Jul 2008, 01:18 PM
  5. A flash MP3 player into a blank sidebox!
    By alhakeem2001 in forum Basic Configuration
    Replies: 1
    Last Post: 7 Jan 2008, 12:41 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
  •  
disjunctive-egg