Jump to content
Jack_mcs

Information Pages SEO addon

Recommended Posts

Thanks for the suggestion. I will add a note about that.

Edited by Jack_mcs

Share this post


Link to post
Share on other sites

Hi Jack, @Jack_mcs

I installed this on CE 1.0.5.0 and it works great, thank you!

I noticed when i create a message, the view has diabled, how can I enable and make it act like page, click on it and will open in new page?

Many thanks!  Lyn

Share this post


Link to post
Share on other sites
14 hours ago, ce7 said:

I noticed when i create a message, the view has diabled, how can I enable and make it act like page, click on it and will open in new page?

There's no way to do that since the message is part of a page and can be displayed anywhere. For example, if you set it to display in a header module so that the message is displayed on every page, what page would open when View is clicked in admin? If you (anyone) can think of a way to this, or how it could be improved, please let me know and I will take a look.

Share this post


Link to post
Share on other sites

Hi Jack, @Jack_mcs

I installed the addon, it was all ok till just now error occur (not sure if something to do the hosting company server site setting...)

this is the error message and related code:

Parse error: syntax error, unexpected '?' in /website.com/includes/functions/information.php on line 58

$id = ($_GET['info_id'] ?? 0);

how to fix this erro? Many thanks!

 

Lyn

Share this post


Link to post
Share on other sites
On 3/31/2020 at 5:39 PM, raiwa said:

You need to run PHP 7+

@raiwa

Thank you.....change the cpanel php version to PHP7+ and reinstall all the addons again...

@Jack_mcs

image.thumb.png.ee2645cf21f1b6956f1b14240ddf050d.png

is there a way when the footer and infobox have the links or pages, that the hook will not show the links/pages again?
(goal: not to show #1 and #2 links)

Thanks! Lyn

Share this post


Link to post
Share on other sites

@ce7I can''t enlarge the image enough to see the problem. But, in general, if you want a link to show up in only one module set its box ID to that modules ID.

Share this post


Link to post
Share on other sites

Hi Jack,

I have altered your code a little since I needed the following functionality: I wanted to display an information page link on my product_info page for all products  belonging to a specific manufacturer. And I wanted it to be displayed on the product info screen (not in a box) . What I did is changed your code in cm_pi_information_pages.php. 

Your origin:

              $where = "pages = 'all'";
              if (isset($_GET['cPath'])) {
                  $where .= " or FIND_IN_SET ('cid',pages) or FIND_IN_SET ('cid=" . tep_db_input($_GET['cPath']) . "',pages) ";               
              } else if (isset($_GET['manufacturers_id'])) {
                  $where .= " or FIND_IN_SET ('mid',pages) or FIND_IN_SET ('mid=" . tep_db_input($_GET['manufacturers_id']) . "',pages) ";                   
              } else if (isset($_GET['products_id'])) {
                  $where .= " or FIND_IN_SET ('pid',pages) or FIND_IN_SET ('pid=" . tep_db_input($_GET['products_id']) . "',pages) "; 
              }

My changes:

              $where = "pages = 'all'";
             if (isset($_GET['products_id'])) {
                  $where .= " or FIND_IN_SET ('pid',pages) or FIND_IN_SET ('pid=" . tep_db_input($_GET['products_id']) . "',pages) "; 
                  if  (INFORMATION_PAGES_SEO_ALSO_MAN_PAGES === 'true'){      
                    //find corresponding manufacturers_id 
                     $man_id=tep_db_fetch_array(tep_db_query("select manufacturers_id  from products where products_id='". tep_db_input($_GET['products_id'])."' limit 1"));
                     $where .= " or FIND_IN_SET ('mid=" . $man_id['manufacturers_id'] . "',pages) "; 
                  }

              }

I removed the first part of your code since in product_info I believe there is no cPath or manufacturers_id being populated in the form when calling product_info.php. I added a new parameter.  If this is set to true the pages belonging to that manufacturer are also shown in the product page.

Maybe this feature is interesting for u to add to your great contribution. 

 

Share this post


Link to post
Share on other sites
11 hours ago, koopmanh said:

Maybe this feature is interesting for u to add to your great contribution. 

Thank you for posting it. I will take a look at it when I get a chance. But, to be clear, the original code allows cross-referencing to any page, depending on the settings for the IP page. So your change has removed that functionality. 

Share this post


Link to post
Share on other sites

Hello Jack, Mendoh here. 

I have tried to install your contribution on the very latest Phoenix 1.0.7.5 and despite I have triple-checked everything, I could not get it to work. 
Admin seems to work, however:
1) no line title or name is displayed for each new page on the admin list of added pages
2) trying to install the "information pages block" footer content module gets me the following error:

1146 - Table 'mystoredb_2.TABLE_CONFIGURATION' doesn't exist

insert into TABLE_CONFIGURATION (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Information Pages Links Footer Module', 'MODULE_CONTENT_FOOTER_INFORMATION_PAGES_STATUS', 'True', 'Do you want to enable the Information Pages Links content module?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())

