Jump to content



Photo
- - - - -

[Addon] Generic Box


  • Please log in to reply
261 replies to this topic

#61   avtardeol

avtardeol
  • Members
  • 13 posts
  • Real Name:Avtar

Posted 23 March 2011 - 17:34

This is a really good addon - what I've been looking for.

One prob tho (sorry)
The title on my box is: MODULE_BOXES_GENERIC_BOX_TITLE

and I can't see why.

help pleaseeeee...
Thanks

A

#62   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,027 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 23 March 2011 - 18:23

That was a bug in older versions of this Addon. Uninstall your box and upload version 1.0.2.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#63   avtardeol

avtardeol
  • Members
  • 13 posts
  • Real Name:Avtar

Posted 24 March 2011 - 09:28

That was a bug in older versions of this Addon. Uninstall your box and upload version 1.0.2.



SPOT ON JIM - Thanks very much - very useful

#64   rebelrich888

rebelrich888
  • Members
  • 1 posts
  • Real Name:Richard Connell

Posted 04 April 2011 - 01:31

Hi guys i need a bit of help, i just got and installed the generic box module, im a complete noob to php code and sometimes it feels like trying Learning Einsteins theory of relativity from a french man :S,

I wanted to implement social links with buttons into my Generic box and was wondering where and how i imput the html coding within the php file


I notice this is an old Post im just praying you still get an alert for it

#65   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,027 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 04 April 2011 - 01:47

You add your HTML code in the Admin interface where you installed the module, in the box labeled <language> Contents (where <language> is your installed language). See section 3.2.1 in the manual for more information.

Yes, thankfully, the forum is still sending notices on this one. It will stop doing so at some unknown future time, without notice, so PM me if I don't respond in a day or so.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#66   wildvettes

wildvettes
  • Members
  • 81 posts
  • Real Name:Damien Routledge

Posted 05 April 2011 - 07:14

Hi Jim,

First thank you for the module...works great.

The problem I'm trying to fix is related to ssl encryption. I am using this box for twitter and facebook feeds. Facebook offers the feed in encrypted format so it works perfectly at all times.

My twitter feed is not available in an https format

I have this code

<?php
if( $_SERVER['HTTPS'] != "on" )
{
?>
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
  version: 2,
  type: 'search',
  search: 'Corvette',
  interval: 6000,
  title: 'Corvette Tweets',
  subject: '',
  width: 'auto',
  height: 300,
  theme: {
    shell: {
      background: '#535454',
      color: '#ffffff'
    },
    tweets: {
      background: '#050505',
      color: '#f2eff2',
      links: '#1985b5'
    }
  },
  features: {
    scrollbar: true,
    loop: true,
    live: true,
    hashtags: true,
    timestamp: true,
    avatars: true,
    toptweets: true,
    behavior: 'default'
  }
}).render().start();
</script>

<?php
}
?>

It works as it is supposed to from my main page, but inserted into the generic box text box it doesn't turn off on https.

Is there somewhere else in the coding I can place this to have it show up properly? Thank you in advance. /biggrin.gif' class='bbc_emoticon' alt=':D' />

#67   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,027 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 05 April 2011 - 15:26

