Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Links Manager II


Recommended Posts

Thanks for the fast response Jack

 

I have Ultimate SEO V2.2d-5 installed..

I turned OFF the spider friendly option , check links on edit and reciprocal link required under: Configuration - Links

but everything stayed the same.. The redirect links still shows...

Any other suggestions..

 

Greg

Link to comment
Share on other sites

Thanks for the fast response Jack

 

I have Ultimate SEO V2.2d-5 installed..

I turned OFF the spider friendly option , check links on edit and reciprocal link required under: Configuration - Links

but everything stayed the same.. The redirect links still shows...

Any other suggestions..

 

Greg

Try updating to V2.2d-7 since some changes were made to the code regarding this contribution. Also be sure you have the entry for Links Manager in your .htaccess file. Once that is done, go into the admin settings for Ultimate SEO and use the reset cache option. The links should be correct at that point.

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 first link is correct.

This contribution works fine with Ultimate SEO V 2.2d, which is what I recommend using. If it doesn't work with SEO 5, you will need to ask in that support thread.

 

Thanks Jack - Just to let you and anyone else encountering this problem know that I found the following sorted it out .. I turned Ultimate SEO Urls 5 off, then on again and reset the cache and it's working fine :-D

Edited by topoils
Link to comment
Share on other sites

Hi Jack,

 

in catalog/links.php the sub category shows directly below the main category, however if I have lots of sub categories for that particular main category it can look very busy, is it possible to disable the sub category listing on the catalog/links.php, then when the main category is selected it leaves you with the sub categories listed as per normal install?

 

ie as at stands catalog/links.php

 

main cat

sub1 sub2 sub3 etc

 

however be better for me to have main cat only on the links page.

 

then on the links-0_1.html page have the sub categories available as per normal.

 

I am looking to find out which code in the file realtes to the sub category listing so I can disable only the sub cats on the main catalog/links.php page.

 

At the moment when I look I am not sure which part I need to disable, I will have another look in the morning,as it could be tired eyes why I cant see it at the moment.

 

Thanks

Getting better with mods but no programmer am I.

Link to comment
Share on other sites

The same code is used to display sub-categories regardless of if it under a main category or a sub-category. You will need to find the code in links.php (look for the checking of the option to display sbu-categories) and add a check to ignore that if on the main category (parent_id=0).

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 same code is used to display sub-categories regardless of if it under a main category or a sub-category. You will need to find the code in links.php (look for the checking of the option to display sbu-categories) and add a check to ignore that if on the main category (parent_id=0).

 

not sure I conveyed this properly.

 

on links.php there is a list of categories displayed, under the main category is a link to any sub categories for that main category.

 

ie I need to remove the link with class linkListingSubCats.

 

as when you go to the main category and it lists all the sub categories the class is linkListingCats for all the sub categories.

 

Thanks

Getting better with mods but no programmer am I.

Link to comment
Share on other sites

not sure I conveyed this properly.

 

on links.php there is a list of categories displayed, under the main category is a link to any sub categories for that main category.

 

ie I need to remove the link with class linkListingSubCats.

 

as when you go to the main category and it lists all the sub categories the class is linkListingCats for all the sub categories.

I understood. When you are on a sub-categories page, if those sub-categories have sub-categories of their own, they will display the same was as in the parent category. That code is all the same. If you remove it for when you are on the parent category page, it will remove it on the sub-category page. That may not matter in your case if you only have one level of nested categories though.

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,

 

Thanks for the great add-on and appreciate the forum support!

 

I have this working now but encountered a minor issue regarding displaying £ (GBP) on the links page under the products

http://top-oils.co.uk/links.php

They display perfectly in the rest of the site so am assuming that the character needs to be entered or set somehow in the Links Manager but no idea where or how.... please advise.

Link to comment
Share on other sites

No, there's no setting for special characters. It might be the links.pho file is missing the charset tag. Try comparing it with the privacy page (using a program like Winmerge will make that easier), to see if that code is missing.

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

No, there's no setting for special characters. It might be the links.pho file is missing the charset tag. Try comparing it with the privacy page (using a program like Winmerge will make that easier), to see if that code is missing.

 

Thank you for the swift response and the fix! - that solved the problem - the charset tag was missing - now fixed! :thumbsup:

Link to comment
Share on other sites

Thank you for the swift response and the fix! - that solved the problem - the charset tag was missing - now fixed! :thumbsup:

