Jump to content
Jack_mcs

Links Manager II

Recommended Posts

I've deleted all links database entries before I started upgrading... Even if I run links_db_update.php, the entry remains the same. I can change and check it manually in phpMyAdmin but I cannot find those entries there... are they hidden somewhere? I just want to make sure that it works fine with the id language.


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

It's supposed to. :) The tests I ran with other languages worked and, I assume, others here have other languages enabled and they haven't complained so it should be OK.

Share this post


Link to post
Share on other sites

1 - That is currently coded in the file. You would have to remove the code to show all categories. I think I posted that change previously.

 

Thanks for your reply. The above question was regarding how to display all categories, even empty categories. I read through all 36 pages for about 3 hours and googled it also, but with bleary eyes. If anyone can point me in the right direction to find where this is posted I'd be very very appreciative. I just can't find it.

 

Thank you again, Jack, and community members.

Share this post


Link to post
Share on other sites

In links.php, remove this line. I haven't tested it but it should do the trick.

if ($linkCount > 0) //only show categories with links

Share this post


Link to post
Share on other sites

Hi Jack right thread this time.

 

Example below shows the main category as General and subgeneral as the sub category and Big cat as a main category and Lion and Tiger as sub categories and chocolate bar etc.

 

 

link categories in the submit link page in the catalog show the categories as follows:-

 

category:- General

sub general

Big cat

Lion

Tiger

Chocolate bar

Lion

 

whereas I want it to be

 

category:- General > Sub category

Big Cat > Lion

> Tiger

Chocolate bar> Lion

 

basically all categories and sub categories are displayed as categories of the same standing. In the admin categories all the categories are together but you can select a category and a have a top level category assigned to it. (so its not a major issue here).

 

as it is now, if someone submitted a link to the site as a Lion site, they wouldnt be able to know if they submitted it as Lion the big cat or as Lion the chocolate bar.

 

If this hasnt made any clearer pm me about the site url and I can talk through it with live examples.

 

Thanks

Edited by johnnybebad

Getting better with mods but no programmer am I.

Share this post


Link to post
Share on other sites

In links.php, remove this line. I haven't tested it but it should do the trick.

if ($linkCount > 0) //only show categories with links

 

Worked like a charm! A million thanks -

 

Now, after having done that it displays Categories, then two sub-categories under the main category. Does anyone know how to change that to display say, 3 or 4 sub-categories (or more)?

Share this post


Link to post
Share on other sites

as it is now, if someone submitted a link to the site as a Lion site, they wouldnt be able to know if they submitted it as Lion the big cat or as Lion the chocolate bar.

Ahh, I see now. I thought you meant in the admin. Yes, that is a problem. I've never noticed it before and no one has mentioned it until now. There isn't anything in the code to have that display in a better format. I will rewrite that and apply it to the next version. No idea when that will be though.

Share this post


Link to post
Share on other sites

Worked like a charm! A million thanks -

 

Now, after having done that it displays Categories, then two sub-categories under the main category. Does anyone know how to change that to display say, 3 or 4 sub-categories (or more)?

A few lines down, change the 2 to whatever you want

if ($subCtr >= 2)

Share this post


Link to post
Share on other sites

Jack,

I'm sorry to bother you again, the support staff at my hosting company is probably having some bad time... They're telling me that this application is using non standard way of calling Curl and that my problem lies withing osCommerce. It is almost the same scenario as I was having with sitemap SEO, but that was sorted when I asked them to enable allow_fopen. I just wanted to ask you, are there any functions that might be causing the issue? If it is caused by server settings, I will simply ask them to allow those and problem sorted.

 

I did some further testing and this is the problem... At the moment, I cannot even see the links.php page in admin, as soon as I click it I'm receiving the 500 server error. I think it is due to the fact that there is one link available... I'll try to delete the link via phpMyAdmin and see if there is a change... one moment... OK I'm back, link deleted and I can see the links page safely! BUT... it was due to the fact that the link had this option selected (ticked) Disable Reciprocal Checking.

 

