Gossamer Forum
Home : Products : Links 2.0 : Customization :

New Mod Request

Quote Reply
New Mod Request
This seems rather a simple mod to do, but since I am no programmer, I would have to stumble my way through it. So, I thought I'd ask the talented people that do these types of things to see if they can do this.

What I propose, is this:
In my database, I have a category or Internet and a subcategory of Classifieds, what I would like to do, is that nobody posts any links to the main category of Internet, but they can post to classifieds directory, but what I would like to happen, is that when someone posts to a sub category, when I rebuild the index, instead of putting the new links on the new page, instead put them on the main category page that their sub category falls under. In this way, I can have say someone listing My classified Ads in the Internet/Classifieds directory, and while it's still new, it will appear on the Internet main page, as well as the Internet/Classifieds page.

So, how difficult would it be to have the script write to the main category page instead of the new page?

Anyone? Has this been done before?

Thanks
Visionary
Quote Reply
Re: New Mod Request In reply to
 
Quote:
Anyone? Has this been done before?

Answer: Bobsie. Yes. The Category Select Mod in the Resource Center does exactly what you are asking for.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------




[This message has been edited by Eliot (edited November 09, 1999).]
Quote Reply
Re: New Mod Request In reply to
Thanks Eliot,
That took care of half of my mod request. Now the other half of my message was this:
When someone submits a new listing, instead of writing it to the "New" html page, can it be written to the main category that the sub category it has been added to resides under.

So, I submit to Internet/Classifieds/ and I want the new listing to appear in the Internet directory listing as well as the Classifieds directory, then the next time that I build the system again, and the listing falls off of the normal New listing, it should be removed from the Internet page.

The best example of this would be shareware.com or cnet, they list the items newly added, to the main category pages instead of a What's New page.

Any suggestions for that one Eliot?

Thanks
Vis

[This message has been edited by Visionary (edited November 09, 1999).]
Quote Reply
Re: New Mod Request In reply to
Code:
if ($values[$db_isnew] eq "Yes") {
($main) = $values[$db_category] =~ m,^([^/]+),;
push (@{links{$main}}, @values);
}

jerry

[This message has been edited by widgetz (edited November 09, 1999).]
Quote Reply
Re: New Mod Request In reply to
Thanks Jerry,
I tried placing this in the place of
if ($values[$db_isnew] eq "Yes")

But now when you click on Build All, it produces a DNS not found error, I copied it exactly as you wrote it:

if ($values[$db_isnew] eq "Yes") { ($main) = $values[$db_category] =~ m,^([^/]+),; push (@{links{$main}}, @values);}

Any clue what in this coding would force a server to produce that error?

When i go back to the stock nph-build.cgi it works just fine.

Thanks
Vis
Quote Reply
Re: New Mod Request In reply to
uhhh.. dns not found or document contains no data..

nph-build.cgi causes document contains no data if you messed up the code.. i'm guessing you don't know where to put that code..

jerry
Quote Reply
Re: New Mod Request In reply to
Your guess right, I thought it was just a matter or replacing the other code but apparently not. Can you lend some insight on where to place that coding.

Thanks
Visionary
Quote Reply
Re: New Mod Request In reply to
under

Code:
if ($hitsday >= $cutoff) {
print "\tUpdating record: $id, marking as popular ($hitsday/day). ($days)\n";
$values[$db_ispop] = "Yes";
}
else {
$values[$db_ispop] = "No";
}

in nph-build.cgi

jerry
Quote Reply
Re: New Mod Request In reply to
Thanks Jerry,
Im guessing though that your nph-build.cgi file has been modified or is a different version than the one we have. We just downloaded the Links2.0 zip file and the following code is not in it.
Code:
if ($hitsday >= $cutoff)
{
print "\tUpdating record: $id, marking as popular ($hitsday/day). ($days)\n";
$values[$db_ispop] = "Yes";
}
else {
$values[$db_ispop] = "No";
}

There is however something close to it, it is:
Code:
if ($values[$db_hits] >= $cutoff) {
print "\tUpdating record: $id, marking as popular ($values[$db_hits]).\n";
$values[$db_ispop] = "Yes";
}
else {
$values[$db_ispop] = "No";
}

So we placed it under that, and still DNS error. So, we replaced the above with what you said to replace the coding under, and still no go.

I appreciate your help and patience trying to help out a complete and total brainless coding fool.

Visionary


[This message has been edited by Visionary (edited November 10, 1999).]
Quote Reply
Re: New Mod Request In reply to
oh geez.

Code:
push (@{links{$main}}, @values);

to

Code:
push (@{$links{$main}}, @values);

i messed up typing it..

jerry
Quote Reply
Re: New Mod Request In reply to
again.. i didn't remember what this thread was about when i posted that response.. and going through it i figured that it will work.. but the code isn't in the place it should be in..

put it under:

Code:
push (@{$links{$category}}, @values) if (!$staggered_mode);

in build_stats

jerry
Quote Reply
Re: New Mod Request In reply to
it'd help if you got the lines in the errorlog.. i don't see anything wrong with that code..

jerry
Quote Reply
Re: New Mod Request In reply to
Thanks for taking the time to help me out Jerry, unfortunately, no matter what I do now, it still sends out the error of DNS.

Im at a complete loss here to figure out why.

What I did was this:

In nph-build.cgi I found this code:
Code:
push (@{$links{$category}}, @values) if (!$staggered_mode);

I then inserted this directly underneath that:
Code:

if ($values[$db_isnew] eq "Yes")
{
($main) = $values[$db_category] =~ m,^([^/]+),;
push (@{$links{$main}}, @values);
}

Then uploaded the nph-build.cgi in ascii mode, and tried it, DNS error. So apparently Im doing something wrong, or something is conflicting, the only mod I have done to it is the review mod by (I could be wrong here),you widgetz, the one with the install.cgi and reset.cgi. So, Im wondering if something here is conflicting with that mod.



------------------
Regards,
Visionary




[This message has been edited by Visionary (edited November 11, 1999).]
Quote Reply
Re: New Mod Request In reply to
Okay,
I saw my problem, it was with this line:

Code:
push (@{$links{$category}}, @values) if (!$staggered_mode);

I was putting the coding that you gave us not underneath this but under the line below that
Code:
$grand_total++;

By placing it between the two, it worked.

Thanks much Widgetz for the coding and the patience in helping us



------------------
Regards,
Visionary