Jump to content



Photo
- - - - -

Links Manager II


  • Please log in to reply
1157 replies to this topic

#1   Jack_mcs

Jack_mcs
  • Members
  • 26,548 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 06 July 2007 - 02:17

This is a replacment for the Links Manager contribution. However, due to the many changes made, the code is no longer compatible with that version so I'm starting this new thread to make support easier. This version addresses many of the short-comings the other contribution has. Here is list of the major changes:

- Added code to includes/modules/links_listing.php and missing classes for sort heading problem with the standard listing box.
- Added code based on code submitted by rabbitseffort that presents the link exchange information in the links submit page is an easy-to-copy format.
- Added option to check for blacklisted words. The words are defined in a new setting in admin->configuration->Links.
- Added option to disable reciprocal link checking for individual links.
- Added a count option to admin->Configuration->Links that will allow links to be checked by the Check links script a number of times before the link is disabled. This was needed since some sites may not be working when the check is performed.
- Added checkboxes to Links Status page to easily change status to Approved.
- Added option of having nested categories.
- Added option of having no categories (for display - one in admin still needs to exist).
- Added code to check for the existence of at least one category in admin->Links Manger->Links. If not found, the code redirects to the admin->Links Manger->Link Categories page.
- Added option to display link count, or not.
- Added option to create a new category from within the links edit page.
- Added link category name to the links page.
- Added login option to allow link partners to edit their own links.
- Added option to Featured Links so that a featured link will be displayed on all link pages or just on the one it is listed for.
- Changed code so that the breadcrumb link has the session ID attached.
- Changed code in admin/links.pgp so search function works as expected.
- Changed code in admin/links.php to generate a normal link instead of an SEO one, which was causing some sites problems. If you want that ability, you should install Ultimate SEO with the update for Links Manager.
- Changed links_db_update.php script so that it will update the admin->configuration->Links options while keeping the current settings in place.
- Changed code so that the categories description is displayed as a true categories description on the page under the page heading.
- Fixed search code so it finds the links from any page.
- Included fixes from partial updates and items mentioned in the support thread.
- Removed extra code from links_check.php file to speed up checking.
- Removed the code for the Rating option since it was never implemented.
- Renamed to Links Manager II since the large amount of changes would cause support problems.
- Made many small fixes and changes that are too numerous to mention.

I didn't convert the language files since I don't know the languages. The format of at least one changed so I couldn't just do a copy/paste without changing the original. So, either way, something would be wrong with those files. Converting them will not be difficult if you know the language though.

The code has been installed into several shops and no problems have been reported. But there is a lot of new code here so it is still possible that could happen. In other words - backup first.

Jack

Edited by Jack_mcs, 06 July 2007 - 02:21.


#2   valerif

valerif
  • Members
  • 199 posts
  • Real Name:valeri

Posted 06 July 2007 - 16:06

dear jack
there is some issue with the links.php - see the message i get when used

1054 - Unknown column 'l.links_id' in 'on clause'

select l.links_status from links l LEFT JOIN links_description ld on l.links_status = 2 and ld.language_id = '1', links_to_link_categories l2c LEFT JOIN link_categories lc on l2c.links_id = l.links_id and lc.parent_id = '1'

[TEP STOP]

http://printingcanvas.co.uk/links.php

can u give me a suggestion how to rectify this problems
cheers
valeri

#3   twoifbysea

twoifbysea
  • Members
  • 205 posts
  • Real Name:Dave
  • Gender:Male
  • Location:Grass Valley, CA

Posted 06 July 2007 - 16:34

The categories show up. They indicate that there are links in them but when I click on the category box there are no links. The links show up in admin just fine though. Any ideas?
Sign Here

#4   Jack_mcs

Jack_mcs
  • Members
  • 26,548 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 06 July 2007 - 17:29

dear jack
there is some issue with the links.php - see the message i get when used

1054 - Unknown column 'l.links_id' in 'on clause'

