Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Contribution: Reciprocal Links


spooks

Recommended Posts

Reciprocal Links-2.0

 

This Contribution is a simple links mod for osC2.2.

It provides a easy way to exchange links, if you want something with lots of bells & whistles look at Links Manager II.

Clients can submit links that are approved in admin, administrators can also add, edit & delete links.

An automatic process in admin can check reciprocal links.

The screen shots folder has some sample page views.

Its a very easy install.

 

Modifications in this edition (2.0):

Corrected a number or errors in the code & language files.

Moved the 'submit links' section to its own page

Added error checking & display for every submit links input field.

Added confirmation of link submission.

Commented out the client side Google Page Rank (remove comment marks to show)

Commented out the client side Link_codes (remove comment marks to show)

Added function to automatically give a nofollow tag to all links not giving a reciprocal.

Added headers in admin plus extra fields for 'Link Found' status & date.

Added option to check all reciprocal links.

Added option to check individual links for reciprocal.

Increased field sizes to more suitable amount.

 

Contribution can be found at: http://addons.oscommerce.com/info/6099

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Hi Sam,

I've installed your contrib and I think it's great - but still buggy.

The links can't be confirmed by admin check since there's a undefined variable in admin/link_manage.php at line 25

	$check_phrase = LM_CHECK_PHRASE;

Only if LM_CHECK_PHRASE is replaced by the code that the customer has to add to his page, the link can be verified.

 

Thanks anyway,

Anton

Link to comment
Share on other sites

Sorry, its just a missing instruction in the install, if you look at the language file you will find:

 

 

define('LM_CHECK_PHRASE',''); // Link check phrases seperated by a comma. Like 'osCommerce Online Merchant,www.oscommerce.com'

 

thats where you should set your phrases.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Someone has PM me regading SQL injection, this does use tep_db_prepare_input on all the fields, but it is possible to enter a sql despite that.

 

To fix after:

 

$error=false;

 

add:

 

 reset($_POST);
  while (list($key, $value) = each($_POST)) {
 if (!is_array($_POST[$key])) {
	  $_POST[$key] = preg_replace("/[^ \/a-zA-Z0-9@:{}_.-]/i", "", urldecode($_POST[$key]));
	} else { unset($_POST[$key]); } // no arrays expected 
  }

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Uploaded new version 2.1

 

Added missing entries to installation instructions.

Added code to sanitise submitted $_POST to prevent injection attacks.

Added correction for missed errors on submission date, plus added admin display for same. If updating, dBase data will be invalid, will correct to today's date on edit.

Added 'Flip Status' function to Links Manager main page.

Changed Files:

admin/link_manage.php

admin/includes/languages/english/link_manage.php

links_submit.php

 

 

Hope that gets all them bugs this time!!

 

;)

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

  • 2 weeks later...

Uploaded new version 3.0

 

This features automatic site thumbnail generation.

Clients can submit links that are approved in admin, administrators can also add, edit & delete links.

An automatic process in admin can check reciprocal links, either all, individual or by category.

Links status can be modified from any manager page.

Links can be organised by category.

A local image can be used in place of the thumbshot.

The screen shots folder has some sample page views.

Its a very easy install.

 

 

Modifications in 3.0:

 

Added categories including

1.Ordering (set in admin)

2.Editing (in admin)

3.Submitter can suggest a new category or choose existing.

4.If no categories are active drop down will not appear.

5.Categories can be added on main or edit pages in admin.

6.Reciprocal links check automatically restricts to selected category.

Added option of a local image in place of thumbnail, edit mode will show both local and thumbnail images once local is added.

Images are saved to images/links, created automatically if not exists.

Fixed error in Page rank code, if no data held will now display n/a.

Added option to check a new sites page rank, useful if looking for sites to exchange with.

Added reciprocal link to main admin page for quicker checking.

Modified so links page 'pagination' will only appear if multiple pages exist.

 

Not done in this version:

 

Language files not fully updated: English hard coded within files.

 

Will be corrected on next update.

 

 

;)

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

  • 2 weeks later...

Im getting an error when installing the sql "#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 'DEFAULT CHARSET=latin1 AUTO_INCREMENT=1' at line 18 "

 

Uploaded new version 3.0

 

This features automatic site thumbnail generation.

Clients can submit links that are approved in admin, administrators can also add, edit & delete links.

An automatic process in admin can check reciprocal links, either all, individual or by category.

Links status can be modified from any manager page.

Links can be organised by category.

A local image can be used in place of the thumbshot.

The screen shots folder has some sample page views.

Its a very easy install.

 

 

Modifications in 3.0:

 

Added categories including

1.Ordering (set in admin)

2.Editing (in admin)

3.Submitter can suggest a new category or choose existing.

4.If no categories are active drop down will not appear.

5.Categories can be added on main or edit pages in admin.

6.Reciprocal links check automatically restricts to selected category.

Added option of a local image in place of thumbnail, edit mode will show both local and thumbnail images once local is added.

Images are saved to images/links, created automatically if not exists.

Fixed error in Page rank code, if no data held will now display n/a.

Added option to check a new sites page rank, useful if looking for sites to exchange with.

Added reciprocal link to main admin page for quicker checking.

Modified so links page 'pagination' will only appear if multiple pages exist.

 

Not done in this version:

 

Language files not fully updated: English hard coded within files.

 

