Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Infobox Skin Manager


equilla

Recommended Posts

My newest contribution released today :D

 

http://www.oscommerce.com/community/contributions,1680

 

This contribution allows you to easily change the look of your infoboxes by "wrapping" them in a sliced up graphic. All you have to do is draw one infobox template, save it as a JPEG, upload it and the script does the rest!

 

A small library of example infobox skins is included with this contrib to get you started.

 

You must have gdlib2 installed on your server for this script to work.

 

This is a relatively simple script at the moment and there are some limitations with what can be achieved with it. I'd really like some feedback on this so that we know what people would also like to see in any future releases.

 

I do have a working demo available online, so if anyone wants to see that, please just drop me a line for details.

 

Enjoy,

 

 

 

 

Mark

Link to comment
Share on other sites

  • Replies 156
  • Created
  • Last Reply

Top Posters In This Topic

Thanks Blueline. I've been getting some good feedback on this from a number of sources so I think we can look forward to some further additions to this contribution in the near future.

Edited by Johnson
Link to comment
Share on other sites

Hi,

 

many thanks for that.

 

Site thema for stylesheets? Is that some kind of simplified stylesheet editor thingy?

 

Anyway, taking these various template related contribs and integrating them into some kind of cohesive templating armoury is something that would be nice to achieve.

 

I still have the automatic button creator on my todo list, but this week has been kind of hectic, so it didn't even make it onto the drawing board (aka laptop...) :(

Link to comment
Share on other sites

I have installed this contribution and followed the instructions exactly but I am coming up with this error when I click on templates

 

1146 - Table 'jaamor.skins' doesn't exist

 

select * from skins

 

[TEP STOP]

 

My hosting company told me that the jaamor. part is automatically added because that is the name of my site. I obviously have to modify one/some files to add the jaamor. part of the table but I am unsure of what to modify. I think the text I need to modify is in infobox_skins.php but I don't know what to change. Could someone please help? Thanks.

Link to comment
Share on other sites

Hi All,

 

right let's deal with these one by one ;)

 

dbenfell - yes you are missing something. You should have a new menu option Templates -> Infobox Skin Manager - that is where the main controls are. If you don't have these then you need to check that up changed admin/includes/column_left.php.

 

JanetMor - There is a small omission from the installation instructions. You need to use the .sql file to add the required table "skins" to your database. You should do this using something like phpmyadmin.

 

Paulm2003 - thank you for your comments. Shame I couldn't see the original but hey that's life! I never purported to be a graphics designer - just a reasonable programmer. I provide the tools, it's what you do with them that counts. If you think you can do better then why don't you show us.....

Link to comment
Share on other sites

thank you for your comments. Shame I couldn't see the original but hey that's life!
you mean the :censored: ? That was/is the original :)

 

I never purported to be a graphics designer
Ok sorry, to be honest I can't do it any better. I understand now the demo is only to show what is possible with the boxes this way.

 

What does bother me, and it made me a bit irritated, that the demo you provided only looks ok in IE. I also tried Mozilla, Opera and Konqueror and it really looks terrible. I just think a reasonable " "programmer should" check/go for at least some cross browser compatibility (I don't say it does not have to be 100% perfect in every browser).

 

Paul

Link to comment
Share on other sites

Hi Paul,

 

OK fair enough.

 

Must admit I haven't had time to fire up my Opera and have a look at it - always to many coding deadlines to meet at the moment.

 

You're right, it should at least look reasonable in all the others browsers. However, at least for now it'll look right for about 96% of visitors (according to my weblogs anyway) - seems that Bill still rules for most people!

 

Cheers,

 

 

Mark

Link to comment
Share on other sites

Aha, yes I see what you mean. That it is a nice shade of green though isn't it lol?

 

This can be easily fixed, so I think we will roll this in with the next updates that will include some feature extensions too.

 

Cheers,

 

 

Mark

Link to comment
Share on other sites

Thanks. Yes I noticed that and added the table in mysql database. However, I am getting this error on my front page.

 

Fatal error: Call to undefined function: tep_output_string() in /hsphere/local/home/jade2001/jaamor.com/catalog/includes/classes/boxes.php on line 24

 

 

 

I changed the catalog/includes/classes/boxes back to the original to get rid of that error but I need to replace this file with the file that comes with this contribution. Does someone know what has happened to I can fix the new catalog/includes/classes/boxes.php that comes with the contribution so I can use this contribution? It is such a great tool.Thanks.

Link to comment
Share on other sites

Guys...just a quick note. In order to get this properly working you will need to make some changed. The infoBoxes are almost all tied to the infoBoxContents class in the stylesheet. This is a problem because it has a background color value, which can cause cosmetic problems.

 

The way to fix this: Copy the .infoBoxContents style, and past it right below. Rename it to .infoBoxContents2 and then delete the background color tag.

 

Go into all of the files in the /catalog/includes/boxes folder and rename all instances of class="infoBoxContents" to class="infoBoxContents2"

 

This will fix the problem.

 

HTH,

-Chris

Chris Sullivan

Link to comment
Share on other sites

Hi Janet,

 

That'd be because you are running an MS1 osCommerce store and the new /catalog/includes/classes/boxes.php file is based on MS2 (the tep_output_string thing is because of the change in the name of the function concerned.

 

In order to make it work with MS1, you would have to make the changes manually. The changes are:

 

1. A new class function called newinfoboxcontents which needs to be added.

 

2. A change to the infobox class which added the following near the beginning of the function:

 

if (SKIN_INFOBOX_ACTIVE == 'true')

 

$info_box_contents[] = array('text' => $this->newinfoBoxContents($contents));

 

else {

 

and a corresponding } near the end.

 