select l.links_status from links l LEFT JOIN links_description ld on l.links_status = 2 and ld.language_id = '1', links_to_link_categories l2c LEFT JOIN link_categories lc on l2c.links_id = l.links_id and lc.parent_id = '1'

[TEP STOP]

http://printingcanvas.co.uk/links.php

can u give me a suggestion how to rectify this problems
cheers
valeri

Oops, that's an MySql V5 compatibility error. I meant to go through the code before I released it since I knew that would be a problem but I forgot. The following should fix it but there will probably be others so be sure to test all of the functions. For this one, in links.php, change
$count_links_query = tep_db_query("select l.links_status from " . TABLE_LINKS . " l LEFT JOIN " . TABLE_LINKS_DESCRIPTION . " ld on l.links_status = 2 and ld.language_id = '" . (int)$languages_id . "', " . TABLE_LINKS_TO_LINK_CATEGORIES . " l2c LEFT JOIN " . TABLE_LINK_CATEGORIES . " lc on l2c.links_id = l.links_id and lc.parent_id = '" . (int)$parentID . "'");
to
$count_links_query = tep_db_query("select l.links_status from " . TABLE_LINKS . " l LEFT JOIN ( " . TABLE_LINKS_DESCRIPTION . " ld, " . TABLE_LINKS_TO_LINK_CATEGORIES . " l2c, " . TABLE_LINK_CATEGORIES . " lc ) on (l.links_status = 2 and ld.language_id = '" . (int)$languages_id . "' and l2c.links_id = l.links_id and lc.parent_id = '" . (int)$parentID . "')");

Jack

#5   Jack_mcs

Jack_mcs
  • Members
  • 26,548 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 06 July 2007 - 17:32

The categories show up. They indicate that there are links in them but when I click on the category box there are no links. The links show up in admin just fine though. Any ideas?

This was a common problem with the previous version and I forgot to work on it. You can look in the old support link (the last 2-4 pages) for the fix but I think it was setting the languages option to All in the link. Be sure you have the language options setup correctly in the admin->Configuration->Links options too.

Jack

#6   Ausgirl

Ausgirl
  • Members
  • 936 posts
  • Real Name:Ruth
  • Gender:Female
  • Location:Brisbane, Australia

Posted 07 July 2007 - 17:12

G'day Jack,

On my links submit page it states: If you would like to edit an existing link, enter your login information and then click edit. Username: Password: then the edit button. There is no where to enter this information or do they enter it down the bottom of the page then have to scroll back up the page to click edit? Also a strange thing happens when you dont fill in any fields and just click edit, details of someones link just appears in the fields. Shouldnt a pop up screen say "you must login first" or something?

Thanks

#7   Jack_mcs

Jack_mcs
  • Members
  • 26,548 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 07 July 2007 - 17:22

G'day Jack,

On my links submit page it states: If you would like to edit an existing link, enter your login information and then click edit. Username: Password: then the edit button. There is no where to enter this information or do they enter it down the bottom of the page then have to scroll back up the page to click edit? Also a strange thing happens when you dont fill in any fields and just click edit, details of someones link just appears in the fields. Shouldnt a pop up screen say "you must login first" or something?

Thanks

Are you saying there isn't a input box next to the username and password words? Can you provide a link to the page? As for just clicking on the edit button, that sounds like a coding problem. I will have to test it.

Jack

#8   Ausgirl

Ausgirl
  • Members
  • 936 posts
  • Real Name:Ruth
  • Gender:Female
  • Location:Brisbane, Australia

Posted 07 July 2007 - 17:29

No, no input box next to the username & password near the edit button.( dont know if its suppose to have one there) Only down the bottom under login details. The edit button, tis a bit funny. You can see here.

Thanks

#9   Jack_mcs

Jack_mcs
  • Members
  • 26,548 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 08 July 2007 - 01:05