I've tested one more time, deleted link via phpMyAdmin and I can see the links page with no problems. I can even insert new link completing the form (admin->links). The link is visible on the links page BUT when I edit the link and select Disable Reciprocal Checking, as soon as I hit update, I receive 500 server error. Any other update is possible without a problem.


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

I don't know why they would say the curl code is non-standard. It is a pretty common section of code. But that shouldn't come into play with the problem you are having. When you add the link, nothing is going on other than just adding the link information to the database so changing the reciprocal checking option shouldn't make any difference. You could try turning off the global reciprocal checking option in the admin->Configuration->Links section just to see if that would work. My guess though is that something in the database is corrupted due to the previous installation, which is supported by the problem you had with the old link. I suggest trying to install this contribution into a clean shop with its own database. If it all works that way, then the problem is with your live database.

Share this post


Link to post
Share on other sites

Ahh, I see now. I thought you meant in the admin. Yes, that is a problem. I've never noticed it before and no one has mentioned it until now. There isn't anything in the code to have that display in a better format. I will rewrite that and apply it to the next version. No idea when that will be though.

Look forward to it thanks for your support


Getting better with mods but no programmer am I.

Share this post


Link to post
Share on other sites

You could try turning off the global reciprocal checking option in the admin->Configuration->Links section just to see if that would work. My guess though is that something in the database is corrupted due to the previous installation, which is supported by the problem you had with the old link. I suggest trying to install this contribution into a clean shop with its own database. If it all works that way, then the problem is with your live database.

It is rather hard to tell the difference because if I turn off the global reciprocal checking option in the admin->Configuration->Links, the whole box Reciprocal Page Details that is causing the problem is not there so I'm unable to check or uncheck the Disable Reciprocal Checking box. If it might be caused by the database, can't I just remove all entries required by the Links Manager II and run the links_setup.php again? If so, shall I do it manually or do you have a removal command available?


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

Jack, I installed Links Manager II last night, tested then and this AM. All appears to be working well. Thanks much for this contrib. Exactly what I was looking for.

 

I am not sure if my problem is related to the contrib so if that's the case, let me know and I will go over to general support/questions and post.

 

I want to use Links Manager II to get onto reciprocal link directories. Some of these directories have an automated form that has you to complete various info, including a field where you put the link to their site. The also want you to use html coding to verify that the link is in place. I paste that in the description.

 

However when attempting to set up a reciprocal link on about half dozen directories, (again the ones using a similar validation form wanting the link and html code inserted) after clicking submit, the forms invariable produced a message that the html code could not be found on the page url I entered on their form. But it is there.

 

I even did a "view source" and it's there in the code.

 

Any ideas why the routine used in these forms is not finding the validation code they want?

 

Thanks


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

If it might be caused by the database, can't I just remove all entries required by the Links Manager II and run the links_setup.php again? If so, shall I do it manually or do you have a removal command available?

No, I don't have such a script, although that is planned. When I said remove it I meant anything related to Links Manager since you had said you already deleted existing links. So there is nothing related to Links Manager worth keeping. I would just delete it all and start over to be sure that isn't the problem.

Share this post


Link to post
Share on other sites

Any ideas why the routine used in these forms is not finding the validation code they want?

Be sure the click count option is turned off in the admin settings.

Share this post


Link to post
Share on other sites

I would just delete it all and start over to be sure that isn't the problem.

I've deleted all tables, all entries in Configuration table and also entry in Configuration group. Installed tables again (Database successfully updated!!! ) and the problem remains... as soon as I select Disable Reciprocal Checking, and hit update, I receive 500 server error. Same error is received when I try view the page Links in admin - because there is this link with missing information in links_reciprocal_url! I don't have to remove the link to be able to see Links in admin, I don't even have to change links_reciprocal_disable to "0" in table links. I have noticed that fields links_reciprocal_url and links_reciprocal_disable in table links are empty despite the fact that I've had www.test.com and "2" there. As soon as I complete links_reciprocal_url via phpMyAdmin, all works fine, I can safely see the page Links.

 

