Jump to content
Sign in to follow this  
VJ

[Contribution] Links Manager for osC v1.00

Recommended Posts

hey all,

 

I have installed link 1.4b.

 

And I have a problem with the link_submit.php

it displays like this:

 

HEADING_TITLE

 

 

 

TEXT_MAIN_RECIPROCAL

 

CATEGORY_WEBSITE * Required information

 

ENTRY_LINKS_TITLE ENTRY_LINKS_TITLE_TEXT

ENTRY_LINKS_URL ENTRY_LINKS_URL_TEXT

ENTRY_LINKS_CATEGORY Family Giftoutdoor cooking ENTRY_LINKS_CATEGORY_TEXT

ENTRY_LINKS_SUGGESTION

ENTRY_LINKS_DESCRIPTION ENTRY_LINKS_DESCRIPTION_TEXT

ENTRY_LINKS_IMAGE ENTRY_LINKS_IMAGE_TEXTTEXT_LINKS_HELP_LINK

 

 

 

Your Contact Information

ENTRY_LINKS_CONTACT_NAME ENTRY_LINKS_CONTACT_NAME_TEXT

E-Mail Address: *

 

 

 

CATEGORY_RECIPROCAL

ENTRY_LINKS_RECIPROCAL_URL ENTRY_LINKS_RECIPROCAL_URL_TEXTTEXT_LINKS_HELP_LINK

 

and this is the code:

 

 

<?php