You're welcome. That is actually a coding error introduced by the Header Tags SEO contribution. If you have that contribution installed, there's not a problem. But if not, that tag is missing. I had thought I fixed this contribution regarding that but I see now I didn't. Thanks for verifying that is the problem. I'll change that in the next version.

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

  • 2 weeks later...

Hi

 

I just added Links Manager to my site and have run into two problems.

 

The first is this:

The words 'TEXT_SEARCH' show up next to the input box for the Submit Link button

 

and the second is this:

 

Fatal error: Call to undefined function tep_get_link_category_tree() in /home/justag5/public_html/links_submit.php on line 435

 

Any help would be appreciated..

Thanks

Link to comment
Share on other sites

You've missed some steps in the installation process. Search the install file for those words (TEXT_SEARCH and tep_get_link_category_tree) to find the instructions.

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

You've missed some steps in the installation process. Search the install file for those words (TEXT_SEARCH and tep_get_link_category_tree) to find the instructions.

 

 

I went through the instructions again and highlighed as I went along....the two strings 'TExt_SEARCH and tep_get_link_category_tree are not there.

I went to an older version of links and that documentation does not have the strings either. Below is the instructions I got:

 

---------------------------------------------------------------

Links Manager II for osC(MS2 and RC2) v1.24

 

This contribution was developed for, and tested on osCommerce v2.2 MS2 and RC2

but will run on any shop based on osCommerce with some small modifications.

 

Features include,

 

* multi-language support * spider friendly links click count

* links/link category images support * split page views for links

* link partners contact options * integrated links checker (thanks to Greame Conkie)

* admin configuration options * "semi-automated" install ;-)

* notification on link status change * plus much more!

 

INSTALLATION

------------

********** BACKUP your files and database!!! ************

 

***********************************************************************

1: Copy all the files in the catalog directory to their respective

directories on your server. Only files relating to Links Manager

are in the catalog directory. Note that "catalog" refers to the

directory your shop is in. It may be named something else, like shop,

or it may not exist, which means your shop is in the root directory.

 

***********************************************************************

2: In catalog/stylesheet.css

 

ADD anywhere before the last ?>:

 

/* Links Manager v1.24 begin */

TABLE.linkListing {

border: 1px;

border-style: solid;

border-color: #b6b7cb;

border-spacing: 1px;

}

 

.linkListing-heading {

font-family: Verdana, Arial, sans-serif;

font-size: 10px;

font-weight: bold;

background: #b6b7cb;

color: #FFFFFF;

text-align: center;

}

A.linkListing-heading {

color: #FFFFFF;

}

A.linkListing-heading:hover {

color: #FF0000;

}

TD.linkListing-data {

border-right: 1px solid #b6b7cb;

border-bottom: 1px solid #b6b7cb;

padding: 4px;

font-family: Verdana, Arial, sans-serif;

font-size: 10px;

color: #ff0000;

}

A.linkListing-data {

color: #FF0000;

}

A.linkListing-data:hover {

color: #FF0000;

}

TR.linkListing-odd {

background: #f8f8f9;

}

 

TR.linkListing-even {

background: #F5F5F5;

}

 

.linkFeatured {

font-family: Verdana, Arial, sans-serif;

font-size: 10px;

font-weight: bold;

background: #dbd6d6;

color: #FFFFFF;

text-align: center;

border: 1px solid black;

}

.linkFeaturedHeading {

font-family: Verdana, Arial, sans-serif;

font-size: 14px;

font-weight: bold;

background: #dbd6d6;

color: #FFFFFF;

text-align: center;

}

A.linkListingHeading {

color: #000000;

}

A.linkListingHeading:hover {

color: #FF0000;

}

.linkFeaturedMain {

font-family: Verdana, Arial, sans-serif;

font-size: 10px;

font-weight: bold;

background: #dbd6d6;

color: #FFFFFF;

text-align: center;

}

A.linkFeaturedMain {

color: #FFFFFF;

}

A.linkFeaturedMain:hover {

color: #FF0000;

}

.linkListingMain {

font-family: Verdana, Arial, sans-serif;

font-size: 10px;

background: #ffffff;

color: #000000;

text-align: left;

}

A.linkListingMain {

color: #000000;

}

A.linkListingMain:hover {

color: #FF0000;

}

.linkListingCats {

font-family: Verdana, Arial, sans-serif;

font-size: 11px;

font-weight: bold;

color: #FFFFFF;

text-align: center;

}