There is a mistake in the code. The boxes appear on my installation but it is probably to do with the php version being used. In the links_submit.php file, find this line
<td class="main"<?php echo tep_draw_input_field('links_customer_edit_username'); ?></td>
and change it to
<td class="main"><?php echo tep_draw_input_field('links_customer_edit_username'); ?></td>
And change this
<td class="main"<?php echo tep_draw_password_field('links_customer_edit_password'); ?></td>
to this
<td class="main"><?php echo tep_draw_password_field('links_customer_edit_password'); ?></td>

Jack

#10   twoifbysea

twoifbysea
  • Members
  • 205 posts
  • Real Name:Dave
  • Gender:Male
  • Location:Grass Valley, CA

Posted 08 July 2007 - 04:02

This was a common problem with the previous version and I forgot to work on it. You can look in the old support link (the last 2-4 pages) for the fix but I think it was setting the languages option to All in the link. Be sure you have the language options setup correctly in the admin->Configuration->Links options too.

Jack


Thanks for the reply. The only language option I have is English. I removed the rest from my store. The configuration side all looks appropriate. Still no links.
Sign Here

#11   Ausgirl

Ausgirl
  • Members
  • 936 posts
  • Real Name:Ruth
  • Gender:Female
  • Location:Brisbane, Australia

Posted 08 July 2007 - 04:37

There is a mistake in the code. The boxes appear on my installation but it is probably to do with the php version being used. In the links_submit.php file, find this line

<td class="main"<?php echo tep_draw_input_field('links_customer_edit_username'); ?></td>
and change it to
<td class="main"><?php echo tep_draw_input_field('links_customer_edit_username'); ?></td>
And change this
<td class="main"<?php echo tep_draw_password_field('links_customer_edit_password'); ?></td>
to this
<td class="main"><?php echo tep_draw_password_field('links_customer_edit_password'); ?></td>

Jack



Thanks Jack, the boxes are there now but without filling in anything and just clicking the edit button, someones details still pop into the input boxes /blink.gif' class='bbc_emoticon' alt=':blink:' />

Thanks

#12   Jack_mcs

Jack_mcs
  • Members
  • 26,548 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 08 July 2007 - 12:29

As mentioned previously, that is a problem in the code. It is not a one line fix so I will have to make the code change and upload a new version. I will try to do that this week. If your installation is in a live shop, then I suggest turning that option off for now.

Jack

#13   Ausgirl

Ausgirl
  • Members
  • 936 posts
  • Real Name:Ruth
  • Gender:Female
  • Location:Brisbane, Australia

Posted 08 July 2007 - 13:55

No worries, Jack, thanks

#14   Jack_mcs

Jack_mcs
  • Members
  • 26,548 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 09 July 2007 - 02:47

A new version has been uploaded with these changes:

- converted mysql calls to work properly with Mysql 5
- fixed coding errors that prevented login boxes from showing
- added code to check for a valid login for editing links

Just upload the included files to update from 1.16.

Jack

#15   gregy

gregy
  • Members
  • 678 posts
  • Real Name:Gregor
  • Gender:Male
  • Location:Slovenia, Celje

Posted 09 July 2007 - 07:19

thanx for great update .. i just wanted to say, please keep full versions in contribution section .. don't post just fixes .. it will make such beautiful contribution a mess like a lot of others big contribs.

Thanx

#16   Jack_mcs

Jack_mcs
  • Members
  • 26,548 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 09 July 2007 - 11:23

I totally agree. But since there is no way to control that, it will most likley happen sooner or later.

Jack

#17   Ausgirl

Ausgirl
  • Members
  • 936 posts
  • Real Name:Ruth
  • Gender:Female
  • Location:Brisbane, Australia

Posted 09 July 2007 - 11:26

1.17 works beautifully, thanks Jack, your a legend /smile.gif' class='bbc_emoticon' alt=':)' />

#18   valerif

valerif
  • Members
  • 199 posts
  • Real Name:valeri

Posted 09 July 2007 - 12:01

jack
thanks for the quick responce excellent updgare of links manager
valeri

#19   Jack_mcs

Jack_mcs
  • Members
  • 26,548 posts
  • Real Name:Jack York
  • Gender:Male
  • Location:Michigan

