Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Links Manager for osC v1.00


VJ

Recommended Posts

  • Replies 1.1k
  • Created
  • Last Reply

Top Posters In This Topic

I don't know what you mean by "already busy confguration id's"

Jack

 

What I meant was configuration_group_id. Can I take it for good that these id's aren't already taken? If not, where do I look in phpMyAdmin to check and change this?

Link to comment
Share on other sites

Im getting this error on the admin side:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-20, 20' at line 1

Link to comment
Share on other sites

That's a php error. Find this line in admin/includes/classes/split_page_results.php

$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

and change it to

$sql_query .= " limit " . max($offset,0) . ", " . $max_rows_per_page;

Or, better yet, install the security update contribution.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

This new contribution looks great. Normally I download a contribution and don't go back to check on updates but I was working with Links Manager today and I thought, maybe someone had worked out a few kinks and upgraded a few things.

 

I wanted to impart a little information about a change my brother made in the catalog/includes/functions.php (The change in the function page has to do with actually have the url's show up instead of your website redirecting. There is a lot of information out there saying this is a bad type of linking because having a redirect doesn't give proper search engine credit to the links.

 

Nventa changed their directory to give credit to the actual URL and emailed me instructions. I can post that on here if anyone wants it.)

 

My main question:

 

In the Update_Docs where it is changing from 1.10 to 1.13, is the 1.10 much different than Nventa's version because that was what I originally downloaded? I want to upgrade this but I don't want a big mess because I have modified several files and I can't remember all of them!

 

Thanks!

Link to comment
Share on other sites

In the Update_Docs where it is changing from 1.10 to 1.13, is the 1.10 much different than Nventa's version because that was what I originally downloaded? I want to upgrade this but I don't want a big mess because I have modified several files and I can't remember all of them!

 

Also in Update_Docs, I can't just upload all the included files because I've modified some of them. Is there any way I can find out what has been changed from the last version and just make those changes?

 

Thanks.

Link to comment
Share on other sites

If you have an existing installation with changed files, you probably don't want to just copy/replace. You would need to compare the files. There are far too many changes to even try to document them. You would need to do a compare. The reason I went with V 1.10, besides knowing it worked, was that at least one of the updates had code in it that should not be there. Whoever did the update, apparently uploaded the files from their shop instead of using a clean installation of Links Manager. This can introduce problems down the road so it is not worth taking the chance.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I have the contribution installed now. It seems to work in my three languages except for one instance of code.

 

<?php echo sprintf(TEXT_MAIN_LINKS, $link_categories_value['link_categories_name']); ?>

 

How do I add a language_id to this?

Link to comment
Share on other sites

I just install v1.13. I keep getting "The email address doesn't appear to be valid!" when trying to add a link. I've tried to install links manager multiple time reverting from backups trying to see if possible I missed something.

 

Any ideas?

 

thanks,

 

Nate

Link to comment
Share on other sites

I have the contribution installed now. It seems to work in my three languages except for one instance of code.

 

<?php echo sprintf(TEXT_MAIN_LINKS, $link_categories_value['link_categories_name']); ?>

 

How do I add a language_id to this?

You need to provide a little more information, like what part of the shop you are in, maybe a file name.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I just install v1.13. I keep getting "The email address doesn't appear to be valid!" when trying to add a link. I've tried to install links manager multiple time reverting from backups trying to see if possible I missed something.

 

Any ideas?

 

thanks,

 

Nate

The code for that part of Links Manager wasn't changed. Are yousure the email address you are entering is valid, or at least has the format of a valid address?

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

The code for that part of Links Manager wasn't changed. Are yousure the email address you are entering is valid, or at least has the format of a valid address?

 

Jack

 

I was trying to do a test link. Everything went in ok with the exception of the email. I was using my personal email address for the test which is a yahoo email address. [email protected]

 

thanks,

 

Nate

Link to comment
Share on other sites

You need to provide a little more information, like what part of the shop you are in, maybe a file name.

 

Jack

 

 

It's around row 420 in catalog/links.php

 

<?php echo sprintf(TEXT_MAIN_LINKS, $link_categories_value['link_categories_name']); ?>

 

 

Btw, do I need to change a lot of code to adapt to Swedish and Norwegian? If so, how?

 

 

The code adds the link in the Ultimate SEO format.

This shouldn't cause a problem for those sites that don't use

that contribution but if it does, this part of the code will need

to be disabled or changed.

 

How do I change the code?

 

Thanks!

/kbking

Link to comment
Share on other sites

Hi, Jack!

 