/*

$Id: links_submit.php,v 1.00 2003/10/03 Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

// needs to be included earlier to set the success message in the messageStack

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LINKS_SUBMIT);

require(DIR_WS_FUNCTIONS . 'links.php');

 

$process = false;

if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) {

$process = true;

 

$links_title = tep_db_prepare_input($HTTP_POST_VARS['links_title']);

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

$links_category = tep_db_prepare_input($HTTP_POST_VARS['links_category']);

$links_category_suggest = tep_db_prepare_input($HTTP_POST_VARS['links_cat_suggest']);

$links_description = tep_db_prepare_input($HTTP_POST_VARS['links_description']);

$links_image = tep_db_prepare_input($HTTP_POST_VARS['links_image']);

$links_contact_name = tep_db_prepare_input($HTTP_POST_VARS['links_contact_name']);

$links_contact_email = tep_db_prepare_input($HTTP_POST_VARS['links_contact_email']);

if (LINKS_RECIPROCAL_REQUIRED == 'True') $links_reciprocal_url = tep_db_prepare_input($HTTP_POST_VARS['links_reciprocal_url']);

 

$error = false;

 

if (strlen($links_title) < ENTRY_LINKS_TITLE_MIN_LENGTH) {

$error = true;

 

$messageStack->add('submit_link', ENTRY_LINKS_TITLE_ERROR);

}

 

if (strlen($links_url) < ENTRY_LINKS_URL_MIN_LENGTH) {

$error = true;

 

$messageStack->add('submit_link', ENTRY_LINKS_URL_ERROR);

}

 

if (strlen($links_description) < ENTRY_LINKS_DESCRIPTION_MIN_LENGTH) {

$error = true;

 

$messageStack->add('submit_link', ENTRY_LINKS_DESCRIPTION_ERROR);

}

 

if (strlen($links_contact_name) < ENTRY_LINKS_CONTACT_NAME_MIN_LENGTH) {

$error = true;

 

$messageStack->add('submit_link', ENTRY_LINKS_CONTACT_NAME_ERROR);

}

 

if (strlen($links_contact_email) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {

$error = true;

 

$messageStack->add('submit_link', ENTRY_EMAIL_ADDRESS_ERROR);

} elseif (tep_validate_email($links_contact_email) == false) {

$error = true;

 

$messageStack->add('submit_link', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);

}

 

if (LINKS_RECIPROCAL_REQUIRED == 'True') {

if (strlen($links_reciprocal_url) < ENTRY_LINKS_URL_MIN_LENGTH) {

$error = true;

$messageStack->add('submit_link', ENTRY_LINKS_RECIPROCAL_URL_ERROR);

}

else if (CheckURL($links_reciprocal_url) == 0)

{

$error = true;

$messageStack->add('submit_link', sprintf(ENTRY_LINKS_RECIPROCAL_URL_MISSING_ERROR, $links_reciprocal_url));

}

}

else $links_reciprocal_url = '';

 

// CHECK FOR DUPLICAE ENTRIES

if (LINKS_CHECK_DUPLICATE == 'True')

{

$duplink_query = tep_db_query("select l.links_id, l.links_url, l.links_reciprocal_url, ld.links_id, ld.links_title from " . TABLE_LINKS . " l, " . TABLE_LINKS_DESCRIPTION . " ld where l.links_id = ld.links_id AND (ld.links_title = '" . $links_title . "' OR l.links_url = '" . $links_url . "' OR l.links_reciprocal_url = '" . $links_reciprocal_url . "' ) AND language_id = '" . (int)$languages_id . "'");

if (tep_db_num_rows($duplink_query) > 0)

{

$error = true;

$messageStack->add('submit_link', ENTRY_LINKS_DUPLICATE_ERROR);

}

}

 

if ($error == false) {

if($links_image == 'http://') {

$links_image = '';

}

 

// default values

$links_date_added = 'now()';

$links_status = '1'; // Pending approval

$links_rating = '0';

 

$sql_data_array = array('links_url' => $links_url,

'links_image_url' => $links_image,

'links_contact_name' => $links_contact_name,

'links_contact_email' => $links_contact_email,

'links_reciprocal_url' => $links_reciprocal_url,

'links_category_suggest' => $links_category_suggest,

'links_date_added' => $links_date_added,

'links_status' => $links_status,

'links_rating' => $links_rating);

 

tep_db_perform(TABLE_LINKS, $sql_data_array);

 

$links_id = tep_db_insert_id();

 

$categories_query = tep_db_query("select link_categories_id from " . TABLE_LINK_CATEGORIES_DESCRIPTION . " where link_categories_name = '" . $links_category . "' and language_id = '" . (int)$languages_id . "'");

 

$categories = tep_db_fetch_array($categories_query);

$link_categories_id = $categories['link_categories_id'];

 

tep_db_query("insert into " . TABLE_LINKS_TO_LINK_CATEGORIES . " (links_id, link_categories_id) values ('" . (int)$links_id . "', '" . (int)$link_categories_id . "')");

 

$language_id = $languages_id;

 

$sql_data_array = array('links_id' => $links_id,

'language_id' => $language_id,

'links_title' => $links_title,

'links_description' => $links_description);

 

tep_db_perform(TABLE_LINKS_DESCRIPTION, $sql_data_array);

 

// build the message content

$name = $links_contact_name;

 

//send message to link partner

$email_text = sprintf(EMAIL_GREET_NONE, $links_contact_name);

$email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;

tep_mail($name, $links_contact_email, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

//send message to store owner

$RECIPROCAL = (LINKS_RECIPROCAL_REQUIRED == 'True') ? $links_reciprocal_url : 'Not Required';

$newlink_subject = sprintf(EMAIL_OWNER_TEXT, $name, $links_url, $RECIPROCAL);

tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_OWNER_SUBJECT, $newlink_subject, $name, $links_contact_email);

 

tep_redirect(tep_href_link(FILENAME_LINKS_SUBMIT_SUCCESS, '', 'SSL'));

}

}

 

// links breadcrumb

$breadcrumb->add(NAvb script:popupWindow(\'' . tep_href_link(FILENAME_POPUP_LINKS_HELP) . '\')">' . TEXT_LINKS_HELP_LINK . '</a>'; ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td class="main"><b><?php echo CATEGORY_CONTACT; ?></b></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

<td><table width="60%" border="0" cellspacing="2" cellpadding="2">

<tr>

<td class="main" width="25%"><?php echo ENTRY_LINKS_CONTACT_NAME; ?></td>

<td class="main"><?php echo tep_draw_input_field('links_contact_name') . ' ' . (tep_not_null(ENTRY_LINKS_CONTACT_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_LINKS_CONTACT_NAME_TEXT . '</span>': ''); ?></td>

</tr>

<tr>

<td class="main"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>

<td class="main"><?php echo tep_draw_input_field('links_contact_email') . ' ' . (tep_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

 

<?php if (LINKS_RECIPROCAL_REQUIRED == 'True') { ?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td class="main"><b><?php echo CATEGORY_RECIPROCAL; ?></b></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

<td><table width="60%" border="0" cellspacing="2" cellpadding="2">

<tr>

<td class="main" width="25%"><?php echo ENTRY_LINKS_RECIPROCAL_URL; ?></td>

<td class="main"><?php echo tep_draw_input_field('links_reciprocal_url', 'http://') . ' ' . (tep_not_null(ENTRY_LINKS_RECIPROCAL_URL_TEXT) ? '<span class="inputRequirement">' . ENTRY_LINKS_RECIPROCAL_URL_TEXT . '</span>': ''); ?><?php echo '<a href="java script:popupWindow(\'' . tep_href_link(FILENAME_POPUP_LINKS_HELP) . '\')">' . TEXT_LINKS_HELP_LINK . '</a>'; ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<?php } ?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

</table></form></td>

<!-- body_text_eof //-->

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- right_navigation //-->

<?php include(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

</table></td>

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

<?php include(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

<br>

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

If you want to look at the site it's at

http://thedecoreshoppe.com

Share this post


Link to post
Share on other sites

You are missing the definitions. Go back over the instructions and make sure you made all of the changes.

 

Jack

Share this post


Link to post
Share on other sites
You are missing the definitions. Go back over the instructions and make sure you made all of the changes.

 

Jack

I found it.

 

link_submit.php in languages/english/ was empty lol

 

thanks Jack

Share this post


Link to post
Share on other sites

Hi There,

 

I'm quite new to this hole osCommerce thing!

 

I have managed to install the links manager correctly (i think).

 

I cannot work out how to add a link.. from the admin side of things?

If I look under Configuration > Links... it gives me many options such as...

"Display all English Links"

"Siper Friendly Links" etc etc etc

 

But it gives me no option to create catergories or add links...?

 

Am I doing something wrong...?

No doubt it will be something simple?

 

Thanks in advance for any help.

 

Matt

Share this post


Link to post
Share on other sites

The configuration->Links are just settings the program uses. To manage the links, go to admin->Links Manager.

 

Jack

Share this post


Link to post
Share on other sites
Hi There,

 

I'm quite new to this hole osCommerce thing!

 

I have managed to install the links manager correctly (i think).

 

I cannot work out how to add a link.. from the admin side of things?

If I look under Configuration > Links... it gives me many options such as...

"Display all English Links"

"Siper Friendly Links" etc etc etc

 

But it gives me no option to create catergories or add links...?

 

Am I doing something wrong...?

No doubt it will be something simple?

 

Thanks in advance for any help.

 

Matt

look towards the bottom of admin It says link manager you should see another link in configuration

Share this post


Link to post
Share on other sites
look towards the bottom of admin It says link manager you should see another link in configuration

 

Thank you both,

My problem still is here.

 

I don't have the menu item "Links Manager" in the admin console.

I have reinstalled "Links Manager V1.14" and it is still not there!?

 

Am I missing files?

 

Below is a screen shot... so you can see for yourself...

 

http://bigmattonline.com/help.jpg

 

Thanks Again...

Share this post


Link to post
Share on other sites

If you are using the version by me, then it contains all you need. Did you perform the installation instructions? Particularly the one that says

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

/catalog/admin/includes/column_left.php

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

 

add this to the end,

 

// VJ Links Manager v1.00 begin

require(DIR_WS_BOXES . 'links.php');

// VJ Links Manager v1.00 end

 

Jack

Share this post


Link to post
Share on other sites
If you are using the version by me, then it contains all you need. Did you perform the installation instructions? Particularly the one that says

 

Jack

 

I'm having the exact same problem. I'm new at this but I followed through all of the instructions and everything else is working. I double checked the column_left.php file and it has the added links.php but it is still not showing up. :blink: Is there something else I could check???

Share this post


Link to post
Share on other sites
If you are using the version by me, then it contains all you need. Did you perform the installation instructions? Particularly the one that says

 

Jack

 

Thanks Jack,

Deleted Links Manager again, and re-installed (again) seems to be working now, with only a few mySQL errors on the admin side. Found the patch for this alongside the Contribution.

 

Thanks for the great addon!

 

Regards,

 

Matt.

Share this post


Link to post
Share on other sites
I'm having the exact same problem. I'm new at this but I followed through all of the instructions and everything else is working. I double checked the column_left.php file and it has the added links.php but it is still not showing up. :blink: Is there something else I could check???

 

 

Make sure you added the below code...

 

// VJ Links Manager v1.00 begin
require(DIR_WS_BOXES . 'links.php');
// VJ Links Manager v1.00 end

 

to...

 

/catalog/admin/includes/column_left.php

 

and NOT

 

/catalog/includes/column_left.php

 

Matt

Share this post


Link to post
Share on other sites

I put this

// VJ Links Manager v1.00 begin

require(DIR_WS_BOXES . 'links.php');

// VJ Links Manager v1.00 end

 

 

in admin/includes/column_left.php

 

I have checked it ten times :'( I'm starting to get frustrated. I'm sure I'm doing something really dumb, but I can't find it.

Any other ideas on what I can check???

Share this post


Link to post
Share on other sites
I put this

// VJ Links Manager v1.00 begin

require(DIR_WS_BOXES . 'links.php');

// VJ Links Manager v1.00 end

in admin/includes/column_left.php

 

I have checked it ten times :'( I'm starting to get frustrated. I'm sure I'm doing something really dumb, but I can't find it.

Any other ideas on what I can check???

 

Your best bet is to do what I did.

Remove Links Manager all together.

Then install it again, but this time, spend extra time and care walking through the 'readme.txt' file.

 

I was having the exact same problem as you. In the end I re-installed Links Manager 'carefully' and it worked.

 

Sorry I can't be of any other help. :blink: Good Luck!

Share this post


Link to post
Share on other sites
Your best bet is to do what I did.

Remove Links Manager all together.

Then install it again, but this time, spend extra time and care walking through the 'readme.txt' file.

 

I was having the exact same problem as you. In the end I re-installed Links Manager 'carefully' and it worked.

 

Sorry I can't be of any other help. :blink: Good Luck!

 

I reinstalled it-agian. Nothing. i hve double checked things and I don't know what else could be wrong. I wil continue to look at it more but if any one else has any ideas let me know please.

Share this post


Link to post
Share on other sites
I put this

// VJ Links Manager v1.00 begin

require(DIR_WS_BOXES . 'links.php');

// VJ Links Manager v1.00 end

in admin/includes/column_left.php

 

I have checked it ten times :'( I'm starting to get frustrated. I'm sure I'm doing something really dumb, but I can't find it.

Any other ideas on what I can check???

If you have that code installed in that file, then something has to be displaying there. Even if you didn't install any other part of Links Manager, there would be something there (an error in that case). So either you are editing the wrong file or there is something in your admin section that is preventing the column from being updated. You should have the following statement in that file
require(DIR_WS_BOXES . 'modules.php');

Try changing it to

//require(DIR_WS_BOXES . 'modules.php');

Go to your admin section now and see if the modules section is in the left column. If it is, then there is something else going on.

 

Jack

Share this post


Link to post
Share on other sites

Thank you for your help. Somehow I got it working. No idea what I did just enough tinkering around with it and it started to work. I really need to learn more php. Looks like a great contribution that does exactly what I want. I'm excited to start putting it to good use.

Share this post


Link to post
Share on other sites

Hi, sorry to bring up this old topic but i have some problem customizing the display of categories

 

I run a pet shop and trying to create a link directory categorized by different breed, there is so many breeds now my link categories page looks huge.....

 

What i am trying to do is to categorize the categories accordingly to alphabet, i.e

 

A

A Dog

A Cat

ABC

ADR

ADE

 

B

B Dog

B Cat

BBB

BCD

 

C

...

..

...

 

etc etc.

 

I have been tosing around with the links.php code but have no idea how to limit the display of categories to only categy_name starting with A, or B, or C.

 

I am currently looking at these lines of code in catalog/links.php:

 

if ($number_of_categories > 0) {

$rows = 0;

while ($categories = tep_db_fetch_array($categories_query)) {

$rows++;

$lPath_new = 'lPath=' . $categories['link_categories_id'];

$width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';

 

echo ' <td align="left" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_LINKS, $lPath_new) . '">';

 

 

not sure if i am at the right path, can any guru please help? Thanks.

Edited by j4tan

Share this post


Link to post
Share on other sites
You can remove the submit button from the link.php page. But doing so takes away one of the key features of the package, in my opinion. Plus, it won't prevent those sites from linking to you. As with all spam, it is just something that has to be accepted.

 

Jack

dear jack,

 

would you be able to give me a link to the contribution that is the latest update. i am a bit confused wich files to download since there are many updates there

 

thanks

valeri

Share this post


Link to post
Share on other sites

How could it not show up? Are you sure you're editing admin/includes/column_left.php? Are you sure you're uploading it to the proper directory on your server? Double check every step.

 

It just doesn't make sense ... if you added the line in admin/includes/column_left.php and uploaded it to the proper directory, something has to show up there.


Jason

 

Simple 1-2-3 Intructions on how to get, install and configure SSL

 

The Google Sandbox explained

 

Simple to follow instructions on how to change the look of your OSC

 

How To Make A Horrible OSC Website

 

my toolbox: All things WordPress-related - All things Adobe-related - PHP Designer 2007 - Codecanyon Junkie - Crimson Editor - Winmerge - phpMyAdmin - WS_FTP

 

my installed contributions: Category Banners, File Upload feature-.77, Header Tags, Sort_Product_Attributes_1, XSellv2.3, Price Break 1.11.2, wishlist 3.5, rollover_category_images_v1.2, Short_Description_v2.1, UPSXML_v1_2_3, quickbooks qbi_v2_10, allprods v4.4, Mouseover-effect for image-buttons 1.0, Ultimate_SEO, AAP 1.41, Auto Select State Value, Fast Easy Checkout, Dynamic SiteMap v2.0, Image Magic, Links Manager 1.14, Featured Products, Customer Testimonials, Article Manager, FAQ System, and I'm sure more ...

Share this post


Link to post
Share on other sites

Valerie, just download version 1.14 by Jackmsc.


Jason

 

Simple 1-2-3 Intructions on how to get, install and configure SSL

 

The Google Sandbox explained

 

Simple to follow instructions on how to change the look of your OSC

 

How To Make A Horrible OSC Website

 

my toolbox: All things WordPress-related - All things Adobe-related - PHP Designer 2007 - Codecanyon Junkie - Crimson Editor - Winmerge - phpMyAdmin - WS_FTP

 

my installed contributions: Category Banners, File Upload feature-.77, Header Tags, Sort_Product_Attributes_1, XSellv2.3, Price Break 1.11.2, wishlist 3.5, rollover_category_images_v1.2, Short_Description_v2.1, UPSXML_v1_2_3, quickbooks qbi_v2_10, allprods v4.4, Mouseover-effect for image-buttons 1.0, Ultimate_SEO, AAP 1.41, Auto Select State Value, Fast Easy Checkout, Dynamic SiteMap v2.0, Image Magic, Links Manager 1.14, Featured Products, Customer Testimonials, Article Manager, FAQ System, and I'm sure more ...

Share this post


Link to post
Share on other sites
How could it not show up? Are you sure you're editing admin/includes/column_left.php? Are you sure you're uploading it to the proper directory on your server? Double check every step.

 

It just doesn't make sense ... if you added the line in admin/includes/column_left.php and uploaded it to the proper directory, something has to show up there.

thanks

Share this post


Link to post
Share on other sites
How could it not show up? Are you sure you're editing admin/includes/column_left.php? Are you sure you're uploading it to the proper directory on your server? Double check every step.

 

It just doesn't make sense ... if you added the line in admin/includes/column_left.php and uploaded it to the proper directory, something has to show up there.

jason,

 

just clarify please. "missing dBase option" updtae form 10Dec2006 is not needed?

cheers

valeri

Share this post


Link to post
Share on other sites

If you are missing that option after the install, then you can run the command. Actually, you can run it anyway - it won't hurt.

 

Jack

Share this post


Link to post
Share on other sites

Hi Jack,

 

Just wondering if it is possible to not have categories in Links Manager.

I would rather just display the links instead if having to give it a "Compulsary" catergory.

 

Any Help/Ideas?

 

Thanks In Advance,

 

 

Matt

Share this post


Link to post
Share on other sites

Yes, this has been addressed several times. You'll need to read back through the pages to find the fix. You just need to change the links link so that it links directly to the links page.

 

Jack

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
Sign in to follow this  

×