It looks like the error is being caused by these two boxes: Reciprocal Page and Disable Reciprocal Checking. When I do changes in phpMyAdmin as mentioned above - links_reciprocal_url = www.test.com and links_reciprocal_disable = 1, I see grey box Reciprocal Page in admin (no URL - no grey URL, no white URL - NO URL). However there is no way of leaving that box empty or greyed out via admin - even if I select Disable Reciprocal Checking "on", the popup warning I receive is telling me than there is a minimum length for the reciprocal url. As soon as I complete it and keep the Disable ticked, I've got 500 error and NO URL is written into database field links_reciprocal_url. Probably nothing to do with Reciprocal Check Count as I've tried 0 as well as 2, etc.


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

Alex - with the database cleared the problem has to be due to the code or the server. I've gone over that part of the code and don't see anything about it that would cause such a problem. Code was added in the last version to see if the url exists, though not in that section of code, but you may want to try replacing the admin/links.php file from the previous version to see if the problem goes away. Also, to help isolate the problem, it might help to know if a link can be submitted from the submit page on the shop side.

Share this post


Link to post
Share on other sites

Alex - with the database cleared the problem has to be due to the code or the server. I've gone over that part of the code and don't see anything about it that would cause such a problem. Code was added in the last version to see if the url exists, though not in that section of code, but you may want to try replacing the admin/links.php file from the previous version to see if the problem goes away. Also, to help isolate the problem, it might help to know if a link can be submitted from the submit page on the shop side.

Jack,

Does it make any difference knowing that it was tested with a fake url? I can try a test it later with a real URL.

 

I've tested the contribution on a different server with php 5.2.8, result is exactly the same - empty field links_reciprocal_url in table links. The only difference is that this other server does not return 500 error. I can submit the link from the store side with reciprocal link required set to False. If I set it to True, I receive error message that Our link cannot be found on my fake page - quite obvious.

 

I've also applied your fix in post #705 and it doesn't work for me on either server - keep receiving the max length warning despite the fact that the message contains only a few characters.


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

OK, I've tested with a real URL - no difference but I was able to safely submit the page from the store side (after commenting out the MAX_LENGTH as per my above post). The only way of getting rid of the 500 error is going into phpMyAdmin and typing something in the field links_reciprocal_url that was deleted after I selected Disable Reciprocal Checking in admin. I have also tried to type "blue_shoe" in the field links_reciprocal_url and that also returns 500 error while trying to visit Links in admin. This is on php 5.3.0.

Edited by mr_absinthe

Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

Be sure the click count option is turned off in the admin settings.

 

Jack, affirmative and it has been off. I am only brainstorming here, but it seems the forms for these problem directories has a code that combs the page for what they want to see. Which is their link. I am wondering if I something on my site that is preventing this from occurring???

 

Thanks


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

Jack, affirmative and it has been off. I am only brainstorming here, but it seems the forms for these problem directories has a code that combs the page for what they want to see. Which is their link. I am wondering if I something on my site that is preventing this from occurring???

 

Thanks

Nothing that I am aware of, with regards to the Links Manager code. Others have posted this problem over time but turing off that setting has always fixed it. You'll need to contact the site having the problem finding their link and ask them what the problem is. Maybe they are looking for something written a certain way and you don't have it exactly like that.

Share this post


Link to post
Share on other sites

Nothing that I am aware of, with regards to the Links Manager code. Others have posted this problem over time but turing off that setting has always fixed it. You'll need to contact the site having the problem finding their link and ask them what the problem is. Maybe they are looking for something written a certain way and you don't have it exactly like that.

 

OK, I will look at some of my other add ons, especially the security related ones, to see if there might be anything in there that may be causing this.

 

Thanks for the followup.

 

SK


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