[TEP STOP]


On top of the above, after adding a new page on admin, its name/title (the very same that does not show on admin list of new pages) actually shows as a link in the "Helpful Links" information box on the store side, however,  clicking on either such link or the "view" icon for the same page on the admin side, delivers another error: 


This page isn’t working
Yourwebsite is currently unable to handle this request.
HTTP ERROR 500

Can you point me out on what is wrong with my install or is it just the contribution to be incompatible with Phoenix 1.0.7.5?

Thank you

Share this post


Link to post
Share on other sites

It won't work in any Phoenix version after 1.0.4. The latest version will work in 1.0.7.5 (I have it installed here) but I can't say when it will be uploaded since it is not ready for release. So, for now, you should remove the changes you've made since the changes in the new version won't match them. 

Just for reference, when installing any addon into Phoenix, it is best to verify the addon will work in that version of Phoenix. The code in Phoenix changes quite often, sometimes dramatically, so it usually isn't possible for developers to provide versions of their addons for all Phoenix versions.

Share this post


Link to post
Share on other sites

Thanks a lot Jack!

I will do exactly as you suggested and wait for a new release to come out...

Share this post


Link to post
Share on other sites

@mendoh

17 hours ago, mendoh said:

1146 - Table 'mystoredb_2.TABLE_CONFIGURATION' doesn't exist

insert into TABLE_CONFIGURATION (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Information Pages Links Footer Module', 'MODULE_CONTENT_FOOTER_INFORMATION_PAGES_STATUS', 'True', 'Do you want to enable the Information Pages Links content module?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())

[TEP STOP]

Find the code above, and change it to:

insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Information Pages Links Footer Module', 'MODULE_CONTENT_FOOTER_INFORMATION_PAGES_STATUS', 'True', 'Do you want to enable the Information Pages Links content module?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())

M


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites
4 hours ago, ArtcoInc said:

@mendoh

Find the code above, and change it to:

insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Information Pages Links Footer Module', 'MODULE_CONTENT_FOOTER_INFORMATION_PAGES_STATUS', 'True', 'Do you want to enable the Information Pages Links content module?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())

M

Thanks Artcolnc! 

Unfortunately, the one above is only half of the problem: 

 

21 hours ago, mendoh said:

 

On top of the above, after adding a new page on admin, its name/title (the very same that does not show on admin list of new pages) actually shows as a link in the "Helpful Links" information box on the store side, however,  clicking on either such link or the "view" icon for the same page on the admin side, delivers another error: 


This page isn’t working
Yourwebsite is currently unable to handle this request.
HTTP ERROR 500

Can you point me out on what is wrong with my install or is it just the contribution to be incompatible with Phoenix 1.0.7.5?

Thank you

😥

Share this post


Link to post
Share on other sites
Posted (edited)

A new version has been uploaded with these changes:

Added a left column icon for Phoenix.
Added a title for the Pages and Redirect boxes in admin to provide instruction for using them.
Added a Navbar module. Pro Version only.**
Changed the code for displaying cross-reference links on the product page for a better display.
Changed name of shops language file from information_pages to information so the shops code loads it automatically.
Corrected a coding mistake in the footer module that caused the display to not be correct.
Moved changes for application_top files into hooks (Phoenix only).
Updated the Version Checker to return correct versions.

** The new Navbar module allows messages to be displayed as pages, which greatly increases the flexibility.

Edited by Jack_mcs

Share this post


Link to post
Share on other sites
14 hours ago, Jack_mcs said:

A new version has been uploaded with these changes:

Thanks you again for you work on this addon, however the link is broken it just takes you to the top of the page.

 


Live Phoenix 1.0.5.0 on PHP 7.3

Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix 1.0.7.9) here.

Share this post


Link to post
Share on other sites
Posted (edited)

@mhsuffolkThanks for letting me know. I tried editing it but it wouldn't allow it. Then I tried adding a new link in this post and it still ignored it so there must be something wrong with the forum software. Here is the link without using the editor:


https://apps.oscommerce.com/k6oAF&information-pages-seo-v-1-0

Edited by Jack_mcs

Share this post


Link to post
Share on other sites
Posted (edited)

@Jack_mcs
hi Jack,
Once again, thank you for this great addon.
I just installed on Phoenix 1075 version, found several issues need your help.

After installed the infobox, at the front page, has this error message:

Warning: Use of undefined constant INFORMATION_PAGES_SEO_FOOTER_XREF_USE_UL - assumed 'INFORMATION_PAGES_SEO_FOOTER_XREF_USE_UL' (this will throw an Error in a future version of PHP) in catalog/includes/modules/boxes/bm_information_pages.php on line 37

And can not install the footer module as the error message show up as below:

Fatal error: Uncaught Error: Call to protected method cm_footer_information_pages::install() from context '' in catalog/admin/modules_content.php:126 Stack trace: #0 {main} thrown in catalog/admin/modules_content.php on line 126 (#126 code:        $module->install();      )