In includes/modules/boxes/bm_generic.php, find this line:

      if (tep_not_null($content)) {

and replace it with:

      if (tep_not_null($content) && $_SERVER['HTTPS'] != "on" ) {

Then put your script (without the PHP code) in the module's text box for your language. Thanks for pointing this out. I'll fix it in a future release.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#68   wildvettes

wildvettes
  • Members
  • 81 posts
  • Real Name:Damien Routledge

Posted 05 April 2011 - 16:40

In includes/modules/boxes/bm_generic.php, find this line:

      if (tep_not_null($content)) {

and replace it with:

      if (tep_not_null($content) && $_SERVER['HTTPS'] != "on" ) {

Then put your script (without the PHP code) in the module's text box for your language. Thanks for pointing this out. I'll fix it in a future release.

Regards
Jim


Great thanks, I already got it working outside of the generic box, but this change will allow me to add another whole "Generic Box" and turn it on and off with https correct? I actually had a split between encrypted and non-encrypted content in the same box, so I added the whole code line into the template_bottom.php in an infoboxcontainer div and now it latches on the bottom of the generic box.

Thanks for the great add-on!

#69   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,027 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 05 April 2011 - 18:57

This code disables the box on a SSL page. I intend to code a version that will switch to SSL when needed, but that's a lot more complex. This was a quick fix to solve the problem.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#70   Ausgirl

Ausgirl
  • Members
  • 936 posts
  • Real Name:Ruth
  • Gender:Female
  • Location:Brisbane, Australia

Posted 15 April 2011 - 09:27

I got the same error, I tried the fixes you suggested still had the same error.

I double checked it to make sure I uploaded to the right file paths, uninstalled it, re-installed it, double checked again
and still got the same error message so I just uninstalled it. /sad.gif' class='bbc_emoticon' alt=':(' />

#71   surrfman

surrfman
  • Members
  • 363 posts
  • Real Name:Timmy C
  • Gender:Male
  • Location:Great State of Michigan

Posted 15 April 2011 - 16:51

run into an error after installing module:

Fatal error: Cannot redeclare class language in /home1/sgptechc/public_html/discountegauges/includes/classes/language.php on line 16


here is the code from the language.php file:

<?php
/*
$Id$

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright © 2003 osCommerce

Released under the GNU General Public License

browser language detection logic Copyright phpMyAdmin (select_lang.lib.php3 v1.24 04/19/2002)
Copyright Stephane Garin <sgarin@sgarin.com> (detect_language.php v0.1 04/02/2002)
*/

class language { (this is line 16)

var $languages, $catalog_languages, $browser_languages, $language;
function language($lng = '') {
$this->languages = array('ar' => 'ar([-_][[:alpha:]]{2})?|arabic',
'bg' => 'bg|bulgarian',
'br' => 'pt[-_]br|brazilian portuguese',
'ca' => 'ca|catalan',
'cs' => 'cs|czech',
'da' => 'da|danish',
'de' => 'de([-_][[:alpha:]]{2})?|german',
'el' => 'el|greek',
'en' => 'en([-_][[:alpha:]]{2})?|english',
'es' => 'es([-_][[:alpha:]]{2})?|spanish',
'et' => 'et|estonian',
'fi' => 'fi|finnish',
'fr' => 'fr([-_][[:alpha:]]{2})?|french',
'gl' => 'gl|galician',
'he' => 'he|hebrew',
'hu' => 'hu|hungarian',
'id' => 'id|indonesian',
'it' => 'it|italian',
'ja' => 'ja|japanese',
'ko' => 'ko|korean',
'ka' => 'ka|georgian',
'lt' => 'lt|lithuanian',
'lv' => 'lv|latvian',
'nl' => 'nl([-_][[:alpha:]]{2})?|dutch',
'no' => 'no|norwegian',
'pl' => 'pl|polish',
'pt' => 'pt([-_][[:alpha:]]{2})?|portuguese',
'ro' => 'ro|romanian',
'ru' => 'ru|russian',
'sk' => 'sk|slovak',
'sr' => 'sr|serbian',
'sv' => 'sv|swedish',
'th' => 'th|thai',
'tr' => 'tr|turkish',
'uk' => 'uk|ukrainian',
'tw' => 'zh[-_]tw|chinese traditional',
'zh' => 'zh|chinese simplified');

$this->catalog_languages = array();
$languages_query = tep_db_query("select languages_id, name, code, image, directory from " . TABLE_LANGUAGES . " order by sort_order");
while ($languages = tep_db_fetch_array($languages_query)) {
$this->catalog_languages[$languages['code']] = array('id' => $languages['languages_id'],
'name' => $languages['name'],
'image' => $languages['image'],
'directory' => $languages['directory']);
}

$this->browser_languages = '';
$this->language = '';

$this->set_language($lng);
}

function set_language($language) {
if ( (tep_not_null($language)) && (isset($this->catalog_languages[$language])) ) {
$this->language = $this->catalog_languages[$language];
} else {
$this->language = $this->catalog_languages[DEFAULT_LANGUAGE];
}
}

function get_browser_language() {
$this->browser_languages = explode(',', getenv('HTTP_ACCEPT_LANGUAGE'));

for ($i=0, $n=sizeof($this->browser_languages); $i<$n; $i++) {
reset($this->languages);
while (list($key, $value) = each($this->languages)) {
if (preg_match('/^(' . $value . ')(;q=[0-9]\\.[0-9])?$/i', $this->browser_languages[$i]) && isset($this->catalog_languages[$key])) {
$this->language = $this->catalog_languages[$key];
break 2;
}
}
}
}
}
?>

the languages module is set to true: sort order doesn't conflict with other boxes. tried downloading the contribution, and re-installing, but get same result. did notice if I close the browser window, wait few minutes, start a new browser, the site comes up with no error. try another site, go back to my site and the error rears it's ugly head!


any idea on what I have messed-up?

Thanks,

Timmy C

#72   germ

germ
  • Members
  • 13,921 posts
  • Real Name:Jim
  • Gender:Male
  • Location:USA (GMT-6)

Posted 15 April 2011 - 20:48

In includes/modules/boxes/bm_generic.php, find this line:

      if (tep_not_null($content)) {

and replace it with:

      if (tep_not_null($content) && $_SERVER['HTTPS'] != "on" ) {

Then put your script (without the PHP code) in the module's text box for your language. Thanks for pointing this out. I'll fix it in a future release.

Regards
Jim

Wouldn't it be better to use this:

      if (tep_not_null($content) && $request_type != 'SSL' ) {

The other test isn't valid on all servers.

If you use the global variable $request_type set in /includes/application_top.php then the contribution will work, provided of course SSL works at all in the shop.
If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -

"Headers already sent" - The definitive help

"Cannot redeclare ..." - How to find/fix it

SSL Implementation Help

Like this post? "Like" it again over there >

#73   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,027 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 15 April 2011 - 20:49

I've heard of this error before, but I've never been able to duplicate it. Whatever the problem is, it's nothing to do with what the error message says. I would have to try to track it down with whatever debugging tricks I can manage. Without having the error in the code on my server to do this, it's just not happening. Sorry.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#74   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,027 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 17 April 2011 - 02:35

Another blind attempt at a bug fix. Would somebody who is getting the Fatal error: Cannot redeclare class language.... error message please try this and report back whether it works or not. In catalog/includes/application_top.php, find the following code:

    include(DIR_WS_CLASSES . 'language.php');

and change it to

    include_once(DIR_WS_CLASSES . 'language.php');

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#75   BurtonDavis

BurtonDavis
  • Members
  • 8 posts
  • Real Name:Burton Davis
  • Gender:Male

Posted 19 April 2011 - 18:14

Worked GREAT and the 1st time for me, no issues.

Another question however, is it possible to have more than 1 generic box?


#76   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,027 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 19 April 2011 - 19:01

It's possible. You need to make a copy of the files and rename them. Then use your editor's search-and-replace to:

1. Change all instances of bm_generic to the name of your new box.

2. Change all instances (Case Sensitive!) of _GENERIC_ to match your new name.

You might also want to change the name in the language file so you can keep the new box separate from the original.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#77   ChristianGarcia-Cox

ChristianGarcia-Cox
  • Members
  • 2 posts

Posted 24 April 2011 - 06:19

Well, it's the oddest thing...

Wanna replicate it? try re-ordering all the other boxes using 2-digit numbers, instead of the default 4-digit.

I really don't know why, but when I've done this (use 2-digits order numbers) I get the error message, re-order everything using 4-digits again and the problem solves by itself...

I've done this in 2 different pages, with the same causes/results/fix; you should check it yourself.

Great add-on by the way, thank you very much for sharing it with us.

Kindest regards.

I've heard of this error before, but I've never been able to duplicate it. Whatever the problem is, it's nothing to do with what the error message says. I would have to try to track it down with whatever debugging tricks I can manage. Without having the error in the code on my server to do this, it's just not happening. Sorry.

Regards
Jim



#78   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,027 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 24 April 2011 - 17:46

I tried that, and still don't get an error message. I even tried setting all of the boxes' sort order to 0. My copy just works. I suspect this may have something to do with the version of PHP, or possibly a server setting.

If using 4-digit numbers works for you, then maybe it will help others as well, so thank you very much for posting that.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#79   ChristianGarcia-Cox

ChristianGarcia-Cox
  • Members
  • 2 posts

Posted 24 April 2011 - 20:53

You have to install it for every language you have on your site.


This is a really good addon - what I've been looking for.

One prob tho (sorry)
The title on my box is: MODULE_BOXES_GENERIC_BOX_TITLE

and I can't see why.

help pleaseeeee...
Thanks

A



#80   francois21

francois21
  • Members
  • 68 posts
  • Real Name:francois
  • Gender:Male
  • Location:France

Posted 05 May 2011 - 12:14

Hello, this contribution is excellent,
but I have the following error: Fatal error: Can not redeclare class language in C: \ wamp \ www \ 01-boutic_rc231_en_dev \ includes \ classes \ language.php on line 16.
When I install the module in admin all goes well, and on the main page when I update the browser, boxe appears, but if I click on the logo to reload the index page, I have nothing more: blank page.
Have you a fix for this, I see that I am not alone with this error.
Thank you for this job
Francois

Excuse my bad English, I'm in France and I do not speak very good English.