I've noticed that in catalog/links.php, the text Search was still hardcoded and unformatted, therefore I've changed:

<td align="right" align="center"><?php echo tep_draw_form('check_links', tep_href_link(FILENAME_LINKS, '', 'NONSSL'), 'post', 'onSubmit="return true;" onReset="return true"') . tep_draw_hidden_field('action_search', 'process'); ?>
                   Search <?php echo tep_draw_input_field('links_search', '', 'maxlength="255", size="30"', false) . tep_image_submit('button_quick_find.gif', SEARCH) ; ?>

 

to this:

<td class="main" align="center"><?php echo tep_draw_form('check_links', tep_href_link(FILENAME_LINKS, '', 'NONSSL'), 'post', 'onSubmit="return true;" onReset="return true"') . tep_draw_hidden_field('action_search', 'process'); ?>
                   <?php echo TEXT_SEARCH . tep_draw_input_field('links_search', '', 'maxlength="255", size="20"', false) . '  ' . tep_image_submit('button_quick_find.gif', SEARCH) ; ?>

 

and in language file catalog/includes/languages/yourlanguage/links.php add this:

define('TEXT_SEARCH', 'Search ');

You may notice, that I've also changed the size of the search box, that could be changed by changing size="20" to size="30" or whatever you wish.

 

While trying and testing hard, I've also noticed that on the Links Status page in admin, there was no radio button next to Delete and selecting Disabled was changing the status to Waiting, after the following change, all seem to look and work OK.

 

link_status.php

starting line 233 change from:

<td valign="top"><INPUT TYPE="radio" NAME="group1" VALUE="<?php echo $links_statuses['links_status_id']; ?>" <?php echo $checked; ?> ></td>
          <td valign="middle" width="50" ><?php echo $links_statuses['links_status_name']; ?></td>
        <?php } ?>
          <td valign="top"><INPUT TYPE="radio" NAME="group1" VALUE="delete_links" <?php echo $checked; ?> ></td>
          <td valign="middle" class="smallText" width="50"><?php echo TEXT_LINK_DELETE; ?></td>

 

to this:

<td valign="middle" width="50" ><?php echo $links_statuses['links_status_name']; ?></td>	
          <td valign="top"><INPUT TYPE="radio" NAME="group1" VALUE="<?php echo $links_statuses['links_status_id']; ?>" <?php echo $checked; ?> ></td>

        <?php } ?>
          <td valign="middle" class="smallText" width="50"><?php echo TEXT_LINK_DELETE; ?></td>
          <td valign="top"><INPUT TYPE="radio" NAME="group1" VALUE="delete_links" <?php echo $checked; ?> ></td>

 

Every change on the Links Status page takes too long, even selecting status from the drop down menu at the top. Looks like the page is checking the links on each change... I only have 30 links there, no idea what will happen after I'll have 300 and more. I'll do more testing on both servers and report later, so far there seems to be a problem with finding the reciprocal links. Look at this scenario:

 

my link is on www.pewter-gifts.co.uk/acatalog/whisky-links.html

 

information box on the Links page is saying - Site Located: Yes, Link Located: Yes, on edit I see that the reciprocal link WAS found. Why is there a question mark on the Link Status page if on the Links page is Yes for both? The date in last column is showing that I've clicked the check link button (on the Links page) and found the link, therefore why the question mark? No idea! The logic is telling me that I should see the same result on the Links Status page... or maybe I was looking at this for too long and I'm missing something obvious.

Edited by mr_absinthe

Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Jack Thanks this is a very nice add onrolleyes.gif

 

I finished install ( I use STS Temp. ) and a modified admin menu. and I only see one button option CONFIGURATION>Links I assume their should be 2 menu's ?

 

 

15: To start using it:

 

1 - Set up the options via admin->Configuration->Links

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

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

 

P.S. the whole submit process works with emails and all I just cant find anything in add on to approve disapprove or manage

 

Thanks in advance for your anyone that can help

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

×