A.linkListingCats {

font-family: Verdana, Arial, sans-serif;

font-size: 11px;

color: #000000;

line-height: 1.5;

}

A.linkListingCats:hover {

font-family: Verdana, Arial, sans-serif;

font-size: 11px;

color: #FF0000;

}

.linkListingSubCats {

font-family: Verdana, Arial, sans-serif;

font-size: 9px;

font-weight: normal;

color: #FFFFFF;

text-align: center;

line-height: 1.5;

}

A.linkListingSubCats {

color: #000;

line-height: 1.5;

}

A.linkListingSubCats:hover {

color: #FF0000;

}

TABLE.linkSubmit {

border: 3px;

border-style: ridge;

border-color: #b6b7cb;

}

TR.linkSubmit {

background-color: #f8f8f9;

}

/* Links Manager II v1.24 end */

 

 

***********************************************************************

3: In catalog/redirect.php

 

BEFORE: (around line 30)

 

case 'manufacturer':

 

ADD:

 

// Links Manager II v1.24 begin

case 'links':

require(DIR_WS_FUNCTIONS . 'links.php');

 

$links_query = tep_db_query("select links_url from " . TABLE_LINKS . " where links_id = '" . (int)$HTTP_GET_VARS['goto'] . "'");

if (tep_db_num_rows($links_query)) {

$link = tep_db_fetch_array($links_query);

tep_update_links_click_count($HTTP_GET_VARS['goto']);

 

tep_redirect($link['links_url']);

}

break;

// Links Manager II v1.24 end

 

 

***********************************************************************

4: In catalog/includes/filenames.php

 

ADD anywhere before the last ?>:

 

// Links Manager II v1.24 begin

define('FILENAME_LINKS', 'links.php');

define('FILENAME_LINKS_SUBMIT', 'links_submit.php');

define('FILENAME_LINKS_SUBMIT_SUCCESS', 'links_submit_success.php');

define('FILENAME_LINK_LISTING', 'link_listing.php');

define('FILENAME_LINK_SEARCH', 'link_search.php');

define('FILENAME_POPUP_LINKS_HELP', 'popup_links_help.php');

// Links Manager II v1.24 end

 

 

***********************************************************************

5:) In catalog/includes/database_tables.php

 

ADD anywhere before the last ?>:

 

// Links Manager II v1.24 begin

define('TABLE_LINK_CATEGORIES', 'link_categories');

define('TABLE_LINK_CATEGORIES_DESCRIPTION', 'link_categories_description');

define('TABLE_LINKS', 'links');

define('TABLE_LINKS_DESCRIPTION', 'links_description');

define('TABLE_LINKS_EXCHANGE', 'links_exchange');

define('TABLE_LINKS_TO_LINK_CATEGORIES', 'links_to_link_categories');

define('TABLE_LINKS_FEATURED', 'links_featured');

// Links Manager II v1.24 end

 

 

***********************************************************************

6: In catalog/includes/languages/english.php (same for other language files you may use)

 

ADD anywhere before the last ?>:

 

// Links Manager II v1.24 begin

define('BOX_INFORMATION_LINKS', 'Links');

define('BOX_HEADING_LINKS', 'Featured Links');

// Links Manager II v1.24 end

 

 

***********************************************************************

7: In catalog/includes/boxes/information.php

In catalog/includes/MODULES/SIDEBOXES/information.php

AFTER:

 

$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a><br>' .

 

ADD:

'<a href="' . tep_href_link(FILENAME_LINKS) . '">' . BOX_INFORMATION_LINKS . '</a><br>' . // Links Manager II v1.00 added

 

***********************************************************************

8: In catalog/includes/column_right.php (or column_left.php per your preference)

 

ADD anywhere before the last ?>:

 

include(DIR_WS_BOXES . 'links.php');

 

 

***********************************************************************

9: In catalog/admin/includes/filenames.php

 

ADD anywhere before the last ?>:

 

// Links Manager II v1.24 begin

define('FILENAME_LINKS', 'links.php');

define('FILENAME_LINK_CATEGORIES', 'link_categories.php');

define('FILENAME_LINKS_CONTACT', 'links_contact.php');

define('FILENAME_LINKS_CHECK', 'links_check.php');

define('FILENAME_LINKS_EXCHANGE', 'links_exchange.php');

define('FILENAME_LINKS_FEATURED', 'links_featured.php');

define('FILENAME_LINKS_STATUS', 'links_status.php');

// Links Manager II v1.24 end

 

 

