Jump to content
kymation

[Addon} Modular Front Page

Recommended Posts

No, I was only asking about the file in the local folder because that overrides the main configure file if it exists. There's no problem if it doesn't exist.

 

I see no reason why your system is looking in the wrong place for this file. I'll post here if I find something.

 

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

I have just installed the latest version of this. All went well, until, i added text for the front page. When i went to modify this text in admin i get the following error.

 

Parse error: syntax error, unexpected T_STRING in /home/railway1/public_html/test_2.3/admin/modules.php(232) : eval()'d code on line 28

 

I hope this is not serious for me.

 

Hello, everyody. Special thanks to Jim for this great module.

 

I also have the apostrophe problem with Text Main module after having added French language. Now, I replace apostrophes with ' in the textarea. Is there another way ? With addslashes() or stripslashes()?

Thank you.

Share this post


Link to post
Share on other sites

I'm using the stock osCommerce function to draw the text field for this function. This function is processed by the existing code that handles the configuration values. I could write my own functions to handle all of this, but that would add a considerable amount of extra code that would have to be inserted in various places. This would make this a lot less modular and a lot harder to install. So yes, this could be done, but at considerable cost.

 

You could also escape your apostrophes with slashes when you put in the text, like this: \'

Then change Line 47 of the text_main.php module to this:

        $body_text .= stripslashes(constant('MODULE_FRONT_PAGE_TEXT_MAIN_' . strtoupper($language))) . "\n";

 

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

 

You could also escape your apostrophes with slashes when you put in the text, like this: \'

Then change Line 47 of the text_main.php module to this:

        $body_text .= stripslashes(constant('MODULE_FRONT_PAGE_TEXT_MAIN_' . strtoupper($language))) . "\n";

 

Thank you for your answer. I cant't explain why as soon as I put an apostrophe in the db (even with escape), I can't edit the textarea in the admin anymore. The stripslashes affects the frontpage, this is ok. But still, I cant't edit the message in the admin. I must edit the db table and suppress the apostrophe.

Does it work with apostrophes for you? Maybe there is a configuration error on my server.

 

I congratulate you again for your excellent work and thank you for your numerous answers.

Share this post


Link to post
Share on other sites

I thought that I had tested this, and I did, but I misremembered the fix. You have to double escape the apostrophes, like this: \\\'

That's three backslashes before the apostrophe. I realize that this is horribly annoying, but the bug is in the core osCommerce code. I should probably fix it and submit a bug report.

 

Sorry about my confusing response.

 

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

Slightly different issue here but again it's with the Text Main module. I was able to edit it once, however, seconds after saving it I decided it didn't look quite right and discovered that when I hit the Edit button now all the options appear except from the text box, abd there's an error message appearing directly above the table:

 

Parse error: syntax error, unexpected T_STRING in /home/thewanne/public_html/designing/admin/modules.php(232) : eval()'d code on line 1

 

I had a look inside the file and on the first is only the <?php tag, and on line 232 (indicated just after modules.php) it has:

 

          eval('$keys .= ' . $value['set_function'] . "'" . $value['value'] . "', '" . $key . "');");

 

To be honest I haven't a clue what I'm looking at in the line above, can only make educated guesses that may well be wrong, so any help with this would be awesome!

 

Best,

 

LJ

Share this post


Link to post
Share on other sites

Thanks Jim nice add love looking through it,

 

I installed on a clean 2.3.1 with only Catagory menu installed

When i installed yours the right boxes apear beneath the left boxes and not on the right?

I understand it's a formating issue my end but i am stumped.

Notice: Undefined index: tax_id in /var/www/vhosts/francosmotorcycle.com/httpdocs/catalog/includes/modules/front_page/specials.php on line 89 also is a minor error

 

url of error http://www.francosmotorcycle.com/catalog/

 

Just tried putting all standard files back into includes but still the same ow dear what i have I changed

 

Sorry found it I had changed the style sheet a bit by mistake please ignore me

Mike

Edited by liveuk

Share this post


Link to post
Share on other sites

Thanks for the bug report on the tax id. I'll fix that in the master.

 

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

