PDA

View Full Version : oscommerce install - combine osc & phpld


tonyb
08-25-2005, 01:27 AM
First - a question, with two possible answers and two possible solutions:

What do you want your link directory to do? Build link popularity, or become an authority directory on your subject?

If you just want to build link popularity, why not let my free service take care of that for you? Based loosely on phpld, www.logon.info comes complete with simple osc install instructions and will be live on your site in less than 10 minutes.

Now the shameless plug is out of the way, if you want to build your own authority directory with you doing all the legowrk and vetting, and you have an osc store, this is the fix you need:

Sit tight, this may be a bumpy ride!! lol

First, download phpld onto your pc. Now go through the main folder. Look for index.php and submit.php. Change these to link_index.php and link_submit.php.

**optional**
do the same with payment.php - i.e. rename to link_payment.php - if you are not going to offer paid links, no need to do this!

Now go into your templates folder. Find main.tpl and submit.tpl - in both folders, remove the lines:

{include file="header.tpl"}
and
{include file="footer.tpl"}

**directory link structure fix**
in templates/main.tpl, find on lines 32 and 38 and change index.php to resources.php

**Captcha fix**
in templates/submit.tpl, line 107 change
Content visible to registered users only.
to
Content visible to registered users only.

**optional**
leave in or remove:
{include file="top_bar.tpl"}
But remember if you remove this line, your directory will not have a submit link, an rss feed link or a search bar - you will need to add these in somewhere eles yourself, so probably easiest to leave this alone - we will amend it a bit later!

If you leave the top_bar in, you will need to amend the call to img to refer to your links folder i.e. on line 17

Open templates/top_bar.tpl - look for any reference to index.php and amend to resources.php - these should be lines 9,11, 23 and 36. Now look for submit.php and change to link_submit.php - line 7.

Upload your entire phpld file structure into a new folder within your oscommerce folder called "links" - i.e. in default osc setup, this would be wwww.yourdomain.com/catalog/links.....

Now for the oscommerce part. Go to one of your existing top level files - the conditions.php file is normally a good one to use. Make a copy of this file and download it to a local folder. Make 2 (or 3 if using payments) copies of this file - save one as resources.php, the other as submit_link.php

In both, delete the line which says:
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONDITIONS);
Now you need to edit the next line where you see CONDITIONS to your new file name - i.e. RESOURCES or SUBMIT_LINK.

Now find:
<?php echo TEXT_INFORMATION; ?>
and change this to:
<?php include links/link_index.php ?> in one file and
<?php include links/link_submit.php ?> in the other.

Save those two files you just made as resources.php and submit_link.php respectively and upload them to your oscommerce folder.

Now, in your existing osc files, make a few quick changes:
open includes/languages/english.php and add this line:

define('TEXT_RESOURCES', 'Link Directory');

Next, open includes/filenames.php and add these two lines:

define('FILENAME_RESOURCES', 'resources.php');
define('FILENAME_SUBMIT_LINK', 'submit_link.php');

Now, in includes/boxes/information.php, and add this line:

'' . TEXT_RESOURCES . ' (' . tep_href_link(FILENAME_RESOURCES) . ')');

All you need to do now is go to yourdomain.com/catalog/links/install and setup your php link directory. Your directory should now show in your oscommerce store perfectly.

*******Please note a couple of important points!!

1 - I have not tested this out myself - as mentioned above I have developed a seperate solution and do not have a blank osc store to test my own instructions out - if you try this and it doesn't work, let me know. If you try this, it doesn't work but you fix it, please share the fix. If you try this and it works great, please let me know so everyone elese feels comfortable trying it!
2 - This is based on osc 2.2 MS2 - and phpld RC5.2 - you may have to tweak it accordingly if you are using a diff version
3 - Whilst I will try to keep track and help out where possible, I am a busy man trying to earn a living, so my answers wont always be immediate - patience is a virtue - post a question I'll get to it when I can, or one of the great coders on these forums may beat me to the punch!
4 - Did I point out - I have NOT tested this - DONT SHOOT ME if it doesn't work, but help me try to fix it! So many people want this, I thought I may as well try to get it going!!

ENJOY!!

billybrag
08-25-2005, 11:12 AM
thisis almost works, but needssome more time spent on it

things like the captch dont work

therte are a few other issues too

great start though

billybrag
08-25-2005, 12:56 PM
the main issue is that the links to the categories ie /index.php?c=2
take you to that page of the oscommerce install rather than the phpld page...

is there a config i am missing somewhere?

thanks

tonyb
08-25-2005, 08:54 PM
OK, think best thing is for me to install a vanilla osc and phpld and combine them. I hadn't done this because I know I can get it to work, but Im rubbish at documenting my changes!

I'll post later, and probably upload a complete package, be easier than trying to keep track of the changes - I will try to keep the instructions updated, but no promises....

Be back later! ;)

David
08-25-2005, 09:02 PM
Awe-some!
We'll add this to the Wiki as well. A lot of people have been after us to get this done.

tonyb
08-25-2005, 11:07 PM
Hi

Sorry, wont get around to finishing this tonight, having a bit of a clash with certain people at oscommerce at the moment regarding me contributing packages and adding my copyright notice - also they say I cant require users to register.....one rule for me, another for PayPal etc.?? Anyway, different issue, sorry to go off on one, but i am soooo mad.

The upshot of this is that I haven't now got the time tonight to sort this out, but I promise I will get it done before the weekend!!

David, could you hold off adding it to the Wiki until I have got it running 100%? Also, is there any way for me to upload a set of files which are amended and ready to roll? If so, how!!!

Keep smiling, and those who are waiting, hang in there, I've nearly done it!!!!!

Ap0s7le
08-27-2005, 06:17 AM
It's nice to see you growing Tony, really it is bro.

Good going, I'll look more into your post later.

-Casey

tonyb
08-27-2005, 11:54 PM
OK, have edited my original post to include this as a quick reference to future browsers, but if you are already using this and stuck, i omitted this bit:

**Directory Structure fix**
in templates/main.php, find on lines 32 and 38 and change index.php to resources.php

**Captcha fix**
in templates/submit.tpl, line 107 change
Content visible to registered users only.
to
Content visible to registered users only.


David - this is now ready to roll, the original post is edited and functional, tested on 3 different installs with 3 diff webmasters now. If there is a big demand or need for a "contrib" style download fix, yell me and I'll zip one up for you!

Thank you everyone for helping to get this working, and I hope you enjoy the results!!

**To Do**
There is still a possibility of session info being lost whilst users are browsing your link directory if they have goods in their osc cart. This happens erratically, but is due to the fact that the links within the directory have not been parsed with an oscSid included. Cookie enabled browsers work most of the time, but if cookies are turned off or your store is configured to not use them, you may have a small problem with this.

It would also be nice to incorporate the paid links INTO osc, so that a user can submit a link and buy stuff from your store and have it all in one basket - anything to boost sales! Bit lost where to start with that one, but there must be a way.....

Also, would be nice to somehow put the phpld admin side into the osc admin side so its all in one place, but thats a whole different story.