***********************************************************************

10: In catalog/admin/includes/database_tables.php

 

ADD anywhere before the last ?>:

 

// Links Manager II v1.24 begin

define('TABLE_LINK_CATEGORIES', 'link_categories');

define('TABLE_LINK_CATEGORIES_DESCRIPTION', 'link_categories_description');

define('TABLE_LINKS', 'links');

define('TABLE_LINKS_DESCRIPTION', 'links_description');

define('TABLE_LINKS_EXCHANGE', 'links_exchange');

define('TABLE_LINKS_TO_LINK_CATEGORIES', 'links_to_link_categories');

define('TABLE_LINKS_STATUS', 'links_status');

define('TABLE_LINKS_CHECK', 'links_check');

define('TABLE_LINKS_FEATURED', 'links_featured');

// Links Manager II v1.24 end

 

 

***********************************************************************

11: In catalog/admin/includes/column_left.php

 

ADD anywhere before the last ?>:

 

// Links Manager II v1.24 begin

require(DIR_WS_BOXES . 'links.php');

// Links Manager II v1.24 end

 

 

***********************************************************************

12: In catalog/admin/includes/languages/english.php (same for other language files you may use)

 

ADD anywhere before the last ?>:

 

// Links Manager II v1.24 begin

// links manager box text in includes/boxes/links.php

define('BOX_HEADING_LINKS', 'Links Manager II');

define('BOX_LINKS_LINKS', 'Links');

define('BOX_LINKS_LINK_CATEGORIES', 'Link Categories');

define('BOX_LINKS_LINKS_CONTACT', 'Links Contact');

define('BOX_LINKS_LINKS_EXCHANGE', 'Links Exchange');

define('BOX_LINKS_LINKS_FEATURED', 'Links Featured');

define('BOX_LINKS_LINKS_STATUS', 'Links Status');

// Links Manager II v1.24 end

 

 

***********************************************************************

13: Using a browser, visit this url, http://www.yoursite.com/links_setup.php,

using your correct url, of course. This will apply the needed database

changes to your database.

 

***********************************************************************

14: Delete /catalog/links_setup.php (THIS IS IMPORTANT, as your data can

be overwritten, if the script is run again).

 

***********************************************************************

15: To start using it:

 

- Set up the options via admin->Configuration->Links. Pay particular

attention to the Check Phase option since this determines if your

link can be found on another site.

- Setup the exchange text via admin->Links Manager II->Links Exchange.

This is the text that will show up on the links submit page of your

shop.

- Setup a link category and links via admin->Links Manager II

 

********************** OPTIONAL ***************************************

This explains how to setup a cron job to automatically check

your reciprocal links. Cron is a program that will run scripts

automatically. Your host has to have this feature enabled.

 

To set up the cron job, add the following as the cron command:

 

php /home/username/public_html/catalog/admin/links_check.php

 

Note that you need to change username to your username and the path

to the links_check.php file must be correct. Also, some hosts require

a different syntax for the command. Ask your host if you run into

problems.

 

There should also be settings for Minute, Hour, Day, Month and Weekday.

If you place an asterisk (*) in these fields, then it means any time

at all. If a number is placed in that field, it means just that

one time. For example, if you place a 10 in the minute field and a *

in all of the other fields, the job will be ran every hour of

every day at 10 past the hour. Now, if you replace * in the hour

field with a 12, the script will be called everyday at 12:10.

 

If you have a large number of links, the script might time out before

all of the links are checked. When, or even if, that timeout occurs will

depend upon your server. If you find that the script is not completing, then

you may need the following option. It will cause the cron job to sleep for a

little while in between checking url's. By setting this sleep option, you can

cause the script to delay so that it doesn't timeout. Note that this may not

work on all hosts. You will have to adjust the sleep value to your situation.

You can tell if all of the links are being checked by looking at the Last Checked

column in admin->Links->Links Status section.

 

To enable this option, open the admin/check_link.php file and find these lines:

 

$sleepCnt = 30;

$sleepDuration = 600;

 

The first tells it to go to sleep when 30 links, or a multiple of 30 (60, 90, etc.)

have been checked. The second tells it how long to sleep, in seconds. So with the

above settings, after 30 links, the cron job will sleep for 10 minutes (60 seconds

times 10 minutes = 600 seconds). These numbers may not work for you. You might have

to adjust them if you still have timeout problems. On some hosts, the sleep option

may not work at all as intended. You will need to ask your host about that if it

