Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Links Manager for osC v1.00


VJ

Recommended Posts

Hmm, a few others have mentioned having this problem but only on updates. Did you try checking the langauge settings as mentioned a page or two ago? Also make sure te link is set to Approved.

 

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

  • Replies 1.1k
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

 

I desperately hope someone can help!

 

I've installed everything ok, but now need to configure it to my liking, but I'm having trouble!

 

 

I have some links with no images, but still get an empty box showing - how do i get the image to show only if there is something there?!

 

My links page

 

Thanks for any help

 

Ben

Link to comment
Share on other sites

Find this code in includes/modules/link_listing_vertical.php

case 'LINK_LIST_IMAGE':

if (tep_not_null($listing['links_image_url'])) {

echo '<tr><td class="main"><a href="' . tep_get_links_url($listing['links_id']) . '" target="_blank">' . tep_links_image($listing['links_image_url'], $listing['links_title'], LINKS_IMAGE_WIDTH, LINKS_IMAGE_HEIGHT) . '</a></td></tr>';

} else {

echo '<tr><td class="main"><a href="' . tep_get_links_url($listing['links_id']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', $listing['links_title'], LINKS_IMAGE_WIDTH, LINKS_IMAGE_HEIGHT, 'style="border: 3px double black"') . '</a></td></tr>';

}

break;

and change it to
			case 'LINK_LIST_IMAGE':
		  if (tep_not_null($listing['links_image_url'])) {
			echo '';
		  } else {
			echo '<tr><td class="main"><a href="' . tep_get_links_url($listing['links_id']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', $listing['links_title'], LINKS_IMAGE_WIDTH, LINKS_IMAGE_HEIGHT, 'style="border: 3px double black"') . '</a></td></tr>';
		  }		
		  break;

I haven't tried this but I think it will work. A better approach to be to change the image being shown for a missing image to something like a "Image Not Available" image.

 

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

Hello,

 

I installed the latest version, but having some problems like the ones a few post back.

Installation and database adaptation gave no problem.

All menus work fine as long as no links where submitted. Problems in admin occurred when a link was submitted.

 

In de admin section, the next error occurs:

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/sites/site81/web/admin/links.php on line 235

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/sites/site81/web/admin/links.php on line 235

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/sites/site81/web/admin/includes/classes/object_info.php on line 17

Warning: Variable passed to each() is not an array or object in /home/sites/site81/web/admin/includes/classes/object_info.php on line 18

 

Also sometimes the errors are:

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/sites/site81/web/adminshop/links.php on line 733

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/sites/site81/web/adminshop/includes/classes/object_info.php on line 17

Warning: Variable passed to each() is not an array or object in /home/sites/site81/web/adminshop/includes/classes/object_info.php on line 18

 

 

The first error refers to line 235 in admin/links.php:

$lInfo_array = array_merge($links, $category);

 

My knowledge of PHP is not that great, but I think it means that arrays $links and $category don?t exist. Looking into this file, I can?t find something like:

$links = array();

$category = array();

 

So what is happening here?

Regards,

Peter

Link to comment
Share on other sites

Hello,

 

I couldn?t edit my topic, but I have some extra info.

If I look into links_setup.php, it seems that there is a protection to run setup if the tables are already there. I can run the setup over and over, without any warning that the tables exist, In admin > configuration, the item Links occurs as many times as I run the setup, but the item admin>links manager will not multiply. The link that was submitted is deleted, and the error in the link manager is disappeared. As soon as I submit a link in the shop, the error in the link manager will occur again.

Does this ring any bells?

 

Best regards,

Peter

Link to comment
Share on other sites

further to my posts above, i have reinstalled the contrib (stripped all the references from the database and started from scratch) but i still get the same problem i did try and change the link to a featured one to see if that worked but got this error in admin

 

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 'ON DUPLICATE KEY UPDATE date_added = now()' at line 1

 

insert into links_featured (links_id, date_added, expires_date) values ('1', now(), '20061231') ON DUPLICATE KEY UPDATE date_added = now()

 

[TEP STOP]

 

 

not great with php/sql so unsure if this could be the route of my problems?

 

Chris

Link to comment
Share on other sites

Got it!

 

The first error was:

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/sites/site81/web/admin/links.php on line 733

 

Line 733 is: $lInfo_array = array_merge($links, $category);

 

By accident, I found the following in the installation file of the contri ?extra pages?:

 

Somebody told me that on php 5.x this contribution is not working. And he found the resolution: He said he replaced

$bInfo_array = array_merge($pages, $info);

 

with:

$bInfo_array = array_merge($pages, (array) $info);

in the scripts and everything worked fine.. I have not tried this myself but it worths checking if you use PHP 5.x and having problems.

 

Because I am using PHP5, I changed line 733 into:

$lInfo_array = array_merge($links, (array)$category);

 

It helped, now it seems to work, but I haven?t tried everything yet.

I saw that there are still some more array_merge instructions in the files.

That is why I am changing my question now to:

 

For stability, is it wise to change all lines with:

array_merge($A, $B);

Into:

array_merge((array)$A, (array)$B);?

 

Regards,

Peter

Link to comment
Share on other sites

Also sometimes the errors are:

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/sites/site81/web/adminshop/links.php on line 733

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/sites/site81/web/adminshop/includes/classes/object_info.php on line 17

Warning: Variable passed to each() is not an array or object in /home/sites/site81/web/adminshop/includes/classes/object_info.php on line 18

The first error refers to line 235 in admin/links.php:

$lInfo_array = array_merge($links, $category);

 

My knowledge of PHP is not that great, but I think it means that arrays $links and $category don?t exist. Looking into this file, I can?t find something like:

$links = array();

$category = array();

It might be that there is nothing loading from the database. Find this code around line 733
		$category = tep_db_fetch_array($categories_query);

	$lInfo_array = array_merge($links, $category);

and change it to

		$category = tep_db_fetch_array($categories_query);
if (tep_db_num_rows($categories_query) < 1) 
echo ('No database entry found<br>');

	$lInfo_array = array_merge($links, $category);

Save it and update your browser. Do you get the error displayed?

 

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

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 'ON DUPLICATE KEY UPDATE date_added = now()' at line 1

 

insert into links_featured (links_id, date_added, expires_date) values ('1', now(), '20061231') ON DUPLICATE KEY UPDATE date_added = now()

 

[TEP STOP]

not great with php/sql so unsure if this could be the route of my problems?

 

Chris

That is due to an incompatibility with your mysql version. A fix as posted a page or two ago.

 

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

Find this code in includes/modules/link_listing_vertical.phpand change it to
			case 'LINK_LIST_IMAGE':
		  if (tep_not_null($listing['links_image_url'])) {
			echo '';
		  } else {
			echo '<tr><td class="main"><a href="' . tep_get_links_url($listing['links_id']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', $listing['links_title'], LINKS_IMAGE_WIDTH, LINKS_IMAGE_HEIGHT, 'style="border: 3px double black"') . '</a></td></tr>';
		  }		
		  break;

I haven't tried this but I think it will work. A better approach to be to change the image being shown for a missing image to something like a "Image Not Available" image.

 

Jack

 

Hi,

 

i tried the above - but it removed images for where there was an image available, and left blank boxes for links where there is no image available.

 

Sadly my code knowledge is very poor, it obviosuly only needs a small tweak to make it not show links where there is no image, can anyone do this?

 

Thanks in advance

 

Ben

Link to comment
Share on other sites

Thanks for that jack, hadn't noticed the eariler reply, any ideas about the missing links though?
Not other than what I already suggested. You may try contacting some of the others that have posted with that problem. They never posted back so either they got it fixed or gave up on it. I posted some code several pages back to help troubleshoot this somewhat but I don't recall how far that went.

 

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

Hello,

I have working with this contribution a lot.

 

Due to the fact that we add links from admin section to some people and they never link back, I was thinking in create an approval page. It will be placed on the catalog section and will work this way.

 

We enter the link from admin with pending status. We email the prospect and make the offer. We ask him to come to the approval page to approve his link. When he come to the approval page, we ask him to enter his website address, the script looks and pull from database all details we entered previously from admin and we ask him to enter the exact location of our link on his site. If it exists, the script changes the status of his link to approved and we show the category it's located, otherwise, we display a warning that our link is not found.

 

I think this way we are sure to have approved links from sites are linking to us and save us time in looking for reciprocal. Of course, there is room to elaborate on this, we can even set a period of time to delete his info, etc, etc.

 

I know what to do, BUT, I don't know how. We even can use part of the existing script (like the one to check for reciprocal on the admin side).

 

If anyone want to work with me on this, please let me know.

Thanks

Bob

Link to comment
Share on other sites

It seems like a lot of work to me. If you use the included cron script, it will check if the recipricol link exists and, if not, will change the link to disabled. You will need to use it anyway, if you want to keep your links current, since sites drop such links all of the time, for a variety of reasons. So even if someone visits your site and aprroves the link today, it may not present tomorrow.

 

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

It seems like a lot of work to me. If you use the included cron script, it will check if the recipricol link exists and, if not, will change the link to disabled. You will need to use it anyway, if you want to keep your links current, since sites drop such links all of the time, for a variety of reasons. So even if someone visits your site and aprroves the link today, it may not present tomorrow.

 

Jack

 

Hi Jack,

I understand what you means, but, I didn't go that far. I don't recommend the script attached with this contr. for a daily basic of reciprocal checker. One of my sites had over 1,000 links and I check all of then in just 20 minutes using the Reciprocal Link Checker. This program even looks in another pages inside the domain and it is the best I have found.

 

I was thinking for some kind of verification at the entry process. In my case, I enter many links every day and then invite partners for an exchange. I got the idea of placing the link in pending status, and in the invitation message to partners ask then to come to my site and approve the link so we don't have to display the link until the partner accept. This way if the link is not approved by the partner, we never show up, so it is more easy to delete in the future.

 

I agree with you, links must be checked regularly and it is a tedious work that never ends. Believe me, I have been on this for a long time and every second we can save will make hours in the run.

 

Thanks for the post.

Link to comment
Share on other sites

i'm hoping someone can spot what i'm doing wrong.

 

i'm trying to get links_submit.php to see if the user has a link to my site BEFORE throwing a success message. this (in my opinion) is a good way to avoid wasting your time logging into the admin panel for the undesirables' links which are only going to be deleted anyway...

 

i put this in the top of links_submit.php after $process = false;

//error checking

$parsed_url=parse_url($links_url);

$parsed_rec=parse_url($links_reciprocal_url);

if ($parsed_url['host'] != $parsed_rec['host']) {

$messageStack->add('nosub', 'The reciprocal link must be placed under the same (sub)domain as your link is!');

$error = true;

}

$html = @file_get_contents($links_reciprocal_url) or $messageStack->add('Can\'t open this URL. Please try again later.');

$error = true;

$html = strtolower($html);

$site_url =strtolower(LINKS_CHECK_PHRASE);

 

if (!strstr($html,$site_url)) {

$messageStack->add('lcheck', 'Our URL was not found on your website.<br>Please make sure you link to us before adding your link!');

$error = true;

}

but it still goes through with the success page even though i'm entering nonexistant domains
Link to comment
Share on other sites

I just installed v1.14 and I get the following errors in the admin section, in all link files:

 

admin/links.php

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

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_status from links l left join links_description ld on l.links_id = ld.links_id order by ld.links_title limit -20, 20

 

admin/link_categories.php

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

select lc.link_categories_id, lc.link_categories_image, lc.link_categories_status, lc.link_categories_sort_order, lc.link_categories_date_added, lc.link_categories_last_modified, lcd.link_categories_name, lcd.link_categories_description from link_categories lc left join link_categories_description lcd on lc.link_categories_id = lcd.link_categories_id where lcd.language_id = '4' order by lc.link_categories_sort_order, lcd.link_categories_name limit -20, 20

 

admin/links_status.php

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

SELECT l.links_id, l.links_reciprocal_url, l.links_status, ld.links_id, ld.links_title, lc.links_id, lc.date_last_checked, lc.link_found, ls.links_status_name from links l LEFT JOIN links_description ld on l.links_id = ld.links_id LEFT JOIN links_check lc on l.links_id = lc.links_id LEFT JOIN links_status ls on l.links_status = ls.links_status_id and ls.language_id = '4' limit -20, 20

[TEP STOP]

 

Any ideas?

Link to comment
Share on other sites

Problem solved by manually inputting data in the DB.

 

I just installed v1.14 and I get the following errors in the admin section, in all link files:

 

admin/links.php

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

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_status from links l left join links_description ld on l.links_id = ld.links_id order by ld.links_title limit -20, 20

 

admin/link_categories.php

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

select lc.link_categories_id, lc.link_categories_image, lc.link_categories_status, lc.link_categories_sort_order, lc.link_categories_date_added, lc.link_categories_last_modified, lcd.link_categories_name, lcd.link_categories_description from link_categories lc left join link_categories_description lcd on lc.link_categories_id = lcd.link_categories_id where lcd.language_id = '4' order by lc.link_categories_sort_order, lcd.link_categories_name limit -20, 20

 

admin/links_status.php

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

SELECT l.links_id, l.links_reciprocal_url, l.links_status, ld.links_id, ld.links_title, lc.links_id, lc.date_last_checked, lc.link_found, ls.links_status_name from links l LEFT JOIN links_description ld on l.links_id = ld.links_id LEFT JOIN links_check lc on l.links_id = lc.links_id LEFT JOIN links_status ls on l.links_status = ls.links_status_id and ls.language_id = '4' limit -20, 20

[TEP STOP]

 

Any ideas?

Link to comment
Share on other sites

I have this problem but no with this contribution...

Those errors: "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

 

select banners_id, banners_title, banners_image, banners_group, status, expires_date, expires_impressions, date_status_change, date_scheduled, date_added from banners order by banners_title, banners_group limit -20, 20"

 

appeared when I change from serve with MySQL different versions.

 

Any clue?

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