Replace Line 67 of catalog/includes/modules/front_page/text_main.php with the following:

 

        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ( '" . ucwords($language_name) . " Text', 'MODULE_FRONT_PAGE_TEXT_MAIN_" . strtoupper($language_name) . "', 'Quid ergo hunc aliud moliri, quid optare censetis aut quam omnino causam esse belli?', 'Enter the text that you want to show on the front page in " . $language_name . "', '6', '2', 'tep_draw_textarea_field(\'configuration[MODULE_FRONT_PAGE_TEXT_MAIN_" . strtoupper($language_name) . "]\', false, 35, 20, \'\', \' class=\"ckeditor\"\', ', now())");

 

It doesn't remember the text you have entered if you go back to change something, so you'll have to enter it again. This is a bug in the stock osCommerce function that I used to draw the textarea box. I can probably fix that with a custom function, but not tonight.

 

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

Hi!

My index page does not match the one in the download, so I'm having a hard time figuring out exactly how to add the code

 

Help please!

Share this post


Link to post
Share on other sites

Have you already made major changes to that page? If not, are you using osCommerce version 2.3.1?

 

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

Have you already made major changes to that page? If not, are you using osCommerce version 2.3.1?

 

Regards

Jim

 

Thanks for the quick response Jim!

 

I've been working on this for some time and installed some add-ons, which I'm sure have affected the index. And yes, I'm on v 2.3.1

Here's a snippet of line 243 onward

<?php
 } else { // default page
?>

<h1><?php echo HEADING_TITLE; ?></h1>

<div class="contentContainer">
 <div class="contentText">
   <?php echo tep_customer_greeting(); ?>
 </div>

<?php
   if (tep_not_null(TEXT_MAIN)) {
?>

 <div class="contentText">
   <?php echo TEXT_MAIN; ?>
 </div>

<?php
   }

   include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS);
   include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
?>

</div>

<?php
 }

 require(DIR_WS_INCLUDES . 'template_bottom.php');
 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

 

I tried to insert the block from the add-on around line 246, but it didn't work.

 

THANKS!

V

Share this post


Link to post
Share on other sites

Replace the code that you posted with this:

<?php
 } else { // default page
 // Start Modular Front Page
?>

<div class="contentContainer">

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

</div>

<?php
 // End Modular Front Page
 }

 require(DIR_WS_INCLUDES . 'template_bottom.php');
 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

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

Thanks a lot, Jim!

 

I thought I had to add the code, didn't realize I had to replace all that...

THANKS

Share this post


Link to post
Share on other sites

All of the code that is on the stock front page is replaced with modules. This gives you control of everything, not just the added stuff.

 

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

Replace Line 67 of catalog/includes/modules/front_page/text_main.php with the following:

 

        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ( '" . ucwords($language_name) . " Text', 'MODULE_FRONT_PAGE_TEXT_MAIN_" . strtoupper($language_name) . "', 'Quid ergo hunc aliud moliri, quid optare censetis aut quam omnino causam esse belli?', 'Enter the text that you want to show on the front page in " . $language_name . "', '6', '2', 'tep_draw_textarea_field(\'configuration[MODULE_FRONT_PAGE_TEXT_MAIN_" . strtoupper($language_name) . "]\', false, 35, 20, \'\', \' class=\"ckeditor\"\', ', now())");

 

It doesn't remember the text you have entered if you go back to change something, so you'll have to enter it again. This is a bug in the stock osCommerce function that I used to draw the textarea box. I can probably fix that with a custom function, but not tonight.

 

Regards

Jim

 

Tks , but I don't know where can i put the "ckeditor" floder

Share this post


Link to post
Share on other sites

I don't know what "floder" means.

 

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

deleted

Edited by kymation

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

Share this post


Link to post
Share on other sites

deleted

Edited by kymation

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

Share this post


Link to post
Share on other sites

I don't know what "floder" means.

 

Regards

Jim

 

sorry , is "folder" of the ckeditor , and I think , there must have a

 

"<script type="text/javascript" src="../ckeditor.js"></script>"

 

where can i put this

Share this post


Link to post
Share on other sites

You have to install ckeditor first. Get the CKEditor osC 2.3.1 Addon package and follow the install instructions. Then this will work.

 

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

You have to install ckeditor first. Get the CKEditor osC 2.3.1 Addon package and follow the install instructions. Then this will work.

 

Regards

Jim

 

tks , I just add a statement

 

"<script type="text/javascript" src="../ckeditor.js"></script>"

 

on the

 

admin/includes/template_top.php

 

file , and then it work

 

 

but another problem , the space is too small for edit the TEXT_MAIN , do You have any suggest for this

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

×