Posted 09 July 2007 - 12:27

Ugh! I just found a mistake in the admin/links.php files that occurs when viewing pending links. You need to change this section of code
$where = '';
	if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) {
	  $keywords = tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['search']));
	  $where = ' where ';
	  $search = " ld.links_title like '%" . $keywords . "%' or  l.links_url like '%" . $keywords . "%'";
	}
	
	if ($showLinkStatus == 'All')
	  $links_query_raw = "select l.links_id, l.links_url, l.links_image_url, l.links_date_added, l.links_last_modified, l.links_status, l.links_clicked, ld.links_title, ld.links_description, l.links_contact_name, l.links_contact_email, l.links_reciprocal_url, l.links_reciprocal_disable, l.links_status from " . TABLE_LINKS . " l left join ( " . TABLE_LINKS_DESCRIPTION . " ld ) on ( l.links_id = ld.links_id ) " . $where .  $search . " order by " . $order;
	else
	  $links_query_raw = "select l.links_id, l.links_url, l.links_image_url, l.links_date_added, l.links_last_modified, l.links_status, l.links_clicked, ld.links_title, ld.links_description, l.links_contact_name, l.links_contact_email, l.links_reciprocal_url, l.links_reciprocal_disable, l.links_status from " . TABLE_LINKS . " l left join ( " . TABLE_LINKS_DESCRIPTION . " ld ) on ( l.links_id = ld.links_id ) " . $where . " l.links_status = '" . $showLinkStatus . "' and " . $search . " order by " . $order;
to this
$where = ' where ';
	if (isset($HTTP_GET_VARS['search']) && tep_not_null($HTTP_GET_VARS['search'])) {
	  $keywords = tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['search']));
	  $where = ' where ';
	  $search = " and ld.links_title like '%" . $keywords . "%' or  l.links_url like '%" . $keywords . "%'";
	}
	else if ($showLinkStatus == 'All')
	  $where = '';
	
	if ($showLinkStatus == 'All')
	  $links_query_raw = "select l.links_id, l.links_url, l.links_image_url, l.links_date_added, l.links_last_modified, l.links_status, l.links_clicked, ld.links_title, ld.links_description, l.links_contact_name, l.links_contact_email, l.links_reciprocal_url, l.links_reciprocal_disable, l.links_status from " . TABLE_LINKS . " l left join ( " . TABLE_LINKS_DESCRIPTION . " ld ) on ( l.links_id = ld.links_id ) " . $where .  $search . " order by " . $order;
	else
	  $links_query_raw = "select l.links_id, l.links_url, l.links_image_url, l.links_date_added, l.links_last_modified, l.links_status, l.links_clicked, ld.links_title, ld.links_description, l.links_contact_name, l.links_contact_email, l.links_reciprocal_url, l.links_reciprocal_disable, l.links_status from " . TABLE_LINKS . " l left join ( " . TABLE_LINKS_DESCRIPTION . " ld ) on ( l.links_id = ld.links_id ) " . $where . " l.links_status = '" . $showLinkStatus . "'" . $search . " order by " . $order;

Jack

#20   gregy

gregy
  • Members
  • 678 posts
  • Real Name:Gregor
  • Gender:Male
  • Location:Slovenia, Celje

Posted 09 July 2007 - 12:34

hmm .. in admin/links.php

1064 - syntax error near '( links_description ld ) on ( l.links_id = ld.links_id ) ' at line 1

select count(*) as total from links l left join ( links_description ld ) on ( l.links_id = ld.links_id )

also in admin/links_status.php

1064 - syntax error near '( links_description ld, links_check lc, links_status ls ) on ( l.links_id = ld.' at line 1

select count(*) as total from links l LEFT JOIN ( links_description ld, links_check lc, links_status ls ) on ( l.links_id = ld.links_id and l.links_id = lc.links_id and l.links_status = ls.links_status_id ) where ls.language_id = '4'

Edited by gregy, 09 July 2007 - 12:37.