I am back from Disneyland :) Anyway, I uploaded all the files... I checked. It still doesn't work. My links still do not show up in the catalogue.

 

I want to uninstall and install everything from the beginning... and I have a question: what do I have to do in order to delete the SQL commands that I ran when I upgraded? Should I to run the same commands but with DELETE instead on CREATE TABLE and INSERT INTO?

 

Another thing: I read your advice for Scott:

add this after it:
echo $listing_sql;

That will display some text on your links page. Copy and paste that here and restore the file to the way you want it.

I added that code, and indeed I had some text/codes on the links page but I don't know where "here" is... :(

 

Thank you for your patience!

 

S

Link to comment
Share on other sites

You would need to add an option in the database to allow controlling it and then duplicate the code segments in catalog/links.php. There are only a about 10 lines to copy. Then change the references in the lines to the proper language.

 

Again, the reference for the quote you provide is out of context so I don't know where it refers to. Without looking it up, I'm guessing in admin/links.php.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi, Jack!

 

I am back from Disneyland :) Anyway, I uploaded all the files... I checked. It still doesn't work. My links still do not show up in the catalogue.

 

I want to uninstall and install everything from the beginning... and I have a question: what do I have to do in order to delete the SQL commands that I ran when I upgraded? Should I to run the same commands but with DELETE instead on CREATE TABLE and INSERT INTO?

 

Another thing: I read your advice for Scott:

I added that code, and indeed I had some text/codes on the links page but I don't know where "here" is... :(

 

Thank you for your patience!

 

S

To remove the changes made to the database by the update, you would need to delete the new tables but also delete the entries in the configuration table.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi!

Could you please have a look at this sql command and tell me if there is anything I need to change before I run it?

 

DELETE TABLE links_featured (
links_id int not null auto_increment, 
date_added datetime, 
expires_date datetime,  
PRIMARY KEY (links_id));
DELETE TABLE links_check (
links_id int not null auto_increment, 
date_last_checked datetime, 
link_found tinyint(1) NOT NULL, 
PRIMARY KEY (links_id));

DELETE FROM configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Reciprocal Link required', 'LINKS_RECIPRICAL_REQUIRED', 'True', 'A reciprical link is required when a link is submitted.', '" . $configuration_group_id . "17', '20', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());
DELETE FROM configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Check for Duplicate Links', 'LINKS_CHECK_DUPLICATE', 'True', 'Check if the submitted link is already on file.', '" . $configuration_group_id . "17', '21', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());
DELETE FROM configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display in standard format', 'LINKS_DISPLAY_FORMAT_STANDARD', 'True', 'Dislay the links in the standard format (true) or in a vertical listing (false).', '" . $configuration_group_id . "17', '22', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());
DELETE FROM configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display English Links', 'LINKS_DISPLAY_ENGLISH', 'False', 'Display this language in the shop.', '17', '23', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());
DELETE FROM configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display Gernam Links', 'LINKS_DISPLAY_GERMAN', 'False', 'Display this language in the shop.', '17', '24', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());
DELETE FROM configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display Spanish Links', 'LINKS_DISPLAY_SPANISH', 'False', 'Display this language in the shop.', '17', '25', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());
DELETE FROM configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display French Links', 'LINKS_DISPLAY_FRENCH', 'False', 'Display this language in the shop.', '17', '26', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());
DELETE FROM configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Check Link on Edit', 'LINKS_CHECK_ON_EDIT', 'True', 'Check if a reciprocol link is valid when Edit is clicked. This will slow down the loading of the edit page a little.', '" . $configuration_group_id . "17', '27', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());
DELETE FROM configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display Featured Link', 'LINKS_FEATURED_LINK', 'True', 'Display a randomly selected link.', '" . $configuration_group_id . "17', '28', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());

ALTER TABLE links DELETE links_category_suggest varchar(32) NULL;

 

Thank you very much! Your support is very appreciated! :)

 

Simone

Link to comment
Share on other sites

I just spotted this in the above code: Display Gernam Links maybe it should be: Display German Links

 

Hi, Chris!

Thank you for your reply! "Gernam" was in the original file when I installed the contribution... so I guess I should use it when I uninstall...

 

Simone

Link to comment
Share on other sites

You would need to add an option in the database to allow controlling it and then duplicate the code segments in catalog/links.php. There are only a about 10 lines to copy. Then change the references in the lines to the proper language.

 

Again, the reference for the quote you provide is out of context so I don't know where it refers to. Without looking it up, I'm guessing in admin/links.php.

 

Jack

 

