Webmastersite.net
Register Log In

Order links like forum

Comments on Order links like forum

scriptwiki
Member

Usergroup: Customer
Joined: Aug 04, 2005

Total Topics: 11
Total Comments: 47
Posted Feb 18, 2006 - 11:33 AM:

I want my links ordered like a forum so when someone submits a link it goes to the top of the category, but if someone comments on another link, I want that one to go to the top.

How would I order my links so they are like that?

If you can figure it out, you have $20 coming to your paypal account. And please note, I have to do everything inside PHPMYADMIN because my Settings > General doesn't work.
zippo
Forum Regular

Usergroup: Customer
Joined: Jan 11, 2006

Total Topics: 48
Total Comments: 166
zippo
Posted Feb 18, 2006 - 3:19 PM:

Snip:
INSERT INTO `wsnlinks_settings` VALUES (92, 'orderlinks2', 'ORDER BY lastcomment DESC');
INSERT INTO `wsnlinks_settings` VALUES (5, 'orderlinks', 'ORDER BY lastcomment DESC');

I'm not sure the integer values (92 & 5) will be the same, these are the field ID in the wsn_settings table, but the orderlinks and orderlinks2 are surly going to be what you'll want to look for.

I reccomend you manually past the "ORDER BY lastcomment DESC" (no quotes) into the content values for name orderlinks and orderlinks2.

EG: open your database that your wsnlinks table is in, select wsn_settings from the list of tables, browse the table and look for the fields with the names orderlinks and orderlinks2 (sort by ID first might help speed up finding these) then use the edit function and change the values as noted above.
scriptwiki
Member

Usergroup: Customer
Joined: Aug 04, 2005

Total Topics: 11
Total Comments: 47
Posted Feb 18, 2006 - 4:28 PM:

Nope, doesn't work. Anyone else? You will get $20 smiling face
zippo
Forum Regular

Usergroup: Customer
Joined: Jan 11, 2006

Total Topics: 48
Total Comments: 166
zippo
Posted Feb 18, 2006 - 6:49 PM:

When I tried it the comments were bumping the link with the latest comment above (single column link list) the others, with the older links with comments below and those without comments below them.. Like a forum might act.

Granted I didn't try setting this via phpMyAdmin.. I'll try and see if that for whatever reason isn't working the same as the settings menu..

..tried it and it worked for me as described. Oh well. Frankly with the problems you've described previously on the forum you're installation is ate up. Good luck.
scriptwiki
Member

Usergroup: Customer
Joined: Aug 04, 2005

Total Topics: 11
Total Comments: 47
Posted Feb 18, 2006 - 7:46 PM:

lol, I had to reinstall WSNLinks, everything was messed up.

Maybe I didn't make it clear enough what I wanted.

When someone submits a link I want it to be at the very top of the category. But if someone else comments on another link, I want that link to go to the very top of the category. But, if another person submits a new link, it would go straight to the top again.

I will try your method again using the admin panel.

You're da bomb Zippo
zippo
Forum Regular

Usergroup: Customer
Joined: Jan 11, 2006

Total Topics: 48
Total Comments: 166
zippo
Posted Feb 19, 2006 - 1:29 PM:

You probably will have to use a combination of settings to get the new links to take priority, if it can be done. Since there are only two sorting levels it might be hard to get the new links into the mix since both (as above) are needed to keep commented & new comments leap-frogging to the top.

There may be another setting that somehow can be used to float new links to the top but it's still going to boil down to two sort levels, which is where the criteria needs to go, might not be do-able without customizing the php.

Realistically you'd save yourself time and by simply using WSN Forum. It's got much of the same features and the additional code to do what you're after without any hassles. wink
peumus
Forum Regular

Usergroup: Customer
Joined: Aug 09, 2004
Location: Chile

Total Topics: 172
Total Comments: 462
peumus
Posted Feb 19, 2006 - 4:07 PM:

Srs, I have just tested in WSN Links 3.3.5 and it's working:

If I understood your inquiry, the following does it:

Admin Panel -> Settings -> General:

Default Ordering:

Links order by: "By lastcomment descending" ,
then secondary order: "By timevalidated descending"

Do not forget to regenerate links after this.

Kind Regards.
zippo
Forum Regular

Usergroup: Customer
Joined: Jan 11, 2006

Total Topics: 48
Total Comments: 166
zippo
Posted Feb 19, 2006 - 5:18 PM:

Cool, so that will put a link without comments above links that do have comments?

I figured that the primary would always kick in first and keep commented links above any that had none..
scriptwiki
Member

Usergroup: Customer
Joined: Aug 04, 2005

Total Topics: 11
Total Comments: 47
Posted Feb 19, 2006 - 6:32 PM:

Nope, doesn't work either. I want it so the newest link always is on the very top. But when someone comments on another link, it will be moved to the top.
peumus
Forum Regular

Usergroup: Customer
Joined: Aug 09, 2004
Location: Chile

Total Topics: 172
Total Comments: 462
peumus
#10 - Quote - Permalink
Posted Feb 19, 2006 - 6:52 PM:

You are right, commets have priority.

We need a variable to be stablished as the maximum value from (lastcomment and timevalidated) and select to order by this variable.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
#11 - Quote - Permalink
Posted Feb 19, 2006 - 7:36 PM:

You could use the above but force the lastcomment value to start off with the link's submission time, by opening classes/onelink.php and changing
 function add()
{

to
 function add()
{
$this->lastcomment = time();


as long as you don't mind the lastcomment being factually incorrect by reporting a last comment time when there are no comments.
scriptwiki
Member

Usergroup: Customer
Joined: Aug 04, 2005

Total Topics: 11
Total Comments: 47
#12 - Quote - Permalink
Posted Feb 19, 2006 - 7:44 PM:

You're the man Paul, do you have a paypal email so I can leave you a nice tip?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
#13 - Quote - Permalink
Posted Feb 21, 2006 - 10:52 AM:

My paypal is support [at] webmastersite [dot] net.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.