Jump to content
kymation

[Addon] Generic Box

Recommended Posts

Well it is recommended that you protect the admin and more important rename the admin folder itself that is the best protection but this does not normally affect the front end of the shop.

 

 

If I rename the Admin folder, are there references to 'Admin' within other files that i will need to change as well?

 

Yeah sorry confusing we need to find out what is happening in

 

public_html/shop/.htaccess

 

Is this something that someone else will need to help me with? Or can I just delete that code?

 

Thank you,

Jewell

Share this post


Link to post
Share on other sites

First move this I made a mistake it should be <script type="ext/jquery/gistfile1.js"></script>

 

That will first solve your password problem I hope

 

Lets get the first one fixed before renaming admin

 

Probably better a new thread about renaming admin as do not want to block this thread with different info it is simple just x 2 files

Edited by joli1811

To improve is to change; to be perfect is to change often.

 

Share this post


Link to post
Share on other sites

Oh, ok ... Thank you. I went in and made the change to my shop/includes/template_top.php file.

 

Is this now correct?

 

<?php

/*

$Id$

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2012 osCommerce

 

Released under the GNU General Public License

*/

 

$oscTemplate->buildBlocks();

 

if (!$oscTemplate->hasBlocks('boxes_column_left')) {

$oscTemplate->setGridContentWidth($oscTemplate->getGridContentWidth() + $oscTemplate->getGridColumnWidth());

}

 

if (!$oscTemplate->hasBlocks('boxes_column_right')) {

$oscTemplate->setGridContentWidth($oscTemplate->getGridContentWidth() + $oscTemplate->getGridColumnWidth());

}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />

<title><?php echo tep_output_string_protected($oscTemplate->getTitle()); ?></title>

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>" />

<link rel="stylesheet" type="text/css" href="ext/jquery/ui/redmond/jquery-ui-1.8.22.css" />

<script type="text/javascript" src="ext/jquery/jquery-1.8.0.min.js"></script>

<script type="text/javascript" src="ext/jquery/ui/jquery-ui-1.8.22.min.js"></script>