happens.

 

***********************************************************************

Possible Problems

 

-----------------------------------------------------------------------

If you get a message like

 

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

 

it is caused by a know code problem with mysql. To fix it, open the

admin/includes/classes/split_page_results.php file and

 

CHANGE THIS:

 

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

 

TO THIS:

 

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

 

-----------------------------------------------------------------------

If, and only if, you get the following error in admin:

 

Fatal error: Call to undefined function: tep_hide_session_id()...

 

then, add the following to the end of the admin/includes/functions/html_output.php

file before the final ?>.

 

////

// Hide form elements

function tep_hide_session_id() {

$string = '';

 

if (defined('SID') && tep_not_null(SID)) {

$string = tep_draw_hidden_field(tep_session_name(), tep_session_id());

}

 

return $string;

}

 

***********************************************************************

If you have any problems or questions, please see the support thread at:

http://www.oscommerce.com/forums/index.php?showtopic=268562

 

 

Thanks

Alice

Link to comment
Share on other sites

I went through the instructions again and highlighed as I went along....the two strings 'TExt_SEARCH and tep_get_link_category_tree are not there.

If you performed Step 1, then the files should be on the server. If they are there, then you uploaded them to the wrong location. If they are not there, then you skipped that step.

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

DescriptionDuring our analysis of your web application, we were able to intentionally generate database specific errors. By causing a system to output errors such as these, it is often possible to determine the database version and inject database command syntax that would allow us to extract data.

 

The information gathered from the specific error responses generated using various input validation techniques by the web application scanner has determined the remote host may be running a MySQL database.

 

The extent of the damage that can be caused by this vulnerability varies greatly depending on environment and configuration. While input validation via webapp may cause a database to generate an error, the database configuration will also play an important role in determining how much it can be altered. A remote attacker may be able to gain access to very sensitive information, or gain administrative access.

 

This is not an exhaustive test and has not identified all of the forms and variables that may be affected by this vulnerability.

 

 

General SolutionTHE SINGLE BEST WAY TO FIX THIS VULNERABILITY IS TO IDENTIFY THE ACCEPTABLE INPUT FOR EACH FORM PARAMETER AND REJECT INPUT THAT DOES NOT MEET THAT CRITERIA.

 

The following is an acceptable solution however it is not optimal.

 

Implement content parsing on data input fields including URL parameters.

 

Remove the following characters from any user or dynamic database input: (examples in VBScript)

 

' (escape the single quote) input = replace( input, "'", "''" ) <li>" (double quote) input = replace( input, """", "" ) <li>) (close parenthesis) input = replace( input, ")", "" ) <li>( (open parenthesis) input = replace( input, "(", "" ) <li>; (semi-colon) input = replace( input, ";", "" ) <li>- (dash) input = replace( input, "-", "" ) <li>| (pipe) input = replace( input, "|", "" )

 

On text input it is recommended to append quotes around the user supplied input.

 

Whats the best way to address this security issue? My McaFee security logo went down because of this mod :(. I think maybe to sanitize the inputs?

Link to comment
Share on other sites

Jack_mcs,

 

I took a stab at fixing this myself. They have an online demo to allow you to test as you go. This is what I did.

 

Added:

 

function tep_sanitize_string_custom($string) {

$string = ereg_replace(' +', ' ', trim($string));

 

return preg_replace("/[<;)`,\'\">]/",'', $string);

}

 

 

Changed:

$links_url = tep_db_prepare_input($_POST['links_url']);

 

TO

$links_url = tep_sanitize_string_custom($_POST['links_url']);

 

AND

 

$links_reciprocal_url = tep_sanitize_string_custom($_POST['links_reciprocal_url'])

 

TO

$links_reciprocal_url = tep_db_prepare_input($_POST['links_reciprocal_url'])

 

Since making the changes I have been able to pass the demo test. I have now submitted it for an on demand audit. I will post the results if it works or not. My PHP skills, described by myself server only as band-aids. I do not know how to code it correctly. That said I would appreciate if someone could post a better version of what I attempted to fix. If it works, that is.

Link to comment
Share on other sites

Hi Jack

 

I've followed your installation instruction till step 9-12 where I just found out that I only have image.php under the directory catalog/admin/ but not includes.php. I guess your catalog is htdoc (public_html) in my case. This can be a silly question with obvious answer behind. But I have no clue at all. It'd be appreciated if you could point me out what I got wrong here. Thanks a lot.

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