If this is your first visit, check our documentation. To post, register or login.
Forums / Addon Sideboxes / Problem with Blank Sidebox Plugin

Problem with Blank Sidebox Plugin

Started by aaronjmorgan on 17 Apr 2013, 5:52 AM · Views: 1,940

Results 1 to 9 of 9
17 Apr 2013, 5:52 AM
#1
aaronjmorgan avatar

aaronjmorgan

New Zenner

Join Date:
Mar 2013
Posts:
48
Plugin Contributions:
0

Problem with Blank Sidebox Plugin

this is my website: https://www.toyzeum.com/store

this is my tpl_blank_sidebox.php file:

"<?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 .= '<HTML><IMG SRC="https://www.toyzeum.com/store/images/main/rightsidebar_incoming2.jpg"><IMG SRC="https://www.toyzeum.com/store/images/main/rightsidebar_incoming<? $num = Rand (1,6); switch ($num) { case 1: echo "1"; break; case 2: echo "2"; break; case 3: echo "2"; break; case 4: echo "2"; break; case 5: echo "1"; break; case 6: echo "1"; }?>.jpg"></HTML>';

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

Description: As you can see... I have a basic image which is displaying fine in the right hand sidebar... followed by a random image PHP script contained within Image HTML coding. There should be two images displaying.. A normal image followed by a rotating image....Any ideas why it is not displaying correctly and if there is a way to get it being able to display random images? I also would like the image to be displaying at the very top of the sidebar but there is a small gap of whitespace? any idea what is causing that small gap and how to get rid of that ? I am a new forum user. Thank you kindly for your help. - Aaron :smile:

17 Apr 2013, 6:27 AM
#2
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Problem with Blank Sidebox Plugin

Why not use Banner Manager?

17 Apr 2013, 4:00 PM
#3
aaronjmorgan avatar

aaronjmorgan

New Zenner

Join Date:
Mar 2013
Posts:
48
Plugin Contributions:
0

Re: Problem with Blank Sidebox Plugin

i just really want to understand why this is not working the way it is rather than looking for other alternatives at this point...

17 Apr 2013, 4:20 PM
#4
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Problem with Blank Sidebox Plugin

I do not believe php echo will work within the sidebox. The sidebox contents are output by ```php
$content .=


try replacing echo with $content

I do not utilize zen cart sidebox functionality as much these days except to display product and/or navigation.
17 Apr 2013, 4:30 PM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8
17 Apr 2013, 4:48 PM
#7
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Problem with Blank Sidebox Plugin

aaronjmorgan:

i just really want to understand why this is not working the way it is rather than looking for other alternatives at this point...
And that's fine, but what is being suggested is built into Zen Cart and is very similar to the random image code you are using.. The end result is EXACTLY the same output that you are trying to achieve with your script (random rotating images that change whenever the page refreshes -- do not let the term "banner" throw you off.. I often say that the banner functions are one of the most underused and versatile features within Zen Cart).. That's why it was suggested..

Carry on..

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

18 Apr 2013, 11:41 PM
#8
aaronjmorgan avatar

aaronjmorgan

New Zenner

Join Date:
Mar 2013
Posts:
48
Plugin Contributions:
0

Re: Problem with Blank Sidebox Plugin

DivaVocals:

And that's fine, but what is being suggested is built into Zen Cart and is very similar to the random image code you are using.. The end result is EXACTLY the same output that you are trying to achieve with your script (random rotating images that change whenever the page refreshes -- do not let the term "banner" throw you off.. I often say that the banner functions are one of the most underused and versatile features within Zen Cart).. That's why it was suggested..

Carry on..

I tried to replace "echo" with "$content .=" but that didnt work either.... I checked out the banner section and I actually like how it tracks the banners... So I will go with that. Thank you... With regard to my other question... does anyone know how to get rid of the white space that is above the sideboxes. I want my sideboxes to go all the way to the top up against my top bar of sections. You can see that the Incoming image is designed to merge with my breadcrumb trail bar which is grey.

Also why do i feel like some people are following me and posting harsh things... As i said... i am new to zen cart and trying to learn... I am new to PHP as well and do not know too much... but the best way to learn is by doing it. People are snapping at me for not using overrides... relax... its making the forums unpleasant for me and ive only been using these forums for like 4 days...

If you can help me with the white space gap i would really appreciate it. Thank you

19 Apr 2013, 12:29 AM
#9
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Problem with Blank Sidebox Plugin

aaronjmorgan:

I tried to replace "echo" with "$content .=" but that didnt work either.... I checked out the banner section and I actually like how it tracks the banners... So I will go with that. Thank you... With regard to my other question... does anyone know how to get rid of the white space that is above the sideboxes. I want my sideboxes to go all the way to the top up against my top bar of sections. You can see that the Incoming image is designed to merge with my breadcrumb trail bar which is grey.Once you get the banners setup I think you be RELEIVED that you didn't spend one more minute trying to make this work.. PLUS the tracking feature is tre cool!:smoke:

aaronjmorgan:

Also why do i feel like some people are following me and posting harsh things... As i said... i am new to zen cart and trying to learn... I am new to PHP as well and do not know too much... but the best way to learn is by doing it. People are snapping at me for not using overrides... relax... its making the forums unpleasant for me and ive only been using these forums for like 4 days...I don't think anyone is following you persay.. folks just answer posts when they see them posted.. and if they are following the recent posts filter (as many of us are) and you are posting a LOT of questions which are popping up in the new posts filter, then it may appear that folks are following you.. but trust me.. No one is stalking anyone here..:laugh:

From what I've seen the information posted is meant to help, not punish you.. Take your question to get your random image code to work, it raised flags for a LOT of us here to see that you were brand new to Zen Cart, (and inexperienced with PHP and such) and without making sure that your path was a good solid path to take, you dove into this and IMMEDIATELY began make core code changes that many of us KNEW were not necessarry to achive what you wanted.. The reason for the seemingly harsh tones is that we all saw you walking down a path that would lead to issues later and especially would be problematic come upgrade time.. Don't take it personal.. I got beat up a LOT when I first got here asking newbie questions and making newbie statements.. But I toughened up and realized that most here are really just trying to help..

TRULY folks are just trying to help..:smile: You will find though that we are a group of direct speakers.. (myself ESPECIALLY!!:laugh:)

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.