<script type="text/javascript" src="/ext/jquery/gistfile1.js"></script> (or should I remove "text/javascript" src=" and leave just what is in blue?)

 

<script type="text/javascript">

// fix jQuery 1.8.0 and jQuery UI 1.8.22 bug with dialog buttons; http://bugs.jqueryui.com/ticket/8484

if ( $.attrFn ) { $.attrFn.text = true; }

</script>

 

<?php

if (tep_not_null(JQUERY_DATEPICKER_I18N_CODE)) {

?>

<script type="text/javascript" src="ext/jquery/ui/i18n/jquery.ui.datepicker-<?php echo JQUERY_DATEPICKER_I18N_CODE; ?>.js"></script>

<script type="text/javascript">

$.datepicker.setDefaults($.datepicker.regional['<?php echo JQUERY_DATEPICKER_I18N_CODE; ?>']);

</script>

<?php

}

?>

 

<script type="text/javascript" src="ext/jquery/bxGallery/jquery.bxGallery.1.1.min.js"></script>

<link rel="stylesheet" type="text/css" href="ext/jquery/fancybox/jquery.fancybox-1.3.4.css" />

<script type="text/javascript" src="ext/jquery/fancybox/jquery.fancybox-1.3.4.pack.js"></script>

<link rel="stylesheet" type="text/css" href="ext/960gs/<?php echo ((stripos(HTML_PARAMS, 'dir="rtl"') !== false) ? 'rtl_' : ''); ?>960_24_col.css" />

<link rel="stylesheet" type="text/css" href="stylesheet.css" />

<?php echo $oscTemplate->getBlocks('header_tags'); ?>

</head>

<body>

 

<div id="bodyWrapper" class="container_<?php echo $oscTemplate->getGridContainerWidth(); ?>">

 

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

 

<div id="bodyContent" class="grid_<?php echo $oscTemplate->getGridContentWidth(); ?> <?php echo ($oscTemplate->hasBlocks('boxes_column_left') ? 'push_' . $oscTemplate->getGridColumnWidth() : ''); ?>">

Edited by jeu4328

Share this post


Link to post
Share on other sites

No if you look carefully I made a mistake and said <script type="text/javascript" src="/ext/jquery/gistfile1.js"></script>

 

when I should have said <script type="text/javascript" src="ext/jquery/gistfile1.js"></script>

 

 

bit like loose thread in embroidery / going to run (w00t)

Edited by joli1811

To improve is to change; to be perfect is to change often.

 

Share this post


Link to post
Share on other sites

haha! I'm feeling exactly like a loose thread!!! My brain is one knotted mess!

 

I've made that change, and I really appreciate your help!

 

I've got to go clean an dental office ... but I'll be back to work on this in about an hour or so.

 

Regarding the password requirement which is being called for ... can I just go in and delete the code calling for it? Or is it going to take something more than that to fix the problem? Actually, I'll go ahead and ask this question on the other thread so as not to take this thread off in a completely different path. :thumbsup:

 

Thanks a million for your help!!!

Jewell

Share this post


Link to post
Share on other sites

Looks fixed to me it was just that small mistake in template _top.php

 

so maybe if you go back a bit on the thread to what Jim was saying the scroll or whatever will work (didn't really study) as the ext/jquery/gistfile1.js was in the wrong place.

Hiding in your admin :D

Going to catch a nap talk later

Regards

Joli


To improve is to change; to be perfect is to change often.

 

Share this post


Link to post
Share on other sites

Well, I've re-tried the scroll code in the banner box and it still isn't working.

That is ok ... for now I will just use the banner box to hold my stationary text.

Thanks again!

Jewell

Share this post


Link to post
Share on other sites

Hi Jim!

 

I tried to use your generic box to insert the PayPal logo and the GeoTrust logo inside it but both seem to not work.

When copy & pasting the PP code it shows a weird <table> structure with some partial text inside it still though the logo shows OK in the front end as long i don't click on "edit" again. Once i edit the generic box again the code gets messed up and i have to re-copy & paste the PP code.

The Geotrust SSL logo doesn't show up at all. That one uses javascript only.

I know that this add-on adds backslashes to avoid special characters like " or ' maybe that's the cause?

 

Wondering how other people add their PP and SSL logos to the left or right column?

Edited by Tsimi

Share this post


Link to post
Share on other sites

<!-- EDIT TO MY UPPER POST //-->

 

Got it! Just used your older Generic Box 1.0.3 and now both Logos show up.

 

Thanks again Jim for another great Add-on! :thumbsup:

Edited by Tsimi

Share this post


Link to post
Share on other sites

Bugger! Opened the champagne too early...getting following error message. :x

 

Parse error: syntax error, unexpected 'https' (T_STRING) in xxxx\xxxx\xxxx\xxxx\modules.php(234) : eval()'d code on line 14

Edited by Tsimi

Share this post


Link to post
Share on other sites

Hi Jim,

 

I installed this add on and it works fine.

 

My problem is that wanted to use it for displaying the "google trusted store badge", which is defined as a java script (please see attachment - I replaced the ID number with XXXXXX).

 

Naturally it doesn't work to copy the script into the Content fields via the admin panel. I guess I should create a file and link to it then, but I wouldn't know about it.

 

I searched the forum and also googled the matter, but couldn't find a solution, therefore I would be grateful for your advice.

 

 

Kindest regards,

 

Christiane

google_badge.txt

Share this post


Link to post
Share on other sites

I don't see anythig in that code that should cause it to fail. Maybe I'm just missing it. Anyway, some people have had luck with version 1.0.3  of this box. It's still picky about what you put in it, but in different ways.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites

Good evening

I uninstall the add on I had and reinstall everything.

With the fix of Silverfish ,everything works well in all languages.

 

editing the language.php file from:

 

class language { var $languages, $catalog_languages, $browser_languages, $language;

 

to

 

if (!class_exists('language')) {class language { var $languages, $catalog_languages, $browser_languages, $language;

 

 

dont forget to close the if at the end of the file.

 

 

Thank you

 

How to close the "if"  at the end of the file ? 

Share this post


Link to post
Share on other sites

So i found it, when have a redeclare language class error write the following line behind the last content in the include/classes/language.php

 

editing the language.php file from:

class language { var $languages, $catalog_languages, $browser_languages, $language;

to

if (!class_exists('language')) {class language { var $languages, $catalog_languages, $browser_languages, $language;

 

Find:

 

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;
 
after write:
 
class_exists.close();
            }
 
 
 
and the error was with me gone.  The checkout success php works normal now.

Share this post


Link to post
Share on other sites

This line is wrong:

class_exists.close();

The only thing you need is the }, and that goes at the end of the file (before the ?> if there is one).

 

Regards

Jim


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

Share this post


Link to post
Share on other sites
On 5.08.2013 at 5:03 AM, letmein said:

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!

I just do this in admin/modules.php

tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'");
             // Generic Box
         // tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . addslashes( addslashes( $value ) ) . "' where configuration_key = '" . $key . "'");


and than disappeared slashes \" and fixed links to images.


 

Share this post


Link to post
Share on other sites

@driven22 That will work until you enter an unescaped quote mark, then it will break the module Admin. Be very careful to always escape your single quotes.

Regards

Jim


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

Share this post


Link to post
Share on other sites
  1. You're right, but without this change there is always a broken link to the image and thrown "\ into the description. How does it differently change?

Share this post


Link to post
Share on other sites

I have not found any way to make a generic box work 100% of the time with the current osCommerce code. I plan to try this again with osC 2.3.6 or 2.4, in the hope that it may be possible with the updated code. Until then, just do what you can with what's there. If the change you posted works for you, then do that.

Regards

Jim


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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×