Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Addon] Generic Box


kymation

Recommended Posts

Checked and used a file comparison prog.

Only diff is the renaming of the file itself and within the php file.

Still 1 module to install and it is only showing the original generic module.

Will leave it for now, do not want to hog the thread.

Thanks

Jim

Link to comment
Share on other sites

You probably failed to make one or more of the changes in the module file. Check your changes against the instructions.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I get this...

Which is the original generic box

 

MODULE_BOXES_GENERIC_TITLE 1020 icon_arrow_right.gif Module Directory: /home/dcollier/public_html/includes/modules/boxes/

 

I have compared and checked both files and changed Enable Generic Module to Enable Generic Module Two, which is the name of my new files.

 

Thanks

Des

Link to comment
Share on other sites

  • 1 month later...

@@kymation

 

Hi jim!

First thank you for your contibution!

 

I’m having a problem with trying to display a image in the box. In the contents box seems it put a slash before each " and the image doesn’t show.

 

I put in window contents: <img src="/images/myimage.jpg">

 

and submit, the system changes it to <img src=\"/images/myimage.png\"> everytime I try to modify it, it add a new slash...

 

I've already tried to re install the modul, but the problem always apperas.

 

Any idea?

thank you very much for your help.

Riccardo

Edited by rikic
Link to comment
Share on other sites

  • 4 weeks later...

Hi Jim,

 

Just want to say that I installed this add-on onto V2.3.3 and it worked a treat. The code and the documentation are a fine example of how these things should be done.

 

I had just one discrepancy, which I put down to a difference between the version of 2.3.x when you wrote it, and 2.3.3, and that was when modifying catalog/admin/modules.php

 

I found, in addition the the "Line 38" difference, a second one as below at line 245, where the top one is the one included in your kit:

 

274c273
<		 $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_MODULES, 'set=' . $set . (isset($HTTP_GET_VARS['module']) ? '&module=' . $HTTP_GET_VARS['module'] : '') . '&action=edit')) . tep_draw_button(IMAGE_MODULE_REMOVE, 'minus', tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $mInfo->code . '&action=remove')));
---
>		 $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $mInfo->code . '&action=edit')) . tep_draw_button(IMAGE_MODULE_REMOVE, 'minus', tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $mInfo->code . '&action=remove')));

 

On the grounds that this difference was probably spurious, I ignored it and only made the "Line 38" change. The add-on has worked perfectly.

 

Many thanks, Laurie.

Link to comment
Share on other sites

Yes, that was a change in osC 2.3.3, and this code was written on 2.3.1. You did the right thing in ignoring the difference.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

  • 1 month later...

Hi,

I just installed this module and all works fine first go!

 

One small hitch which a couple of other people here are having is the back slash "\" in image links that is added everytime you hit the edit button. I don't see an answer yet so my temporary fix is to just enter the link and then don't touch the edit after that. If you do you have to go through the code entry and remove each "\". For some reason it is added just prior to a quote " " " so you end up with something like this ... catalog/images/PhotoGallery.jpg\" height=\"135\" width=\"135\" border=\"1\"></a>. If I save and click edit again I end up with this ... catalog/images/PhotoGallery.jpg\\" height=\\"135\\" width=\\"135\\" border=\\"1\\"></a> another back slash is added and so on it goes. I would love to have this than add a banner as I want to add more image links in this box. Big thanks to the developer!

Link to comment
Share on other sites

This is a known bug, caused by fixing another bug. I'm not sure if there is a permanent fix possible without rewriting part of the osCommerce module system. I should take another look at this when I have time.

 

I suggest using the Banner Box addon for banners.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

How can I add this to a generic box ?

 