3. Similarly, in infoboxheading class, the following were added near the beginning:

 

if (SKIN_INFOBOX_ACTIVE == 'true'){

 

$infobox_header_text = $contents[0]['text'];

$infobox_header_link = $right_arrow;

}

 

else {

 

and a corresponding } near the end too.

 

If you have any trouble doing this let me know and I will modify an MS1 version of this file for you.

Edited by equilla
Link to comment
Share on other sites

Hi Blueline,

 

yes you are right. If you have new infoboxes with a background other than white, you will notice that the odd one here and there that still has a white background because of the infoboxcontents class being hard coded into the code for the box.

 

I think I may have found another way around this though. If you edit the following part of the stylesheet to include this instead of the original colour value:

 

.infoBoxContents {

background: transparent;

}

 

Then this allows the colour of the middle cell in those boxes to show through without upsetting anything else.

 

I think.... :unsure:

Link to comment
Share on other sites

Hi

 

Thanks for the reply. Now have templates choice on the menu.

 

another problem. When I click confirm after I have selected a skin, I get the following errors. And I noticed none of the jpgs are in the directory but were not in the zip file either. Plus I get the error at the bottom headers already sent.

 

Warning: imagejpeg(): Unable to open '/home/davidb/public_html/catalog/images/infobox/top_left.jpg' for writing in /home/davidb/public_html/catalog/admin/infobox_skin.php on line 129

 

Warning: imagejpeg(): Unable to open '/home/davidb/public_html/catalog/images/infobox/top_right.jpg' for writing in /home/davidb/public_html/catalog/admin/infobox_skin.php on line 129

 

Warning: imagejpeg(): Unable to open '/home/davidb/public_html/catalog/images/infobox/bottom_left.jpg' for writing in /home/davidb/public_html/catalog/admin/infobox_skin.php on line 129

 

Warning: imagejpeg(): Unable to open '/home/davidb/public_html/catalog/images/infobox/bottom_right.jpg' for writing in /home/davidb/public_html/catalog/admin/infobox_skin.php on line 129

 

Warning: imagejpeg(): Unable to open '/home/davidb/public_html/catalog/images/infobox/top_background.jpg' for writing in /home/davidb/public_html/catalog/admin/infobox_skin.php on line 129

 

Warning: imagejpeg(): Unable to open '/home/davidb/public_html/catalog/images/infobox/bottom_background.jpg' for writing in /home/davidb/public_html/catalog/admin/infobox_skin.php on line 129

 

Warning: imagejpeg(): Unable to open '/home/davidb/public_html/catalog/images/infobox/left_background.jpg' for writing in /home/davidb/public_html/catalog/admin/infobox_skin.php on line 129

 

Warning: imagejpeg(): Unable to open '/home/davidb/public_html/catalog/images/infobox/right_background.jpg' for writing in /home/davidb/public_html/catalog/admin/infobox_skin.php on line 129

 

Warning: Cannot modify header information - headers already sent by (output started at /home/davidb/public_html/catalog/admin/infobox_skin.php:129) in /home/davidb/public_html/catalog/admin/includes/functions/general.php on line 18

Link to comment
Share on other sites

Hi Mark,

Must admit I haven't had time to fire up my Opera and have a look at it - always to many coding deadlines to meet at the moment.
OK fair enough. (I know, sometimes I copy and paste too much :) )

 

seems that Bill still rules for most people!
Yes he does, but for the wrong reasons. Most people really don't know why they use IE (actually some do know: because someone put it there, in front of their face and mouse), most people don't even know what it really is and that better alternatives exist. I don't say IE is bad, it only feels to me like the whole world is driving a Lada without knowing a Mercedes exists (which is even cheaper in this case!). :(
Link to comment
Share on other sites

Hi David,

 

sounds like you have a permissions problem. The script should have warned about this actually, with a red message at the top of the page saying that the directory was not writeable.

 

In this case, the directory concerned is /catalog/images/infobox and you need to make the folder writeable through either FTP or Secure Shell (CHMOD) so that the script can write the sliced images to it.

 

The other message about headers already is sent - it is happening because the error messages about the images not being able to be written are being produced and thus the page cannot be redirected as planned.

 

Basically, fix that one issue and this should all work :D

Link to comment
Share on other sites

Hi chfields,

 

I just had a look at your site and did "view source" - it looks as though there may have been some customisation on your site in this area already.

 

If the files in /catalog/includes/boxes.php have been modified to use something other than the infobox class then you will get what you are seeing right now.

 

What I would suggest is having a look at these file to see how they call infoboxheading and infobox. You should see lines similar (though not necessarily identical) to the following:

 

new infoBoxHeading($info_box_contents, true, false);

 

and elsewhere in the file:-

 

new infoBox($info_box_contents);

 

If that draws a blank then perhaps there have been some modifications in /includes/classes/boxes.php which conflict - did you make the changes there manually or use the file included in the contribution directly?

 

 

Mark

Link to comment
Share on other sites

Just thought I would show you guys what can be done with a few mods.

 

Now you can have your content boxes (like the New Products for Month) on the index.php page integrated as well. You can check it out at: http://www.eclyptiq.com/demo if you want to see it.

How are you wrapping the non-infoboxes (new products, etc)?

 

I hacked boxes.php myself a while ago to do the same thing (although I didn't go as far as hacking the admin side as well to manage it and I cut the boxes manually).

 

Looking at your mod, you are doing the same thing I did and have the same limitation. It only works on infoboxes. New products has the content data handled differently and doesn't decode the same way. The best I've been able to manage so far is a wrapped newproducts box with no content.

 

If you've found a way to wrap all the boxes, please release it !!!!!!!!!!

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