Will be corrected on next update.

 

 

;)

Link to comment
Share on other sites

Did you paste the whole sql?

 

I see no error, what version of Mysql do you have? This is tested on Mysql 4 & 5

 

You can remove those instructions from the sql if you wish, it wont hert

 

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

  • 3 weeks later...

all url's must start with http:// you have just www.--, put http:// in front of that

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

I must admit I though I had added that to the input field, seems I did'nt, to fix alter in link_manage.php:

 

Find:(434)

 

<td><?php echo tep_draw_input_field('url', $e_info['link_url']?$e_info['link_url']:'', 'maxLength=80 size=70') ?></td>

 

replace with:

 

<td><?php echo tep_draw_input_field('url', $e_info['link_url']?$e_info['link_url']:'http://', 'maxLength=80 size=70') ?></td>

 

:blush:

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

  • 4 weeks later...

Uploaded new version 3.1

 

Modifications :

 

Added missing htttp: in admin

Added further check to inputs on links submit

Added code to 'Post Load' thumbshots thumbnails as these were slowing page loads somewhat.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

In links.php

 

find:

 

 <td width="130" align="center"><?php echo  '<a ' . ($links_tree['link_found'] ? '' : 'rel="nofollow" ') . 'href="'.$links_tree['link_url'] . '">';

 

replace with

 

<td width="130" align="center"><?php echo  '<a ' . ($links_tree['link_found'] ? '' : 'rel="nofollow" ') . 'href="'.$links_tree['link_url'] . '" target="_blank" >';

 

find:

 

<td align="center" width="520"><?php echo  '<a ' . ($links_tree['link_found'] ? '' : 'rel="nofollow" ') . 'href="'.$links_tree['link_url'].'"><b>'.$links_tree['link_title'].'</b></a><br />'.nl2br($links_tree['link_description']); ?></td>

 

replace with:

 

<td align="center" width="520"><?php echo  '<a ' . ($links_tree['link_found'] ? '' : 'rel="nofollow" ') . 'href="'.$links_tree['link_url'].'" target="_blank" ><b>'.$links_tree['link_title'].'</b></a><br />'.nl2br($links_tree['link_description']); ?></td>

 

B)

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

  • 3 weeks later...

How would I make it so the links.php page shows the title of the "links category" it is in, rather than just the parent category header?

 

Right now, no matter what I choose under "Links of Interest" - my page header stays "Links of Interest". I would like it to change if I click on the Business Partners category so the page header would then say "Business Partners".

 

I have found tricks for doing this with the categories - but I can't seem to modify the code correctly to get it working with this contribution. Any ideas?

~Tracy
 

Link to comment
Share on other sites

Assuming your using the latest, the code is already there, just not in the order you want.

 

you have

 

 

<title><?php echo TITLE . ' Links ' .(!$page ? '' : 'Page ' . $units[$page]). ' - ' . (!$cats ? (!$page ? '' : $categories[$category_array[$page]['id']]) : $categories[$cats]) . (!$page ? ' - ' : ''); ?> </title>

 

replace with:

 

 

<title><?php echo (!$cats ? (!$page ? '' : $categories[$category_array[$page]['id']]) : $categories[$cats]) . TITLE . ' Links ' .(!$page ? '' : 'Page ' . $units[$page]). ' - ' . (!$page ? ' - ' : ''); ?> </title>

 

Not tersted & I`m on the wine, so I may have messed!!

 

;)

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Oooops, said I'd had a few, perhaps your taking of the page heading??

 

 

 

 

<td align="center" class="pageHeading"><?php echo LM_TITLE;?></td>

 

becomes

 

 

 

<td align="center" class="pageHeading"><?php echo (!$cats ? LM_TITLE : $categories[$cats]);?></td>

 

 

rider as last!!

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

  • 3 weeks later...

I have error like this:

 

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit in safe mode in /home/bnetbtan/public_html/admin/link_manage.php on line 32

 

anyone can help me?

Rocdy

 

Beginner in php programming and still learning from this forums.

Special thanks for Oscommerce Community Forums that help me a lot. :-)

Link to comment
Share on other sites

Duplicate Post!!

 

As is says, function not allowed in safe mode, ask host to change or..

 

Simply comment out the line like :

 

CODE//set_time_limit(300);

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Hello Sir

 

Thanks for your pleasant contribution.

However I have edited the shop towards a fixed width of 778 with the Basic Design Pack by toybear,

Unfortunately all pages of your modification have "the old" dimesions, so it breaks out of the middle section.

Can you tell me how to correct this easily?

 

Thank you for your time

Best regards

Ashvattha

https://shop.ashvattha.org

Where do I sign?

Link to comment
Share on other sites

I know, it was ammiss of me, I`ve already done a fix, I'll upload new files tomorrow when I've time.

 

PS, 778 seems narrow when around 97% have a screen size of at least 1024 wide?

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

I have V3.2 ready for upload, I will do so as soon as uploads are working again!!!

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Uploaded Version 3.2

 

Modifications in 3.2:

 

Corrected some minor bugs

Cleaned up some of the display & removed 'fixed width' settings

Added categories title to page title in category mode.

Corrected MS2 compatibility bug

 

This has been tested on PHP 4 & 5, SQL 4 & 5, osC 2.2 ms2, rc1 & rc2a and is register_globals off compatible.

 

;)

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

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