Jump to content

Recommended Posts

Hi.

 

I need some basic help to make a ssi function work in my webshop. I use zen cart and have installed a simple mod called blank sidebox. this is a box where I can put basic html content in but I want to put a SSI function from my forum in it. The code in blank_sidebox.php looks like this:

 

$content = '';

 

  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';

 

  $content .= '

 

<!-- EDIT BELOW THIS LINE -->

 

<table align="center">

 

<tr>

 

ssi_recentPosts(); (This is where i want to put my SSI function, how do i do that? this will just output ssi_recentPosts(); in the box )

 

<tr>

 

</table>

 

 

 

<!-- EDIT ABOVE THIS LINE -->

 

';

 

  $content .= '</div>';

 

 

 

 

(yes I am a totally noob  :-[)

Link to comment
https://forums.phpfreaks.com/topic/70715-noob-need-help-with-a-ssi-function/
Share on other sites

It's to get the recent posts from my SMF forum in my and this works but the problem here is that the recent posts actually is above the box not in it  :-\

 

  $content = '';

  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';

  $content .= '

<!-- EDIT BELOW THIS LINE -->

<table align="center">

<tr>';



ssi_recentPosts();

$content .= '<tr>

</table>



<!-- EDIT ABOVE THIS LINE -->

';

  $content .= '</div>';

Try changing it to this...

 

<!-- EDIT BELOW THIS LINE -->

<table align="center">

<tr>';



$data = ssi_recentPosts();
$content .= $data;

$content .= '<tr>

</table>



<!-- EDIT ABOVE THIS LINE -->

';

  $content .= '</div>';

 

Regards

Huggie

the original file looks like this:

 

<?php

//

// Blank Sidebox Mod

// includes/templates/templates_default/sideboxes/tpl_blank_sidebox.php


  $content = '';

  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';

  $content .= '

<!-- EDIT BELOW THIS LINE -->

<table align="center">

<tr>




<tr>

</table>



<!-- EDIT ABOVE THIS LINE -->

';

  $content .= '</div>';

?>

 

You can see the result on www.csstemplateheaven.com in the left column. Recent posts are above the "Support" (which is blank_sidebox.php). I want recent posts to be inside this box. If I put plain html in the table it works perfect.

 

 

I looked at the Zen Cart site and dowloaded the latest version of Blank Sidebox (for Zen Cart v1.3.7) and then visited the SMF site to look at their SSI stuff.

 

I came up with the following:

 

<?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 $
*/

/*
Looking at both the Zen Cart homepage and the SMF homepage I think the
following should probably work.
*/

// Needs to be the full path to the SMF SSI.php
require('/path/to/smf/forum/SSI.php');

  $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>' . ssi_recentPosts() . '</p>';

  $content .= '</div>';
?>

 

I think the most important part to note here is probably the require of SSI.php on your page.

 

If you're running version 1.3.0 of Zen Cart then you should still be able to use what I've posted.

 

Regards

Huggie

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.