With Phoenix 1075 version, I had tried JcM CKEditor, but I found that I can not copy and paste the image, so I tried CKEditor for osC2.3, the attached CKEditor zip not work properly on Phoenix as the toolbar button label disappear, but if use ckeditor_4.12,  I can copy and paste the image and no error on button labels...

I found when I did not call tep_draw_textarea_field_ckeditor( ) admin/information_form.php, it is still appear ckeditor for the seo area? Why is this happen?

image.thumb.png.b502aa3cd7c108048bb3e101dbf9b8db.png

Another question I maybe asked before but I dont quite understand so please allow me to ask again...

When I create a new page, I select the Box ID as Infobox, and it will appear in the infobox area, which is working as expected,
but it also appear at the bottom AN INTERESTING  ARTICLE... area, which I dont really want it appear again.

How can I make AN INTERESTING  ARTICLE... links appear ONLY when I choose the Box ID as Links?
image.thumb.png.814b3e0c5d85228de12efdeb4a4867e8.png

 


 

 

Edited by ce7

Share this post


Link to post
Share on other sites
7 hours ago, ce7 said:

Warning: Use of undefined constant INFORMATION_PAGES_SEO_FOOTER_XREF_USE_UL

That is defined in the database so you must not have ran the database script with the reset option. Do that and the error should go away.

I can't help you with getting a certain editor to work. I used the TinyMCE  addon to test it since it doesn't require any core changes and it works fine,

For the article message showing, enter something in the Pages box. If you don't want it to show at all, enter some invalid item, like pid=999999, assuming that is not valid on your site. I'll add an off option in the next version.

Share this post


Link to post
Share on other sites
17 hours ago, Jack_mcs said:

That is defined in the database so you must not have ran the database script with the reset option. Do that and the error should go away.

I can't help you with getting a certain editor to work. I used the TinyMCE  addon to test it since it doesn't require any core changes and it works fine,

For the article message showing, enter something in the Pages box. If you don't want it to show at all, enter some invalid item, like pid=999999, assuming that is not valid on your site. I'll add an off option in the next version.

@Jack_mcs   Hi Jack,

I have the database installed, but I will double check it again. Maybe something goes wrong.
Thank you very much for prompt reply.
Looking forward to installing the newer version with off option.
Once again, thank you for the great addon and support!

Share this post


Link to post
Share on other sites
1 hour ago, ce7 said:

I have the database installed, but I will double check it again. Maybe something goes wrong.

If you did a new installation, then the database should be correct. But if you did an update, you may have to run the install script twice, depending on the version. On the second run, or maybe the first one, there will be a button that says run with reset. Click on that and any new differences will be applied.

Share this post


Link to post
Share on other sites

@Jack_mcs  Hi Jack,

I did try to reinstall from newer version download, but  the error message appeared still the same problem,
Fatal error: Uncaught Error: Call to protected method cm_footer_information_pages::install() from context '' in catalog/admin/modules_content.php:126 Stack trace: #0 {main} thrown in catalog/admin/modules_content.php on line 126 (#126 code:        $module->install();      )

Only infobox installed so far, it is ok as I only need the infobox so far, but not sure if others has similar problem like me to install the footer...

with the database, I tried #1 install from new, no install, #2 installed wit the newer version information_pages_seo_db_handler.php, reset, but got all the different error,

and I end up run sql at phpMyAdmin with

find this
-- (Disable UL style', 'INFORMATION_PAGES_SEO_XREF_USE_UL', 'true', 'Set to true to not use lists in the footer modules.', 22, 7, NULL, now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'), '),

replace with
('Disable UL style', 'INFORMATION_PAGES_SEO_FOOTER_XREF_USE_UL', 'true', 'Set to true to not use lists in the footer modules.', 22, 7, NULL, now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'), '),

and now the language error on front page is gone...

Another tiny question is with Phoenix 1075, I have recently view addon installed, and it will show up index / index_nest area,
and if the setting is show up, let says as 4+, then the AN INTERESTING ARTICLES..... will be the very bottom of the websites,
is there a way to be able to setup the sort order so that I can change AN INTERESTING ARTICLES.....  appear on top of the recently viewed addon?

 

 

 

Share this post


Link to post
Share on other sites

Good catch on the database error. I do apologize for the problems it caused. The previous versions used INFORMATION_PAGES_SEO_XREF_USE_UL' but it was changed to INFORMATION_PAGES_SEO_FOOTER_XREF_USE_UL' to allow handling the bod id's easier. And I see now that IO forgot to mention that as part of the update.

Regarding the position of the box, the answer depends on how the recently viewed addon is placing the code. This addon is using a hook for that box. The only way hooks are sortable are by their names so if that addon uses a hook, you could do some renaming to get them placed as you want. But if it is using a module, you can't do it.

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

×