<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_QRCODE);
new infoBoxHeading($info_box_contents, false, false);
$info_box_contents = array();
$info_box_contents[] = array('align' => 'center',
						 'text' => '<img src="https://chart.googleapis.com/chart?chs=100x100&cht=qr&chl=http://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] . '" width="100" height="100"><br>');
new infoBox($info_box_contents);
?>

You can't add PHP code to the generic box. It's not designed to do that. You need to create a new box to hold that external image.

 

Regards

Jim

 

hello and first of all thanks for your contributions.

second i try to use your generic box to create a QR box, i have no knowledge in programming and i found another post with a little info about create QR codes with a link, and i try to mix it up and works but then the bottom of my page move totally to the right like in another page, i have no idea where is the problem, i try different things and nothing work.

 

this is the link of my page i leave the box activated to show you the problem

 

http://www.electronixs123.com/store/

 

and here is the links to the box i try to create

 

http://www.electronixs123.com/share/

 

if you have time to check it and help me will be very appreciated.

 

i have installed theme switcher, generic box and banner box thanks to you

and iOSC Mobile Version for OSC 2.3.3. that is the big add-on that is all.

 

sorry i didn't realize generic box has its own topic

 

i try to read all the post quickly and one of them says someone try to do it before and you that told him that we cant add PHP code but this one works just with the little problem of the bottom of the page.

 

thanks in advance.

Jesus Morales

Edited by Tripa-X
Link to comment
Share on other sites

Your problem is in this line:

 

			  '  <div class="ui-widget-content infoBoxContents"><center><img src="https://chart.googleapis.com/chart?chs=100x100&cht=qr&chl=http://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] . '" width="100" height="100">';

 

You have opened a <center> tag and then never closed it. Since that tag is deprecated, I suggest you just remove it and add any styling you need to the CSS.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Your problem is in this line:

 

			 ' <div class="ui-widget-content infoBoxContents"><center><img src="https://chart.googleapis.com/chart?chs=100x100&cht=qr&chl=http://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] . '" width="100" height="100">';

 

You have opened a <center> tag and then never closed it. Since that tag is deprecated, I suggest you just remove it and add any styling you need to the CSS.

 

Regards

Jim

 

 

thank you so much, it is working now

 

if someone needed it or wanna try here it is

 

http://www.electronixs123.com/share/qr_box_final.zip

 

or maybe someone make improvements much better.

Link to comment
Share on other sites

  • 4 weeks later...

BUG FOUND:

 

It works, but at the admin panel in the content (the last field where you are supposed to fill in the codes) it is showing the field boxes (like to enter your email address and names or whatever your HTML and script code is supposed to produce) and fields are showing with back slashes like: \"\" and \"Subscribe\". If I were to modify the Title or other box fields above without touching these HTML or script codes I entered before, it will enter more and more back slashes in my codes and it will not work anymore unless I reenter new codes in that last box.

 

For example:

 

<p align=\\\"center\\\"><input type=\\\"submit\\\" value=\\\"Subscribe\\\" name=\\\"subscribe\\\" id=\\\"mc-embedded-subscribe\\\" />

</p>

</form>

</div>

 

The line above is the product after thrid edit from my last of my HTML codes. They are only supposed to look like this:

 

<p align="center"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" />

</p>

</form>

</div>

 

Do you see that each time you edit, it put extra back slash in the codes? Please fix it.

Link to comment
Share on other sites

This would require rewriting more of stock osCommerce than I'm willing to do, so it's probably not going to happen. Feel free to write your own box that does whatever you want it to.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

  • 1 month later...

Hi, Jim: I've just installed the Generic Box, and it is great!

 

I am wondering if it is possible to reduce the box height. I am using the box as a scrolling marquee to suggest ways that my embroidery designs can be used. http://jewellsembroidery.com/shop/

 

I would be happy with a box about the same height as the boxes immediately under it.

 

Is there an easy way to make this change? Could you please advise me on how to go about doing it?

 

Thank you,

Jewell

Edited by jeu4328
Link to comment
Share on other sites

The box should scale itself to fit the contents. There are some margins inherited from the jQuery stylesheets, so those might be adding some space. Look at your box using Firebug in Firefox. That will tell you what is being applied and where to find it. If all else fails, you can add some CSS to your marquee in your stylesheet with maximum height etc.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Firebug should give you some ideas. It's a marquee, so you might be able to get away with just that if it's the only one you have. For example:

 

marquee {
 max-height: 50px;
}

 

I don't guarantee that will work, of course, but you could try it. You can add CSS in the Firebug right panel and see the result immediately. I usually mess with the values there until it looks right, then copy what I've done into the stylesheet.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Thanks a million, Jim! I appreciate all your help! :D

 

:)

I will try that.

 

Have a great remainder of the week!

Jewell

 

Ok ... I tried it and that didn't work ... but that's ok. I'll keep working with it.

I'll post results once the problem is resolved.

Thanks again! :thumbsup:

Edited by jeu4328
Link to comment
Share on other sites

Well ... I've had a change of plans.

 

My intention was to have a banner box with a column of centered words scrolling 'up'. And although the banner box seemed to look right when viewing it in Google Chrome, it did not appear right in FireFox. It was a list of words, left justified, that extended the bottom border and could be seen behind all of the other boxes in the right column.

 

So I've decided to have a banner box with words scrolling to the 'left' in a single line. I'm very happy with it while viewing it in FireFox, but when I view it in Google Chrome, only a few of the words scroll to the left and then starts over again ... instead of going through the entire list of 28 items. (If you view it, it will go through 'bed spreads' and then starts back at 'aprons') I checked it in Internet Explorer, and it works fine.

 

http://JewellsEmbroidery.com/shop

 

Is there a reason it doesn't work right in Google Chrome? Is this a common problem? Is there something that I need to 'tweak' to make sure that it does?

 

Thank you,

Jewell

 

Link to comment
Share on other sites

It appears that Chrome no longer supports the marquee tag. You'll have to implement this in Javascript for it to work on all current browsers. I don't have a script handy, but a search turns up several likely candidates.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...