Sorry for letting you guess what I'm reffering to. :blush: The quote is to be found in the file History below Last Update: 2006-06-08 by Jack_mcs.

 

To modify the code so as to get the link_categories_name to be displayed in different languages is yet way above my knowledge of php. I would need more help for that.

 

In links_submit.php - around line 286 - I found a code snippet that language-wise deals correct with link_categories_name. Would it be easier/possible to re-write it to fit into links.php?

Link to comment
Share on other sites

Hi!

Could you please have a look at this sql command and tell me if there is anything I need to change before I run it?

 

DELETE TABLE links_featured (
links_id int not null auto_increment, 
date_added datetime, 
expires_date datetime,  
PRIMARY KEY (links_id));
DELETE TABLE links_check (
links_id int not null auto_increment, 
date_last_checked datetime, 
link_found tinyint(1) NOT NULL, 
PRIMARY KEY (links_id));

DELETE FROM configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Reciprocal Link required', 'LINKS_RECIPRICAL_REQUIRED', 'True', 'A reciprical link is required when a link is submitted.', '" . $configuration_group_id . "17', '20', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());
DELETE FROM configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Check for Duplicate Links', 'LINKS_CHECK_DUPLICATE', 'True', 'Check if the submitted link is already on file.', '" . $configuration_group_id . "17', '21', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());
DELETE FROM configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display in standard format', 'LINKS_DISPLAY_FORMAT_STANDARD', 'True', 'Dislay the links in the standard format (true) or in a vertical listing (false).', '" . $configuration_group_id . "17', '22', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());
DELETE FROM configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display English Links', 'LINKS_DISPLAY_ENGLISH', 'False', 'Display this language in the shop.', '17', '23', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());
DELETE FROM configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display Gernam Links', 'LINKS_DISPLAY_GERMAN', 'False', 'Display this language in the shop.', '17', '24', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());
DELETE FROM configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display Spanish Links', 'LINKS_DISPLAY_SPANISH', 'False', 'Display this language in the shop.', '17', '25', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());
DELETE FROM configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display French Links', 'LINKS_DISPLAY_FRENCH', 'False', 'Display this language in the shop.', '17', '26', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());
DELETE FROM configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Check Link on Edit', 'LINKS_CHECK_ON_EDIT', 'True', 'Check if a reciprocol link is valid when Edit is clicked. This will slow down the loading of the edit page a little.', '" . $configuration_group_id . "17', '27', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());
DELETE FROM configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display Featured Link', 'LINKS_FEATURED_LINK', 'True', 'Display a randomly selected link.', '" . $configuration_group_id . "17', '28', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());

ALTER TABLE links DELETE links_category_suggest varchar(32) NULL;

 

Thank you very much! Your support is very appreciated! :)

 

Simone

No, those deletes won't work. Try this. Make a backup of your database in admin->tools. Go to phpmyadmin and click on the SQL tab. Copy one of the above commands and click go. If it fails, no harm done but you need to fix the command. If it passes and you don't want to keep it, just restore the database.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Sorry for letting you guess what I'm reffering to. :blush: The quote is to be found in the file History below Last Update: 2006-06-08 by Jack_mcs.

 

To modify the code so as to get the link_categories_name to be displayed in different languages is yet way above my knowledge of php. I would need more help for that.

 

In links_submit.php - around line 286 - I found a code snippet that language-wise deals correct with link_categories_name. Would it be easier/possible to re-write it to fit into links.php?

For the langauge, add this to the database
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display XXXX Links', 'LINKS_DISPLAY_XXXX', 'False', 'Display this language in the shop.', '40', '25', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());

where XXXX is the language. Then in catalog/links.php, find

  if ($langsort['languages_id'] == '4')
 {
if (LINKS_DISPLAY_FRENCH == 'True')
{
  if ($lang_set)
	$listing_sql .= "' xor ld.language_id = '" . $langsort['languages_id'] . "";
  else
  {
	$listing_sql .= " and ( ld.language_id = '" . $langsort['languages_id'] . "";
	$lang_set = true;
  }
}
else
{
  $useAll = true;
}
 }

and change to

  if ($langsort['languages_id'] == 'YYYY')
 {
if (LINKS_DISPLAY_XXXX == 'True')
{
  if ($lang_set)
	$listing_sql .= "' xor ld.language_id = '" . $langsort['languages_id'] . "";
  else
  {
	$listing_sql .= " and ( ld.language_id = '" . $langsort['languages_id'] . "";
	$lang_set = true;
  }
}
else
{
  $useAll = true;
}
 }

where the XXXX is the language name and YYYY is the placement in the list of languages.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

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